yjw 3 éve
szülő
commit
68e8dbd349

+ 18 - 1
src/views/hzyb/report/ChapterDetail.vue

@@ -83,7 +83,7 @@
     <van-popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
         <div class="global-pup">
             <div class="content">
-                <rich-text :nodes="pupData.content"></rich-text>
+                <div v-html="pupData.content"></div>
             </div>
             <div class="flex bot">
                 <div @click="pupData.show=false">知道了</div>
@@ -135,6 +135,20 @@ export default {
     this.fromPage=this.$route.query.fromPage||''
     this.getDetail()
   },
+  mounted(){
+        $(document).on('click', '.rich-content img',function(event) {
+            let imgArray = [];
+            let curImageSrc = $(this).attr('src');
+            let oParent = $(this).parent();
+            if (curImageSrc && !oParent.attr('href')) {
+                $('.rich-content img').each(function(index, el) {
+                    let itemSrc = $(this).attr('src');
+                    imgArray.push(itemSrc);
+                });
+                wx.previewImage({current:curImageSrc,urls:imgArray});
+            }
+        })
+  },
   methods: {
     async getDetail(){
       const res=await apiChapterDetail({report_chapter_id:Number(this.chapterId)})
@@ -348,6 +362,9 @@ export default {
     .rich-content{
         line-height: 1.7;
         font-size: 32px;
+        :deep(img){
+            width: 100%;
+        }
     }
 
     .no-auth-wrap{

+ 14 - 0
src/views/hzyb/report/Detail.vue

@@ -148,6 +148,20 @@ export default {
         this.reportId=this.$route.query.reportId
         this.getDetail()
     },
+    mounted(){
+        $(document).on('click', '.rich-content img',function(event) {
+            let imgArray = [];
+            let curImageSrc = $(this).attr('src');
+            let oParent = $(this).parent();
+            if (curImageSrc && !oParent.attr('href')) {
+                $('.rich-content img').each(function(index, el) {
+                    let itemSrc = $(this).attr('src');
+                    imgArray.push(itemSrc);
+                });
+                wx.previewImage({current:curImageSrc,urls:imgArray});
+            }
+        })
+    },
     methods: {
         //获取报告详情
         async getDetail(){