<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>下载文件</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<style>
</style>
</head>
<body>
<div id="container" style="display: none">
<div style='position:relative;padding-top:100px;color:#333;font-size: 22px;text-align: center;'>
<i style='position: absolute;top: 10px;right: 10px;font-size: 100px' class='iconfont icon-jiantou'></i>
<p style="font-weight: 600;">请点击屏幕右上角 [ ··· ] </p>
<p id="confirm">选择在浏览器打开</p>
</div>
</div>
<script>
function get_UrlQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
var browser = {
versions: function () {
var u = navigator.userAgent, app = navigator.appVersion;
return {
trident: u.indexOf('Trident') > -1,
presto: u.indexOf('Presto') > -1,
webKit: u.indexOf('AppleWebKit') > -1,
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,
mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/),
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1,
iPad: u.indexOf('iPad') > -1,
webApp: u.indexOf('Safari') == -1,
wx: u.indexOf("MicroMessenger") > 0
};
}(),
language: (navigator.browserLanguage || navigator.language).toLowerCase()
}, con = document.getElementById("container");
if (browser.versions.wx) {
con.style.cssText = "display:block";
if (IsIOS()) {
document.getElementById('confirm').innerHTML='选择复制链接后到浏览器打开'
}
} else if (browser.versions.android) {
download();
} else if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
download();
} else {
download();
}
function download() {
var a = document.createElement("a");
a.href = "";
a.target = "_blank";
a.download = "";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
function IsIOS() {
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isAndroid) {
return false;
}
if (isiOS) {
return true;
}
return false
}
</script>
</body>
</html>
|