index.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=0">
  7. <title>跳转</title>
  8. <link rel="stylesheet" href="./css/animate.min.css">
  9. <script>
  10. function resizeFontsize() {
  11. var width = document.documentElement.clientWidth;
  12. document.documentElement.style.fontSize = width / 3.75 + 'px';
  13. }
  14. resizeFontsize();
  15. window.addEventListener('orientationchange', resizeFontsize);
  16. window.addEventListener('resize', resizeFontsize);
  17. </script>
  18. <style>
  19. .zIndex {
  20. display: none;
  21. position: absolute;
  22. top: 0;
  23. left: 0;
  24. width: 100%;
  25. z-index: 999;
  26. /* height: 100%; */
  27. height: 100vh;
  28. background-color: rgba(0, 0, 0, .8);
  29. }
  30. .word {
  31. font-size: 16px;
  32. text-align: center;
  33. margin: .7rem auto 0;
  34. color: aliceblue;
  35. }
  36. .arrow {
  37. width: .85rem;
  38. height: .55rem;
  39. position: absolute;
  40. top: .3rem;
  41. right: 0.3rem;
  42. }
  43. .arrow img {
  44. width: 100%;
  45. height: 100%;
  46. display: block;
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <div class="jump" style="font-size: 16px;text-align: left;">正在跳转中,请稍后。。。(如未跳转请手动点击)</div>
  52. <div class='zIndex'>
  53. <div class="arrow">
  54. <!-- <div class="arrow animated fadeInUp infinite delay-5s"> -->
  55. <img src='./image/arrow.png' />
  56. </div>
  57. <div class="word">
  58. 在浏览器中打开
  59. </div>
  60. </div>
  61. <script src="js/jquery-2.1.0.min.js"></script>
  62. </body>
  63. </html>
  64. <script language="javascript">
  65. var id = getUrlParam("id");
  66. var page = getUrlParam("page");
  67. var time = new Date().getTime();
  68. if (isWeiXin()) {
  69. $('.zIndex').show()
  70. } else {
  71. init();
  72. }
  73. function init() {
  74. if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
  75. var loadDateTime = new Date();
  76. window.setTimeout(function() {
  77. var timeOutDateTime = new Date();
  78. if (timeOutDateTime - loadDateTime < 5000) {
  79. window.location.href = "https://dtgj.edtyun.com/h5/download.html";
  80. } else {
  81. window.close();
  82. }
  83. },
  84. 25);
  85. window.location.href = `tytylift://dtgj.edtyun.com?page=${page}&id=${id}`;
  86. // var ifr = document.createElement("iframe");
  87. // ifr.src = `tytylift://lift.whlhcx.com?page=${page}&id=${id}`;
  88. // ifr.style.display = "none";
  89. // document.body.appendChild(ifr);
  90. // window.setTimeout(function () {
  91. // document.body.removeChild(ifr);
  92. // window.location.href = `http://lift.whlhcx.com/h5/download.html?${time}`;
  93. // }, 2000)
  94. } else if (navigator.userAgent.match(/android/i)) {
  95. // var state = null;
  96. // try {
  97. // state = window.location.href = `tytylift://lift.whlhcx.com?page=${page}&id=${id}`;
  98. // // state = window.open(`tytylift://lift.whlhcx.com?page=${page}&id=${id}`, '_blank');
  99. // } catch(e) {}
  100. // if (state) {
  101. // window.close();
  102. // } else {
  103. // window.location.href = `http://lift.whlhcx.com/h5/download.html?${time}`;
  104. // }
  105. window.location.href = `tytylift://dtgj.edtyun.com?page=${page}&id=${id}`;
  106. window.setTimeout(function () {
  107. window.location.href = `http://dtgj.edtyun.com/h5/download.html?${time}`;
  108. }, 2000);
  109. // var loadDateTime = new Date();
  110. // window.setTimeout(function() {
  111. // var timeOutDateTime = new Date();
  112. // if (timeOutDateTime - loadDateTime < 5000) {
  113. // window.location.href = "http://lift.whlhcx.com/h5/download.html";
  114. // } else {
  115. // window.close();
  116. // }
  117. // },
  118. // 25);
  119. // window.location.href = `tytylift://lift.whlhcx.com?page=${page}&id=${id}`;
  120. }
  121. }
  122. function getUrlParam(name) {
  123. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  124. // var r = "http://lift.whlhcx.com/h5/index?id=132456&pass=iii&page=productDetail".split("?")[1].match(reg); //匹配目标参数
  125. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  126. // var r = window.location.herf.split("?")[1].match(reg); //匹配目标参数
  127. if (r != null) {
  128. return unescape(r[2]);
  129. }
  130. return null; //返回参数值
  131. }
  132. //判断是否是微信浏览器
  133. function isWeiXin() {
  134. //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
  135. var ua = window.navigator.userAgent.toLowerCase();
  136. console.log(ua)
  137. //通过正则表达式匹配ua中是否含有MicroMessenger字符串
  138. if (ua.match(/MicroMessenger/i) == 'micromessenger') {
  139. return true;
  140. } else {
  141. return false;
  142. }
  143. }
  144. $(".jump").click(function () {
  145. if (isWeiXin()) {
  146. $('.zIndex').show()
  147. } else {
  148. init();
  149. }
  150. });
  151. </script>