Authored by whb

测试wechat

... ... @@ -103,33 +103,32 @@
]
});
wx.ready(function () {
var shareData = {
title: $('.detail-title').find('.title'),
desc: '123123',
imgUrl: $(".share").attr("cover-url"),
link: $(".share").attr("data-link"),
success: function () // 用户确认分享后执行的回调函数
{
alert("OK");
},
cancel: function () { // 用户取消分享后执行的回调函数
alert("fail");
}
};
// 2.1 “分享给朋友”
wx.onMenuShareAppMessage(shareData);
// 2.2 “分享到朋友圈”
wx.onMenuShareTimeline(shareData);
// 2.3 “分享到QQ”
wx.onMenuShareQQ(shareData);
// 2.4 “分享到微博”
wx.onMenuShareWeibo(shareData);
alert('aaa');
});
wx.error(function (res) {
alert(res.errMsg);
});
var shareData = {
title: $('.detail-title').find('.title'),
desc: '123123',
imgUrl: $(".share").attr("cover-url"),
link: $(".share").attr("data-link"),
success: function () // 用户确认分享后执行的回调函数
{
alert("OK");
},
cancel: function () { // 用户取消分享后执行的回调函数
alert("fail");
}
};
// 2.1 “分享给朋友”
wx.onMenuShareAppMessage(shareData);
// 2.2 “分享到朋友圈”
wx.onMenuShareTimeline(shareData);
// 2.3 “分享到QQ”
wx.onMenuShareQQ(shareData);
// 2.4 “分享到微博”
wx.onMenuShareWeibo(shareData);
});
</script>
<?php $this->_endblock();?>
... ...