小編給大家分享一下小程序開發中如何實現分享朋友圈,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
<script type="text/javascript"> document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { window.shareData = { "imgUrl": "/index.php/images/jp_1.jpg", "timeLineLink": "/tupian/20230522/index.php "sendFriendLink": "/tupian/20230522/index.php "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>
看完了這篇文章,相信你對“小程序開發中如何實現分享朋友圈”有了一定的了解,如果想了解更多相關知識,歡迎關注創新互聯行業資訊頻道,感謝各位的閱讀!
標題名稱:小程序開發中如何實現分享朋友圈-創新互聯
URL分享:http://vcdvsql.cn/article44/ceojee.html
成都網站建設公司_創新互聯,為您提供網站設計、定制網站、關鍵詞優化、自適應網站、網站維護、企業網站制作
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯