您好,登錄后才能下訂單哦!
小編給大家分享一下小程序開發中如何實現分享朋友圈,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
<script type="text/javascript"> document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { window.shareData = { "imgUrl": "/index.php/images/jp_1.jpg", "timeLineLink": "http://dc.exweixin.com/index.php?app=RedPacket&mod=Index&act=robSmallRed&fatherid={$fatherid}",//好友 "sendFriendLink": "http://dc.exweixin.com/index.php?app=RedPacket&mod=Index&act=robSmallRed&fatherid={$fatherid}",//朋友圈 "weiboLink": "", "tTitle": "標題!", "tContent": "內容", "fTitle": "!", "fContent": "!", "wContent": "" }; // 發送給好友 WeixinJSBridge.on('menu:share:appmessage', function (argv) { WeixinJSBridge.invoke('sendAppMessage', { "img_url": window.shareData.imgUrl, "img_width": "640", "img_height": "640", "link": window.shareData.sendFriendLink, "desc": window.shareData.fContent, "title": window.shareData.fTitle }, function (res) { _report('send_msg', res.err_msg); }) }); // 分享到朋友圈 WeixinJSBridge.on('menu:share:timeline', function (argv) { WeixinJSBridge.invoke('shareTimeline', { "img_url": window.shareData.imgUrl, "img_width": "640", "img_height": "640", "link": window.shareData.timeLineLink, "desc": window.shareData.tContent, "title": window.shareData.tTitle }, function (res) { _report('timeline', res.err_msg); }); }); // 分享到微博 WeixinJSBridge.on('menu:share:weibo', function (argv) { WeixinJSBridge.invoke('shareWeibo', { "content": window.shareData.wContent, "url": window.shareData.weiboLink, }, function (res) { _report('weibo', res.err_msg); }); }); }, false) </script>
看完了這篇文章,相信你對“小程序開發中如何實現分享朋友圈”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。