|
@@ -124,6 +124,7 @@
|
|
|
|
|
|
categoryList: [],
|
|
categoryList: [],
|
|
registAmount: null,
|
|
registAmount: null,
|
|
|
|
+ shareToken:"",
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(param) {
|
|
onLoad(param) {
|
|
@@ -146,6 +147,19 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async getSingle(){
|
|
|
|
+ let params = {
|
|
|
|
+ "projectId": this.projectId,
|
|
|
|
+ "userId": getApp().globalData.userId
|
|
|
|
+ }
|
|
|
|
+ let res = await this.$myRequest({
|
|
|
|
+ url: '/share_token/generate',
|
|
|
|
+ data: parmas
|
|
|
|
+ });
|
|
|
|
+ if(res.data.success){
|
|
|
|
+ this.shareToken = res.data.single;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async signJsapiTicket(){
|
|
async signJsapiTicket(){
|
|
let url = location.href.split('#')[0]
|
|
let url = location.href.split('#')[0]
|
|
let parmas = {
|
|
let parmas = {
|
|
@@ -172,7 +186,7 @@
|
|
wx.updateAppMessageShareData({ //分享给朋友
|
|
wx.updateAppMessageShareData({ //分享给朋友
|
|
title: self.dataInfo.name, // 分享标题
|
|
title: self.dataInfo.name, // 分享标题
|
|
desc: self.dataInfo.shareRemark, // 分享描述
|
|
desc: self.dataInfo.shareRemark, // 分享描述
|
|
- link: location.origin+location.pathname + "?projectId="+self.projectId+"&shareToken="+getApp().globalData.shareToken, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
|
|
|
+ link: location.origin+location.pathname + "?projectId="+self.projectId+"&shareToken="+self.shareToken, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
imgUrl: self.dataInfo.shareImg, // 分享图标
|
|
imgUrl: self.dataInfo.shareImg, // 分享图标
|
|
success: function() {
|
|
success: function() {
|
|
// 设置成功
|
|
// 设置成功
|
|
@@ -180,7 +194,7 @@
|
|
});
|
|
});
|
|
wx.updateTimelineShareData({ //分享到朋友圈
|
|
wx.updateTimelineShareData({ //分享到朋友圈
|
|
title: self.dataInfo.name, // 分享标题
|
|
title: self.dataInfo.name, // 分享标题
|
|
- link: location.origin+location.pathname + "?projectId="+self.projectId+"&shareToken="+getApp().globalData.shareToken, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
|
|
|
+ link: location.origin+location.pathname + "?projectId="+self.projectId+"&shareToken="+self.shareToken, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
imgUrl: self.dataInfo.shareImg, // 分享图标
|
|
imgUrl: self.dataInfo.shareImg, // 分享图标
|
|
success: function() {
|
|
success: function() {
|
|
// 设置成功
|
|
// 设置成功
|
|
@@ -201,6 +215,7 @@
|
|
projectId: this.projectId,
|
|
projectId: this.projectId,
|
|
userId: getApp().globalData.userId
|
|
userId: getApp().globalData.userId
|
|
}
|
|
}
|
|
|
|
+ this.getSingle();
|
|
this.createUserProjectRlat();
|
|
this.createUserProjectRlat();
|
|
this.getRegistTask();
|
|
this.getRegistTask();
|
|
let res = await this.$myRequest({
|
|
let res = await this.$myRequest({
|