feat(attendant): 展示实习/正式身份与实习只读提示
- 角色解析缓存陪诊师阶段与等级,实习仍可进入工作台 - 首页与个人中心展示身份文案,实习期给出不能接单的提示 - 申请页文案说明审核通过后为实习陪诊师、转正后可接单
This commit is contained in:
+9
-3
@@ -35,11 +35,12 @@ Page({
|
||||
recentOrders: [],
|
||||
role: '',
|
||||
isAdmin: false,
|
||||
isIntern: false,
|
||||
levelText: '',
|
||||
quickEntries: [],
|
||||
online: true,
|
||||
profile: {
|
||||
name: '',
|
||||
level: '初级陪诊师',
|
||||
avatar: ''
|
||||
},
|
||||
todayIncome: 0,
|
||||
@@ -84,11 +85,16 @@ Page({
|
||||
* 先解析角色再取数:管理员看全量,陪诊员只看本人订单
|
||||
*/
|
||||
init() {
|
||||
return role.ensureRole()
|
||||
.then(r => {
|
||||
return role.ensureRoleSafe()
|
||||
.then((detail) => {
|
||||
const r = detail.role
|
||||
const attendant = detail.attendant || null
|
||||
this.setData({
|
||||
role: r,
|
||||
isAdmin: r === 'admin',
|
||||
// 实习陪诊师可进工作台查看,但不能接单:首页给一条只读提示
|
||||
isIntern: !!(attendant && attendant.stage === 'intern'),
|
||||
levelText: r === 'admin' ? '管理员' : (attendant ? attendant.text : ''),
|
||||
quickEntries: r === 'admin' ? ADMIN_ENTRIES : (r === 'attendant' ? ATTENDANT_ENTRIES : [])
|
||||
})
|
||||
this.loadUser()
|
||||
|
||||
Reference in New Issue
Block a user