拷贝忍者卡卡西
- 拷贝忍者卡卡西 回复了 erdangjiades 的回答
刚刚做好的,参考下这里;https://www.erdangjiade.com/php/8493.html
在线演示的demo出现了和我现在一样的问题。
wx.config({ debug: true, appId: '<?php echo $signPackage["appId"];?>', timestamp: <?php echo $signPackage["timestamp"];?>, nonceStr: '<?php echo $signPackage["nonceStr"];?>', signature: '<?php echo $signPackage["signature"];?>', jsApiList: [ 'onMenuShareTimeline','onMenuShareQQ' // 所有要调用的 API 都要加到这个列表中 ] }); wx.checkJsApi({ jsApiList: ['onMenuShareTimeline','onMenuShareQQ'], // 需要检测的JS接口列表,所有JS接口列表见附录2, success: function(res) { alert(res); // 以键值对的形式返回,可用的api值true,不可用为false // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"} } }); wx.ready(function () { var url = location.href.split('#')[0]; // 在这里调用 API wx.onMenuShareQQ({ title: '互联网之子 方倍工作室', link: url, desc: '分享描述', // 分享描述 imgUrl: 'http://img3.douban.com/view/movie_poster_cover/spst/public/p2166127561.jpg', trigger: function (res) { alert(res); alert('用户点击分享到朋友圈'); }, success: function (res) { alert(res); alert('已分享'); }, cancel: function (res) { alert(res); alert('已取消'); }, fail: function (res) { alert(res); alert(JSON.stringify(res)); } }); wx.onMenuShareTimeline({ title: '互联网之子 方倍工作室', link: url, imgUrl: 'http://img3.douban.com/view/movie_poster_cover/spst/public/p2166127561.jpg', trigger: function (res) { alert(res); alert('用户点击分享到朋友圈'); }, success: function (res) { alert(res); alert('已分享'); }, cancel: function (res) { alert(res); alert('已取消'); }, fail: function (res) { alert(res); alert(JSON.stringify(res)); } }); alert('已注册获取“分享到朋友圈”状态事件'); // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口 }); wx.error(function(res){ alert("错误信息:"+res); // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 });
上传图片就是未响应。凑合着看吧。
- 拷贝忍者卡卡西 2018-07-06 已签到连续签到1天,获得了5个金钱