Authored by LakeR

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

@@ -50,7 +50,6 @@ export default class Seckill extends Component { @@ -50,7 +50,6 @@ export default class Seckill extends Component {
50 } else { 50 } else {
51 this.props.onRefresh && this.props.onRefresh(); 51 this.props.onRefresh && this.props.onRefresh();
52 } 52 }
53 - this.props.onFetchDiscountProductList && this.props.onFetchDiscountProductList();  
54 53
55 } 54 }
56 55
@@ -67,7 +66,7 @@ export default class Seckill extends Component { @@ -67,7 +66,7 @@ export default class Seckill extends Component {
67 this.props.onRefresh && this.props.onRefresh(); 66 this.props.onRefresh && this.props.onRefresh();
68 } 67 }
69 68
70 - renderListHeaderComponent() { 69 + renderHeader() {
71 if (this.queryActivityInfo && this.queryActivityInfo.secKillProductVoList && this.queryActivityInfo.secKillProductVoList.size > 0) { 70 if (this.queryActivityInfo && this.queryActivityInfo.secKillProductVoList && this.queryActivityInfo.secKillProductVoList.size > 0) {
72 return ( 71 return (
73 <TimeListView 72 <TimeListView
@@ -78,7 +77,12 @@ export default class Seckill extends Component { @@ -78,7 +77,12 @@ export default class Seckill extends Component {
78 diff={diff} 77 diff={diff}
79 /> 78 />
80 ); 79 );
81 - } else if (this.queryActivityInfo.secKillProductVoList.size == 0 && !this.firstLaunch) { 80 + }
  81 + return null
  82 + }
  83 +
  84 + renderListHeaderComponent() {
  85 + if (this.queryActivityInfo.secKillProductVoList.size == 0 && !this.firstLaunch) {
82 return ( 86 return (
83 <View style={styles.seckillEndView}> 87 <View style={styles.seckillEndView}>
84 <Text style={{fontSize: 16, color: 'black'}}>来晚啦~秒杀已结束</Text> 88 <Text style={{fontSize: 16, color: 'black'}}>来晚啦~秒杀已结束</Text>
@@ -94,7 +98,14 @@ export default class Seckill extends Component { @@ -94,7 +98,14 @@ export default class Seckill extends Component {
94 return <View style={styles.sectionHeaderContainer}> 98 return <View style={styles.sectionHeaderContainer}>
95 <View style={styles.sectionLine}/> 99 <View style={styles.sectionLine}/>
96 <Text style={styles.sectionHeaderText}>{title}</Text> 100 <Text style={styles.sectionHeaderText}>{title}</Text>
97 - <View style={{position:'absolute',left:0,right:0,bottom:0,height:0.5,backgroundColor:'#E0E0E0'}}/> 101 + <View style={{
  102 + position: 'absolute',
  103 + left: 0,
  104 + right: 0,
  105 + bottom: 0,
  106 + height: 0.5,
  107 + backgroundColor: '#E0E0E0'
  108 + }}/>
98 </View> 109 </View>
99 110
100 } 111 }
@@ -183,16 +194,9 @@ export default class Seckill extends Component { @@ -183,16 +194,9 @@ export default class Seckill extends Component {
183 let sections = [ 194 let sections = [
184 {title: null, type: SECTION_TYPE_SECKILL, data: queryProductList ? queryProductList : []}, 195 {title: null, type: SECTION_TYPE_SECKILL, data: queryProductList ? queryProductList : []},
185 ]; 196 ];
186 - if (discountProduct.list && discountProduct.list.length > 0) {  
187 - sections.push({  
188 - title: '限时促销',  
189 - type: SECTION_TYPE_DISCOUNT,  
190 - data: discountProduct.list ? [discountProduct.list] : [[]],  
191 - renderItem: this.renderDiscountSection  
192 - })  
193 - }  
194 return ( 197 return (
195 <View style={styles.container}> 198 <View style={styles.container}>
  199 + {this.renderHeader()}
196 <SectionList 200 <SectionList
197 renderItem={this.renderItem} 201 renderItem={this.renderItem}
198 contentContainerStyle={styles.contentContainer} 202 contentContainerStyle={styles.contentContainer}
@@ -201,9 +205,6 @@ export default class Seckill extends Component { @@ -201,9 +205,6 @@ export default class Seckill extends Component {
201 renderSectionHeader={this.renderSectionHeader} 205 renderSectionHeader={this.renderSectionHeader}
202 stickySectionHeadersEnabled={false} 206 stickySectionHeadersEnabled={false}
203 onRefreshData={() => this.props.onRefresh && this.props.onRefresh()} 207 onRefreshData={() => this.props.onRefresh && this.props.onRefresh()}
204 - onEndReached={() => {  
205 - this.props.onEndReached && this.props.onEndReached();  
206 - }}  
207 sections={sections} 208 sections={sections}
208 /> 209 />
209 <LoadingIndicator isVisible={isPullToRefresh}/> 210 <LoadingIndicator isVisible={isPullToRefresh}/>
@@ -269,14 +270,14 @@ let styles = StyleSheet.create({ @@ -269,14 +270,14 @@ let styles = StyleSheet.create({
269 width: width, 270 width: width,
270 paddingTop: 10, 271 paddingTop: 10,
271 paddingBottom: 10, 272 paddingBottom: 10,
272 - paddingLeft:15, 273 + paddingLeft: 15,
273 backgroundColor: 'white', 274 backgroundColor: 'white',
274 alignItems: 'center', 275 alignItems: 'center',
275 - flexDirection:'row' 276 + flexDirection: 'row'
276 }, 277 },
277 sectionHeaderText: { 278 sectionHeaderText: {
278 fontSize: 14, 279 fontSize: 14,
279 - marginLeft:10, 280 + marginLeft: 10,
280 color: '#444444', 281 color: '#444444',
281 fontFamily: 'PingFang-SC-Medium' 282 fontFamily: 'PingFang-SC-Medium'
282 }, 283 },
@@ -101,11 +101,11 @@ class SeckillContainer extends Component { @@ -101,11 +101,11 @@ class SeckillContainer extends Component {
101 } 101 }
102 102
103 _onFetchDiscountProductList() { 103 _onFetchDiscountProductList() {
104 - this.props.actions.getDiscountProductList() 104 + // this.props.actions.getDiscountProductList()
105 } 105 }
106 106
107 _onEndReached() { 107 _onEndReached() {
108 - this.props.actions.getDiscountProductList() 108 + // this.props.actions.getDiscountProductList()
109 } 109 }
110 110
111 render() { 111 render() {