Browse Source

预览ppt页也要转发

jwyu 2 years ago
parent
commit
00378971ce
2 changed files with 18 additions and 2 deletions
  1. 11 1
      src/views/hzyb/report/ChapterDetail.vue
  2. 7 1
      src/views/hzyb/report/Detail.vue

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

@@ -193,6 +193,7 @@ export default {
       total_page: 0,
 
       hasPPt:false,
+      shareData:{},//分享的数据传给ppt页
     };
   },
   beforeCreate(){
@@ -235,8 +236,12 @@ export default {
     // },
     //跳转ppt预览页
     goPPtDetail(){
+        const report_id=this.info.report_chapter_item.report_id
+        const chapterId=this.info.report_chapter_item.report_chapter_id
+        const shareImg=this.shareData.shareImg
+        const shareTitle=this.shareData.title
         wx.miniProgram.navigateTo({
-            url:`/pages-report/previewImage?reportId=${this.info.report_chapter_item.report_id}&chapterId=${this.info.report_chapter_item.report_chapter_id}`
+            url:`/pages-report/previewImage?reportId=${report_id}&chapterId=${chapterId}&shareImg=${shareImg}&shareTitle=${shareTitle}`
         })
     },
 
@@ -316,6 +321,11 @@ export default {
         if(rddpImgRes.code===200){
             shareImg=rddpImgRes.data
         }
+        this.shareData={
+          title:shareTitle,
+          chapterId:this.chapterId,
+          shareImg:shareImg
+        }
         wx.miniProgram.postMessage({ 
           data: {
             title:shareTitle,

+ 7 - 1
src/views/hzyb/report/Detail.vue

@@ -202,6 +202,7 @@ export default {
             fromPage: '', // message定位到留言板
 
             hasPPt:false,//是否有ppt
+            shareData:{},//分享的数据传给ppt页
         }
     },
     beforeCreate(){
@@ -246,7 +247,7 @@ export default {
         //跳转ppt预览页
         goPPtDetail(){
             wx.miniProgram.navigateTo({
-                url:`/pages-report/previewImage?reportId=${this.reportId}&chapterId=0`
+                url:`/pages-report/previewImage?reportId=${this.reportId}&chapterId=0&shareImg=${this.shareData.shareImg}&shareTitle=${this.shareData.title}`,
             })
         },
 
@@ -365,6 +366,11 @@ export default {
                 if(rddpImgRes.code===200){
                     shareImg=rddpImgRes.data
                 }
+                this.shareData={
+                    title:shareTitle,
+                    reportId:this.reportId,
+                    shareImg:shareImg
+                }
 
                 wx.miniProgram.postMessage({ 
                     data: {