微信、微博、facebook等分享
来源:互联网 发布:骨朵网络剧排行榜 编辑:程序博客网 时间:2024/06/05 12:46
var wx = { appId:'', imgUrl:'http://guangdong.sinaimg.cn/ily/haier/111183280.jpg', link:'http://gd.sina.com.cn/zt2014/haiersmart09/index.html', title:'海尔智慧城市行', desc:'好智慧耀健康,海尔智能城市行。珠海,9月26日-9月28日(为期3天),丰富礼品,劲爆优惠等你来!', fakeid:'', weiboContent:'微博内容', scene:0, init:function(){ var _this = this; _this.desc= _this.desc || _this.link; if (typeof WeixinJSBridge == "undefined"){ document.addEventListener('WeixinJSBridgeReady',function(){_this.onBridgeReady(_this)}, false); }else{ _this.onBridgeReady(_this); } }, onBridgeReady:function(_this){ if(true){ WeixinJSBridge.call("showOptionMenu"); }else{ WeixinJSBridge.call("hideOptionMenu"); } // 发送给好友; WeixinJSBridge.on('menu:share:appmessage', function(argv){ WeixinJSBridge.invoke('sendAppMessage',{ "appid": _this.appId, "img_url": _this.imgUrl, "img_width": "640", "img_height" : "640", "link" : _this.link, "desc" : _this.desc, "title": _this.title }, function(res) { _this.callback(); }); }); // 分享到朋友圈; WeixinJSBridge.on('menu:share:timeline', function(argv){ //report(link, fakeid, 2); WeixinJSBridge.invoke('shareTimeline',{ "img_url": _this.imgUrl, "img_width": "640", "img_height" : "640", "link" : _this.link, "desc" : _this.desc, "title": _this.title }, function(res) { _this.callback(); }); }); // 分享到微博; WeixinJSBridge.on('menu:share:weibo', function(argv){ WeixinJSBridge.invoke('shareWeibo',{ "content" : _this.title + _this.link, "url" : _this.link }, function(res) { _this.callback(); }); }); // 分享到Facebook WeixinJSBridge.on('menu:share:facebook', function(argv){ //report(link, fakeid, 4); WeixinJSBridge.invoke('shareFB',{ "img_url": _this.imgUrl, "img_width": "640", "img_height" : "640", "link" : _this.link, "desc" : _this.desc, "title": _this.title }, function(res) { _this.callback(); }); }); // 新的接口 WeixinJSBridge.on('menu:general:share', function(argv){ switch(argv.shareTo){ case 'friend': _this.scene = 1; break; case 'timeline': _this.scene = 2; break; case 'weibo' : _this.scene = 3; break; } argv.generalShare({ "appid": _this.appId, "img_url": _this.imgUrl, "img_width": "640", "img_height" : "640", "link" : _this.link, "desc" : _this.desc, "title": _this.title }, function(res){ _this.callback(); }); }); }, callback:function(){ //alert('微信分享返回调用啦。'); }}wx.init();
0 0
- 微信、微博、facebook等分享
- 微信、微博、Facebook、Twitter等社交媒体分享方案探索
- 微信、微博、Facebook、Twitter等社交媒体分享方案探索
- iOS实现向多个社交网站(facebook,微信,微博,twitter等)分享的代码,支持iPhone和iPAD(分享链接编码)
- 微信分享等设置 -- 缩略图等
- iOS分享到Facebook/微信/Line C++接口
- 前端开发-微博、微信等分享制作
- mod微信,qq等分享
- 微信分享等api笔记
- 在Android中使App快速、简单地支持新浪微博、微信、QQ、facebook等十几个主流社交平台的分享功能
- 在Android中使App快速、简单地支持新浪微博、微信、QQ、facebook等十几个主流社交平台的分享功能
- [置顶] 在Android中使App快速、简单地支持新浪微博、微信、QQ、facebook等十几个主流社交平台的分享功能
- 在Android中使App快速、简单地支持新浪微博、微信、QQ、facebook等十几个主流社交平台的分享功能
- 微信开发--微信分享等接口配置
- android ShareSDK分享,QQ,微信,新浪等分享
- 微信登录,分享,支付,等的白屏闪屏等问题
- art apk像facebook、微信等apk安装失败,安装慢等问题
- jsp页面分享到QQ空间、微信、微博、人人网等
- Problem 005——UVa 1583 - Digit Generator
- Intent的URI及其示例
- mysql 的 find_in_set函数使用方法
- 练习题总结
- 输出配置信息,学习记录~~~
- 微信、微博、facebook等分享
- Problem 006——UVa 1584 - Circular Sequence
- 如何用opencv的GPU模块实现算法
- 第十一周项目一(4)——函数版星号图
- quick 中的触摸事件
- 启动栏中的mysql命令行无法启动
- private, public, protected
- 组合,关联,聚合的区别
- Problem 007——UVa 1585 - Score