Browse Source

增加分享

cr 4 years ago
parent
commit
31c7856fd2
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/common/js/share.js

+ 10 - 2
src/common/js/share.js

@@ -12,17 +12,25 @@ export default {
12 12
         }
13 13
     },
14 14
     onShareAppMessage(res) { //发送给朋友
15
+        let query = ``;
16
+        if(store.state.user.user && store.state.user.user.inviteCode){
17
+            query+=`?inviteCode=${store.state.user.user.inviteCode}`
18
+        }
15 19
         return {
16 20
             title: this.share.title,
17 21
             imageUrl: this.share.imageUrl,
18
-            path: this.share.path,
22
+            path: this.share.path+query,
19 23
         }
20 24
     },
21 25
     onShareTimeline(res) {//分享到朋友圈
26
+        let query = ``;
27
+        if(store.state.user.user && store.state.user.user.inviteCode){
28
+            query+=`?inviteCode=${store.state.user.user.inviteCode}`
29
+        }
22 30
         return {
23 31
             title: this.share.title,
24 32
             imageUrl: this.share.imageUrl,
25
-            path: this.share.path,
33
+            path: this.share.path+query,
26 34
         }
27 35
     },
28 36
 }