Authored by baoss

解决分类页埋点问题

... ... @@ -7,8 +7,8 @@
v-for="(item, index) in categoryParent"
:key="index"
:class="{'category-left-item-select-flag' : item.isSelect }"
:data-id="item"
@click="onClick(item)">
:data-id="item.id"
@click="onClick(item, index)">
<p
class="category-left-item-title"
:class="{'category-left-item-select' : item.isSelect }">
... ... @@ -71,7 +71,7 @@ export default {
scrollEvents: ['scroll-end'],
sortItem:{
id:'-1',
name:'brand',
name:'品牌',
index: 0
}
};
... ... @@ -94,8 +94,6 @@ export default {
let reportParams = [];
this.categorySubList.forEach((item) => {
let subItemList = item.sub;
// console.log('item'+scrollY)
// console.log(item)
subItemList.forEach((val, index) => {
let eleTop = this.$refs.index[index].offsetTop;
let eleHeight = this.$refs.index[index].offsetHeight;
... ... @@ -108,13 +106,14 @@ export default {
// console.log("firstHeight:"+firstHeight+'==scrollHeight='+scrollHeight+"==eleTop=="+eleTop+"==lastViewHeight="+lastViewHeight);
if(firstHeight < eleTop && scrollHeight + scrollY > eleTop){
let reportItem = {
P_NAME: 'XY_UFOCategory',
CATE_ID: this.sortItem.id,
CATE_NM: this.sortItem.name,
CATE_INDEX: this.sortItem.index,
CATE_INDEX: this.sortItem.index + 1,
F_ID: item.id,
F_NAME: item.name,
F_INDEX: item.index,
I_INDEX: index,
F_INDEX: item.index + 1,
I_INDEX: index + 1,
TO_TYPE: val.linkType,
TO_ID: val.link,
};
... ... @@ -132,16 +131,16 @@ export default {
});
},
onClick(item) {
async onClick(item,index) {
if (!item.isSelect) {
this.sortItem = item;
let id = item.id;
let name = item.name;
let subList ;
if (id === '-1') {
subList = this.fetchBrandList({ id });
subList = await this.fetchBrandList({ id });
} else {
subList = this.fetchCategorySubList({ id, name });
subList = await this.fetchCategorySubList({ id, name });
}
this.$store.dispatch('reportYas', {
... ... @@ -149,7 +148,8 @@ export default {
appop: 'XY_UFO_CATEGORY_TAB_LIST',
param: {
CATE_ID: id,
CATE_NM: item.name
CATE_NM: item.name,
CATE_INDEX: index + 1
}
}
});
... ... @@ -163,11 +163,11 @@ export default {
param: {
CATE_ID: this.sortItem.id,
CATE_NM: this.sortItem.name,
CATE_INDEX: this.sortItem.index,
CATE_INDEX: this.sortItem.index + 1,
F_ID: itemSub.id,
F_NAME: itemSub.name,
F_INDEX: itemSub.index,
I_INDEX: index,
F_INDEX: itemSub.index + 1,
I_INDEX: index + 1,
TO_TYPE: item.linkType,
TO_ID: item.link,
}
... ...