-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (75 loc) · 2.29 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
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>app入口页面</title>
<link href="css/mui.min.css" rel="stylesheet" />
<style type="text/css">
body {
background-color: rgba(0, 0, 0, 0);
}
</style>
</head>
<body>
<script src="js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">
mui.init();
mui.plusReady(function() {
/**
* 获取本地存储中launchFlag的值
* http://www.html5plus.org/doc/zh_cn/storage.html#plus.storage.getItem
* 若存在,说明不是首次启动,直接进入首页;
* 若不存在,说明是首次启动,进入引导页;
*/
var launchFlag = plus.storage.getItem("launchFlag");
if(launchFlag) {
mui.openWindow({
url: "main.html",
id: "main",
show: {
autoShow: true, //页面loaded事件发生后自动显示,默认为true
aniShow: 'none', //页面显示动画,默认为”slide-in-right“;
duration: 0 //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
},
});
} else {
mui.openWindow({
url: "guidePage.html",
id: "guidePage",
show: {
autoShow: true, //页面loaded事件发生后自动显示,默认为true
aniShow: 'none', //页面显示动画,默认为”slide-in-right“;
duration: 0 //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
},
});
}
});
/**
* 重写mui.back(),一秒内连续点击两次,退出应用,仅安卓有效;
*/
var first = null;
mui.back = function() {
if(!first) {
first = new Date().getTime();
/**
* 自动消失提示信息
* http://www.html5plus.org/doc/zh_cn/nativeui.html#plus.nativeUI.toast
*/
plus.nativeUI.toast("再按一次退出应用");
setTimeout(function() {
first = null;
}, 1000);
} else {
if(new Date().getTime() - first < 1000) {
/**
* 退出应用,仅安卓有效;
* http://www.html5plus.org/doc/zh_cn/runtime.html#plus.runtime.quit
*/
plus.runtime.quit();
}
}
};
</script>
</body>
</html>