Просмотр исходного кода

花材详情页补图文展示

shizhongqi 10 месяцев назад
Родитель
Сommit
351c0c314f
2 измененных файлов с 13 добавлено и 9 удалено
  1. 12 8
      hdApp/src/admin/ghsProduct/detail.vue
  2. 1 1
      mallApp/src/pages/goods/detail.vue

+ 12 - 8
hdApp/src/admin/ghsProduct/detail.vue

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

+ 1 - 1
mallApp/src/pages/goods/detail.vue

@@ -92,7 +92,7 @@ import SelPopup from "./components/sel-popup.vue";
 import { share } from "@/mixins";
 import { mapGetters } from "vuex";
 import { getDetail } from "@/api/goods";
-import RichMediaViewer from "../../components/RichMediaViewer/index.vue";
+import RichMediaViewer from "@/components/RichMediaViewer/index.vue";
 export default {
   name: "detail",
   mixins: [share],