微信分享问题

WBOY
Release: 2016-06-20 12:40:35
Original
882 people have browsed it

令牌什么的都能没问题,微信的其他接口都测试过,都好使,就是分享接口不好使,没有反应。求大神指教!!!

 <script> <br /> <br /> <br /> var signature="{$signature}"; <br /> var timestamp="{$timestamp}"; <br /> var noncestr="{$noncestr}"; <br /> var url1="{$url1}"; <br /> wx.config({ <br /> debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 <br /> appId: 'wx9f37f2d6536da1fd', // 必填,公众号的唯一标识 <br /> timestamp:timestamp , // 必填,生成签名的时间戳 <br /> nonceStr: noncestr, // 必填,生成签名的随机串 <br /> signature: signature,// 必填,签名,见附录1 <br /> jsApiList: ['onMenuShareTimeline','onMenuShareQQ','onMenuShareAppMessage','onMenuShareWeibo','chooseImage'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 <br /> }); <br /> <br />wx.ready(function(){ <br /> wx.checkJsApi({ <br /> jsApiList: [ <br /> 'getLocation', <br /> 'onMenuShareTimeline', <br /> 'onMenuShareAppMessage' <br /> ], <br /> success: function (res) { <br /> alert(JSON.stringify(res)); <br /> } <br /> }); <br /> wx.onMenuShareAppMessage({ <br /> title: 'hehe', <br /> desc: '本书共分10章', <br /> link: 'http://www.cnblogs.com/txw1958/p/weixin-development-best-practice.html', <br /> imgUrl: 'http://images.cnitblog.com/i/340216/201404/301756448922305.jpg', <br /> trigger: function (res) { <br /> // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回 <br /> alert('用户点击发送给朋友'); <br /> }, <br /> success: function (res) { <br /> alert('已分享'); <br /> }, <br /> cancel: function (res) { <br /> alert('已取消'); <br /> }, <br /> fail: function (res) { <br /> alert(JSON.stringify(res)); <br /> } <br /> }); </script>


回复讨论(解决方案)

可能不是你写的有问题,你可能吧这个理解错了,你得点微信右上角那3个点进行分享。而不是通过你那个按钮直接进入分享页面了,你试下

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template