index.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. </head>
  22. <body>
  23. <noscript>
  24. <strong>
  25. We're sorry but
  26. <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to
  27. continue.
  28. </strong>
  29. </noscript>
  30. <div id="z-loading-1" style="display: block;position: fixed;left:0px;top:0px;bottom:0px;right:0px;width: 100%;height: 100%;background: rgb(255, 255, 255, 0.9);z-index: 999;">
  31. <div style="position: absolute;top: 40%;left: 40%">
  32. <img src="xxd_loading.gif" id="loading-gif" />
  33. </div>
  34. <div class="index-load" id="index-load" style="display:block;position: absolute;bottom: 10px;right: 10px;"></div>
  35. </div>
  36. <script>
  37. var indexSetInval;
  38. var indexStartNum = 1;
  39. indexSetInval = setInterval(function() {
  40. indexStartNum++;
  41. var str = '加载中' + ((indexStartNum % 2 == 0) ? '…' : '……');
  42. document.getElementById('index-load').innerHTML = str;
  43. }, 1000)
  44. </script>
  45. <div id="app"></div>
  46. <script>
  47. window.onload = function() {
  48. clearInterval(indexSetInval);
  49. var end_time = (new Date()).getTime();
  50. var loading_time = end_time - start_time;
  51. console.log(((loading_time) / 1000).toString() + '秒');
  52. if (loading_time < 2000) {
  53. setTimeout(function() {
  54. removeLoading();
  55. }, 2000 - (loading_time));
  56. } else {
  57. removeLoading()
  58. }
  59. }
  60. function removeLoading() {
  61. if (document.getElementById('z-loading-1').style.display != 'none') {
  62. var loading = document.getElementById('z-loading-1');
  63. }
  64. document.body.removeChild(loading);
  65. }
  66. </script>
  67. <script type="text/javascript">
  68. (function() {
  69. if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
  70. handleFontSize();
  71. } else {
  72. if (document.addEventListener) {
  73. document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
  74. } else if (document.attachEvent) {
  75. document.attachEvent("WeixinJSBridgeReady", handleFontSize);
  76. document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
  77. }
  78. }
  79. function handleFontSize() {
  80. /*设置网页字体为默认大小*/
  81. WeixinJSBridge.invoke('setFontSizeCallback', {
  82. 'fontSize': 0
  83. });
  84. /*重写设置网页字体大小的事件*/
  85. WeixinJSBridge.on('menu:setfont', function() {
  86. WeixinJSBridge.invoke('setFontSizeCallback', {
  87. 'fontSize': 0
  88. });
  89. });
  90. }
  91. })();
  92. </script>
  93. </body>
  94. </html>