Authored by QC-L

添加商品数据上报

... ... @@ -158,6 +158,61 @@ class ResourceShowYasRpter {
}
});
$('.new-goods-list').each((floorIndex, theFloor) => {
let currentState = history.state;
let $theFloor = $(theFloor);
let F_INDEX = (currentState.index_idx || 0) + 2;
let TAB_NAME = currentState.tab_name;
let F_ID = currentState.template_id;
let F_NAME = currentState.template_name;
let floorsRawArr = [];
$theFloor.find('.new-index-filter-list-item').each((aIndex, theA) => {
let $theA = $(theA);
let productSkn = $theA.data('product-skn');
let itemIndex = $theA.data('item-idx');
if (
$.inviewport($theA, { threshold: 0 }) &&
productSkn
) {
floorsRawArr.push({
href: '',
PRD_SKN: productSkn,
I_INDEX: itemIndex + 1,
F_INDEX,
F_ID,
TAB_NAME,
F_NAME
});
}
});
if (floorsRawArr.length) { // 本楼层有符合上报条件的商品
for (let goodsRawObj of floorsRawArr) {
let indexInLast = this.lastShowSkns.indexOf(goodsRawObj.PRD_SKN);
if (indexInLast < 0) {
let newParams = {
P_NAME: this.getPname(),
P_PARAM: goodsRawObj.href && goodsRawObj.href.split('?')[0] || '',
F_INDEX: goodsRawObj.F_INDEX,
I_INDEX: goodsRawObj.I_INDEX,
F_ID: goodsRawObj.F_ID,
F_NAME: goodsRawObj.F_NAME,
TAB_NAME: goodsRawObj.TAB_NAME,
PRD_SKN: goodsRawObj.PRD_SKN,
ACTION_URL: ''
};
this.reportParams.DATA.push(newParams);
}
cacheTheShowSkns.push(goodsRawObj.PRD_SKN);
}
}
});
this.lastShowSkns = cacheTheShowSkns;
setTimeout(() => {
... ...
... ... @@ -277,6 +277,17 @@ class Group extends Page {
this.templateId = templateId;
this.templateName = templateName;
this.indexIdx = indexIdx;
let stateObj = {
tab_name: this.tabName,
index_idx: this.indexIdx,
template_id: templateId,
template_name: templateName
};
let url = window.location.href;
let valiable = url.split('?')[0];
window.history.replaceState(stateObj, 'page', valiable);
this.sendCustomInfo($this, {});
query.forEach(item => {
queryObject = Object.assign(queryObject, item);
... ... @@ -705,7 +716,16 @@ class Group extends Page {
this.templateId = first.data('template-id');
this.indexIdx = first.data('index-idx');
let stateObj = {
tab_name: this.tabName,
index_idx: this.indexIdx,
template_id: this.templateId,
template_name: this.templateName
};
let url = window.location.href;
let valiable = url.split('?')[0];
window.history.replaceState(stateObj, 'page', valiable);
// let selectedChannel = this.selectedChannel;
// let requestParams = {
... ...