Authored by 盖剑秋

Fix bug on order and good goods recommends. reviewed by redding.

... ... @@ -77,7 +77,15 @@ export default class List extends Component {
return (
<View style={styles.container}>
{Platform.OS === 'ios'
? <ListView contentContainerStyle={styles.contentContainer} enableEmptySections={true} showsVerticalScrollIndicator={false} dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} renderRow={this.renderRow} enablePullToRefresh={true} isOnPullToRefresh={isProductListFetching && products.ptr} onRefreshData={() => {
? <ListView
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
showsVerticalScrollIndicator={false}
dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)}
renderRow={this.renderRow}
enablePullToRefresh={true}
isOnPullToRefresh={isProductListFetching && products.ptr}
onRefreshData={() => {
this.props.onRefresh && this.props.onRefresh();
}} onEndReached={() => {
if (list && list.length) {
... ... @@ -90,7 +98,14 @@ export default class List extends Component {
return null;
}
}}/>
: <ListView contentContainerStyle={styles.contentContainer} enableEmptySections={true} showsVerticalScrollIndicator={false} dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)} renderRow={this.renderRow} enablePullToRefresh={true} refreshControl={< YH_PtrRefresh refreshing = {
: <ListView
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
showsVerticalScrollIndicator={false}
dataSource={this.dataSource.cloneWithRowsAndSections(dataBlob)}
renderRow={this.renderRow}
enablePullToRefresh={true}
refreshControl={< YH_PtrRefresh refreshing = {
isFetchingAndroid
}
onRefresh = {
... ... @@ -109,6 +124,9 @@ export default class List extends Component {
}
}}/>
}
<LoadingIndicator
isVisible={isProductListFetching && !list.length}
/>
</View>
);
}
... ...
... ... @@ -44,7 +44,7 @@ export default class ListCell extends Component {
likeImgSource =require('../../image/unlike.png')
likeTextColor = '#b0b0b0';
}
let showPraiseButton = is_praised && total_praised;
return (
<TouchableOpacity style={styles.container} onPress={() => {
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 {
<View style={styles.rightPannel}>
<Text numberOfLines={2} style={styles.title}>{product_name}</Text>
<Text numberOfLines={4} style={styles.phrase}>{phrase}</Text>
<TouchableOpacity style={styles.likeButton} activeOpacity={1} onPress={() => {
{showPraiseButton
?<TouchableOpacity style={styles.likeButton} activeOpacity={1} onPress={() => {
this.props.onPressLike && this.props.onPressLike(this.props.index);
}}>
<Image style={styles.likeImage} source={likeImgSource}/>
<Text style={[styles.likeText, {color: likeTextColor}]}>{total_praised}人说赞</Text>
</TouchableOpacity>
: null}
</View>
</View>
</TouchableOpacity>
... ...
... ... @@ -77,7 +77,7 @@ export default class Detail extends Component {
}}/>);
break;
case 'productList':
return (<ProductListCell data={rowData} onPressProduct={this.props.onPressProduct}/>);
return (<ProductListCell data={rowData} onPressProduct={this.props.onPressProduct} _onPressDelayNotice={this.props._onPressDelayNotice}/>);
break;
case 'paymentInfo':
return (<PaymentInfoCell data={rowData}/>);
... ...
... ... @@ -53,6 +53,7 @@ class DetailContainer extends Component {
this.onPressProduct = this.onPressProduct.bind(this);
this.pushMultiPackageWithPackages = this.pushMultiPackageWithPackages.bind(this);
this.onPressReturnOrderCode = this.onPressReturnOrderCode.bind(this);
this.showDelayDeliveryNotice = this.showDelayDeliveryNotice.bind(this);
this.subscription = NativeAppEventEmitter.addListener(
'YHNotificationChangeOnLinePayToCodPay',
(reminder) => {
... ... @@ -101,6 +102,10 @@ class DetailContainer extends Component {
ReactNative.NativeModules.YH_OrderHelper.onPressReturnOrderCode();
}
showDelayDeliveryNotice(noticeString){
NativeModules.YH_OrderHelper.deliveryDelayNotice(noticeString);
}
render() {
let {detail, app} = this.props;
return (
... ... @@ -114,6 +119,7 @@ class DetailContainer extends Component {
onPressExpress={this.onPressExpress}
pushMultiPackageWithPackages={this.pushMultiPackageWithPackages}
onPressReturnOrderCode={this.onPressReturnOrderCode}
_onPressDelayNotice={this.showDelayDeliveryNotice}
/>
);
}
... ...