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’){
//关注成功,或者已经关注过
}
})
}