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
| <!--
| * @name:
| * @version: 1.1.1
| * @Author: 刘大可
| * @Date: 2022-03-24 19:35:23
| * @LastEditors: 刘大可
| * @LastEditTime: 2022-03-24 19:37:00
| -->
|
| <template>
| <view class="footer row">
| <view v-for="(item,index) in tabBar" :key="index">
| <view class="item col" :class="flg==index?'cur':''" @click="go(item)">
| <image
| class="icon"
|
| :src="flg==index?item.selectedIconPath:item.iconPath"
| mode="scaleToFill"
| />
| {{item.text}}
| </view>
| </view>
| </view>
| </template>
| <script>
| export default {
| data() {
| return {
| tabBar:[
| {
| pagePath:"/manage/manage/index/index",
| text:"首页",
| iconPath:"/static/icon/tabBar/icon1.png",
| selectedIconPath:"/static/icon/tabBar/icon1_active.png"
| },
| {
| pagePath:"/pages/msg/msg",
| text:"消息",
| iconPath:"/static/icon/tabBar/icon3.png",
| selectedIconPath:"/static/icon/tabBar/icon3_active.png"
| },
| {
| pagePath:"/pages/userCenter/index",
| text:"我的",
| iconPath:"/static/icon/tabBar/icon4.png",
| selectedIconPath:"/static/icon/tabBar/icon4_active.png"
| }
| ]
| }
| },
| props:{
| flg:{
| type:String,
| }
| },
| created() {
| wx.hideTabBar({
| animation:true
| })
| },
| methods: {
| go(item){
| uni.reLaunch({ url: item.pagePath })
| // uni.switchTab({ url: item.pagePath })
| }
| }
| }
| </script>
| <style lang="scss">
| @import "./main.scss";
| </style>
|
|