You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
const app = getApp()
|
|
Component({
|
|
data: {
|
|
selected: 0,
|
|
color: "#7A7E83",
|
|
selectedColor: "#3cc51f",
|
|
"list": [
|
|
{
|
|
"pagePath": "/pages/home/home",
|
|
"text": "",
|
|
"iconPath": "/images/main/icon01.png",
|
|
"selectedIconPath": "/images/main/icon01-a.png"
|
|
},
|
|
{
|
|
"pagePath": "/pages/message/message",
|
|
"text": "消息",
|
|
"iconPath": "/images/main/icon02.png",
|
|
"selectedIconPath": "/images/main/icon02-a.png"
|
|
},
|
|
|
|
{
|
|
"pagePath": "/pages/my/my",
|
|
"text": "我的",
|
|
"iconPath": "/images/main/icon03.png",
|
|
"selectedIconPath": "/images/main/icon03-a.png"
|
|
}
|
|
]
|
|
},
|
|
attached() {
|
|
},
|
|
ready: function() {
|
|
this.setData({
|
|
selected: app.globalData.selected
|
|
})
|
|
},
|
|
methods: {
|
|
switchTab(e) {
|
|
// console.log(e);
|
|
const data = e.currentTarget.dataset;
|
|
const url = data.path;
|
|
app.globalData.selected = data.index;
|
|
wx.switchTab({url})
|
|
}
|
|
}
|
|
})
|