forked from zanguixuan/bws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
320 lines (314 loc) · 8.85 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!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>面包工作室</title>
<link rel="stylesheet" type="text/css" href="./css/aui.css" />
<style>
#aui-header {
display: block;
}
/*可切换的头部*/
.custom-headers {
display: none;
height: 45px;
}
.custom-headers.active {
display: block;
}
/*可点击,切换的头部*/
.header-btn-group {
margin: 0 auto;
font-size: 0;
width: 190px;
height: 26px;
position: relative;
top: 3px;
text-align: center;
}
.header-btn-group .header-btn {
display: inline-block;
height: 30px;
width: 90px;
font-size: 12px;
text-align: center;
line-height: 28px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #FFFFFF;
border-left: none;
}
.header-btn-group .header-btn.active, .header-btn-group .header-btn.tap-active, .header-btn-group .header-btn:active {
background-color: #FFFFFF;
color: #1abc9c;
box-shadow: inset 1px 1px 1px rgba(238, 238, 238, 0.6);
}
.header-btn-group .header-btn:first-child {
border-left: 1px solid #FFFFFF;
border-top-left-radius: 999px;
border-bottom-left-radius: 999px;
}
.header-btn-group .header-btn:last-child {
border-right: 1px solid #FFFFFF;
border-top-right-radius: 999px;
border-bottom-right-radius: 999px;
}
</style>
</head>
<body>
<header class="aui-bar aui-bar-nav aui-bar-dark" id="aui-header">
<div class="custom-headers active">
<div class="header-btn-group">
<span class="header-btn active " tapmode="tap-active" onclick="changeHeaderBtns(0, 0);">我的动态</span>
<span class="header-btn" tapmode="tap-active" onclick="changeHeaderBtns(1, 0);">好友动态</span>
</div>
</div>
<div class="custom-headers">
<a class="aui-btn aui-bar-dark aui-pull-right" id="back" tapmode="tap-active" onclick="openAddContact();"> <span class="aui-iconfont aui-icon-roundadd"></span> </a>
<div class="header-btn-group">
<span class="header-btn active" tapmode="tap-active" onclick="changeHeaderBtns(0, 1);">联系人列表</span>
<span class="header-btn" tapmode="tap-active" onclick="changeHeaderBtns(1, 1);">群组列表</span>
</div>
</div>
<div class="custom-headers">
<div class="header-btn-group">
<span class="header-btn active" tapmode="tap-active" onclick="changeHeaderBtns(0, 2);">好友群组消息</span>
<span class="header-btn" tapmode="tap-active" onclick="changeHeaderBtns(1, 2);">系统消息</span>
</div>
</div>
<div class="custom-headers">
<a class="aui-btn aui-bar-dark aui-pull-left" id="back" tapmode="tap-active" onclick="myInfoBack();"> <span class="aui-iconfont aui-icon-left"></span> </a>
<div class="aui-title">
会员中心
</div>
<a class="aui-iconfont aui-icon-sitting aui-pull-right"></a>
</div>
</header>
<footer class="aui-nav" id="aui-footer">
<ul class="aui-bar-tab">
<li class="active-success" id="tabbar1" onclick="randomSwitchBtn(0)">
<span class="aui-iconfont aui-icon-favor"></span>
<p>
动态
</p>
</li>
<li id="tabbar2" onclick="randomSwitchBtn(1)">
<span class="aui-iconfont aui-icon-mark"></span>
<p>
联系人
</p>
</li>
<li id="tabbar3" onclick="randomSwitchBtn(2)">
<span class="aui-iconfont aui-icon-like"></span>
<p>
消息
</p>
</li>
<li id="tabbar4" onclick="randomSwitchBtn(3)">
<span class="aui-iconfont aui-icon-my"></span>
<p>
个人
</p>
</li>
</ul>
</footer>
</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript" src="./script/common.js"></script>
<script type="text/javascript" src="./script/mycommon.js"></script>
<script type="text/javascript" src="./script/rong_index_init.js"></script>
<script type="text/javascript" src="./script/winu-base.js"></script>
<script type="text/javascript">
var header = $api.dom('#aui-header');
var rect = {};
/*rong全局*/
var rong;
apiready = function() {
//创建本地数据库 file
CreateDB('file');
//创建本地数据库 friends
setTimeout("CreateDB('friends')",200);
//本地数据库初始化完毕
$api.fixStatusBar(header);
$api.addHeaderColor(header);
var headerPos = $api.offset(header);
var body_h = $api.offset($api.dom('body')).h;
var footer_h = $api.offset($api.byId('aui-footer')).h;
rect = {
x : 0,
y : headerPos.h,
w : 'auto',
h : api.winHeight - headerPos.h - footer_h
};
api.addEventListener({
name: 'login_success'
}, function(){
apiready();
});
if ($api.getStorage('lastUser')) {//getStorage('lastUser')
// 有,继续
goPageLogin();
} else {
goPageLogin();
// 登录注册
return;
}
// 各页面未初始化之时↑
randomSwitchBtn(0);
/**
*========================极光推送==============>>>
*/
var ajpush = api.require('ajpush');
api.addEventListener({
name : 'appintent'
}, function(ret, err) {
if (ret && ret.appParam.ajpush) {
var jpush = ret.appParam.ajpush;
var jsonStr = JSON.parse(jpush.extra);
var type = jsonStr.type;
var id = jsonStr.txt;
api.openWin({
name : 'name',
url : 'html/user/setingPage.html',
opaque : true,
vScrollBarEnabled : false,
pageParam : {
yw_id : id
}
});
}
});
//两个监听事件
var ajpush = api.require('ajpush');
api.addEventListener({
name : 'pause'
}, function(ret, err) {
ajpush.onResume();
//监听应用进入后台,通知jpush暂停事件
});
api.addEventListener({
name : 'resume'
}, function(ret, err) {
ajpush.onResume();
//监听应用恢复到前台,通知jpush恢复事件
});
var ajpush = api.require('ajpush');
ajpush.init(function(ret) {
if (ret && ret.status) {
}
});
//给机子设置别名
var user = $api.getStorage('user');
var param = {
alias : user
};
ajpush.bindAliasAndTags(param, function(ret) {
//alert('别名设置成功');
});
/**
* ==========极光推送结束=====================>>>>>
*/
};
// 添加联系人按钮
function openAddContact() {
api.openFrame({
name : 'frm_add_menu',
url : './html/contact/frm_add_menu.html',
bounces : false,
rect : {
x : 0,
y : 0,
w : 'auto',
h : 'auto'
}
});
};
function goPageLogin() {
api.openWin({
name : 'win_login',
url : './html/user/win_login.html',
bounces : false
});
};
function setGroupIndex(index) {
};
var headerInner = $api.domAll(header, '.custom-headers');
var headerTitle = $api.dom('#header-title');
var footer = $api.byId('aui-footer');
var footerBar = $api.domAll(footer, 'li');
function changeHeader(index) {
var headerActive = $api.domAll(header, '.custom-headers.active');
for (var i = 0; i < headerActive.length; i++) {
$api.removeCls(headerActive[i], 'active');
}
$api.addCls(headerInner[index], 'active');
};
var frames = {
0 : 'frm_my_latest',
4 : 'frm_all_latest',
1 : 'frm_contact',
5 : 'frm_contact_group',
2 : 'frm_msg_list',
6 : 'frm_sys_msg_list',
3 : 'frm_my_info'
};
function changeHeaderBtns(index, groupIndex) {
var thisBtns = $api.domAll(headerInner[groupIndex], '.header-btn');
var thisActive = $api.dom(headerInner[groupIndex], '.header-btn.active');
$api.removeCls(thisActive, 'active');
$api.addCls(thisBtns[index], 'active');
if (index == 0 && groupIndex == 0) {
randomSwitchBtn(0);
}
if (index == 1 && groupIndex == 0) {
randomSwitchBtn(4);
}
if (index == 0 && groupIndex == 1) {
randomSwitchBtn(1);
}
if (index == 1 && groupIndex == 1) {
randomSwitchBtn(5);
}
if (index == 0 && groupIndex == 2) {
randomSwitchBtn(2);
}
if (index == 1 && groupIndex == 2) {
randomSwitchBtn(6);
}
};
var lastPageIndex = 0;
function randomSwitchBtn(index) {
api.openFrame({
name : frames[index],
url : './html/index_group/' + frames[index] + '.html',
bounces : true,
bgColor : 'rgba(255,255,255,1)',
rect : rect
});
var footerActive = $api.domAll(footer, '.active-success');
for (var i = 0; i < footerActive.length; i++) {
$api.removeCls(footerActive[i], 'active-success');
}
if (index == 4) {
index = 0
}
if (index == 5) {
index = 1
}
if (index == 6) {
index = 2
}
if (index != 3) {
lastPageIndex = index;
}
$api.addCls(footerBar[index], 'active-success');
changeHeader(index);
}
//返回之前打开页面
function myInfoBack() {
randomSwitchBtn(lastPageIndex);
}
</script>
</html>