From 2ff4723d2530b500226830a9ef45d45b800d7ba4 Mon Sep 17 00:00:00 2001 From: chenl <chenl> Date: Thu, 16 Mar 2017 20:13:19 +0800 Subject: [PATCH] 增加好点推荐数据。review by sunkai。 --- js/home/utils/floorParser.js | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/js/home/utils/floorParser.js b/js/home/utils/floorParser.js index 13ffaf6..c20f496 100644 --- a/js/home/utils/floorParser.js +++ b/js/home/utils/floorParser.js @@ -1099,9 +1099,40 @@ function homeFloorAutoReportData(list,channel) { let titleParam = autoReportData(channlStr,floorName,floorID,floorIndex,"0",moreUrl); title.yh_exposureData = titleParam ? titleParam : ""; - + //list添加曝光数据 + let inFloorIndex = 0; + let itemList = floorData.list ? floorData.list : []; + for (let j = 0; j < itemList.length; j++) { + inFloorIndex = inFloorIndex + 1; + let imageItem = itemList[j]; + let actionUrl = imageItem.url; + let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,actionUrl); + imageItem.yh_exposureData = param; - break; + //添加商品1曝光数据 + if(imageItem.goods0){ + inFloorIndex = inFloorIndex + 1; + let url = imageItem.goods0.url; + let goodsParam = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,url); + imageItem.goods0.yh_exposureData = goodsParam; + } + //添加商品2曝光数据 + if(imageItem.goods1){ + inFloorIndex = inFloorIndex + 1; + let url = imageItem.goods1.url; + let goodsParam = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,url); + imageItem.goods1.yh_exposureData = goodsParam; + } + //添加商品3曝光数据 + if(imageItem.goods2){ + inFloorIndex = inFloorIndex + 1; + let url = imageItem.goods2.url; + let goodsParam = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,url); + imageItem.goods2.yh_exposureData = goodsParam; + } + } + console.log("chenlin", JSON.stringify(itemList)); + break; } case 'sixLinesFloor': { //more添加曝光数据 -- libgit2 0.24.0