index.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <script>
  5. //加载开始时间
  6. var start_time = (new Date()).getTime();
  7. var route_path = window.location.href.split("#")[1].replace(/\?.*/, '')
  8. </script>
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge,IE=IE9">
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  13. <meta name="apple-mobile-web-app-capable" content="yes">
  14. <meta name="apple-touch-fullscreen" content="yes">
  15. <meta name="aformat-detection" content="telephone=no,email=no">
  16. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover">
  17. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  18. <title>
  19. <%= htmlWebpackPlugin.options.title %>
  20. </title>
  21. <style>
  22. body{-webkit-text-size-adjust: 100% !important;}
  23. #z-loading-2 .index-title{
  24. padding:60% 0 0;
  25. text-align: center;
  26. font-size: 30px;
  27. color: #666;
  28. }
  29. #z-loading-2 .index-xxd{
  30. color:#666;
  31. text-align: center;
  32. font-size: 15px;
  33. margin-top: 15px;
  34. }
  35. #z-loading-2 .index-load{
  36. text-align: center;
  37. color:#666;
  38. /* border-radius: 50%; */
  39. font-size: 12px;
  40. position: absolute;
  41. bottom: 30px;
  42. right: 30px;
  43. /* width: 20px;
  44. height: 20px;
  45. background: #ddd; */
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <noscript>
  51. <strong>
  52. We're sorry but
  53. <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to
  54. continue.
  55. </strong>
  56. </noscript>
  57. <div id="z-loading-2" style="display: block;position:fixed;left:0px;top:0px;bottom:0px;right:0px;z-index: 999;background-color: #fff;">
  58. <div style="width:100%;text-align: center;height: 100%;">
  59. <img src="./start.webp?v=20200930" style="width: 100%;height: 100%;" id="qdt" />
  60. <div class="index-load" id="index-load" style="display:block"></div>
  61. </div>
  62. </div>
  63. <script>
  64. var indexSetInval;
  65. var indexStartNum = 1;
  66. indexSetInval = setInterval(function() {
  67. indexStartNum++;
  68. var str = '加载中' + ((indexStartNum % 2 == 0) ? '…' : '……');
  69. document.getElementById('index-load').innerHTML = str;
  70. }, 1000)
  71. </script>
  72. <div id="app"></div>
  73. <script>
  74. window.onload = function() {
  75. clearInterval(indexSetInval);
  76. var end_time = (new Date()).getTime();
  77. var loading_time = end_time - start_time;
  78. console.log(((loading_time) / 1000).toString() + '秒');
  79. if (loading_time < 2000) {
  80. setTimeout(function() {
  81. removeLoading();
  82. }, 2000 - (loading_time));
  83. } else {
  84. removeLoading()
  85. }
  86. }
  87. function removeLoading() {
  88. if (document.getElementById('z-loading-2').style.display != 'none') {
  89. var loading = document.getElementById('z-loading-2');
  90. }
  91. document.body.removeChild(loading);
  92. }
  93. </script>
  94. <script type="text/javascript">
  95. (function() {
  96. if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
  97. handleFontSize();
  98. } else {
  99. if (document.addEventListener) {
  100. document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
  101. } else if (document.attachEvent) {
  102. document.attachEvent("WeixinJSBridgeReady", handleFontSize);
  103. document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
  104. }
  105. }
  106. function handleFontSize() {
  107. /*设置网页字体为默认大小*/
  108. WeixinJSBridge.invoke('setFontSizeCallback', {
  109. 'fontSize': 0
  110. });
  111. /*重写设置网页字体大小的事件*/
  112. WeixinJSBridge.on('menu:setfont', function() {
  113. WeixinJSBridge.invoke('setFontSizeCallback', {
  114. 'fontSize': 0
  115. });
  116. });
  117. }
  118. })();
  119. </script>
  120. </body>
  121. </html>