04 08 2015

分享到朋友圈

  1. function weixinShareTimeline(title,desc,link,imgUrl){ 
  2.     WeixinJSBridge.invoke('shareTimeline',{ 
  3.         "img_url":imgUrl, 
  4.         //"img_width":"640", 
  5.         //"img_height":"640", 
  6.         "link":link, 
  7.         "desc": desc, 
  8.         "title":title 
  9.     });  

发送给好友

  1. function weixinSendAppMessage(title,desc,link,imgUrl){ 
  2.     WeixinJSBridge.invoke('sendAppMessage',{ 
  3.     //"appid":appId, 
  4.     "img_url":imgUrl, 
  5.     //"img_width":"640", 
  6.     //"img_height":"640", 
  7.     "link":link, 
  8.     "desc":desc, 
  9.     "title":title 
  10.     }); 

分享到腾讯微博

  1. function weixinShareWeibo(title,link){ 
  2.     WeixinJSBridge.invoke('shareWeibo',{ 
  3.         "content":title + link, 
  4.         "url":link 
  5.     }); 

关注指定的微信号

  1. function weixinAddContact(name){ 
  2.     WeixinJSBridge.invoke("addContact", {webtype: "1",username: name}, function(e) { 
  3.         WeixinJSBridge.log(e.err_msg); 
  4.         //e.err_msg:add_contact:added 已经添加 
  5.         //e.err_msg:add_contact:cancel 取消添加 
  6.         //e.err_msg:add_contact:ok 添加成功 
  7.         if(e.err_msg == 'add_contact:added' || e.err_msg == 'add_contact:ok'){ 
  8.             //关注成功,或者已经关注过 
  9.         } 
  10.     }) 
发表评论