|
@@ -29,7 +29,12 @@
|
|
|
</view>
|
|
|
<view class="detail-goods">产品介绍</view>
|
|
|
<view class="detail-description">
|
|
|
+ <!-- #ifndef MP-ALIPAY -->
|
|
|
<u-parse :content="description" :selectable="true"></u-parse>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef MP-ALIPAY -->
|
|
|
+ <rich-text :nodes="description"></rich-text>
|
|
|
+ <!-- #endif -->
|
|
|
</view>
|
|
|
<view style="detail-merchant" @click="toCompanyData" v-if="info.merchantInfo?true:false">
|
|
|
<view class="detail-merchant-warp">
|
|
@@ -110,6 +115,7 @@
|
|
|
import { formatRichText } from '@/utils/util.js'
|
|
|
import ExchangePopop from '../components/exchange-popup/exchange-popup.vue'
|
|
|
import PurchasePopup from '../components/purchase-popup/purchase-popup.vue'
|
|
|
+ import parse from 'mini-html-parser2';
|
|
|
export default {
|
|
|
components: {
|
|
|
ExchangePopop,
|
|
@@ -153,6 +159,7 @@
|
|
|
goodsId: this.goodsId,
|
|
|
noToken: true
|
|
|
}).then(res => {
|
|
|
+
|
|
|
uni.hideLoading();
|
|
|
if (res.code == 0) {
|
|
|
this.info = res.data
|
|
@@ -161,10 +168,22 @@
|
|
|
this.picUrlArr.push(env.filePublic + item + '?imageView2/2/w/750')
|
|
|
})
|
|
|
// 处理富文本
|
|
|
- const description = res.data.description.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"")
|
|
|
- .replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",
|
|
|
- ".png?imageView2/2/w/750\"");
|
|
|
+ // #ifndef MP-ALIPAY
|
|
|
+ const description = res.data.description.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"").replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",".png?imageView2/2/w/750\"");
|
|
|
this.description = formatRichText(description);
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef MP-ALIPAY
|
|
|
+ parse(formatRichText(res.data.description),(err,nodes) => {
|
|
|
+ if(!err){
|
|
|
+ nodes[0].children.forEach(item => {
|
|
|
+ item.attrs.src = item.attrs.src + '?imageView2/2/w/750'
|
|
|
+ })
|
|
|
+ this.description = nodes
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+
|
|
|
this.skuListInit = res.data.skuList
|
|
|
if (res.data.skuList.length) {
|
|
|
let skuProp = JSON.parse(res.data.skuProp)
|