feat: update
This commit is contained in:
@@ -16,8 +16,8 @@ export function useWxSDK() {
|
||||
"chooseImage",
|
||||
"uploadImage",
|
||||
"previewImage",
|
||||
"onMenuShareTimeline",
|
||||
"onMenuShareAppMessage",
|
||||
"updateAppMessageShareData",
|
||||
"updateAppMessageShareData",
|
||||
"chooseWXPay",
|
||||
],
|
||||
openTagList: [],
|
||||
@@ -35,20 +35,23 @@ export function useWxSDK() {
|
||||
onSuccess = () => { },
|
||||
onCancel = () => { }
|
||||
) {
|
||||
wx.onMenuShareTimeline({
|
||||
console.log("setShareInfo called", shareInfo);
|
||||
wx.updateTimelineShareData({
|
||||
title: shareInfo.title, // 分享标题
|
||||
link: shareInfo.link, // 分享链接,可以不是当前页面,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||
imgUrl: shareInfo.imgUrl,
|
||||
success: function () {
|
||||
console.log("分享朋友圈成功", e);
|
||||
// 用户确认分享后执行的回调函数
|
||||
onSuccess();
|
||||
},
|
||||
cancel: function () {
|
||||
console.log("分享朋友圈取消", e);
|
||||
onCancel();
|
||||
// 用户取消分享后执行的回调函数
|
||||
},
|
||||
});
|
||||
wx.onMenuShareAppMessage({
|
||||
wx.updateAppMessageShareData({
|
||||
title: shareInfo.title, // 分享标题
|
||||
desc: shareInfo.desc,
|
||||
link: shareInfo.link, // 分享链接,可以不是当前页面,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||
@@ -56,13 +59,13 @@ export function useWxSDK() {
|
||||
type: "link", // 分享类型,music、video或link,不填默认为link
|
||||
success: function (e) {
|
||||
// 用户确认分享后执行的回调函数
|
||||
onSuccess();
|
||||
console.log("分享成功", e);
|
||||
onSuccess();
|
||||
},
|
||||
cancel: function (e) {
|
||||
// 用户取消分享后执行的回调函数
|
||||
onCancel();
|
||||
console.log("分享取消", e);
|
||||
onCancel();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user