添加管理员逻辑

This commit is contained in:
2025-10-19 23:38:54 +08:00
parent 118ec38550
commit 5ee4e077fb
46 changed files with 5263 additions and 883 deletions

View File

@@ -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'
});
}
});
}
});