-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
135 lines (133 loc) · 4.43 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
<!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></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<script type="text/javascript" charset="utf-8">
mui.init();
</script>
<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
<!--<script type="text/javascript">
function login(){
$.ajax({
type:"get",
url:"http://192.168.1.102:8080/beijiao/app/confirm_session",
async:true,
data:{},
dataType:"json",
xhrFields: {
withCredentials: true
},
success:function(data){
if(data.user=="confirm_session_fail"){
//alert(data.user);
window.location.href="login.html";
}else{
window.location.href="tab-message.html?data="+data.user;
}
},
error:function(data,status,e){
alert(e)
}
});
}
function login1(){
$.ajax({
type:"get",
url:"http://192.168.1.102:8080/beijiao/app/confirm_session",
async:true,
data:{},
dataType:"json",
xhrFields: {
withCredentials: true
},
success:function(data){
if(data.user=="confirm_session_fail"){
//alert(data.user);
window.location.href="login.html";
}else{
window.location.href="tab-personal-login.html?data="+data.user;
}
},
error:function(data,status,e){
alert(e)
}
});
}
</script>-->
</head>
<body>
<div class="mui-content">
<nav id="bar" class="mui-bar mui-bar-tab">
<a class="mui-tab-item mui-active" href="tab-main.html" data-id="main">
<span class="mui-icon mui-icon-home"></span>
<span class="mui-tab-label">首页</span>
</a>
<a class="mui-tab-item" href="tab-classification.html" data-id="classification">
<span class="mui-icon mui-icon-more"></span>
<span class="mui-tab-label">分类浏览</span>
</a>
<a id="message" class="mui-tab-item" href="javascript:void(0)" onclick="login()" data-id="message">
<span class="mui-icon mui-icon-chatboxes"></span>
<span id="message_number" class="mui-badge mui-badge-primary">12</span>
<span class="mui-tab-label">消息</span>
</a>
<a class="mui-tab-item" href="javascript:void(0)" onclick="login1()"" data-id="personal">
<span class="mui-icon mui-icon-person"></span>
<span class="mui-tab-label">个人</span>
</a>
</nav>
</div>
<script src="js/mui.min.js"></script>
<script>
mui.init();
mui.plusReady(function() {
var self = plus.webview.currentWebview();
var current = '';
var styles = {
top: '0',
bottom: '51px'
};
var tabsConfig = {
main: {
url: 'tab-main.html',
styles: styles,
default: true
},
classification: {
url: 'tab-classification.html',
styles: styles
},
message: {
url: 'tab-message.html',
styles: styles,
},
personal: {
url: 'tab-personal-login.html',
styles: styles
}
};
var tabs = {};
for (id in tabsConfig) {
tabs[id] = plus.webview.create(tabsConfig[id].url, id, tabsConfig[id].styles);
if (tabsConfig[id]['default']) {
self.append(tabs[id]);
current = id;
}
}
mui('#bar').on('tap', 'a', function(e) {
if (current == this.dataset.id) {
mui.fire(tabs[current], 'scroll2top');
return;
}
tabs[this.dataset.id].show();
tabs[current].hide();
current = this.dataset.id;
});
});
</script>
</body>
</html>