|
|
|
|
@ -19,8 +19,9 @@
|
|
|
|
|
<view class="detail-image" v-if="info.image">
|
|
|
|
|
<image :src="info.image.url" mode="widthFix"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="detail-content-content">
|
|
|
|
|
<rich-text v-if='showContent' :nodes="info.content?info.content:' '"></rich-text>
|
|
|
|
|
<view class="detail-content-content">
|
|
|
|
|
<u-parse v-if='showContent' :html="info.content?info.content:' '"></u-parse>
|
|
|
|
|
<!-- <rich-text v-if='showContent' :nodes="info.content?info.content:' '"></rich-text> -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -70,9 +71,17 @@
|
|
|
|
|
table_name: 'map_point_image_articles',
|
|
|
|
|
'with_relations[0]': 'image'
|
|
|
|
|
})
|
|
|
|
|
this.info = res
|
|
|
|
|
this.info = res
|
|
|
|
|
this.info.content = this.replaceStoragePath(res.content)
|
|
|
|
|
console.log(this.info.content)
|
|
|
|
|
this.showContent = true
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
replaceStoragePath(htmlStr) {
|
|
|
|
|
// 正则匹配 src 属性中包含 ../storage 的部分(支持双引号或单引号)
|
|
|
|
|
const regex = /src=["']\..\/storage/g;
|
|
|
|
|
// 替换为目标路径(保持原有的引号)
|
|
|
|
|
return htmlStr.replace(regex, 'src="https://h5.jscnsaas.cn/storage');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|