heyang 3 年之前
父節點
當前提交
0ec4d05a8e
共有 1 個文件被更改,包括 20 次插入11 次删除
  1. 20 11
      microserviceUserH5/vcloud/actFissionShare.html

+ 20 - 11
microserviceUserH5/vcloud/actFissionShare.html

@@ -594,6 +594,7 @@
                 strategyId: GetRequest().strategyId ? GetRequest().strategyId : '',
                 tagId: GetRequest().tagId ? GetRequest().tagId : '',
                 uuid: '',
+                shareInfo: {},
                 flag: true,
                 timer: null,
                 phoneType: '',
@@ -642,12 +643,14 @@
 
                     });
                 },
+                
                 //查看活动是否下架
                 getActDetail() { //获取活动状态
                     getActDetail().then(res => {
                         this.$toast.clear();
                         if (res.status === 0) {
                             this.phoneType = res.data.phoneType;
+                            this.shareInfo = res.data;
                             if (res.data.actStatus == 1) {
                                 this.isshow = true;
                                 this.getStrategy();
@@ -853,17 +856,23 @@
                     }
                 },
                 share(){
-                    if (isAndroid) {
-                        window.native.share(this.dataObj.strategyTitle, this.dataObj.contentText, 
-                        `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?strategyId=${this.dataObj.id}&username=${username}&tagId=${tagId}&type=2`, `${baseUrl}/file-center/fileOperate/getImage?id=${this.dataObj.fileId}`);
-                    } else if (isiOS) {
-                        window.webkit.messageHandlers.share.postMessage({
-                            title: this.dataObj.strategyTitle,
-                            content: this.dataObj.contentText,
-                            gotoUrl: `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?strategyId=${this.dataObj.id}&type=2`,
-                            shareImg: `${baseUrl}/file-center/fileOperate/getImage?id=${this.dataObj.fileId}`
-                        });
-                    } else {
+                    console.log(this.shareInfo.gotoUrl)
+                    const {
+						title,
+						content,
+						gotoUrl,
+						shareImg
+					} = this.shareInfo;
+					if (isAndroid) {
+						window.native.share(title, content, gotoUrl, shareImg)
+					} else if (isIOS) {
+						window.webkit.messageHandlers.share.postMessage({
+							title: title,
+							content: content,
+							gotoUrl: gotoUrl,
+							shareImg: shareImg
+						});
+					} else {
                         code = window.Location.href;
                         copyUrl();
                     }