|
|
@ -179,14 +179,19 @@ |
|
|
|
v-if="currentTab === 2 && goodsInfo.sku && goodsInfo.sku.product" |
|
|
|
class="tab-panel" |
|
|
|
> |
|
|
|
<view class="" v-html="goodsInfo.sku.product.expenseInfo"> </view> |
|
|
|
<view class="" v-html="goodsInfo.sku.product.bookInfo"> </view> |
|
|
|
<view class="" v-html="goodsInfo.sku.product.cancelInfo"> </view> |
|
|
|
<view class="" v-html="scene.content"> </view> |
|
|
|
<view class="" v-html="goodsInfo.sku.extend.bookInfo"> </view> |
|
|
|
|
|
|
|
<view class="" v-html="scene.time_info"> </view> |
|
|
|
<view class="" v-html="scene.extra_info"> </view> |
|
|
|
<!-- <view class="" v-html="goodsInfo.sku.product.bookInfo"> </view> |
|
|
|
<view class="" v-html="goodsInfo.sku.product.cancelInfo"> </view> --> |
|
|
|
</view> |
|
|
|
<!-- 商品详情 --> |
|
|
|
<template v-for="(item, index) in goodsInfo.goodsVos"> |
|
|
|
<view v-if="currentTab == index + 3" class="tab-panel"> |
|
|
|
<view class="" v-html="item.detailUrl"> </view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
@ -213,6 +218,7 @@ export default { |
|
|
|
tabList: [], |
|
|
|
equityList: [], |
|
|
|
goodsInfo: null, |
|
|
|
scene:null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -237,6 +243,11 @@ export default { |
|
|
|
res.data.goodsVos.forEach((element) => { |
|
|
|
element.detailUrl = this.addImgStyleToHtml(element.detailUrl); |
|
|
|
}); |
|
|
|
if(res.data.sku){ |
|
|
|
this.scene = JSON.parse(res.data.sku.product.scene) |
|
|
|
this.scene.content = this.addImgStyleToHtml(this.scene.content); |
|
|
|
} |
|
|
|
console.log(this.scene,'场景信息') |
|
|
|
this.goodsInfo = res.data; |
|
|
|
this.goodsInfo.ipDigitalAsset.detailUrl = this.addImgStyleToHtml( |
|
|
|
this.goodsInfo.ipDigitalAsset.detailUrl |
|
|
@ -283,7 +294,6 @@ export default { |
|
|
|
addImgStyleToHtml(htmlStr) { |
|
|
|
return htmlStr.replace(/<img\b([^>]*)>/gi, (match, attrs) => { |
|
|
|
// 检查是否已有 style 属性 |
|
|
|
console.log("====开始计算"); |
|
|
|
if (/style\s*=/.test(attrs)) { |
|
|
|
// 已有 style,合并 width:100% |
|
|
|
return `<img${attrs.replace( |
|
|
@ -598,6 +608,7 @@ export default { |
|
|
|
margin: 0 40rpx; |
|
|
|
margin-top: 40rpx; |
|
|
|
white-space: nowrap; |
|
|
|
width: 690rpx; |
|
|
|
|
|
|
|
.tab-container { |
|
|
|
display: flex; |
|
|
|