Tabbar4.vue
3.18 KB
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
<template>
<div id="tabbar">
<div class="tab" :class="active=='KQ'?'active':''" @click="handleKQ">
<img v-if="active=='KQ'" src="../assets/tabbar4/tab3_on.png" alt="">
<img v-else src="../assets/tabbar4/tab3_off.png" alt="">
<p>柯桥研学</p>
</div>
<div class="tab" :class="active=='yanxue'?'active':''" @click="handYanxue">
<img v-if="active=='yanxue'" src="../assets/tabbar4/tab2_on.png" alt="">
<img v-else src="../assets/tabbar4/tab2_off.png" alt="">
<p>每日一习</p>
</div>
<!-- <div class="tab" :class="active=='rank'?'active':''" @click="handleRank">
<img v-if="active=='rank'" src="../assets/rank/rank_on.png" alt="">
<img v-else src="../assets/rank/rank.png" alt="">
<p>排行榜</p>
</div> -->
<div class="tab" :class="active=='fruit'?'active':''" @click="handleFruit">
<img v-if="active=='fruit'" src="../assets/tabbar4/fruit_on.png" alt="">
<img v-else src="../assets/tabbar4/fruit_off.png" alt="">
<p>研学成果</p>
</div>
<div class="tab" :class="active=='center'?'active':''" @click="handleCenter">
<img v-if="active=='center'" src="../assets/tabbar4/tab4_on.png" alt="">
<img v-else src="../assets/tabbar4/tab4_off.png" alt="">
<p>我的</p>
</div>
</div>
</template>
<script>
export default {
name: 'Tabbar4',
props: {
active: String
},
methods: {
handYanxue () {
// this.$router.push({ name: 'ServiceKQ', query: { showTab: 'ZZY' },replace:true })
// this.$router.replace({ path:'/YanxuePage' })
// this.$router.replace({ path:'/stars' })
this.$router.replace({ path:'/dayStudy' })
},
handleKQ () {
// this.$router.push({ name: 'ServiceKQ', query: { showTab: 'KQ' },replace:true })
this.$router.replace({ path:'/' , query: { showTab: 'KQ' }})
},
handleCenter () {
this.$router.replace({ path:'/home' })
},
handleFruit() {
// this.$router.replace({ path:'/achievements' })
this.$router.replace({ path:'/achievementsOne' })
},
handleRank() {
this.$router.replace({ path:'/rank' })
}
}
}
</script>
<style lang="scss" scoped>
#tabbar {
position: fixed;
bottom: 0;
width: 100%;
height: 100px;
background: #fff;
display: flex;
justify-content: space-around;
padding-bottom: 40px;
z-index: 99;
.tab {
padding: 18px;
img {
width: 36px;
padding: 20px;
display: block;
margin: 0 auto;
}
.block {
width: 52px;
height: 52px;
}
p {
font-size: 20px;
color: #999999;
text-align: center;
}
&.active {
p {
color: red;
}
}
}
.center {
width: 92px;
height: 92px;
padding: 30px;
background: transparent;
position: absolute;
top: -60px;
left: 299px;
overflow: hidden;
z-index: 1;
.tip {
width: 92px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
}
}
}
</style>
<style lang="scss">
// 长辈版
.elder {
#tabbar {
.tab{
padding: 0;
img{
width: 44px;
}
p{
font-size: 34px;
}
}
}
}
</style>