Authored by chenl

集成新品到着和分割线数据。review by luliang。

... ... @@ -25,10 +25,10 @@ export default class DivideImage extends Component{
render(){
//测试数据
let rowData = Immutable.fromJS({"template_name":"divideImage","data":[{"src":"http://img11.static.yhbimg.com/yhb-img01/2016/11/24/13/01d93f236d113d1a9f9f93d2163a6b5080.jpg?imageView2/{mode}/w/{width}/h/{height}","alt":"","url":""}],"template_intro":"分隔图","template_id":"113991"});
let url = rowData.get("data").get(0).get("src");
let data = this.props.data;
let url = data.get(0).get("src");
let imageUrl = SlicedImage.getSlicedUrl(url, width, height, 2);
... ...
... ... @@ -28,10 +28,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);
... ...
... ... @@ -19,6 +19,8 @@ import AppIconList from './AppIconList'
import AppHotBrands from './AppHotBrands'
import TrendsetterCollocation from '../floor/TrendsetterCollocation'
import KidsBrandCell from '../cell/KidsBrandsCell';
import DivideImage from '../floor/DivideImage';
import NewProductFloor from '../floor/NewProductFloor';
export default class Home extends Component {
... ... @@ -112,6 +114,20 @@ export default class Home extends Component {
<KidsBrandCell />
)
}
case 'divideImage':{
let data = rowData.get('data');
return (
<DivideImage data={data}/>
)
}
case 'NewProductFloor':{
let data = rowData.get('data');
return (
<NewProductFloor
data={data}
onPressImageItem={this.props.onPressImageItem}/>
)
}
break;
default:
return null;
... ...
... ... @@ -50,6 +50,8 @@ class HomeContainer extends Component {
this._onRefresh = this._onRefresh.bind(this);
this._onEndReached = this._onEndReached.bind(this);
this._onPressImageItem = this._onPressImageItem.bind(this);
this.subscription = NativeAppEventEmitter.addListener(
'ChannelDidChangeEvent',
... ... @@ -84,6 +86,12 @@ class HomeContainer extends Component {
});
}
_onPressImageItem(data, index=0){
if(data && data.url){
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(data.url);
}
}
render() {
let {app, home} = this.props;
return (
... ... @@ -96,6 +104,7 @@ class HomeContainer extends Component {
onRefresh={this._onRefresh}
onEndReached={this._onEndReached}
channel={app.channel}
onPressImageItem={this._onPressImageItem}
/>
</View>
);
... ...