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.
 
 
 
 

32 lines
838 B

Component({
data: {
selected: 0,
color: "#7A7E83",
selectedColor: "#1070E8",
list: []
},
attached () {
let userRole = wx.getStorageSync('userRole');
// 0 表示普通用户 1表示管理员
console.log('userRole', userRole);
if (userRole && userRole.includes('管理')) {
this.setData({
list: getApp().globalData.managerList
})
} else {
this.setData({
list: getApp().globalData.inspecterList
})
}
},
methods: {
switchTab (e) {
const data = e.currentTarget.dataset
const url = data.path
// this.setData({
// selected: data.index
// })
wx.switchTab({ url })
}
}
})