NoActivityView.js 1.6 KB
'use strict';

import React from 'react';
import ReactNative from 'react-native';
import Immutable, {Map} from 'immutable';

const {
    View,
    Text,
    TouchableOpacity,
    Dimensions,
    StyleSheet,
	Platform,
	Image,
} = ReactNative;

export default class NoActivityView extends React.Component {

    constructor(props) {
        super (props);
    }

    render() {
		let {resource} = this.props;
		let title = '活动已经上线,左滑切换频道,更多潮品,就在YOHO!BUY有货';

		if (resource == '即将结束') {
			title = '活动正在火热进行中,左滑切换频道,更多潮品,就在YOHO!BUY有货';
		}

		return (
			<View style={styles.container}>
				<View style={styles.imageV}>
					<Image
						source={require('../../image/bag_moren.png')}
						style={styles.image}
					/>
				</View>
				<View style={styles.textV}>
					<Text style={styles.text}>{title}</Text>
				</View>
			</View>
		);
    }
}

let {width, height} = Dimensions.get('window');
let backgroundWidth = Math.ceil((156 / 640) * width);
let backgroundHeight = Math.ceil((186 / 640) * width);
let textWidth = Math.ceil((400 / 640) * width);

let styles = StyleSheet.create({
	container: {
		width: width,
		height: height,
	},
	imageV: {
		width: backgroundWidth,
        height: backgroundHeight,
		alignSelf: 'center',
		marginTop: (height-80-backgroundHeight)/2 - 40,
	},
	image: {
        width: backgroundWidth,
        height: backgroundHeight,
    },
	textV: {
		width: textWidth,
		height: 50,
		alignSelf: 'center',
		marginTop: 10,
	},
	text: {
		width: textWidth,
		height: 50,
		textAlign: 'center',
	}
});