Tabbar.vue
2.26 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
<template>
<div id="tabbar">
<div class="tab" :class="active=='lecture'?'active':''" @click="handleLecture">
<img v-if="active=='lecture'" src="../assets/tabbar1/tab1_on.png" alt="">
<img v-else src="../assets/tabbar1/tab1_off.png" alt="">
<p>公益讲座</p>
</div>
<div class="center">
<img class="tip" src="../assets/tabbar1/tab2.png" alt="">
<wx-open-launch-weapp id="launch-btn" username="gh_c0f904a5ee0c" path="pages/index/index?type=zkedt">
<script type="text/wxtag-template">
<style>.mini_btn { width:500px;height:500px;background:transparent;border:0; }</style>
<button class="mini_btn"></button>
</script>
</wx-open-launch-weapp>
</div>
<div class="tab">
<div class="block"></div>
<p>志愿填报</p>
</div>
<div class="tab" :class="active=='center'?'active':''" @click="handleCenter">
<img v-if="active=='center'" src="../assets/tabbar1/tab3_on.png" alt="">
<img v-else src="../assets/tabbar1/tab3_off.png" alt="">
<p>个人中心</p>
</div>
</div>
</template>
<script>
export default {
name:'Tabbar',
props:{
active:String
},
mounted(){
console.log(this.active)
},
methods:{
// 点击讲座
handleLecture(){
this.$router.push({name:'Lecture'})
},
// 点击个人中心
handleCenter(){
this.$router.push({name:'Home'})
}
}
}
</script>
<style lang="scss">
#tabbar {
position: fixed;
bottom: 0;
width: 100%;
height: 100px;
background: #fff;
display: flex;
justify-content: space-around;
padding-bottom: 40px;
.tab {
padding: 18px;
img {
width: 52px;
display: block;
margin: 0 auto;
}
.block{
width: 52px;
height: 52px;
}
p {
font-size: 20px;
color: #999999;
text-align: center;
}
&.active{
p{
color: #5789FF;
}
}
}
.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>