forked from aOrz/Wordpress-Mobile-Application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nav_bar.html
109 lines (99 loc) · 2.89 KB
/
nav_bar.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>nav_bar</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="css/mui.min.css">
<style>
html,
body {
background-color: #efeff4;
}
nav {
height: 100%;
}
.tab-item {
display: table-cell;
overflow: hidden;
width: 1%;
height: 50px;
text-align: center;
vertical-align: middle;
white-space: nowrap;
text-overflow: ellipsis;
color: #929292;
}
.mui-bar-tab .tab-item.mui-active {
color: #33cccc;
}
.mui-bar-tab .tab-item .mui-icon {
top: 3px;
width: 24px;
height: 24px;
padding-top: 0;
padding-bottom: 0;
}
.mui-bar-tab .tab-item .mui-icon~.mui-tab-label {
font-size: 11px;
display: block;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<nav id="nav_bar" class="mui-bar mui-bar-tab">
<a v-for="(item,index) in items"
class="tab-item tab-item"
:class="item.catid == catid?'mui-active':''"
@click="getlist"
:data-catid="item.catid"
:data-name="item.name"
:data-id="item.catid">
<span class="mui-icon" :class="item.class"></span>
<span class="mui-tab-label">{{item.name}}</span>
</a>
</nav>
<script src="js/mui.min.js"></script>
<script type="text/javascript" src="js/vue.min.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript" charset="utf-8">
//mui初始化
mui.init();
var nav_bar = new Vue({
el: '#nav_bar',
data: {
items: app.nav_bar,
catid: app.nav_bar[0].catid
},
methods: {
getlist: function(event) {
dataset = event.target.dataset;
fatherDataset = event.target.parentNode.dataset;
var id = dataset.id || fatherDataset.id;
var name = dataset.name || fatherDataset.name;
var catid = dataset.catid || fatherDataset.catid;
var index = plus.webview.getLaunchWebview();
mui.fire(index, 'title', {
title_name: name
})
nav_bar.$data.catid = catid;
// console.log(id)
var list = plus.webview.getWebviewById('list.html');
mui.fire(list, 'reload', {
page: 1,
context: 'embed',
'filter[cat]': id,
});
}
}
});
window.addEventListener('updateCatid', function(event) {
nav_bar.$data.catid = event.detail.catid;
})
</script>
</body>
</html>