-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
107 lines (89 loc) · 3.37 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
<!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" />
<script src="js/mui.min.js"></script>
<link href="css/mui.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="css/common.css"/>
<link rel="stylesheet" type="text/css" href="fonts/font_1/iconfont.css"/>
<script type="text/javascript">
if(window.localStorage){
var un = localStorage.getItem("username");
var pas = localStorage.getItem("password");
//alert(un+pas);
}else{alert("浏览不支持localStorage")}
</script>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title" >糖医</h1>
</header>
<div>
<nav id="bar" class="mui-bar mui-bar-tab iconfont" >
<a class="mui-tab-item mui-active" href="index_main.html" data-id="main">
<span class="mui-icon iconfont icon-zhuye" style="font-size: xx-large;width: 50%;">
<span class="mui-tab-label" id="mainta" ><h4>首页</h4></span>
</a>
<a class="mui-tab-item" href="sleep.html" data-id="sleep">
<span class="mui-icon iconfont icon-shuimian" style="font-size: xx-large;width: 50%;">
<span class="mui-tab-label" id="sleepta"><h4>睡眠</h4></span>
</a>
<a class="mui-tab-item" href="blood_main.html" data-id="blood">
<span class="mui-icon iconfont icon-iconxt" style="font-size: xx-large;width: 50%;">
<span class="mui-tab-label" id="bloodta"><h4 >血糖</h4></span>
</a>
<a class="mui-tab-item" href="mine.html" data-id="mine">
<span class="mui-icon iconfont icon-wode" style="font-size: xx-large;width: 50%;">
<span class="mui-tab-label" id="mineta"><h4>我的</h4></span>
</a>
</nav>
</div>
<script>
mui.init();
mui.plusReady(function() {
var self = plus.webview.currentWebview();
var current = '';
var styles = {
top: '60px',
bottom: '85px'
};
var tabsConfig = {
main: {
url: 'index_main.html',
styles: styles,
default: true
},
sleep: {
url: 'sleep.html',
styles: styles
},
blood: {
url: 'blood_main.html',
styles: styles
},
mine: {
url: 'mine.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) {
return;
}
tabs[this.dataset.id].show();
tabs[current].hide();
current = this.dataset.id;
});
});
</script>
</body>
</html>