feat(attendant): 展示实习/正式身份与实习只读提示
- 角色解析缓存陪诊师阶段与等级,实习仍可进入工作台 - 首页与个人中心展示身份文案,实习期给出不能接单的提示 - 申请页文案说明审核通过后为实习陪诊师、转正后可接单
This commit is contained in:
+20
-1
@@ -1,4 +1,6 @@
|
||||
// pages/me/index.js
|
||||
const role = require('../../utils/role.js')
|
||||
|
||||
// 性别映射
|
||||
const SEX_MAP = {
|
||||
male: '男',
|
||||
@@ -7,11 +9,28 @@ const SEX_MAP = {
|
||||
|
||||
Page({
|
||||
data: {
|
||||
user: {}
|
||||
user: {},
|
||||
identityText: ''
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadUser()
|
||||
this.loadIdentity()
|
||||
},
|
||||
|
||||
/**
|
||||
* 身份文案:管理员/实习陪诊师/正式陪诊师·等级
|
||||
*/
|
||||
loadIdentity() {
|
||||
role
|
||||
.ensureRoleSafe()
|
||||
.then((detail) => {
|
||||
const attendant = detail.attendant || null
|
||||
this.setData({
|
||||
identityText: detail.role === 'admin' ? '管理员' : (attendant ? attendant.text : '')
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
|
||||
<!-- 详细信息 -->
|
||||
<view class="info-card">
|
||||
<view class="info-item" wx:if="{{identityText}}">
|
||||
<view class="info-left">
|
||||
<t-icon name="award" size="36rpx" color="#C26A2E" />
|
||||
<text class="info-label">身份</text>
|
||||
</view>
|
||||
<text class="info-value">{{identityText}}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="info-left">
|
||||
<t-icon name="user" size="36rpx" color="#C26A2E" />
|
||||
|
||||
Reference in New Issue
Block a user