epmet 工作端 小程序
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.
 

50 lines
1.2 KiB

const app = getApp()
Component({
data: {
selected: 0,
color: "#999",
selectedColor: "#3A80E7",
"list": [
{
"pagePath": "/pages/index/index",
"text": "消息",
"iconPath": "/images/home/message.png",
"selectedIconPath": "/images/home/messageSelected.png"
},
{
"pagePath": "/pages/work/work",
"text": "工作",
"iconPath": "/images/home/work.png",
"selectedIconPath": "/images/home/workSelected.png"
},
{
"pagePath": "/pages/statistics/statistics",
"text": "统计",
"iconPath": "/images/home/information.png",
"selectedIconPath": "/images/home/informationSelected.png"
},
{
"pagePath": "/pages/mine/mine",
"text": "我的",
"iconPath": "/images/home/mine.png",
"selectedIconPath": "/images/home/mineSelected.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})
}
}
})