小編給大家分享一下小程序開發(fā)中如何實現(xiàn)分享朋友圈,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

<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": "內(nèi)容",
"fTitle": "!",
"fContent": "!",
"wContent": ""
};
// 發(fā)送給好友
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>看完了這篇文章,相信你對“小程序開發(fā)中如何實現(xiàn)分享朋友圈”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
標題名稱:小程序開發(fā)中如何實現(xiàn)分享朋友圈-創(chuàng)新互聯(lián)
URL分享:http://chinadenli.net/article44/ceojee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計、定制網(wǎng)站、關(guān)鍵詞優(yōu)化、自適應(yīng)網(wǎng)站、網(wǎng)站維護、企業(yè)網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容