Commit 5700fc7f by 陈玉桐

add

parent 44d7518c
...@@ -83,6 +83,55 @@ export default { ...@@ -83,6 +83,55 @@ export default {
this.detailImgUrl = response.data.detailImgUrl this.detailImgUrl = response.data.detailImgUrl
this.qualifications = response.data.qualifications this.qualifications = response.data.qualifications
}) })
let _url = document.location.href.split('#')[0]
request({
url: '/api/MarketingToolApi/Wechat/getSignPackage',
method: 'post',
data: {
url : _url,
token: localStorage.getItem("token")
}
}).then(response => {
this.appId = response.data.appId
this.nonceStr = response.data.nonceStr
this.signature = response.data.signature
this.timestamp = response.data.timestamp
wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: this.appId, // 必填,公众号的唯一标识
timestamp: this.timestamp, // 必填,生成签名的时间戳
nonceStr: this.nonceStr, // 必填,生成签名的随机串
signature: this.signature,// 必填,签名
jsApiList: ['updateAppMessageShareData','updateTimelineShareData'] // 必填,需要使用的JS接口列表
})
let me = this
wx.ready(function(){
// 自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)
wx.updateAppMessageShareData({
title: me.title, // 分享标题
desc: '', // 分享描述
link: _url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: me.detailImgUrl, // 分享图标
success: function () {
// 设置成功
}
})
// 自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容
wx.updateTimelineShareData({
title: me.title, // 分享标题
link: _url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: me.detailImgUrl, // 分享图标
success: function () {
// 设置成功
}
})
})
wx.error(function(res){})
})
}, },
methods: { methods: {
toApply(){ toApply(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment