Authored by chenl

增加楼层数据曝光。review by sunkai。

... ... @@ -64,7 +64,7 @@ export default class ActivityProductFloor extends Component {
let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth,120,2);
return (
<TouchableOpacity
activeOpacity={1}
activeOpacity={1} yh_exposureData={rowData.get('yh_exposureData')}
onPress={()=>{
this.props.onPressVipProduct && this.props.onPressVipProduct(rowData, imgUrl, index+rowID)
}}
... ... @@ -101,7 +101,8 @@ export default class ActivityProductFloor extends Component {
let floorH = cellH + 40 + bannerHeight;
return (
<View style={{backgroundColor: 'white',width:width,height:floorH}}>
<HeadTitleCell title={title} moreUrl={moreUrl} onPressTitleMore={this.props.onPressTitleMore}/>
<HeadTitleCell title={title} moreUrl={moreUrl}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={data.get('title').get('yh_exposureData')}/>
<ImageSlider
resource={bannerData}
sliderWidth={width}
... ...
... ... @@ -38,7 +38,8 @@ export default class HotCategoryIndividualization extends Component {
let containerHeight = listHeight + 40;
return (
<View style={[styles.container, {height: containerHeight}]}>
<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.list, {height: listHeight}]}>
{data.map((item, i) => {
let url = YH_Image.getSlicedUrl(item.get('src'), imageWidth, imageHeight, 2);
... ... @@ -47,6 +48,7 @@ export default class HotCategoryIndividualization extends Component {
key={i}
style={styles.cellContainer}
activeOpacity={1}
yh_exposureData={item.get('yh_exposureData')}
onPress={() => {
this.props.onPressVipBannerItem && this.props.onPressVipBannerItem(item.get('url'), url, i + 1);
}}>
... ...
... ... @@ -45,7 +45,7 @@ export default class VipUserFloor extends Component {
let productSkn = rowData.get('product_skn');
let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth,120,2);
return (
<TouchableOpacity style={styles.row}
<TouchableOpacity style={styles.row} yh_exposureData={rowData.get('yh_exposureData')}
onPress={()=>this.props.onPressVipProduct && this.props.onPressVipProduct(rowData, imgUrl, index + rowID)}>
<YH_Image style={styles.image}
url={imgUrl}
... ... @@ -69,7 +69,8 @@ export default class VipUserFloor extends Component {
let productData = data.get('list');
return (
<View style={styles.container}>
<HeadTitleCell title={title} moreUrl={moreUrl}/>
<HeadTitleCell title={title} moreUrl={moreUrl}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={data.get('title').get('yh_exposureData')}/>
<ImageSlider
resource={bannerData}
sliderWidth={width}
... ...
... ... @@ -1119,19 +1119,52 @@ function homeFloorAutoReportData(list,channel) {
}
break;
}
case 'vipUse': {
case 'vipUse':
case 'activityProductFloor':
case 'new_user_floor': {
//more添加曝光数据
let title = floorData.title ? floorData.title : {};
let titleParam = autoReportData(channlStr,floorName,floorID,floorIndex,"0",title.more_url);
title.yh_exposureData = titleParam;
break;
//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;
}
case 'activityProductFloor': {
//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 'hot_category_individualization': {
//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 : "";
break;
//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;
}
case 'new_user_floor': {
break;
}
}
... ...