添加管理员逻辑
This commit is contained in:
@@ -195,9 +195,10 @@ Page({
|
||||
},
|
||||
|
||||
// 获取员工状态对应的图标
|
||||
getStaffStatusIcon(_status: string): string {
|
||||
// 统一使用trucks.png作为货运人员图标
|
||||
return '/images/trucks.png';
|
||||
getStaffStatusIcon(staff: any): string {
|
||||
// 根据员工角色返回不同的图标
|
||||
const userRole = staff?.role || 'employee';
|
||||
return userRole === 'ADMIN' ? '/images/crown.png' : '/images/truck.png';
|
||||
},
|
||||
|
||||
// 获取状态文本
|
||||
@@ -569,5 +570,17 @@ Page({
|
||||
const minute = date.getMinutes();
|
||||
return `${month}月${day}日 ${hour}:${minute < 10 ? '0' + minute : minute}`;
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
// 尝试使用navigateBack,如果失败则使用redirectTo返回首页
|
||||
wx.navigateBack({
|
||||
fail: () => {
|
||||
wx.redirectTo({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user