error.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>服务器异常</title>
  7. <script type="text/javascript" src="./js/webView.js"></script>
  8. <script type="text/javascript">
  9. // H5 plus事件处理
  10. var ws = null;
  11. function plusReady() {
  12. // Android处理返回键
  13. plus.key.addEventListener('backbutton', function() {
  14. (history.length == 1) && ws.close();
  15. var c = setTimeout(function() {
  16. ws.close();
  17. }, 1000);
  18. window.onbeforeunload = function() {
  19. clearTimeout(c);
  20. }
  21. history.go(-2);
  22. }, false);
  23. ws = plus.webview.currentWebview();
  24. }
  25. if (window.plus) {
  26. plusReady();
  27. } else {
  28. document.addEventListener('plusready', plusReady, false);
  29. }
  30. document.addEventListener('touchstart', function() {
  31. return false;
  32. }, true);
  33. // 禁止选择
  34. document.oncontextmenu = function() {
  35. return false;
  36. };
  37. </script>
  38. <style>
  39. html,
  40. body {
  41. padding: 0;
  42. margin: 0;
  43. width: 100%;
  44. height: 100%;
  45. }
  46. .main {
  47. height: 100%;
  48. width: 100%;
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. line-height: 80px;
  53. flex-direction: column;
  54. }
  55. .text {
  56. font-size: 14px;
  57. color: #999999;
  58. }
  59. img {
  60. width: 150px;
  61. height: 130px;
  62. }
  63. button {
  64. border: 1px solid #1ABC9C;
  65. border-radius: 2px;
  66. background-color: #FFFFFF;
  67. color: #1ABC9C;
  68. width: 100px;
  69. height: 30px;
  70. margin-bottom: 30px;
  71. outline: none;
  72. }
  73. .go-index {
  74. margin-top: 20px;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div class="main">
  80. <div class="text">服务器异常</div>
  81. <button onclick="if(history.length == 1){ws.close();}else{ws.back();ws.back();}">点击刷新</button>
  82. <button onclick="ws.close()">点击关闭</button>
  83. <button onclick="plus.runtime.restart()">点击重启</button>
  84. </div>
  85. </div>
  86. </body>
  87. </html>