04
08月
2015
分享到朋友圈
- function weixinShareTimeline(title,desc,link,imgUrl){
- WeixinJSBridge.invoke('shareTimeline',{
- "img_url":imgUrl,
- //"img_width":"640",
- //"img_height":"640",
- "link":link,
- "desc": desc,
- "title":title
- });
- }
发送给好友
- function weixinSendAppMessage(title,desc,link,imgUrl){
- WeixinJSBridge.invoke('sendAppMessage',{
- //"appid":appId,
- "img_url":imgUrl,
- //"img_width":"640",
- //"img_height":"640",
- "link":link,
- "desc":desc,
- "title":title
- });
- }
分享到腾讯微博
- function weixinShareWeibo(title,link){
- WeixinJSBridge.invoke('shareWeibo',{
- "content":title + link,
- "url":link
- });
- }
关注指定的微信号
- function weixinAddContact(name){
- WeixinJSBridge.invoke("addContact", {webtype: "1",username: name}, function(e) {
- WeixinJSBridge.log(e.err_msg);
- //e.err_msg:add_contact:added 已经添加
- //e.err_msg:add_contact:cancel 取消添加
- //e.err_msg:add_contact:ok 添加成功
- if(e.err_msg == 'add_contact:added' || e.err_msg == 'add_contact:ok'){
- //关注成功,或者已经关注过
- }
- })
- }
特殊说明,本文版权归 ning个人博客 所有带原创标签请勿转载,转载请注明出处.