*share*/ function wxShare() { $.ajax({ url: "https://mp.i.dayoo.cn/activityinterface/wechat/share", dataType: 'jsonp', success: function (response) { if (typeof response.timestamp != 'undefined' && typeof response.nonceStr != 'undefined' && typeof response.signature != 'undefined') { wx.config({ debug: false, appId: response.appId, timestamp: response.timestamp, nonceStr: response.nonceStr, signature: response.signature, jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo'] }); wx.ready(function () { wx.onMenuShareTimeline({ title: shareTxt, link: shareurl, imgUrl: sharephoto, success: function () { console.log('转发成功'); } }); wx.onMenuShareAppMessage({ title: shareTxt, desc: shareesac, link: shareurl, imgUrl: sharephoto, success: function () { console.log('转发成功'); } }); wx.onMenuShareQQ({ title: shareTxt, desc: shareesac, link: shareurl, imgUrl: sharephoto }); wx.onMenuShareWeibo({ title: shareTxt, desc: shareesac, link: shareurl, imgUrl: sharephoto }); }); } } }); } wxShare();