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

花卉宝(零售客户端)花材详情页补图文展示

shizhongqi 10 месяцев назад
Родитель
Сommit
dc7da9ab57
1 измененных файлов с 13 добавлено и 8 удалено
  1. 13 8
      mallApp/src/pages/item/detail.vue

+ 13 - 8
mallApp/src/pages/item/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(data.content) == false">
-            <rich-text :nodes="data.content"></rich-text>
-          </template>
-          <template v-else>
-            <rich-text :nodes="data.briefContent"></rich-text>
-          </template>
+          <rich-media-viewer
+            ref="richMediaViewerGoods"
+            :content="previewContent"
+            :startScroll="350"
+            :threshold="590"
+          />
         </view>
       </view>
     </view>
@@ -51,6 +51,7 @@ import AppImg from "@/components/app-img";
 import AppSwiper from "@/components/app-swiper";
 import AppTag from "@/components/module/app-tag.vue";
 import AppTrademark from "@/components/module/app-trademark";
+import RichMediaViewer from "@/components/RichMediaViewer/index.vue";
 import BuyFoot from "./components/buy-foot.vue";
 import SelPopup from "./components/sel-popup.vue";
 import GoLogin from "@/pages/home/components/go-login.vue";
@@ -69,7 +70,8 @@ export default {
     BuyFoot,
     SelPopup,
     AppImg,
-    GoLogin
+    GoLogin,
+    RichMediaViewer
   },
   data() {
     return {
@@ -81,7 +83,8 @@ export default {
       showShare: false,
 			pageType: "cg",
       autoLoad:false,
-      hdId:0
+      hdId:0,
+      previewContent: []
     };
   },
 	watch: {
@@ -159,6 +162,8 @@ export default {
             return false
           }
           this.data = res.data.info ? res.data.info : {}
+          let content = this.data.picTextGoods ? this.data.picTextGoods.content || "[]" : "[]";
+          this.previewContent = typeof content === "string" ? JSON.parse(content) : content || [];
           let newArr = [];
           newArr.push({img: this.data.bigCover});
           this.imgList = newArr;