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