Last active
January 29, 2016 06:06
-
-
Save toobigdata/6402686 to your computer and use it in GitHub Desktop.
微信前端
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'){ | |
| //关注成功,或者已经关注过 | |
| } | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function weixinShareTimeline(title,desc,link,imgUrl){ | |
| WeixinJSBridge.invoke('shareTimeline',{ | |
| "img_url":imgUrl, | |
| //"img_width":"640", | |
| //"img_height":"640", | |
| "link":link, | |
| "desc": desc, | |
| "title":title | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function weixinShareWeibo(title,link){ | |
| WeixinJSBridge.invoke('shareWeibo',{ | |
| "content":title + link, | |
| "url":link | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
关注指定微信号 这个目前好像不能用了,我不知道是不是微信改了接口。