|
|
@@ -33,12 +33,12 @@
|
|
|
<view class="module-tit app-size-30">商品详情</view>
|
|
|
<view class="module-det">
|
|
|
<view class="module-det-text">
|
|
|
- <template v-if="$util.isEmpty(productInfo.content) == false">
|
|
|
- <rich-text :nodes="productInfo.content"></rich-text>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <rich-text :nodes="productInfo.briefContent"></rich-text>
|
|
|
- </template>
|
|
|
+ <rich-media-viewer
|
|
|
+ ref="richMediaViewerGoods"
|
|
|
+ :content="previewContent"
|
|
|
+ :startScroll="350"
|
|
|
+ :threshold="590"
|
|
|
+ />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -54,6 +54,7 @@ import AppTag from "@/components/module/app-tag.vue";
|
|
|
import BuyFoot from "./components/buy-foot.vue";
|
|
|
import SelPopup from "./components/sel-popup.vue";
|
|
|
import AppShareMask from "@/components/module/app-share-mask";
|
|
|
+import RichMediaViewer from "@/components/RichMediaViewer/index.vue";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { getGhsProductDetail } from "@/api/product";
|
|
|
import { ghsInfo,getGhsDataApi } from "@/api/ghs";
|
|
|
@@ -68,7 +69,8 @@ export default {
|
|
|
BuyFoot,
|
|
|
SelPopup,
|
|
|
AppImg,
|
|
|
- AppShareMask
|
|
|
+ AppShareMask,
|
|
|
+ RichMediaViewer
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -84,6 +86,7 @@ export default {
|
|
|
title:'',
|
|
|
price:0,
|
|
|
largeCover:'',
|
|
|
+ previewContent: [],
|
|
|
id:0,
|
|
|
shopId:0
|
|
|
};
|
|
|
@@ -162,7 +165,8 @@ export default {
|
|
|
getGhsProductDetail({ id: id, ghsId:ghsId}).then(res => {
|
|
|
if (!this.$util.isEmpty(res.data)){
|
|
|
this.productInfo = res.data
|
|
|
-
|
|
|
+ let content = res.data.picTextGoods ? res.data.picTextGoods.content || "[]" : "[]";
|
|
|
+ this.previewContent = typeof content === "string" ? JSON.parse(content) : content || [];
|
|
|
let newArr = [];
|
|
|
newArr.push({img: res.data.largeCover});
|
|
|
this.imgList = newArr;
|