Browse Source

feat:详情字段对接

dev_des
1054425342@qq.com 2 months ago
parent
commit
4426281ca6
  1. 2
      components/DynamicIsland.vue
  2. 19
      subPackages/equityGoods/detail.vue

2
components/DynamicIsland.vue

@ -150,7 +150,7 @@ export default {
isExpanded: false,
statusBarHeight: 0,
isScrolled: false,
scrollThreshold: 140, // 160rpx
scrollThreshold: 160, // 160rpx
// props
currentTitle: "Hi!用户,欢迎回来~",
currentSubtitle: "2个权益 | 120时间银行",

19
subPackages/equityGoods/detail.vue

@ -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;

Loading…
Cancel
Save