...
|
...
|
@@ -3,7 +3,6 @@ |
|
|
import React, {Component} from 'react';
|
|
|
import ReactNative, {
|
|
|
View,
|
|
|
Image,
|
|
|
TouchableOpacity,
|
|
|
StyleSheet,
|
|
|
Dimensions,
|
...
|
...
|
@@ -12,6 +11,8 @@ import Immutable, {Map} from 'immutable'; |
|
|
|
|
|
|
|
|
import SlicedImage from '../../../common/components/SlicedImage';
|
|
|
import YH_Image from '../../../common/components/YH_Image';
|
|
|
|
|
|
import HeadTitleCell from '../cell/HeadTitleCell';
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -28,10 +29,9 @@ export default class NewProductFloor extends Component{ |
|
|
|
|
|
render(){
|
|
|
|
|
|
//测试数据
|
|
|
let rowData = Immutable.fromJS({"template_name":"NewProductFloor","data":{"title":{"more_name":"...","name":"一周精选","title":"一周精选","more_url":""},"list":[{"src":"http://img11.static.yhbimg.com/yhb-img01/2017/01/20/11/01b18ee60e2e9609033a5ad38efc613c8e.jpg?imageView2/{mode}/w/{width}/h/{height}","title":"","url":"https://feature.yoho.cn/0120/0120FENQI/index.html?title=有货分期&share_id=1439&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"share_id\":\"1439\",\"title\":\"有货分期\"},\"share\":\"/operations/api/v5/webshare/getShare\",\"shareparam\":{\"share_id\":\"1439\"},\"title\":\"有货分期\",\"url\":\"https://feature.yoho.cn/0120/0120FENQI/index.html\"}}"},{"src":"http://img11.static.yhbimg.com/yhb-img01/2016/12/20/17/01f0604dfef7a6cc75b33c62fcb5acdecb.jpg?imageView2/{mode}/w/{width}/h/{height}","title":"","url":"https://m.yohobuy.com/activity/shopCollect?channel_id=3&title=vip新品抢鲜&code=8eea98740b3645cddb41629aa5dbf6ab&share_id=25&tab_name=欧美大牌&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"code\":\"8eea98740b3645cddb41629aa5dbf6ab\",\"param\":{\"share_id\":\"25\",\"code\":\"8eea98740b3645cddb41629aa5dbf6ab\",\"tab_name\":\"欧美大牌\",\"title\":\"vip新品抢鲜\",\"channel_id\":\"3\"},\"tab_name\":\"欧美大牌\",\"share\":\"/operations/api/v5/webshare/getShare\",\"shareparam\":{\"share_id\":\"25\"},\"title\":\"vip新品抢鲜\",\"channel_id\":\"3\",\"url\":\"https://m.yohobuy.com/activity/shopCollect\"}}"},{"src":"http://img11.static.yhbimg.com/yhb-img01/2016/12/20/17/011c7324b07161859654c6bc512cc2bc21.jpg?imageView2/{mode}/w/{width}/h/{height}","title":"","url":"https://feature.yoho.cn/0124/0124PINPAIBOY/index.html?title=精选潮牌专场&share_id=1607&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"share_id\":\"1607\",\"title\":\"精选潮牌专场\"},\"share\":\"/operations/api/v5/webshare/getShare\",\"shareparam\":{\"share_id\":\"1607\"},\"title\":\"精选潮牌专场\",\"url\":\"https://feature.yoho.cn/0124/0124PINPAIBOY/index.html\"}}"},{"src":"http://img10.static.yhbimg.com/yhb-img01/2016/12/20/17/0113067023a8f323294982d391fc2534eb.jpg?imageView2/{mode}/w/{width}/h/{height}","title":"","url":"https://m.yohobuy.com/activity/shopCollect?channel_id=3&title=vip新品抢鲜&code=8eea98740b3645cddb41629aa5dbf6ab&share_id=25&tab_name=欧美大牌&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"code\":\"8eea98740b3645cddb41629aa5dbf6ab\",\"param\":{\"share_id\":\"25\",\"code\":\"8eea98740b3645cddb41629aa5dbf6ab\",\"tab_name\":\"欧美大牌\",\"title\":\"vip新品抢鲜\",\"channel_id\":\"3\"},\"tab_name\":\"欧美大牌\",\"share\":\"/operations/api/v5/webshare/getShare\",\"shareparam\":{\"share_id\":\"25\"},\"title\":\"vip新品抢鲜\",\"channel_id\":\"3\",\"url\":\"https://m.yohobuy.com/activity/shopCollect\"}}"},{"src":"http://img11.static.yhbimg.com/yhb-img01/2016/12/13/09/01f52bb02ed578eab606cbf402430e7cfe.jpg?imageView2/{mode}/w/{width}/h/{height}","title":"","url":"https://m.yohobuy.com/guang/star/?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{},\"url\":\"https://m.yohobuy.com/guang/star/\"}}"}]}});
|
|
|
let title = rowData.get("data").get("title");
|
|
|
let imglst = rowData.get("data").get("list");
|
|
|
let data = this.props.data;
|
|
|
let title = data.get("title");
|
|
|
let imglst = data.get("list");
|
|
|
|
|
|
let leftBigImageUrl = SlicedImage.getSlicedUrl(imglst.get(0).get("src"), leftBigImageWidth, leftBigImageHeight, 2);
|
|
|
let rightSmallTopLeftImageUrl = SlicedImage.getSlicedUrl(imglst.get(1).get("src"), rightSmallImageWidth, rightSmallImageHeight, 2);
|
...
|
...
|
@@ -47,27 +47,27 @@ export default class NewProductFloor extends Component{ |
|
|
|
|
|
<TouchableOpacity style={styles.leftBigImageContainer} activeOpacity={1}
|
|
|
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0).toJS())}>
|
|
|
<Image style={styles.leftBigImage} key={leftBigImageUrl} source={{uri: leftBigImageUrl}}/>
|
|
|
<YH_Image style={styles.leftBigImage} url={leftBigImageUrl}/>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity style={styles.rightSmallTopLeftImageContainer} activeOpacity={1}
|
|
|
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1).toJS())}>
|
|
|
<Image style={styles.rightSmallTopLeftImage} key={rightSmallTopLeftImageUrl} source={{uri: rightSmallTopLeftImageUrl}}/>
|
|
|
<YH_Image style={styles.rightSmallTopLeftImage} url={rightSmallTopLeftImageUrl}/>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity style={styles.rightSmallBottomLeftImageContainer} activeOpacity={1}
|
|
|
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2).toJS())}>
|
|
|
<Image style={styles.rightSmallBottomLeftImage} key={rightSmallBottomLeftImageUrl} source={{uri: rightSmallBottomLeftImageUrl}}/>
|
|
|
<YH_Image style={styles.rightSmallBottomLeftImage} url={rightSmallBottomLeftImageUrl}/>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity style={styles.rightSmallTopRightImageContainer} activeOpacity={1}
|
|
|
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(3).toJS())}>
|
|
|
<Image style={styles.rightSmallTopRightImage} key={rightSmallTopRightImageUrl} source={{uri: rightSmallTopRightImageUrl}}/>
|
|
|
<YH_Image style={styles.rightSmallTopRightImage} url={rightSmallTopRightImageUrl}/>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity style={styles.rightSmallBottomRightImageContainer} activeOpacity={1}
|
|
|
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(4).toJS())}>
|
|
|
<Image style={styles.rightSmallBottomRightImage} key={rightSmallBottomRightImageUrl} source={{uri: rightSmallBottomRightImageUrl}}/>
|
|
|
<YH_Image style={styles.rightSmallBottomRightImage} url={rightSmallBottomRightImageUrl}/>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
</View>
|
...
|
...
|
|