|
|
@ -94,7 +94,7 @@ |
|
|
|
<view class="sku-image-box"> |
|
|
|
<!--规格图片遍历处理最大只显示4个--> |
|
|
|
<block v-for="(skuImgItem,skuImgIndex) in productData.names[0].values" :key="skuImgIndex"> |
|
|
|
<image class="sku-image" :class="{'sku-image-select' : skuImgItem.valueCode === selectedAttr[productData.names[0].nameCode]}" @click="handleClickSku(productData.names[0].nameCode, skuImgItem.valueCode)" |
|
|
|
<image class="sku-image" :class="{'sku-image-select' : skuImgItem.valueCode === selectedAttr[productData.names[0].nameCode]}" @click="handleClickSku(productData.names[0].nameCode, skuImgItem.valueCode, skuImgIndex)" |
|
|
|
:src="skuImgItem.image ? skuImgItem.image: defaultImageUrl" @error="onImageError"/> |
|
|
|
</block> |
|
|
|
|
|
|
@ -729,6 +729,7 @@ export default { |
|
|
|
this.isFirstComeIn = false |
|
|
|
this.loading = false |
|
|
|
this.productData = res.data |
|
|
|
console.log('productData-->', this.productData) |
|
|
|
this.markTools = res.data.markTools //平台优惠券 |
|
|
|
this.shopMarkTools = res.data.shopMarkTools //店铺优惠券 |
|
|
|
this.currentActive = this.markTools.length === 0 && this.shopMarkTools.length > 0 ? 1 : 0 |
|
|
@ -749,6 +750,17 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const skuImages = [] |
|
|
|
for (const valueCode of this.productData.names[0].values){ |
|
|
|
if (valueCode.image) { |
|
|
|
skuImages.push(valueCode.image) |
|
|
|
} |
|
|
|
} |
|
|
|
if (skuImages.length > 0) { |
|
|
|
//若规格有图片,则商品轮播图改为规格图片 |
|
|
|
this.productData.images = skuImages |
|
|
|
} |
|
|
|
|
|
|
|
// 评价 |
|
|
|
this.commentList = res.data.comments |
|
|
|
// 宝贝详情 |
|
|
@ -832,9 +844,10 @@ export default { |
|
|
|
(await Services(this.shopId)).flyToService() |
|
|
|
}, |
|
|
|
|
|
|
|
handleClickSku(nameCode, valueCode) { |
|
|
|
handleClickSku(nameCode, valueCode, index) { |
|
|
|
this.$refs.skuSelect.handleClickSkuItem(nameCode,valueCode) |
|
|
|
this.selectedAttr = this.$refs.skuSelect.selectedAttr |
|
|
|
this.$refs.goodActivityDetail.switchSkuImage(index) |
|
|
|
}, |
|
|
|
|
|
|
|
onImageError(e) { |
|
|
|