소스 검색

章节报告内容也截断吧

Karsa 10 달 전
부모
커밋
93c9cc4019
2개의 변경된 파일32개의 추가작업 그리고 12개의 파일을 삭제
  1. 16 6
      src/views/report/reportDetail.vue
  2. 16 6
      src/views/smartReport/detail.vue

+ 16 - 6
src/views/report/reportDetail.vue

@@ -81,7 +81,7 @@
       <div style="padding: 0.6rem; box-sizing: border-box; overflow: hidden">
 
         <!-- 章节报告 -->
-        <div class="chapter-wrap" v-if="reportInfo.HasChapter===1">
+        <!-- <div class="chapter-wrap" v-if="reportInfo.HasChapter===1">
           <div class="chapter-item" v-for="item in reportInfo.ChapterList" :key="item.ReportChapterId">
             <div style="margin-bottom:10px">
               <span class="type" v-if="item.TypeName">{{item.TypeName}}</span>
@@ -89,9 +89,9 @@
             </div>
             <div id="resetcss" style="overflow:hidden;" v-html="item.Content"></div>
           </div>
-        </div>
+        </div> -->
 
-        <div id="resetcss" style="overflow:hidden;" v-else>
+        <div id="resetcss" style="overflow:hidden;">
           <ul>
             <li v-for="(html,index) in realContent" :key="index" v-html="html"></li>
           </ul>
@@ -288,8 +288,9 @@ export default {
         this.reportInfo = Data.Report;
         this.Disclaimer = Data.Disclaimer||'';
         this.isshow = true;
+        wxShare(document.location.href,H5ShareName || document.title,wxShareTitle,H5ReportShareImg,0);
 
-        this.splitContentHandle(this.reportInfo.Content);
+        this.splitContentHandle();
 
         $(document).on("click", "#resetcss img", function (event) {
           let imgArray = [];
@@ -303,7 +304,7 @@ export default {
             wx.previewImage({ current: curImageSrc, urls: imgArray });
           }
         });
-        wxShare(document.location.href,H5ShareName || document.title,wxShareTitle,H5ReportShareImg,0);
+
         //水印
         localStorage.setItem('waterMarkStr',this.$route.query.flag||'')
         const temwaterMarkStr=this.$route.query.flag||localStorage.getItem('waterMarkStr')
@@ -350,7 +351,16 @@ export default {
 
 
     /*内容分割*/
-    splitContentHandle(content) {
+    splitContentHandle() {
+      let content='';
+      if(this.reportInfo.HasChapter===1) {
+        this.reportInfo.ChapterList.forEach(item => {
+          content+=item.Content
+        })
+      }else {
+        content = this.reportInfo.Content;
+      }
+
       const arr = content.split("</p>");
       this.totalContent = arr.map((_) => _ + "</p>");
       this.realContent = this.totalContent.slice(0, this.pageSize);

+ 16 - 6
src/views/smartReport/detail.vue

@@ -31,7 +31,7 @@
         </div>
 
         <!-- 章节报告 -->
-        <div class="chapter-wrap" v-if="reportInfo.HasChapter===1">
+        <!-- <div class="chapter-wrap" v-if="reportInfo.HasChapter===1">
           <div class="chapter-item" v-for="item in reportInfo.ChapterList" :key="item.ReportChapterId">
             <div style="margin-bottom:10px">
               <span class="type" v-if="item.TypeName">{{item.TypeName}}</span>
@@ -39,8 +39,8 @@
             </div>
             <div id="resetcss" style="overflow:hidden;" v-html="item.Content"></div>
           </div>
-        </div>
-        <div id="resetcss" style="overflow:hidden;" v-html="reportInfo.Content" v-else></div>
+        </div> -->
+        <div id="resetcss" style="overflow:hidden;" v-html="reportInfo.Content"></div>
 
         <div class="html-end-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.EndImg">
           <img :src="reportInfo.EndImg" alt="" style="display:block;width:100%">
@@ -184,7 +184,9 @@ export default {
         this.pageResize()
       })
 
-      this.splitContentHandle(this.reportInfo.Content);
+      wxShare(document.location.href, H5ShareName || document.title, wxShareTitle, H5ReportShareImg, 0);
+
+      this.splitContentHandle();
 
       $(document).on("click", "#resetcss img", function (event) {
         let imgArray = [];
@@ -198,11 +200,19 @@ export default {
           wx.previewImage({ current: curImageSrc, urls: imgArray });
         }
       });
-      wxShare(document.location.href, H5ShareName || document.title, wxShareTitle, H5ReportShareImg, 0);
     },
 
     /*内容分割*/
-    splitContentHandle(content) {
+    splitContentHandle() {
+      let content='';
+      if(this.reportInfo.HasChapter===1) {
+        this.reportInfo.ChapterList.forEach(item => {
+          content+=item.Content
+        })
+      }else {
+        content = this.reportInfo.Content;
+      }
+
       const regex = new RegExp(`<div[^>]*class="?report-drag-item-wrap"?>`);
       const arr = content.split(regex);
       this.totalContent = arr.map((_) => _ + "<div class='report-drag-item-wrap'>");