Authored by huangyCode

上报修改

... ... @@ -70,6 +70,7 @@ export default {
isShow: false,
total: 0,
active: 0,
yasHeight: 0,
listBaseParams: {
isHome: true,
},
... ... @@ -107,18 +108,19 @@ export default {
};
},
computed: {
...mapState(['channelList','contentCode']),
...mapState(['channelList', 'contentCode']),
navList() {
return get(find(this.channelList.list, ['template_name', 'guessLike']), 'data') || [];
},
navInfo() {
let index = findIndex(this.channelList.list, ['template_name', 'guessLike'])
let id = get(find(this.channelList.list, ['template_name', 'guessLike']), 'template_id')
let index = findIndex(this.channelList.list, ['template_name', 'guessLike']);
let id = get(find(this.channelList.list, ['template_name', 'guessLike']), 'template_id');
return {
F_ID: id,
F_NAME: 'guessLike',
F_INDEX: index + 1
}
};
},
noItemStyle() {
return {
... ... @@ -162,7 +164,7 @@ export default {
this.refreshProductList(this.active);
},
methods: {
...mapActions(['fetchChannelList','getAllInboxCatInfo']),
...mapActions(['fetchChannelList', 'getAllInboxCatInfo']),
...mapActionsList(['fetchProductList']),
init() {
this.$nextTick(() => {
... ... @@ -290,26 +292,30 @@ export default {
I_INDEX: Number(params.index) + 1,
TAB_ID: Number(params.index) + 1,
TAB_NAME: params.title});
console.log(this.listYasParams)
}
},
getIndex({index, params}) {
this.selectedCategory = params;
this.active = Number(index);
this.isShow && this.$refs.scroll.scrollTo(this.navTop);
// this.setYasParam({index, ...params});
this.guessLikeListParams({index, ...params});
// 商品列表曝光
this.listScrollY > 0 && this.$refs.product && this.$refs.product.yasShowEvent(this.listScrollY);
this.listScrollY > 0 && this.$refs.product && this.$refs.product.yasShowEvent(this.yasHeight);
},
scrollEndHandler({y}) {
let scrollHeight = Math.abs(y);
let viewHeight = this.$refs.scroll.$el.offsetHeight;
let productListTop = this.$refs.product && this.$refs.product.$el.offsetTop || this.navTop + this.navHeight;
let listScrollY = scrollHeight + viewHeight - productListTop;
this.listScrollY = listScrollY
this.listScrollY = listScrollY;
this.yasHeight = scrollHeight - this.navTop;
// 商品列表曝光
listScrollY > 0 && this.$refs.product && this.$refs.product.yasShowEvent(listScrollY);
listScrollY > 0 && this.$refs.product && this.$refs.product.yasShowEvent(this.yasHeight);
if (scrollHeight >= this.navTop) {
return;
}
... ...
... ... @@ -54,11 +54,11 @@ export default {
}
});
},
yasShowEvent(height) {
yasShowEvent: function(height) {
// 获取列表单个元素高度
let index = 0;
if (height) {
if (Number(height) > 0) {
// 获取第一个曝光元素
let item = document.querySelector('.product-list-item');
let itemHeight = item.offsetHeight;
... ... @@ -92,6 +92,8 @@ export default {
list.map((value, i) => {
DATA.push({...this.yasParams, I_INDEX: i + index + 1, PRD_ID: value.id});
});
console.log('-----');
console.log(DATA);
this.$store.dispatch('reportYas', {
params: {
param: {DATA},
... ... @@ -112,7 +114,7 @@ export default {
// 7.PRD_ID:商品id
this.$store.dispatch('reportYas', {
params: {
param: {...this.yasParams, I_INDEX: index, PRD_ID: id },
param: {...this.yasParams, I_INDEX: index + 1, PRD_ID: id },
appop: 'XY_UFO_PRD_LIST_C'
}
});
... ...
... ... @@ -96,7 +96,9 @@ export default {
};
},
activated: async function() {
if (this.yoho.direction === 'forword') {
let {list} = this.productList;
if (this.yoho.direction === 'forword' || !list.length) {
this.$refs.filtrate.hide();
Object.assign(this.$data, this.$options.data());
this.changeArrow();
... ... @@ -111,6 +113,7 @@ export default {
this.setYasParam({param: params, tab: {index: 1, name: '人气'}});
!params.order && (params.order = 'sale_desc');
await this.fetchList({...params, isReset: true});
this.$refs.product.yasShowEvent(0);
} else {
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
}
... ...
... ... @@ -25,7 +25,7 @@
</div>
</Scroll>
<Scroll v-show="query.length" :options="scrollOptions" :data="searchSuggestList">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="(item, index) of searchSuggestList" @click="goSearch({query : item.item} ,{type: 3, index})">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="(item, index) of searchSuggestList" @click="goSearch({query : item.item} ,{type: 0, index: 0})">
{{item.item}}
</div>
</Scroll>
... ... @@ -60,6 +60,13 @@ export default {
this.fetchDefaultSearchWords();
this.setLocalList();
},
beforeRouteEnter: function(to, from, next) {
next(vm => {
if (from.name === 'List') {
vm.SEARCH_POS = 3;
}
});
},
computed: {
...mapState(['searchWord', 'defaultSearchWord', 'searchSuggestList']),
},
... ... @@ -108,11 +115,6 @@ export default {
}
this.localHistory = localHistory;
},
beforeRouteEnter: function(to, from, next) {
if (from.name !== 'List') {
this.SEARCH_POS = 3;
}
},
addLocalWord: function(query) {
if (this.query || query) {
let addQuery = query || this.query;
... ...