Authored by yoho-js001
Committed by 盖剑秋

Good goods recommend list UI. reviewed by Boss Yin.

... ... @@ -36,7 +36,7 @@ export default class List extends Component {
}
break;
case 'list': {
return <ListCell resource={rowData} />;
return <ListCell resource={rowData} onPressDetail={this.props.onPressDetail}/>;
}
break;
}
... ...
... ... @@ -31,17 +31,22 @@ export default class ListCell extends Component {
}
let {
default_images,
product_skn,
phrase,
product_name,
} = data;
default_images = default_images.replace('{width}', 240).replace('{height}', 320).replace('{mode}',2);
return (
<TouchableOpacity style={styles.container} onPress={() => {this.props.onPressDetail && this.props.onPressDetail(product_skn)}}>
<View style={styles.container}>
<Image style={styles.image} source={{uri:default_images}}/>
<View style={styles.rightPannel}>
<Text style={styles.title}>title</Text>
<Text style={styles.phrase}>content</Text>
<Text numberOfLines={2} style={styles.title}>{product_name}</Text>
<Text numberOfLines={4} style={styles.phrase}>{phrase}</Text>
</View>
</View>
</TouchableOpacity>
);
}
}
... ...
... ... @@ -46,6 +46,7 @@ function mapDispatchToProps(dispatch) {
class ListContainer extends Component {
constructor(props) {
super(props);
this._onPressDetail = this._onPressDetail.bind(this);
}
componentDidMount() {
... ... @@ -56,11 +57,19 @@ class ListContainer extends Component {
}
_onPressDetail(product_skn) {
if (!product_skn) {
return;
}
ReactNative.NativeModules.YH_CommonHelper.pushGoodGoodsRecommendDetailWithProductSKN(product_skn.toString());
}
render() {
let {list} = this.props;
return (
<List
resource={list}
onPressDetail={this._onPressDetail}
/>
);
}
... ...