<script>
//判断手机环境
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1
|| u.indexOf('Linux') > -1; //android终端或者uc浏览器
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
var isiosapp = u.indexOf('Safari') == -1
&& u.indexOf('Language') == -1
&& u.indexOf('MicroMessenger') == -1;
var isanapp = u.indexOf('igetapp') > -1;
//微信
function is_weixn() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
;
};
//外部点击按钮直接跳转回APP指定页面
if (is_weixn()) {
if (isiOS) {
$('#join').click(function () {
// window.location="https://ttts.besttoptoday.com/dl/blue.html?urlurlurl=besttoptoday.com/static/weekw/20200220/86855.html"
window.location = "https://ttts.besttoptoday.com/dl/blue.html?need_login=ture&type=25"
})
} else if (isAndroid) {
var link = 'https://anyx52.jmlk.co/AA2m';//短链地址
var configs = [];
var btn_1 = document.querySelector('#join');
configs.push({
//jmlink: link+'?push_id=https://ttts.besttoptoday.com/dl/blue.html?urlurlurlbesttoptoday.com/static/weekw/20200220/86855.html',
//安卓不需要在urlurlurl后边写=
jmlink: link+'?type=25',
button: btn_1
})
new JMLink(configs);
}
}
// 安卓浏览器
if (isAndroid && !is_weixn()) {
var link = 'https://anyx52.jmlk.co/AA2m';//短链地址
var configs = [];
var btn_1 = document.querySelector('#join');
configs.push({
//jmlink: link+'?push_id=https://ttts.besttoptoday.com/dl/blue.html?urlurlurlbesttoptoday.com/static/weekw/20200220/86855.html',
//安卓不需要在urlurlurl后边写=
jmlink: link+'?type=25',
button: btn_1
})
new JMLink(configs);
}
// ios浏览器
if (!isiosapp && isiOS && !is_weixn()) {
$('#join').click(function () {
// window.location="https://ttts.besttoptoday.com/dl/blue.html?urlurlurl=besttoptoday.com/static/weekw/20200220/86855.html"
window.location = "https://ttts.besttoptoday.com/dl/blue.html?need_login=ture&type=25"
})
}
</script>