SchoolPhysicalExamination/application/testapp/view/download/demo.html

172 lines
5.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no, email=no">
<meta name="full-screen" content="true">
<meta name="screen-orientation" content="portrait">
<meta name="x5-fullscreen" content="true">
<meta name="360-fullscreen" content="true">
<title>下载页面-download</title>
<script src="/x_admin/js/jq.js"></script>
<style>
*{
padding: 0 0;
margin: 0 0;
}
.big_box{
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
}
.content_1{
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
overflow: auto;
padding: 10vw;
box-sizing: border-box;
font-size: 4vw;
}
.download{
width: 40vw;
height: 10vw;
background-color: darkgray;
border-radius: 5vw;
text-align: center;
line-height: 10vw;
font-weight: bold;
text-decoration: none;
color: white;
margin-top: 10vw;
}
img{
width: 25vw;
margin-bottom: 20vw;
}
.jump{
width: 40vw;
height: 10vw;
color: white;
background-color: darkgray;
border-radius: 5vw;
text-align: center;
line-height: 10vw;
font-weight: bold;
margin-bottom: 10vw;
}
.ts{
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
}
.ts_box{
width: 85vw;
height: 27vw;
position: absolute;
top: 20%;
left: 12%;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-evenly;
align-items: flex-start;
font-size: 5vw;
color: white;
font-weight: bold;
}
.ts_pic{
width: 32vw;
height: 40vw;
position: absolute;
top: 0%;
right: 0%;
background: url(/tsf/registered_arrow.png) no-repeat;
background-size: contain;
background-position: center;
}
a{
margin-top: 10vw;
text-decoration: none;
color: blue;
}
</style>
</head>
<body id="box_k">
<div class="big_box">
<div class="content_1">
<img src="http://tc.pcxbc.com/tsf/logo.png" alt="">
<!-- <div class="jump" onclick="jump()">打开微信小程序</div> -->
<div class="download" onclick="download()">下载</div>
<!-- <a href="javascript:;">已安装? 打开Reedaw&nbsp;></a> -->
</div>
</div>
<div class="ts" style="display: none;">
<div class="ts_box">
<div>1、点击右上角“ ··· ”</div>
<div>2、在菜单中选择“在浏览器中打开”</div>
</div>
<div class="ts_pic"></div>
</div>
</body>
</html>
<script>
var str_url = "{$url}";
function isWeixin() {
var ua = navigator.userAgent.toLowerCase();
return /micromessenger/i.test(ua);
}
function isIOS() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
return /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream;
}
function jump(){
window.location.href = 'weixin://dl/business/?appid=wx3e50e84030fe0d1e&path=pages/index/index';
}
$('.ts').on('click',function(){
$(this).hide()
})
function download(){
if (isWeixin()) {
console.log('当前在微信环境中');
$('.ts').show()
} else {
console.log('当前不在微信环境中');
if (isIOS()) {
console.log('当前是iOS设备');
// 在这里执行iOS设备下的特定代码
window.location.href = "https://apps.apple.com/app/reedaw/id6654906497";
} else {
console.log('当前不是iOS设备');
// 在这里执行非iOS设备下的代码
window.location.href = str_url;
}
}
}
</script>