现在的位置: 首页 > 微信开发 > 正文

UC浏览器 分享到朋友圈和微信好友

2016年04月17日 微信开发 ⁄ 共 30字 ⁄ 字号 评论关闭

用手机UC浏览器访问新浪微博,会注意到有这样的两个分享按钮:

vc6i0MWho9HQvr/By8/CxuTUtLT6wuujrLTm1NrV4tH5tcTSu7j2anOjumh0dHA6Ly9tanMuc2luYWltZy5jbi93YXAvbW9kdWxlL3NoYXJlLzIwMTUwNDA3MTc0NS9qcy9hZGRTaGFyZS5taW4uanM8L3A+CjxwPrTTwO/D5rPpwOuz9sHLt9bP7bX308O1xLe9t6ijrLe9seO199PDoaMo16LS4qO61eK49rfWz+25psTc1rvU2lVDyta7+uSvwMDG99PQ0KcpPC9wPgo8cD4mbmJzcDs8L3A+Cgo8cHJlIGNsYXNzPQ=="brush:java;">if (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
if (window.location.href.indexOf("?mobile") < 0) {
try {
//判断是手机端访问
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {

//判断是UC浏览器
if (typeof (ucweb) != "undefined") {

//微信好友
("#btnShareFirend").unbind();
("#btnShareFirend").bind("click", function () {
var Browser = new Object();
Browser.ios = /iphone/.test(Browser.userAgent); //判断ios系统
var title = document.title;
var img = "";
var url = location.href;
if (Browser.ios) {
ucbrowser.web_share(title, img, url, 'kWeixin', '', '', '');
} else {
ucweb.startRequest("shell.page_share", [title, img, url, 'WechatFriends', '', '', '']);
};
});

//微信朋友圈
("#btnWeixinShare").unbind();
("#btnWeixinShare").bind("click", function () {
var Browser = new Object();
Browser.ios = /iphone/.test(Browser.userAgent); //判断ios系统
var title = document.title;
var img = "";
var url = location.href;
if (Browser.ios) {
ucbrowser.web_share(title, img, url, 'kWeixinFriend', '', '', '');
} else {
ucweb.startRequest("shell.page_share", [title, img, url, 'WechatTimeline', '', '', '']);
};
});

}
}
} catch (e) { }
}
}

抱歉!评论已关闭.

×