From 15a90ac7782cb389e5318da22048e626ea3327aa Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Thu, 14 Apr 2022 10:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/View/default/Home/landingPage.html | 40 +++++++++---------- .../Home/View/default/Home/landingPage2.html | 40 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html index 812fa5db4..1ef46045a 100644 --- a/Application/Home/View/default/Home/landingPage.html +++ b/Application/Home/View/default/Home/landingPage.html @@ -10,7 +10,7 @@ - + @@ -1534,7 +1534,7 @@ function getCurUserId() { timestamp: response.data.time, nonceStr: response.data.randStr, signature: response.data.sign, - jsApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone'] + jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareWeibo'] }) var title = $('[name=title]').val(); var description = $('[name=desc]').val(); @@ -1546,38 +1546,38 @@ function getCurUserId() { function wxReady(title, description, img) { wx.ready(function () { - wx.onMenuShareAppMessage({ + wx.updateAppMessageShareData({ title: title, desc: description, link: window.location.href, imgUrl: img, - type: '', - dataUrl: '' - }); - wx.onMenuShareTimeline({ - title: title, - link: window.location.href, - imgUrl: img + success: function () { + } }); - wx.onMenuShareQQ({ + wx.updateTimelineShareData({ title: title, - desc: description, link: window.location.href, - imgUrl: img + imgUrl: img, + success: function () { + // 设置成功 + } }); wx.onMenuShareWeibo({ title: title, desc: description, link: window.location.href, - imgUrl: img - }); - wx.onMenuShareQZone({ - title: title, - desc: description, - link: window.location.href, - imgUrl: img + imgUrl: img, + success: function () { + // 用户确认分享后执行的回调函数 + }, + cancel: function () { + // 用户取消分享后执行的回调函数 + } }); }); + wx.error(function(res){ + // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 + }); } diff --git a/Application/Home/View/default/Home/landingPage2.html b/Application/Home/View/default/Home/landingPage2.html index c48df53c7..6a91d9fd1 100644 --- a/Application/Home/View/default/Home/landingPage2.html +++ b/Application/Home/View/default/Home/landingPage2.html @@ -8,7 +8,7 @@ - +