...
|
...
|
@@ -25,9 +25,9 @@ |
|
|
<div ref="scrollNav" class="scroll-nav-wrap" v-if="navList.length">
|
|
|
<ScrollNav :list="navList" :current="active" @transfer="getIndex"></ScrollNav>
|
|
|
</div>
|
|
|
<div class="list-wrap">
|
|
|
<ProductList ref="product" :list="productList.list" :yasParams="listYasParams" v-if="productList.list.length > 0"></ProductList>
|
|
|
<UfoNoItem class="channel-no-item" :style="noItemStyle" :tip="`暂无数据`" v-else></UfoNoItem>
|
|
|
<div class="list-wrap" :style="minHeight">
|
|
|
<ProductList ref="product" :list="productList.list" yasEventName="XY_UFO_MAIN_EVENT" :yasParams="listYasParams" v-if="productList.list.length > 0"></ProductList>
|
|
|
<UfoNoItem class="channel-no-item" :style="'height:' +total+'px'" :tip="`暂无数据`" v-else></UfoNoItem>
|
|
|
</div>
|
|
|
</div>
|
|
|
</LayoutScroll>
|
...
|
...
|
@@ -70,6 +70,7 @@ export default { |
|
|
isShow: false,
|
|
|
total: 0,
|
|
|
active: 0,
|
|
|
yasHeight: 0,
|
|
|
listBaseParams: {
|
|
|
isHome: true,
|
|
|
},
|
...
|
...
|
@@ -107,22 +108,23 @@ 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() {
|
|
|
minHeight() {
|
|
|
return {
|
|
|
height: this.total + 'px'
|
|
|
minHeight: this.total + 'px'
|
|
|
};
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -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.productList.list.length > 0 && 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;
|
|
|
}
|
...
|
...
|
@@ -319,15 +325,7 @@ export default { |
|
|
this.scrollY = -y;
|
|
|
|
|
|
if (this.navTop) {
|
|
|
if (this.scrollY >= this.navTop) {
|
|
|
this.isShow = true;
|
|
|
|
|
|
// this.isA = false;
|
|
|
} else {
|
|
|
this.isShow = false;
|
|
|
|
|
|
// this.isA = true;
|
|
|
}
|
|
|
this.isShow = (this.scrollY >= this.$refs.topSource.offsetHeight);
|
|
|
}
|
|
|
},
|
|
|
async refreshProductList(index) {
|
...
|
...
|
@@ -448,7 +446,6 @@ export default { |
|
|
.yohoufo-channel-page {
|
|
|
background-color: #fefefe;
|
|
|
}
|
|
|
|
|
|
.scroll-nav-wrap {
|
|
|
position: relative;
|
|
|
|
...
|
...
|
|