feat: 首页接单开关接入服务端落库

This commit is contained in:
lik
2026-11-10 15:13:53 +08:00
parent 5ae8a62475
commit 5fdcf8ea4c
4 changed files with 42 additions and 8 deletions
+7
View File
@@ -39,6 +39,7 @@ function normalizeAttendant(employee) {
grade,
star,
canAcceptOrder: stage === 'certified',
isOnline: info.isOnline === true,
text: stage === 'intern' ? '实习陪诊师' : `正式陪诊师 · ${gradeText}`
}
}
@@ -189,6 +190,11 @@ function getAttendantSync() {
return cachedAttendant
}
// 接单开关切换成功后同步快照,避免 onShow 复用旧值把开关弹回去
function setAttendantOnline(isOnline) {
if (cachedAttendant) cachedAttendant.isOnline = !!isOnline
}
/**
* 退出登录 / 清除缓存后重置,避免沿用上一个账号的角色
*/
@@ -242,6 +248,7 @@ module.exports = {
ensureRoleSafe,
getRoleSync,
getAttendantSync,
setAttendantOnline,
resetRole,
queryOrders,
guardAdminPage