wx.config({ //debug: true, appId: 'wx418b79752dfecdc2', timestamp: '1731566608', nonceStr: 'QTk5NM9IwcVrjC9L', signature: '2a23a58e66a74c58c7582c4c8e15a59ea4360de9', jsApiList: ["updateAppMessageShareData","updateTimelineShareData"] }); wx.ready(function () { //需在用户可能点击分享按钮前就先调用 var imgurl = 'http://www.ouyangting.com/data/attachment/block/d9/d935d420ebe9db60a8df294cd9087748.jpg'; var title = document.title; var desc = document.getElementsByName("description")[0].content; var link = ''; wx.updateAppMessageShareData({ title: title, // 分享标题 desc: desc, // 分享描述 link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: imgurl, // 分享图标 success: function () { // 设置成功 } }) wx.updateTimelineShareData({ title: title, // 分享标题 link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: imgurl, // 分享图标 success: function () { // 设置成功 } }) });