Fix bug on order and good goods recommends. reviewed by redding.
Showing
4 changed files
with
31 additions
and
5 deletions
@@ -77,7 +77,15 @@ export default class List extends Component { | @@ -77,7 +77,15 @@ export default class List extends Component { | ||
77 | return ( | 77 | return ( |
78 | <View style={styles.container}> | 78 | <View style={styles.container}> |
79 | {Platform.OS === 'ios' | 79 | {Platform.OS === 'ios' |
80 | - ? <ListView contentContainerStyle={styles.contentContainer} enableEmptySections={true} showsVerticalScrollIndicator={false} dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} renderRow={this.renderRow} enablePullToRefresh={true} isOnPullToRefresh={isProductListFetching && products.ptr} onRefreshData={() => { | 80 | + ? <ListView |
81 | + contentContainerStyle={styles.contentContainer} | ||
82 | + enableEmptySections={true} | ||
83 | + showsVerticalScrollIndicator={false} | ||
84 | + dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} | ||
85 | + renderRow={this.renderRow} | ||
86 | + enablePullToRefresh={true} | ||
87 | + isOnPullToRefresh={isProductListFetching && products.ptr} | ||
88 | + onRefreshData={() => { | ||
81 | this.props.onRefresh && this.props.onRefresh(); | 89 | this.props.onRefresh && this.props.onRefresh(); |
82 | }} onEndReached={() => { | 90 | }} onEndReached={() => { |
83 | if (list && list.length) { | 91 | if (list && list.length) { |
@@ -90,7 +98,14 @@ export default class List extends Component { | @@ -90,7 +98,14 @@ export default class List extends Component { | ||
90 | return null; | 98 | return null; |
91 | } | 99 | } |
92 | }}/> | 100 | }}/> |
93 | - : <ListView contentContainerStyle={styles.contentContainer} enableEmptySections={true} showsVerticalScrollIndicator={false} dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} renderRow={this.renderRow} enablePullToRefresh={true} refreshControl={< YH_PtrRefresh refreshing = { | 101 | + : <ListView |
102 | + contentContainerStyle={styles.contentContainer} | ||
103 | + enableEmptySections={true} | ||
104 | + showsVerticalScrollIndicator={false} | ||
105 | + dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} | ||
106 | + renderRow={this.renderRow} | ||
107 | + enablePullToRefresh={true} | ||
108 | + refreshControl={< YH_PtrRefresh refreshing = { | ||
94 | isFetchingAndroid | 109 | isFetchingAndroid |
95 | } | 110 | } |
96 | onRefresh = { | 111 | onRefresh = { |
@@ -109,6 +124,9 @@ export default class List extends Component { | @@ -109,6 +124,9 @@ export default class List extends Component { | ||
109 | } | 124 | } |
110 | }}/> | 125 | }}/> |
111 | } | 126 | } |
127 | + <LoadingIndicator | ||
128 | + isVisible={isProductListFetching && !list.length} | ||
129 | + /> | ||
112 | </View> | 130 | </View> |
113 | ); | 131 | ); |
114 | } | 132 | } |
@@ -44,7 +44,7 @@ export default class ListCell extends Component { | @@ -44,7 +44,7 @@ export default class ListCell extends Component { | ||
44 | likeImgSource =require('../../image/unlike.png') | 44 | likeImgSource =require('../../image/unlike.png') |
45 | likeTextColor = '#b0b0b0'; | 45 | likeTextColor = '#b0b0b0'; |
46 | } | 46 | } |
47 | - | 47 | + let showPraiseButton = is_praised && total_praised; |
48 | return ( | 48 | return ( |
49 | <TouchableOpacity style={styles.container} onPress={() => { | 49 | <TouchableOpacity style={styles.container} onPress={() => { |
50 | this.props.onPressDetail && this.props.onPressDetail(product_skn, this.props.index, is_praised, total_praised) | 50 | this.props.onPressDetail && this.props.onPressDetail(product_skn, this.props.index, is_praised, total_praised) |
@@ -57,12 +57,14 @@ export default class ListCell extends Component { | @@ -57,12 +57,14 @@ export default class ListCell extends Component { | ||
57 | <View style={styles.rightPannel}> | 57 | <View style={styles.rightPannel}> |
58 | <Text numberOfLines={2} style={styles.title}>{product_name}</Text> | 58 | <Text numberOfLines={2} style={styles.title}>{product_name}</Text> |
59 | <Text numberOfLines={4} style={styles.phrase}>{phrase}</Text> | 59 | <Text numberOfLines={4} style={styles.phrase}>{phrase}</Text> |
60 | - <TouchableOpacity style={styles.likeButton} activeOpacity={1} onPress={() => { | 60 | + {showPraiseButton |
61 | + ?<TouchableOpacity style={styles.likeButton} activeOpacity={1} onPress={() => { | ||
61 | this.props.onPressLike && this.props.onPressLike(this.props.index); | 62 | this.props.onPressLike && this.props.onPressLike(this.props.index); |
62 | }}> | 63 | }}> |
63 | <Image style={styles.likeImage} source={likeImgSource}/> | 64 | <Image style={styles.likeImage} source={likeImgSource}/> |
64 | <Text style={[styles.likeText, {color: likeTextColor}]}>{total_praised}人说赞</Text> | 65 | <Text style={[styles.likeText, {color: likeTextColor}]}>{total_praised}人说赞</Text> |
65 | </TouchableOpacity> | 66 | </TouchableOpacity> |
67 | + : null} | ||
66 | </View> | 68 | </View> |
67 | </View> | 69 | </View> |
68 | </TouchableOpacity> | 70 | </TouchableOpacity> |
@@ -77,7 +77,7 @@ export default class Detail extends Component { | @@ -77,7 +77,7 @@ export default class Detail extends Component { | ||
77 | }}/>); | 77 | }}/>); |
78 | break; | 78 | break; |
79 | case 'productList': | 79 | case 'productList': |
80 | - return (<ProductListCell data={rowData} onPressProduct={this.props.onPressProduct}/>); | 80 | + return (<ProductListCell data={rowData} onPressProduct={this.props.onPressProduct} _onPressDelayNotice={this.props._onPressDelayNotice}/>); |
81 | break; | 81 | break; |
82 | case 'paymentInfo': | 82 | case 'paymentInfo': |
83 | return (<PaymentInfoCell data={rowData}/>); | 83 | return (<PaymentInfoCell data={rowData}/>); |
@@ -53,6 +53,7 @@ class DetailContainer extends Component { | @@ -53,6 +53,7 @@ class DetailContainer extends Component { | ||
53 | this.onPressProduct = this.onPressProduct.bind(this); | 53 | this.onPressProduct = this.onPressProduct.bind(this); |
54 | this.pushMultiPackageWithPackages = this.pushMultiPackageWithPackages.bind(this); | 54 | this.pushMultiPackageWithPackages = this.pushMultiPackageWithPackages.bind(this); |
55 | this.onPressReturnOrderCode = this.onPressReturnOrderCode.bind(this); | 55 | this.onPressReturnOrderCode = this.onPressReturnOrderCode.bind(this); |
56 | + this.showDelayDeliveryNotice = this.showDelayDeliveryNotice.bind(this); | ||
56 | this.subscription = NativeAppEventEmitter.addListener( | 57 | this.subscription = NativeAppEventEmitter.addListener( |
57 | 'YHNotificationChangeOnLinePayToCodPay', | 58 | 'YHNotificationChangeOnLinePayToCodPay', |
58 | (reminder) => { | 59 | (reminder) => { |
@@ -101,6 +102,10 @@ class DetailContainer extends Component { | @@ -101,6 +102,10 @@ class DetailContainer extends Component { | ||
101 | ReactNative.NativeModules.YH_OrderHelper.onPressReturnOrderCode(); | 102 | ReactNative.NativeModules.YH_OrderHelper.onPressReturnOrderCode(); |
102 | } | 103 | } |
103 | 104 | ||
105 | + showDelayDeliveryNotice(noticeString){ | ||
106 | + NativeModules.YH_OrderHelper.deliveryDelayNotice(noticeString); | ||
107 | + } | ||
108 | + | ||
104 | render() { | 109 | render() { |
105 | let {detail, app} = this.props; | 110 | let {detail, app} = this.props; |
106 | return ( | 111 | return ( |
@@ -114,6 +119,7 @@ class DetailContainer extends Component { | @@ -114,6 +119,7 @@ class DetailContainer extends Component { | ||
114 | onPressExpress={this.onPressExpress} | 119 | onPressExpress={this.onPressExpress} |
115 | pushMultiPackageWithPackages={this.pushMultiPackageWithPackages} | 120 | pushMultiPackageWithPackages={this.pushMultiPackageWithPackages} |
116 | onPressReturnOrderCode={this.onPressReturnOrderCode} | 121 | onPressReturnOrderCode={this.onPressReturnOrderCode} |
122 | + _onPressDelayNotice={this.showDelayDeliveryNotice} | ||
117 | /> | 123 | /> |
118 | ); | 124 | ); |
119 | } | 125 | } |
-
Please register or login to post a comment