123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=0">
- <title>跳转</title>
- <link rel="stylesheet" href="./css/animate.min.css">
- <script>
- function resizeFontsize() {
- var width = document.documentElement.clientWidth;
- document.documentElement.style.fontSize = width / 3.75 + 'px';
- }
- resizeFontsize();
- window.addEventListener('orientationchange', resizeFontsize);
- window.addEventListener('resize', resizeFontsize);
- </script>
- <style>
- .zIndex {
- display: none;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 999;
- /* height: 100%; */
- height: 100vh;
- background-color: rgba(0, 0, 0, .8);
- }
- .word {
- font-size: 16px;
- text-align: center;
- margin: .7rem auto 0;
- color: aliceblue;
- }
- .arrow {
- width: .85rem;
- height: .55rem;
- position: absolute;
- top: .3rem;
- right: 0.3rem;
- }
- .arrow img {
- width: 100%;
- height: 100%;
- display: block;
- }
- </style>
- </head>
- <body>
- <div class="jump" style="font-size: 16px;text-align: left;">正在跳转中,请稍后。。。(如未跳转请手动点击)</div>
- <div class='zIndex'>
- <div class="arrow">
- <!-- <div class="arrow animated fadeInUp infinite delay-5s"> -->
- <img src='./image/arrow.png' />
- </div>
- <div class="word">
- 在浏览器中打开
- </div>
- </div>
- <script src="js/jquery-2.1.0.min.js"></script>
- </body>
- </html>
- <script language="javascript">
- var id = getUrlParam("id");
- var page = getUrlParam("page");
- var time = new Date().getTime();
- if (isWeiXin()) {
- $('.zIndex').show()
- } else {
- init();
- }
- function init() {
- if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
- var loadDateTime = new Date();
- window.setTimeout(function() {
- var timeOutDateTime = new Date();
- if (timeOutDateTime - loadDateTime < 5000) {
- window.location.href = "https://dtgj.edtyun.com/h5/download.html";
- } else {
- window.close();
- }
- },
- 25);
- window.location.href = `tytylift://dtgj.edtyun.com?page=${page}&id=${id}`;
- // var ifr = document.createElement("iframe");
- // ifr.src = `tytylift://lift.whlhcx.com?page=${page}&id=${id}`;
- // ifr.style.display = "none";
- // document.body.appendChild(ifr);
- // window.setTimeout(function () {
- // document.body.removeChild(ifr);
- // window.location.href = `http://lift.whlhcx.com/h5/download.html?${time}`;
- // }, 2000)
- } else if (navigator.userAgent.match(/android/i)) {
- // var state = null;
- // try {
- // state = window.location.href = `tytylift://lift.whlhcx.com?page=${page}&id=${id}`;
- // // state = window.open(`tytylift://lift.whlhcx.com?page=${page}&id=${id}`, '_blank');
- // } catch(e) {}
- // if (state) {
- // window.close();
- // } else {
- // window.location.href = `http://lift.whlhcx.com/h5/download.html?${time}`;
- // }
- window.location.href = `tytylift://dtgj.edtyun.com?page=${page}&id=${id}`;
- window.setTimeout(function () {
- window.location.href = `http://dtgj.edtyun.com/h5/download.html?${time}`;
- }, 2000);
- // var loadDateTime = new Date();
- // window.setTimeout(function() {
- // var timeOutDateTime = new Date();
- // if (timeOutDateTime - loadDateTime < 5000) {
- // window.location.href = "http://lift.whlhcx.com/h5/download.html";
- // } else {
- // window.close();
- // }
- // },
- // 25);
- // window.location.href = `tytylift://lift.whlhcx.com?page=${page}&id=${id}`;
- }
- }
- function getUrlParam(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- // var r = "http://lift.whlhcx.com/h5/index?id=132456&pass=iii&page=productDetail".split("?")[1].match(reg); //匹配目标参数
- var r = window.location.search.substr(1).match(reg); //匹配目标参数
- // var r = window.location.herf.split("?")[1].match(reg); //匹配目标参数
- if (r != null) {
- return unescape(r[2]);
- }
-
-
- return null; //返回参数值
- }
- //判断是否是微信浏览器
- function isWeiXin() {
- //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
- var ua = window.navigator.userAgent.toLowerCase();
- console.log(ua)
- //通过正则表达式匹配ua中是否含有MicroMessenger字符串
- if (ua.match(/MicroMessenger/i) == 'micromessenger') {
- return true;
- } else {
- return false;
- }
- }
- $(".jump").click(function () {
-
- if (isWeiXin()) {
- $('.zIndex').show()
- } else {
- init();
- }
- });
- </script>
|