2025-08-29 09:51:02 +08:00
|
|
|
Component({
|
|
|
|
|
data: {
|
|
|
|
|
selected: 0,
|
|
|
|
|
color: '#999',
|
|
|
|
|
selectedColor: '#0082FA',
|
|
|
|
|
list: [
|
|
|
|
|
{
|
|
|
|
|
pagePath: 'pages/index/index',
|
|
|
|
|
text: '首页',
|
|
|
|
|
iconPath: '/static/tabbar/home_icon.png',
|
|
|
|
|
selectedIconPath: '/static/tabbar/home_active.png'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
pagePath: 'pages/ai/index',
|
|
|
|
|
text: '智能管家',
|
|
|
|
|
iconPath: '/static/tabbar/news_icon.png',
|
|
|
|
|
selectedIconPath: '/static/tabbar/news_active.png'
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-10-29 13:53:05 +08:00
|
|
|
pagePath: 'pages/me/index',
|
|
|
|
|
text: '我的',
|
2025-08-29 09:51:02 +08:00
|
|
|
iconPath: '/static/tabbar/news_icon.png',
|
|
|
|
|
selectedIconPath: '/static/tabbar/news_active.png'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
attached() {},
|
|
|
|
|
methods: {
|
|
|
|
|
switchTab(e) {
|
|
|
|
|
const data = e.currentTarget.dataset
|
|
|
|
|
const url = data.path
|
|
|
|
|
console.log(data, 'data')
|
|
|
|
|
wx.switchTab({
|
|
|
|
|
url: `/${url}`
|
|
|
|
|
})
|
|
|
|
|
this.setData({
|
|
|
|
|
selected: data.index
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|