Authored by chenl

增加NewProductFloor楼层曝光。review by sunkai。

... ... @@ -42,31 +42,32 @@ export default class NewProductFloor extends Component{
return(
<View style={styles.container}>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')} onPressTitleMore={this.props.onPressTitleMore}/>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={title.get('yh_exposureData')}/>
<View style={styles.imageContainer}>
<TouchableOpacity style={styles.leftBigImageContainer} activeOpacity={1}
<TouchableOpacity style={styles.leftBigImageContainer} activeOpacity={1} yh_exposureData={imglst.get(0).get('yh_exposureData')}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(0).get('url'), leftBigImageUrl, 0)}>
<YH_Image style={styles.leftBigImage} url={leftBigImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallTopLeftImageContainer} activeOpacity={1}
<TouchableOpacity style={styles.rightSmallTopLeftImageContainer} activeOpacity={1} yh_exposureData={imglst.get(1).get('yh_exposureData')}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(1).get('url'), rightSmallTopLeftImageUrl, 1)}>
<YH_Image style={styles.rightSmallTopLeftImage} url={rightSmallTopLeftImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallBottomLeftImageContainer} activeOpacity={1}
<TouchableOpacity style={styles.rightSmallBottomLeftImageContainer} activeOpacity={1} yh_exposureData={imglst.get(2).get('yh_exposureData')}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(2).get('url'), rightSmallBottomLeftImageUrl, 2)}>
<YH_Image style={styles.rightSmallBottomLeftImage} url={rightSmallBottomLeftImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallTopRightImageContainer} activeOpacity={1}
<TouchableOpacity style={styles.rightSmallTopRightImageContainer} activeOpacity={1} yh_exposureData={imglst.get(3).get('yh_exposureData')}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(3).get('url'), rightSmallTopRightImageUrl, 3)}>
<YH_Image style={styles.rightSmallTopRightImage} url={rightSmallTopRightImageUrl}/>
</TouchableOpacity>
<TouchableOpacity style={styles.rightSmallBottomRightImageContainer} activeOpacity={1}
<TouchableOpacity style={styles.rightSmallBottomRightImageContainer} activeOpacity={1} yh_exposureData={imglst.get(4).get('yh_exposureData')}
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(imglst.get(4).get('url'), rightSmallBottomRightImageUrl ,4)}>
<YH_Image style={styles.rightSmallBottomRightImage} url={rightSmallBottomRightImageUrl}/>
</TouchableOpacity>
... ...
... ... @@ -781,6 +781,7 @@ function homeFloorAutoReportData(list,channel) {
let floorName = item.template_name;
let floorID = item.template_id;
let floorIndex = parseInt(i) + 1 + '';
let floorData = item.data;
switch(floorName) {
case 'focus': {
... ... @@ -1005,12 +1006,50 @@ function homeFloorAutoReportData(list,channel) {
break;
}
case 'NewProductFloor': {
break;
//more添加曝光数据
let title = floorData.title ? floorData.title : {};
let moreUrl = title.more_url ? title.more_url : "";
let titleParam = autoReportData(channlStr,floorName,floorID,floorIndex,"0",moreUrl);
title.yh_exposureData = titleParam ? titleParam : "";
//list添加曝光数据
let itemList = floorData.list ? floorData.list : [];
for (let j = 0; j < itemList.length; j++) {
let imageItem = itemList[j];
let inFloorIndex = parseInt(j) + 1 + '';
let actionUrl = imageItem.url;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,actionUrl);
imageItem.yh_exposureData = param;
}
break;
}
case 'popular_single_product': {
//more添加曝光数据
let title = floorData.title ? floorData.title : {};
let titleParam = autoReportData(channlStr,floorName,floorID,floorIndex,"0",title.more_url);
title.yh_exposureData = titleParam;
//banner添加曝光数据
let banner = floorData.banner_image ? floorData.banner_image : [];
let bannerLength = banner.length ? banner.length : 0;
for (var j = 0; j < bannerLength; j++) {
let bannerItem = banner[j];
let inFloorIndex = parseInt(j) + 1 + '';
let actionUrl = bannerItem.url;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,actionUrl);
bannerItem.yh_exposureData = param;
}
break;
//list添加曝光数据
let itemList = floorData.list ? floorData.list : [];
for (var j = 0; j < itemList.length; j++) {
let imageItem = itemList[j];
let inFloorIndex = parseInt(j) + 1 + bannerLength + '';
let skn = imageItem.product_skn;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,"",skn);
imageItem.yh_exposureData = param;
}
break;
}
case 'shopRecommend': {
... ...