...
|
...
|
@@ -7,7 +7,8 @@ |
|
|
<cube-slide ref="slide" :data="imageList">
|
|
|
<cube-slide-item v-for="(item, index) in imageList" :key="index">
|
|
|
<a click="javascript:void 0" class="square-img-container">
|
|
|
<square-img :src="item.image_url" :width="300" :height="300" />
|
|
|
<square-img v-if="!item.initial" :src="item.image_url" :width="600" :height="600" />
|
|
|
<square-img v-else :src="item.image_url" :width="274" :height="274" /> <!-- 利用缓存, productList使用的size -->
|
|
|
</a>
|
|
|
</cube-slide-item>
|
|
|
<template slot="dots" slot-scope="props">
|
...
|
...
|
@@ -26,8 +27,8 @@ |
|
|
</div>
|
|
|
<div class="info-name"><div>{{productDetail.product_name}}</div></div>
|
|
|
</div>
|
|
|
<a class="banner" v-if="resource" @click.prevent="gotoNewPage(resource.url)">
|
|
|
<img-size ref="resourceImg" :src="sizeImg(resource.src)"/>
|
|
|
<a class="banner" @click.prevent="gotoNewPage">
|
|
|
<img-size v-if="resource" ref="resourceImg" :src="sizeImg(resource.src)"/>
|
|
|
</a>
|
|
|
<div class="info">
|
|
|
<transition-group name="info-list" tag="div" class="info-list">
|
...
|
...
|
@@ -202,6 +203,15 @@ export default { |
|
|
throw new Error('无效的商品ID');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 接收初始化数据
|
|
|
*/
|
|
|
const initialProductInfo = router.params.productInfo;
|
|
|
|
|
|
if (initialProductInfo) {
|
|
|
store.dispatch('product/setupInitialProductInfo', initialProductInfo);
|
|
|
}
|
|
|
|
|
|
return store.dispatch('product/fetchProductInfo', {productId});
|
|
|
},
|
|
|
activated() {
|
...
|
...
|
@@ -252,7 +262,8 @@ export default { |
|
|
next();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['fetchProductInfo', 'fetchBrandTop', 'fetchFav', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct', 'payment', 'resetSelectedSize']),
|
|
|
...mapActions(['fetchProductInfo', 'fetchBrandTop', 'fetchFav', 'setupInitialProductInfo',
|
|
|
'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct', 'payment', 'resetSelectedSize']),
|
|
|
historyBackGuard() {
|
|
|
for (let key of Object.keys(this.actionSheetCloseMap)) {
|
|
|
if (this[key]) {
|
...
|
...
|
@@ -347,6 +358,7 @@ export default { |
|
|
name: this.$route.name,
|
|
|
params: {
|
|
|
productId: product.id,
|
|
|
productInfo: product,
|
|
|
},
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -507,7 +519,13 @@ export default { |
|
|
},
|
|
|
|
|
|
// 资源位
|
|
|
gotoNewPage(url) {
|
|
|
gotoNewPage() {
|
|
|
if (!this.resource || !this.resource.url) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
const url = this.resource.url;
|
|
|
|
|
|
/**
|
|
|
* 商品详情页中的资源位点击
|
|
|
* XY_UFO_GDS_DT_BANNER_C
|
...
|
...
|
@@ -600,10 +618,12 @@ export default { |
|
|
|
|
|
.banner {
|
|
|
display: block;
|
|
|
height: 132px;
|
|
|
|
|
|
img {
|
|
|
display: block;
|
|
|
width: 100%;
|
|
|
height: 132px;
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|