最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

微信开发 分享朋友圈或好友代码-微信开发

来源:http://www.erdangjiade.com/topic/139649.html 微信开发爱好者 2017-11-01 00:11浏览(224)

<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>

以上就是微信开发 分享朋友圈或好友代码的内容,更多相关内容请关注PHP中文网(www.erdangjiade.com)!

标签: 微信
评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2