Authored by 孙凯

add 没有活动是的UI review by zhanglixia

'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: 40,
alignSelf: 'center',
marginTop: 10,
},
text: {
width: textWidth,
height: 40,
textAlign: 'center',
}
});
... ...
... ... @@ -20,6 +20,7 @@ import OutletRecommendFive from './OutletRecommendFive';
import ProductFliter from './ProductFliter';
import BrandProductListCell from '../../../common/components/ListCell/ProductListCell';
import ActivityCell from './ActivityCell';
import NoActivityView from './NoActivityView';
export default class OutletPageListView extends Component {
constructor(props) {
... ... @@ -180,11 +181,13 @@ export default class OutletPageListView extends Component {
if (title == '即将结束' && activityListNum == 0) {
return (
<View style={styles.container}>
<NoActivityView resource={title}/>
</View>
);
}else if (title == '即将开始' && activityListNum == 0) {
return (
<View style={styles.container}>
<NoActivityView resource={title}/>
</View>
);
}
... ...