Skip to content

Instantly share code, notes, and snippets.

@samma835
Created December 1, 2012 00:24
Show Gist options
  • Save samma835/4179734 to your computer and use it in GitHub Desktop.
Save samma835/4179734 to your computer and use it in GitHub Desktop.
分享到朋友圈及其他
// 发送给好友;
WeixinJSBridge.on('menu:share:appmessage', function(argv){
WeixinJSBridge.invoke('sendAppMessage',{
"appid":appId,
"img_url":imgUrl,
"img_width":"640",
"img_height":"640",
"link":"http://yige.org/php/",
"desc":"一个网在线教程",
"title":"yige.org"
}, function(res) {})
});
// 分享到朋友圈;
WeixinJSBridge.on('menu:share:timeline', function(argv){
WeixinJSBridge.invoke('shareTimeline',{
"img_url":imgUrl,
"img_width":"640",
"img_height":"640",
"link":link,
"desc": desc,
"title":title
}, function(res) {
});
});
// 分享到微博;
var weiboContent = '';
WeixinJSBridge.on('menu:share:weibo', function(argv){
WeixinJSBridge.invoke('shareWeibo',{
"content":title + link,
"url":link,
}, function(res) {
});
});
// 隐藏右上角的选项菜单入口;
WeixinJSBridge.call('hideOptionMenu');
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment