Authored by chenl

增加年度活动优惠埋点。review by zhuangjiajia。

... ... @@ -45,6 +45,9 @@ export function getYearActivityProductList() {
.then(json => {
let payload = parseUtils.parsePageInfoList(json);
//对获取的数据进行展示曝光
dispatch(dataExposure(payload));
if (payload.currentPage > 1) {
let oldList = yearActivity.get('list').toJS();
let newList = [...oldList, ...payload.list];
... ... @@ -82,3 +85,38 @@ export function getYearProductFailure(error) {
payload: error
}
}
function dataExposure(payload){
return (dispatch, getState) => {
try {
let productIds = "";
let productCount = 0;
//product list数据
let productList = payload.list;
if(productList && productList.length > 0){
productCount = productList.length;
productList.map((item, i) => {
if(i > 0)
productIds = productIds + "," + item.product_id;
else
productIds = item.product_id;
});
}
let params = {
REC_POSE: 100100,
REC_ID: payload.rec_id,
PRD_ID: productIds,
PRD_NUM: productCount,
ACTION_ID: 0,
};
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_CHOOSE_FOR_YOU', params);
}
catch(error) {
}
};
}
... ...
... ... @@ -11,6 +11,7 @@ let InitialState = Record({
total: 0,
pageSize: 50,
pageCount: 0,
rec_id: '',
});
export default InitialState;
... ...
... ... @@ -14,11 +14,14 @@ function parsePageInfoList(json) {
let total = json && json.total ? json.total : 0;
let list = json && json.product_list ? json.product_list : [];
let rec_id = json && json.rec_id ? json.rec_id : '';
return {
currentPage,
pageCount,
total,
list
list,
rec_id,
}
}
... ...