tanghaolin
2022-08-31 244c4241427b9f3316f06f1e0ae2ee571edc1a23
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
<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <link href="static/css/skin.css" rel="stylesheet">
    <title>
        <%= htmlWebpackPlugin.options.title %>
    </title>
    <script src="static/config/globalConfig.js?v=20220304"></script>
    <script src="static/config/pageConfig.js?v=20220304"></script>
    <script src="static/config/SeriesApplication.js?v=20220304"></script>
    <script src="static/config/pointToleranceConfig.js?v=20220304"></script>
    <script type="text/javascript">
            //首页返回键处理
            // 处理逻辑: 1s内,连续两次按返回键,则退出应用;
        if (window.globalConfig.SoftType == 45) {
            var first = null;
            document.addEventListener('plusready', function() {
                var first = null;
                plus.key.addEventListener('backbutton', function() {
                    if (sessionStorage.getItem("quit") == 1) {
                        // 首次按键, 提示 再按一次退出应用
                        if (!first) {
                            first = new Date().getTime(); //记录第一次按下回退键的时间
                            let isBack = confirm("是否退出应用?")
                            if (isBack) {
                                plus.runtime.quit();
                                setTimeout(function() {
                                    //1s 后清除
                                    first = null;
                                }, 1000);
                            } else {
                                setTimeout(function() {
                                    //1s 后清除
                                    first = null;
                                }, 1000);
                                return;
                            }
                        } else {
                            if (new Date().getTime() - first < 1000) {
                                //如果两次按下的时间小于1s
                                plus.runtime.quit(); //那么就退出app
                            }
                        }
                    } else {
                        history.go(-1); // 回退到上一页
                    }
 
                });
            })
        }
    </script>
</head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>