<script type="text/javascript">
function checkFlag(){
var userType=navigator.userAgent;
var Agents=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];
var flag=false;
for(var i=0;i<Agents.length;i++){
if(userType.indexOf(Agents[i])>0){
flag=true;
break;
}
}
return flag;
}
init();
function init(){
var flag=checkFlag();
if(flag){
var ua = navigator.userAgent.toLowerCase();
var isWeixin = ua.indexOf('micromessenger') != -1;
var isAndroid = ua.indexOf('android') != -1;
var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
if (!isWeixin) {
document.head.innerHTML = '<title>抱歉,出错了</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"><link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css">';
document.body.innerHTML = '<div class="weui_msg"><div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div><div class="weui_text_area"><h5 class="weui_msg_title">请在微信客户端打开链接</h5></div></div>';
}else{
window.location.href ="xxxx.html";
}
}else{
document.head.innerHTML = '<title>抱歉,出错了,请在手机微信打开</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"><link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css">';
document.body.innerHTML = '<div class="weui_msg"><div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div><div class="weui_text_area"><h5 class="weui_msg_title">请在手机端微信客户端打开链接</h5></div></div>';
}
}
</script>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。