Browse Source

ppt预览页增加分享功能

jwyu 2 years ago
parent
commit
121d7c0e8d
1 changed files with 19 additions and 1 deletions
  1. 19 1
      pages-report/previewImage.vue

+ 19 - 1
pages-report/previewImage.vue

@@ -61,18 +61,36 @@ export default {
             activeIndex:0,
             reportId:0,
             chapterId:0,//章节id 
-            aid:''
+            aid:'',
+            shareTitle:'',
+            shareImg:''
         }
     },
     onLoad(options){
+        console.log(options);
         this.reportId=options.reportId
         this.chapterId=options.chapterId
+        this.shareTitle=options.shareTitle||''
+        this.shareImg=options.shareImg||''
         this.getReportPPtImgs()
         uni.setPageOrientation({orientation : "landscape"})
     },
     onUnLoad(){
         uni.setPageOrientation({orientation : "portrait"})
     },
+    onShareAppMessage() {
+        let path=''
+        if(this.chapterId!=0){
+            path=`/pages-report/chapterDetail?chapterId=${this.chapterId}`
+        }else{
+            path=`/pages-report/reportDetail?reportId=${this.reportId}`
+        }
+        return {
+            title:this.shareTitle,
+            path:path,
+            imageUrl:this.shareImg
+        }
+    },
     methods: {
         // 获取ppt图片
         async getReportPPtImgs(){