-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
141 lines (132 loc) · 3.23 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html>
<html>
<head>
<title>Module Develop</title>
<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"/>
<style type="text/css">
html, body {
height: 100%
}
body {
background-color: #fff;
margin: 0;
}
#wrap {
height: 100%;
position: relative;
}
#header {
padding-top: 20px;
background-color: #5082c2;
height: 44px;
position: relative;
}
#header h1 {
font-size: 20px;
height: 44px;
line-height: 44px;
margin: 0em;
color: #fff;
margin-left: 100px;
margin-right: 100px;
text-align: center;
}
#main {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
}
a.button {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 32px;
margin: 8px;
background-color: rgba(240,240,240,1.0);
border-color: rgba(220,220,220,1.0);
border-width: 2px;
border-style: solid;
}
a.active {
background-color: rgba(240,240,240,0.7);
}
</style>
</head>
<body>
<div id="wrap">
<header id="header">
<h1 id="title">模块开发</h1>
</header>
</div>
</body>
<script>
var fullChange = false;
function apiready() {
api.parseTapmode();
api.openFrame({
name : 'main',
url : 'html/main.html',
// url : 'html/ExifInterfaceModule.html',
bounces : true,
rect : {
x : 0,
y : 57,
w : 'auto',
h : 'auto'
}
});
api.addEventListener({
name:'noticeclicked'
},function(ret,err){
alert("noticeclicked>>>"+JSON.stringify(ret.value));
});
var aliPush = api.require('aliPush');
if(aliPush){
aliPush.addEventListener({
name : 'onMessage'
}, function(ret, err) {
api.toast({msg:"onMessage>>>addEventListener>>>>" + JSON.stringify(ret)});
});
aliPush.addEventListener({
name : 'onNotification'
}, function(ret, err) {
api.toast({msg:"onNotification>>>addEventListener>>>>" + JSON.stringify(ret)});
});
aliPush.addEventListener({
name : 'onNotificationOpened'
}, function(ret, err) {
api.toast({msg:"onNotificationOpened>>>addEventListener>>>>" + JSON.stringify(ret)});
});
aliPush.addEventListener({
name : 'onNotificationRemoved'
}, function(ret, err) {
api.toast({msg:"onNotificationRemoved>>>addEventListener>>>>" + JSON.stringify(ret)});
});
}
var demo = api.require('vpnModule');
api.addEventListener({
name:'appintent'
},function(ret,err){
alert(JSON.stringify(ret));
if(demo){
if(api.systemType == 'ios'){
demo.getUserInfo({
json: ret.iosUrl
},function(ret,err){
alert(JSON.stringify(ret));
});
} else {
demo.getUserInfo({
sourceAppId : ret.sourceAppId,
json:ret.ret.appParam.json
},function(ret,err){
alert(JSON.stringify(ret));
});
}
}
});
}
</script>
</html>