Files
xj-admin/public/static/apps/index.html
T

121 lines
3.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>APP下载</title>
</head>
<style>
html,body,#outer {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
box-sizing: border-box;
}
#text {
width: 100%;
height: 100%;
background: url('./images/noOpen.png') no-repeat;
background-size: 100% 100%;
display: none;
align-items: center;
justify-content: center;
}
#text1 {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.down-container {
width: 100%;
height: 100%;
background: url('./images/bg.png') no-repeat;
background-size: 100% 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.android {
width: 400px;
height: 400px;
background: url('./images/android.png') no-repeat;
background-size: 100% 100%;
margin-top: 14%;
}
.ios {
width: 400px;
height: 400px;
background: url('./images/ios.png') no-repeat;
background-size: 100% 100%;
}
</style>
<body>
<div id="outer">
<div id="text">
</div>
<div id="text1">
<div class="down-container">
<!-- <div class="ios" onclick="down('ios')"></div>-->
<div class="android" onclick="down('android')"></div>
</div>
</div>
</div>
</body>
</html>
<script>
function isWeiXin() {
return navigator.userAgent.toLocaleLowerCase().indexOf('micromessenger') != -1;
}
function f() {
if (isWeiXin()) {
document.getElementById('text1').style.display = 'none';
document.getElementById('text').style.display = 'flex';
}
}
f();
function isType() {
let userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i) || userAgent.match(/iPod/i)) {
return 'ios';
} else if (userAgent.match(/Android/i)) {
return 'android';
}
}
function androidLoad() {
fetch(window['downUrl']+`/health-system/version/getSysVersionDetailByPackageName?androidOrIos=1&packageName=com.xjjk.healthyclients`)
.then(response => {
if (!response.ok) {
throw new Error('网络响应不正常');
}
return response.json();
})
.then(data => {
if (data.code === 200) {
window.open(window['downUrl']+`/file/down/${data.result.appUrl}`)
} else {
window.alert('网络异常');
}
})
.catch(error => {
console.error('请求失败:', error);
window.alert('网络异常');
});
}
function iosLoad() {
// // 响应App store
// const appID = '6483208440';
// const link = 'itms-apps://itunes.apple.com/app/id' + appID;
// window.location.href = 'https://api.cqygjk.com/health-system/api/anon/sys/toAppDown?pkg=com.escortUP.EscortProject&type=2';
}
function down(type) {
if (type === 'ios') {
iosLoad();
} else {
androidLoad();
}
}
</script>