|
|
<template>
|
|
|
<div class="layout">
|
|
|
<LayoutHeader class="layout-header" :show-back="true" :title="'\u200E'"></LayoutHeader>
|
|
|
<LayoutHeader class="layout-header" :show-back="true" title="商品详情"></LayoutHeader>
|
|
|
<div class="layout-context fixscroll">
|
|
|
<LayoutScroll
|
|
|
ref="pageScroll"
|
...
|
...
|
@@ -30,7 +30,7 @@ |
|
|
</div>
|
|
|
<div class="info-name"><div>{{productDetail.product_name}}</div></div>
|
|
|
</div>
|
|
|
<a class="banner" v-show="resource" @click.prevent="gotoNewPage">
|
|
|
<a class="banner" v-if="resource.src" @click.prevent="gotoNewPage">
|
|
|
<img-size ref="resourceImg" :src="sizeImg(resource.src)"/>
|
|
|
</a>
|
|
|
<div class="info">
|
...
|
...
|
@@ -47,7 +47,8 @@ |
|
|
<div class="info-list-value">{{desc.value}}</div>
|
|
|
</div>
|
|
|
</transition-group>
|
|
|
<top-list v-if="topList && topList.length !== 0" :list="topList" @itemClick="gotoProduct" @allClick="gotoBrand" />
|
|
|
<!-- 相关商品 -->
|
|
|
<top-list ref="topList" v-if="topList && topList.length !== 0" :list="topList" @itemClick="gotoProduct" @allClick="gotoBrand" />
|
|
|
<img class="ref-img" v-lazy="prdDetailTip"/>
|
|
|
</div>
|
|
|
|
...
|
...
|
@@ -304,7 +305,30 @@ export default { |
|
|
},
|
|
|
scrollEndHandler({y}) {
|
|
|
const scrollTop = Math.abs(y);
|
|
|
const pageScrollHeight = this.$refs.pageScroll.$el.offsetHeight;
|
|
|
|
|
|
// 相关商品
|
|
|
if (!this._topListYas && this.$refs.topList) {
|
|
|
if (this._topListTop === undefined) {
|
|
|
this._topListTop = this.$refs.topList.$el.offsetTop;
|
|
|
}
|
|
|
|
|
|
if (scrollTop < this._topListTop && (scrollTop + pageScrollHeight) > this._topListTop) {
|
|
|
const DATA = this.topList.slice(0, 3).map((value, i) => {
|
|
|
return {...this.recommendYasParams, I_INDEX: i, PRD_ID: value.id, PRD_SKN: value.id};
|
|
|
});
|
|
|
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
param: {DATA},
|
|
|
appop: 'XY_UFO_SHOW_EVENT'
|
|
|
}
|
|
|
});
|
|
|
this._topListYas = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 推荐商品
|
|
|
if (this._productItemHeight === undefined) {
|
|
|
let item = document.querySelector('.product-list-item');
|
|
|
|
...
|
...
|
@@ -313,12 +337,13 @@ export default { |
|
|
}
|
|
|
}
|
|
|
|
|
|
const listTop = this.$refs.recommendList.$el.offsetTop;
|
|
|
if (this.$refs.recommendList) {
|
|
|
const listTop = this.$refs.recommendList.$el.offsetTop;
|
|
|
const productListScrollTop = scrollTop + pageScrollHeight - listTop - this._productItemHeight;
|
|
|
|
|
|
const productListScrollTop = scrollTop + this.$refs.pageScroll.$el.offsetHeight - listTop - this._productItemHeight;
|
|
|
|
|
|
if (productListScrollTop > 0) {
|
|
|
this.$refs.recommendList.yasShowEvent(productListScrollTop);
|
|
|
if (productListScrollTop > 0) {
|
|
|
this.$refs.recommendList.yasShowEvent(productListScrollTop);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
yasResourceVisible() {
|
...
|
...
|
|