|
|
<template>
|
|
|
<div class="layout">
|
|
|
<LayoutHeader class="layout-header" :show-back="true" :title="title" ref="header">
|
|
|
<transition name="fade">
|
|
|
<img-size v-show="headThumbnailVisible" class="title-thumbnail" :src="imageList && imageList[0] && imageList[0].image_url" :width="300" :height="300"/>
|
|
|
</transition>
|
|
|
</LayoutHeader>
|
|
|
<LayoutHeader class="layout-header" :show-back="true" :title="'\u200E'"></LayoutHeader>
|
|
|
<div class="layout-context fixscroll">
|
|
|
<cube-scroll :data="imageList"
|
|
|
:scroll-events="['scroll']"
|
|
|
@scroll="handleScroll">
|
|
|
<cube-scroll :data="imageList">
|
|
|
<div class="slide">
|
|
|
<cube-slide ref="slide" :data="imageList">
|
|
|
<cube-slide-item v-for="(item, index) in imageList" :key="index">
|
...
|
...
|
@@ -139,7 +133,6 @@ export default { |
|
|
return {
|
|
|
prdDetailTip,
|
|
|
prdDetailImage,
|
|
|
headThumbnailVisible: false,
|
|
|
|
|
|
showActivitySheet: false,
|
|
|
|
...
|
...
|
@@ -184,16 +177,7 @@ export default { |
|
|
return get(this.productDetail, 'product_name', '商品详情');
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
title: {
|
|
|
handler() {
|
|
|
this.setTitle();
|
|
|
},
|
|
|
immediate: true,
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
this.imageHideThreadhold = -window.innerWidth * 0.693;
|
|
|
if (this.isQiugouEnabled === null) {
|
|
|
this.$store.dispatch('getSysConfigQiugou');
|
|
|
}
|
...
|
...
|
@@ -205,21 +189,8 @@ export default { |
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['fetchProductInfo', 'fetchTop3', 'fetchFav', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct', 'payment']),
|
|
|
setTitle() {
|
|
|
if (this.productId === this.productDetail.product_id) {
|
|
|
if (this.$refs.header && this.$refs.header.setTitle) {
|
|
|
this.$refs.header.setTitle(this.title);
|
|
|
} else if (document) {
|
|
|
document.title = this.title;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
refresh() {
|
|
|
this.$refs.slide.refresh();
|
|
|
this.headThumbnailVisible = false;
|
|
|
},
|
|
|
handleScroll(e) {
|
|
|
this.headThumbnailVisible = e.y < this.imageHideThreadhold;
|
|
|
},
|
|
|
sizeImg(src, width = 360, height = 72) {
|
|
|
if (src) {
|
...
|
...
|
@@ -579,10 +550,6 @@ export default { |
|
|
}
|
|
|
}
|
|
|
|
|
|
.title-thumbnail {
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
.footer {
|
|
|
display: flex;
|
|
|
text-align: center;
|
...
|
...
|
|