/
index.html
74 lines (68 loc) · 2.1 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta data-hid="description" name="description" content="蓝桥杯">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="justyeh@163.com">
<meta name="apple-mobile-web-app-title" content="蓝桥杯">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#04acf7">
<meta name="screen-orientation" content="portrait">
<meta name="x5-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="browsermode" content="application">
<meta name="x5-page-mode" content="app">
<meta name="theme-color" content="#04acf7">
<title>蓝桥杯</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
<script>
var ws = null;
if (window.plus) {
plusReady();
} else {
document.addEventListener("plusready", plusReady, false);
}
function plusReady() {
plus.key.addEventListener("backbutton", function () {
ws = plus.webview.currentWebview();
ws.canBack(function (event) {
if (event.canBack) {
var fullPath = window.app.$route.fullPath
if(fullPath == '/home' || fullPath == '/'){
back();
return;
}
ws.back();
} else {
back();
}
});
});
}
var first = null;
var back = function () {
if (!first) {
first = (new Date()).getTime();
plus.nativeUI.toast('再按一次退出应用');
setTimeout(function () {
first = null;
}, 2000);
} else {
if ((new Date()).getTime() - first < 2000) {
ws.close()
plus.runtime.quit();
}
}
}
</script>
</body>
</html>