
完全根据微信 jssdk 文档写的。 wx.ready(function () {
// 朋友圈分享 wx.onMenuShareTimeline({ title:"", // 分享标题 link: domainName + serverProjectName + '/OAuthForward.php?OAuthCode=scancode&isOAuth=Y', // 分享链接 imgUrl: domainName + projectName + '/img/default.jpg', // 分享图标 success: function () { //alert("分享成功") // 用户确认分享后执行的回调函数 }, cancel: function () { // 用户取消分享后执行的回调函数 //alert("取消分享") } }); //---------------------------微信分享----------------------------- wx.onMenuShareAppMessage({ title: '快快加入', // 分享标题 desc: '小伙伴们邀请你加入', // 分享描述 link: domainName + serverProjectName + '/OAuthForward.php?OAuthCode=scancode&isOAuth=Y', // 分享链接 imgUrl: domainName + projectName + '/img/default.jpg', // 分享图标 type: 'link', // 分享类型,music 、 video 或 link ,不填默认为 link dataUrl: '', // 如果 type 是 music 或 video ,则要提供数据链接,默认为空 success: function () { //alert("分享成功") // 用户确认分享后执行的回调函数 }, cancel: function () { // 用户取消分享后执行的回调函数 //alert("取消分享") } }); }) 1 airyland 2016 年 8 月 5 日 title 为空导致的? |
2 yushiro 2016 年 8 月 6 日 你的 jsapi_ticket 申请的时候带上“朋友圈”的 scope 了吗? |