您的位置:首页 > 其它

分享到朋友圈和发送给好友

2014-06-13 11:20 323 查看
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>微信公众平台开发最佳实践</title>
</head>
<body style="">
<script type="text/javascript">
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 发送给好友
WeixinJSBridge.on('menu:share:appmessage', function (argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"appid": "123",
"img_url": "http://bcs.duapp.com/api100/image/logo/lover.jpg",
"img_width": "160",
"img_height": "160",
"link": "http://api100.duapp.com/card/",
"desc":  "山无陵,天地合,乃敢与君绝。",
"title": "爱情贺卡"
}, function (res) {
_report('send_msg', res.err_msg);
})
});

// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function (argv) {
WeixinJSBridge.invoke('shareTimeline', {
"img_url": "http://bcs.duapp.com/api100/image/logo/newyear.jpg",
"img_width": "160",
"img_height": "160",
"link": "http://api100.duapp.com/card/",
"desc":  "Best wishes for a wonderful new year.",
"title": "新年贺卡"
}, function (res) {
_report('timeline', res.err_msg);
});
});
}, false)
</script>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  朋友 开发 share