Authored by 张丽霞

新品到着埋点,review by redding

... ... @@ -77,7 +77,7 @@ export function getTopInfo() {
I_INDEX ++;
}
logData.push({
F_ID: 1,
F_ID: 1001,
F_NM: 'BANNER',
F_INDEX,
LIST,
... ... @@ -99,7 +99,7 @@ export function getTopInfo() {
I_INDEX ++;
}
logData.push({
F_ID: 2,
F_ID: 1002,
F_NM: '为您推荐',
F_INDEX,
LIST,
... ... @@ -121,7 +121,7 @@ export function getTopInfo() {
I_INDEX ++;
}
logData.push({
F_ID: 3,
F_ID: 1003,
F_NM: '精选抢先看',
F_INDEX,
LIST,
... ... @@ -193,11 +193,16 @@ export function getProductList(reload=false) {
return new NewArrivalService(app.host).fetchProductList(channel, order, page, pageSize, allFilterFactors)
.then(json => {
let payload = parseProductList(json);
payload.endReached = payload.currentPage == payload.pageCount;
let LIST = [];
for (var i = 0; i < payload.list.length; i++) {
let item = payload.list[i]
let KEYWORD = '';
let ListItem = {
I_INDEX: productList.list.size + i + 1,
RECOMMEND_TYPE: item.recommend_type,
};
let KEYWORD_WORD = '';
if (item.recommend_type == 'hotSearchTerm'&&item.data.length) {
KEYWORD = item.data.join(',');
}
... ... @@ -219,16 +224,20 @@ export function getProductList(reload=false) {
}
CATE_ID = tempAry.join(',');
}
LIST.push({
I_INDEX: productList.list.size + i + 1,
RECOMMEND_TYPE: item.recommend_type,
PRD_SKN: item.product_skn,
BRAND_ID: item.brand_id,
CATE_ID,
ARTICLE_ID,
SHOP_ID,
KEYWORD,
})
if (item.product_skn) {
ListItem.PRD_SKN = item.product_skn;
} else if (item.brand_id) {
ListItem.BRAND_ID = item.brand_id;
} else if (CATE_ID && CATE_ID!= '') {
ListItem.CATE_ID = CATE_ID;
} else if (ARTICLE_ID && ARTICLE_ID != 0) {
ListItem.ARTICLE_ID = ARTICLE_ID;
} else if (SHOP_ID && SHOP_ID != 0) {
ListItem.SHOP_ID = SHOP_ID;
} else if (KEYWORD_WORD && KEYWORD_WORD != '') {
ListItem.KEYWORD_WORD = KEYWORD_WORD;
}
LIST.push(ListItem);
}
let F_INDEX = 1;
if (topPart.topList.size) {
... ... @@ -400,9 +409,93 @@ export function getRecommendBrand() {
dispatch(recommendBrandRequest());
return new NewArrivalService(app.host).fetchRecommendBrand(channel)
.then(json => {
let hotBrandList = json.hot_brand_list;
let browseBrandList = json.browse_brand_list;
let hotBrandList = json.hot_brand_list;
let newBrandList = json.new_brand_list;
/**
数据曝光
*/
let logData = [];
let F_INDEX = 1;
if (browseBrandList && browseBrandList.length) {
let LIST = [];
let I_INDEX = 1;
for (var i = 0; i < browseBrandList.length; i++) {
browseBrandList[i].F_ID = 1001;
browseBrandList[i].F_INDEX = F_INDEX;
browseBrandList[i].F_NM = '浏览过的品牌';
browseBrandList[i].I_INDEX = I_INDEX;
let item = browseBrandList[i];
LIST.push({
I_INDEX,
BRAND_ID: item.brand_id,
SHOP_ID: item.shops_id,
});
I_INDEX ++;
}
logData.push({
F_ID: 1001,
F_NM: '浏览过的品牌',
F_INDEX,
LIST,
});
F_INDEX ++;
}
if (hotBrandList && hotBrandList.length) {
let LIST = [];
let I_INDEX = 1;
for (var i = 0; i < hotBrandList.length; i++) {
let item = hotBrandList[i];
hotBrandList[i].F_ID = 1002;
hotBrandList[i].F_INDEX = F_INDEX;
hotBrandList[i].F_NM = '热门品牌';
hotBrandList[i].I_INDEX = I_INDEX;
LIST.push({
I_INDEX,
BRAND_ID: item.brand_id,
SHOP_ID: item.shops_id,
});
I_INDEX ++;
}
logData.push({
F_ID: 1002,
F_NM: '热门品牌',
F_INDEX,
LIST,
});
F_INDEX ++;
}
if (newBrandList && newBrandList.length) {
let LIST = [];
let I_INDEX = 1;
for (var i = 0; i < newBrandList.length; i++) {
let item = hotBrandList[i];
hotBrandList[i].F_ID = 1003;
hotBrandList[i].F_INDEX = F_INDEX;
hotBrandList[i].F_NM = '新入驻品牌';
hotBrandList[i].I_INDEX = I_INDEX;
LIST.push({
I_INDEX,
BRAND_ID: item.brand_id,
SHOP_ID: item.shops_id,
});
I_INDEX ++;
}
logData.push({
F_ID: 1003,
F_NM: '新入驻品牌',
F_INDEX,
LIST,
});
F_INDEX ++;
}
let params = {
DATA: logData,
};
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_SHOW_NEW_ARRIVAL_RECOMMEND', params);
dispatch(recommendBrandSuccess({hotBrandList, browseBrandList, newBrandList}));
})
.catch(error => {
... ... @@ -413,7 +506,25 @@ export function getRecommendBrand() {
export function goToRecommendForYou() {
return (dispatch, getState) => {
let {app, newArrival} = getState();
let { productList, filterFactors, topPart} = newArrival;
let I_INDEX = "0";
let F_INDEX = 1;
if (newArrival.topPart.topList.size) {
F_INDEX = 2;
}
F_INDEX = F_INDEX.toString();
let param = {
F_ID: "1002",
F_NM: '为您推荐',
F_INDEX,
I_INDEX,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
ReactNative.NativeModules.YH_NewArrivalHelper.goToRecommendForYou();
};
}
... ...