index.js
1.14 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
Component({
data: {
selected: 1,
color: "#7A7E83",
selectedColor: "#0077FF",
list: [{
pagePath: "/pages/tabbar/board",
iconPath: "/images/tab-home.png",
selectedIconPath: "/images/tab-home-active.png",
text: "看板",
customClass: ''
}, {
pagePath: "/pages/tabbar/index",
iconPath: "/images/tab-findcar.png",
selectedIconPath: "/images/tab-findcar-active.png",
text: "找车",
customClass: 'custom_select_bar',
isSpecial: true
}, {
pagePath: "/pages/tabbar/my",
iconPath: "/images/tab-mine.png",
selectedIconPath: "/images/tab-mine-active.png",
text: "我的",
customClass: ''
}]
},
attached() {},
methods: {
switchTab(e) {
console.log(e)
const data = e.currentTarget.dataset
const url = data.path
this.setData({
selected: data.index
})
wx.switchTab({
url: url
})
}
}
})