...
|
...
|
@@ -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
|
...
|
...
|
@@ -569,14 +587,14 @@ export default { |
|
|
|
|
|
.cube-dot {
|
|
|
display: inline-block;
|
|
|
width: 6px;
|
|
|
height: 6px;
|
|
|
margin: 0 10px;
|
|
|
width: 4px;
|
|
|
height: 4px;
|
|
|
margin: 0 5px;
|
|
|
background: rgba(0, 0, 0, 0.15);
|
|
|
border-radius: 50%;
|
|
|
&.active {
|
|
|
transform-origin: 50% 50%;
|
|
|
transform: scale(1.3333);
|
|
|
transform: scale(1.5);
|
|
|
background: rgba(0, 0, 0, 1);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -600,10 +618,12 @@ export default { |
|
|
|
|
|
.banner {
|
|
|
display: block;
|
|
|
height: 132px;
|
|
|
|
|
|
img {
|
|
|
display: block;
|
|
|
width: 100%;
|
|
|
height: 132px;
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -636,13 +656,14 @@ export default { |
|
|
}
|
|
|
|
|
|
.info-basic {
|
|
|
padding: 46px 40px 32px;
|
|
|
padding: 46px 40px 30px;
|
|
|
|
|
|
.info-price {
|
|
|
color: #d0021b;
|
|
|
font-size: 48px;
|
|
|
|
|
|
@include num;
|
|
|
|
|
|
font-weight: bold;
|
|
|
line-height: 56px;
|
|
|
height: 56px;
|
...
|
...
|
@@ -665,10 +686,11 @@ export default { |
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
overflow: Hide;
|
|
|
overflow: hidden;
|
|
|
|
|
|
div {
|
|
|
font-size: 28px;
|
|
|
font-weight: bold;
|
|
|
line-height: 32px;
|
|
|
max-height: 64px;
|
|
|
white-space: normal;
|
...
|
...
|
|