wx.config({ debug: false, appId: 'wxa9470ffc52629dd6', timestamp: 1745024443, nonceStr: '12d34aabb123f4', signature: 'a00a75122d0f9d75425f2df36edf7c86a1c5cf69', jsApiList: [ 'onMenuShareTimeline', 'onMenuShareAppMessage' ] }); var shareData = { title: '', desc: '', img: '', link: '' }; shareData.title = '(经济观察)海南“全域限购”松绑 楼市或将进入新阶段'; shareData.desc = ''; shareData.img = 'https://upload.sicomedia.cn/2024/1011/1728617667151.jpg'; shareData.link = 'https://sicomedia.cn/2024/1011/42996.shtml'; wx.ready(function () { //分享到朋友圈 //alert(shareData.img); wx.onMenuShareTimeline({ title: shareData.title, // 分享标题fxtitle link: shareData.link, // 分享链接 imgUrl: shareData.img, // 分享图标 type: '', // 分享类型,music、video或link,不填默认为link dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 success: function () { }, cancel: function () { } }); //分享给单个朋友 wx.onMenuShareAppMessage({ title: shareData.title, // 分享标题 desc: shareData.desc, // 分享描述 link: shareData.link, // 分享链接 imgUrl: shareData.img, // 分享图标 type: '', // 分享类型,music、video或link,不填默认为link dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 success: function () { }, cancel: function () { // 用户取消分享后执行的回调函数 } }); //分享给QQ好友 wx.onMenuShareQQ({ title: shareData.title, // 分享标题 desc: shareData.desc, // 分享描述 link: shareData.link, // 分享链接 imgUrl: shareData.img, // 分享图标 success: function () { // 用户确认分享后执行的回调函数 }, cancel: function () { // 用户取消分享后执行的回调函数 } }); }); wx.error(function (res) { });