Authored by chenl

修复了部分楼层点击事件。review by yuliang。

... ... @@ -44,17 +44,17 @@ export default class LivePicture extends Component{
<View style={styles.imageContainer}>
<TouchableOpacity activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0).get('url'), 0)}>
<YH_Image style={styles.imageLeftAndRight} url={image1Url}/>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1).get('url'), 1)}>
<YH_Image style={styles.imageMiddle} url={image2Url}/>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2).get('url'), 2)}>
<YH_Image style={styles.imageLeftAndRight} url={image3Url}/>
</TouchableOpacity>
... ...
... ... @@ -47,27 +47,27 @@ export default class NewProductFloor extends Component{
<View style={styles.imageContainer}>
<TouchableOpacity style={styles.leftBigImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0).get('url'), 0)}>
<YH_Image style={styles.leftBigImage} url={leftBigImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallTopLeftImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1).get('url'), 1)}>
<YH_Image style={styles.rightSmallTopLeftImage} url={rightSmallTopLeftImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallBottomLeftImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2).get('url'), 2)}>
<YH_Image style={styles.rightSmallBottomLeftImage} url={rightSmallBottomLeftImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallTopRightImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(3))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(3).get('url'), 3)}>
<YH_Image style={styles.rightSmallTopRightImage} url={rightSmallTopRightImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallBottomRightImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(4))}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(4).get('url'), 4)}>
<YH_Image style={styles.rightSmallBottomRightImage} url={rightSmallBottomRightImageUrl}/>
</TouchableOpacity>
</View>
... ...
... ... @@ -43,7 +43,7 @@ export default class PopularSingleProduct extends Component{
return (
<TouchableOpacity
activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(rowData, rowID)}
onPress={() => this.props.onPressToProductDetail && this.props.onPressToProductDetail(rowData, rowID)}
>
<View style={styles.goodsContainer}>
... ... @@ -74,11 +74,6 @@ export default class PopularSingleProduct extends Component{
let title = data.get("title");
let imglst = data.get("list", List());
// let backgroundStyle = background.get("color") ? {backgroundColor: background.get("color")} : null;
// let bannerImageUrl = SlicedImage.getSlicedUrl(bannerImage.get(0).get("src"), width, bannerHeight, 2);
return(
<View style={styles.container}>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')} onPressTitleMore={this.props.onPressTitleMore} />
... ...
... ... @@ -117,7 +117,7 @@ export default class Sale1T1L4R extends Component{
<View style={styles.imageContainer}>
<TouchableOpacity style={styles.leftBigImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0).toJS())}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0).get('url'), 0)}>
<YH_Image style={styles.leftBigImage} url={leftBigImageUrl}/>
<View style={styles.timerImageContainer}>
... ... @@ -136,22 +136,22 @@ export default class Sale1T1L4R extends Component{
</TouchableOpacity>
<TouchableOpacity style={styles.rightTopBigImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1).toJS())}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1).get('url'), 1)}>
<YH_Image style={styles.rightTopBigImage} url={rightTopBigImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightTopSmallImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2).toJS())}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2).get('url'), 2)}>
<YH_Image style={styles.rightTopSmallImage} url={rightTopSmallImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightBottomBigImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(3).toJS())}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(3).get('url'), 3)}>
<YH_Image style={styles.rightBottomBigImage} url={rightBottomBigImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightBottomSmallImageContainer} activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(4).toJS())}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(4).get('url'), 4)}>
<YH_Image style={styles.rightBottomSmallImage} url={rightBottomSmallImageUrl}/>
</TouchableOpacity>
</View>
... ...
... ... @@ -38,7 +38,7 @@ export default class SixLinesFloor extends Component{
return(
<TouchableOpacity activeOpacity={1}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(rowData, rowID)}>
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(rowData.get('url'), rowID)}>
<YH_Image style={styles.goodsImage} url={goodsImageUrl} />
... ...
... ... @@ -330,7 +330,7 @@ export default class Home extends Component {
<PopularSingleProduct
data={rowData.get('data')}
onPressSlideItem={this.props.onPressSlideItem}
onPressImageItem={this.props.onPressImageItem}
onPressToProductDetail={this.props.onPressToProductDetail}
onPressTitleMore={this.props.onPressTitleMore}
/>
)
... ...
... ... @@ -74,6 +74,8 @@ class HomeContainer extends Component {
this.onPressFindSimilar = this.onPressFindSimilar.bind(this);
this.onPressDislike = this.onPressDislike.bind(this);
this.onPressProductListProduct = this.onPressProductListProduct.bind(this);
this.onPressToProductDetail = this.onPressToProductDetail.bind(this);
this.subscription = NativeAppEventEmitter.addListener(
'ChannelDidChangeEvent',
... ... @@ -168,7 +170,11 @@ class HomeContainer extends Component {
this.jumpWithUrl(url);
}
onPressImageItem(data, index=0) {
onPressImageItem(url, index) {
this.jumpWithUrl(url);
}
onPressToProductDetail(data, index){
let productSkn = data && data.get('product_skn', 0);
if (!productSkn) {
return;
... ... @@ -268,6 +274,7 @@ class HomeContainer extends Component {
onPressDislike={this.onPressDislike}
onPressProductListProduct={this.onPressProductListProduct}
onClickRecommendProduct={this.onClickRecommendProduct}
onPressToProductDetail={this.onPressToProductDetail}
/>
</View>
);
... ...