提交 bd30bef1 作者: 王进

增加右上角分享按钮监听接口

上级 fde188ed
...@@ -70,13 +70,6 @@ class WechatSDK { ...@@ -70,13 +70,6 @@ class WechatSDK {
that.ReportParams.openId = that.sdkParams.open_id = that.sdkParams.uniqueid = res.data.openid that.ReportParams.openId = that.sdkParams.open_id = that.sdkParams.uniqueid = res.data.openid
that.sdkParams.session_key = res.data.session_key that.sdkParams.session_key = res.data.session_key
that.sdkActive() // SDK激活 that.sdkActive() // SDK激活
const ShareParams = {
title: SDKConfig.shareTitle,
imageUrl: SDKConfig.shareImageUrl,
query: 'fromOpenId=' + that.ReportParams.openId + '&from=share&tag=0'
}
// 监听右上角的分享按钮
that.addShareEvent(ShareParams)
} else { } else {
that.printf(res.msg, 1) that.printf(res.msg, 1)
} }
...@@ -541,15 +534,16 @@ class WechatSDK { ...@@ -541,15 +534,16 @@ class WechatSDK {
complete: () => {} complete: () => {}
}) })
} }
// 监听右上角的分享按钮
private addShareEvent(DATA) { public addShareEvent(DATA, CALLBACK) {
const that = this; const that = this;
const ShareParams = {
title: SDKConfig.shareTitle,
imageUrl: SDKConfig.shareImageUrl,
query: 'fromOpenId=' + that.ReportParams.openId + '&from=share&tag=0'
};
(wx as any).onShareAppMessage(() => { (wx as any).onShareAppMessage(() => {
return that.deepCopy(DATA, { return that.deepCopy(DATA, CALLBACK)
success: function() {},
fail: function() {},
complete() {}
})
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论