Authored by LakeR

秒杀header悬浮 去除热促功能 review by chenlin

... ... @@ -50,7 +50,6 @@ export default class Seckill extends Component {
} else {
this.props.onRefresh && this.props.onRefresh();
}
this.props.onFetchDiscountProductList && this.props.onFetchDiscountProductList();
}
... ... @@ -67,7 +66,7 @@ export default class Seckill extends Component {
this.props.onRefresh && this.props.onRefresh();
}
renderListHeaderComponent() {
renderHeader() {
if (this.queryActivityInfo && this.queryActivityInfo.secKillProductVoList && this.queryActivityInfo.secKillProductVoList.size > 0) {
return (
<TimeListView
... ... @@ -78,7 +77,12 @@ export default class Seckill extends Component {
diff={diff}
/>
);
} else if (this.queryActivityInfo.secKillProductVoList.size == 0 && !this.firstLaunch) {
}
return null
}
renderListHeaderComponent() {
if (this.queryActivityInfo.secKillProductVoList.size == 0 && !this.firstLaunch) {
return (
<View style={styles.seckillEndView}>
<Text style={{fontSize: 16, color: 'black'}}>来晚啦~秒杀已结束</Text>
... ... @@ -94,7 +98,14 @@ export default class Seckill extends Component {
return <View style={styles.sectionHeaderContainer}>
<View style={styles.sectionLine}/>
<Text style={styles.sectionHeaderText}>{title}</Text>
<View style={{position:'absolute',left:0,right:0,bottom:0,height:0.5,backgroundColor:'#E0E0E0'}}/>
<View style={{
position: 'absolute',
left: 0,
right: 0,
bottom: 0,
height: 0.5,
backgroundColor: '#E0E0E0'
}}/>
</View>
}
... ... @@ -183,16 +194,9 @@ export default class Seckill extends Component {
let sections = [
{title: null, type: SECTION_TYPE_SECKILL, data: queryProductList ? queryProductList : []},
];
if (discountProduct.list && discountProduct.list.length > 0) {
sections.push({
title: '限时促销',
type: SECTION_TYPE_DISCOUNT,
data: discountProduct.list ? [discountProduct.list] : [[]],
renderItem: this.renderDiscountSection
})
}
return (
<View style={styles.container}>
{this.renderHeader()}
<SectionList
renderItem={this.renderItem}
contentContainerStyle={styles.contentContainer}
... ... @@ -201,9 +205,6 @@ export default class Seckill extends Component {
renderSectionHeader={this.renderSectionHeader}
stickySectionHeadersEnabled={false}
onRefreshData={() => this.props.onRefresh && this.props.onRefresh()}
onEndReached={() => {
this.props.onEndReached && this.props.onEndReached();
}}
sections={sections}
/>
<LoadingIndicator isVisible={isPullToRefresh}/>
... ... @@ -269,14 +270,14 @@ let styles = StyleSheet.create({
width: width,
paddingTop: 10,
paddingBottom: 10,
paddingLeft:15,
paddingLeft: 15,
backgroundColor: 'white',
alignItems: 'center',
flexDirection:'row'
flexDirection: 'row'
},
sectionHeaderText: {
fontSize: 14,
marginLeft:10,
marginLeft: 10,
color: '#444444',
fontFamily: 'PingFang-SC-Medium'
},
... ...
... ... @@ -101,11 +101,11 @@ class SeckillContainer extends Component {
}
_onFetchDiscountProductList() {
this.props.actions.getDiscountProductList()
// this.props.actions.getDiscountProductList()
}
_onEndReached() {
this.props.actions.getDiscountProductList()
// this.props.actions.getDiscountProductList()
}
render() {
... ...