-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
105 lines (105 loc) · 2.59 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="./css/api.css" />
<style type="text/css">
</style>
</head>
<body></body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
apiready = function() {
var welcomeShowed = $api.getStorage('welcomeShowed');
var isLogin = $api.getStorage('isLogin');
if (welcomeShowed) {
if (isLogin == 1) {
api.openWin({
name : 'main',
url : './html/main/main.html',
bounces : false,
slidBackEnabled : false,
pageParam : {
key : ''
},
animation : {
type : 'none'
}
});
} else {
api.openWin({
name : 'login',
url : './html/login.html',
bounces : false,
slidBackEnabled : false,
pageParam : {
key : ''
},
animation : {
type : 'none'
}
});
}
} else {
api.openFrameGroup({
name : 'welcomeFrames',
scrollEnabled : true,
rect : {
x : 0,
y : 0,
w : 'auto',
h : 'auto'
},
index : 0,
frames : [{
name : 'welcome_frame_1',
url : './html/welcome_frame_1.html',
bgColor : './image/welcome/guide1.png',
bounces : false,
vScrollBarEnabled : false,
hScrollBarEnabled : false
}, {
name : 'welcome_frame_2',
url : './html/welcome_frame_2.html',
bgColor : './image/welcome/guide2.png',
bounces : false,
vScrollBarEnabled : false,
hScrollBarEnabled : false
}, {
name : 'welcome_frame_3',
url : './html/welcome_frame_3.html',
bgColor : './image/welcome/guide3.png',
bounces : false,
vScrollBarEnabled : false,
hScrollBarEnabled : false
}, {
name : 'welcome_frame_4',
url : './html/welcome_frame_4.html',
bgColor : './image/welcome/guide4.png',
bounces : false,
vScrollBarEnabled : false,
hScrollBarEnabled : false
}]
}, function(ret, err) {
var name = ret.name;
var index = ret.index;
});
$api.setStorage('welcomeShowed', '1');
}
};
function fnSetPushListener() {
var push = api.require('push');
push.setListener(function(ret, err) {
if (ret.data) {
fnSaveMessagesToDB(ret.data);
api.sendEvent({
name : 'onMessage'
});
}
});
};
</script>
</html>