feat(admin): 新增陪诊员入驻申请与全局角色守卫

- 新增 pages/apply 入驻申请页:填写资料、上传证件、查看审核状态
- 新增 utils/role.js 统一角色解析与管理端页面守卫
- app.js 包装 Page 构造器集中做 onShow 守卫,无身份用户重定向至申请页
- 订单、客户、档案、统计等按角色区分能力:陪诊员不请求档案接口,改用订单快照
- 订单列表支持待取消订单一键同意取消;新增订单价格由服务目录决定只读展示
This commit is contained in:
lik
2026-11-08 12:01:48 +08:00
parent bfe820aa31
commit c8bcc79865
27 changed files with 1332 additions and 206 deletions
+205
View File
@@ -0,0 +1,205 @@
<!--pages/apply/index.wxml-->
<view class="apply-page">
<view class="loading-box" wx:if="{{loading}}">
<text class="loading-text">加载中…</text>
</view>
<!-- 待审核 -->
<block wx:elif="{{view === 'pending'}}">
<view class="hero">
<view class="hero-badge">待审核</view>
<text class="hero-title">申请已提交</text>
<text class="hero-desc">审核通过后重新进入小程序即可接单。期间无需重复提交。</text>
</view>
<view class="card">
<view class="row">
<text class="row-label">申请人</text>
<text class="row-value">{{application.applicant.name}}</text>
</view>
<view class="row">
<text class="row-label">手机号</text>
<text class="row-value">{{application.applicant.mobile}}</text>
</view>
<view class="row">
<text class="row-label">服务城市</text>
<text class="row-value">{{serviceAreaText}}</text>
</view>
<view class="row">
<text class="row-label">提交时间</text>
<text class="row-value">{{submitTimeText}}</text>
</view>
</view>
<view class="foot-note">当前微信账号:{{accountName}}</view>
</block>
<!-- 审核已通过但角色还没刷新(多为瞬时接口异常) -->
<block wx:elif="{{view === 'approved'}}">
<view class="hero">
<view class="hero-badge hero-badge-ok">已通过</view>
<text class="hero-title">审核已通过</text>
<text class="hero-desc">权限正在同步,点击下方按钮重新进入。</text>
</view>
<button class="submit-btn" bindtap="onRetry">重新进入</button>
<view class="foot-note">当前微信账号:{{accountName}}</view>
</block>
<!-- 填写申请表 -->
<block wx:else>
<view class="hero">
<text class="hero-title">成为陪诊师</text>
<text class="hero-desc">提交资料并通过审核后,即可查看订单、接单并使用 AI 办公。</text>
</view>
<view class="reject-box" wx:if="{{rejectReason}}">
<text class="reject-title">上次申请未通过</text>
<text class="reject-text">原因:{{rejectReason}}</text>
<text class="reject-hint">修改后可重新提交,已上传的证件照无需重复上传。</text>
</view>
<view class="card">
<text class="card-title">基本信息</text>
<view class="field">
<text class="field-label">姓名</text>
<input
class="field-input"
value="{{form.name}}"
data-key="name"
maxlength="20"
placeholder="请输入真实姓名"
bindinput="onInput"
/>
</view>
<view class="field">
<text class="field-label">手机号</text>
<input
class="field-input"
type="number"
value="{{form.mobile}}"
data-key="mobile"
maxlength="11"
placeholder="用于审核联系"
bindinput="onInput"
/>
</view>
<view class="field">
<text class="field-label">身份证号</text>
<input
class="field-input"
value="{{form.idNumber}}"
data-key="idNumber"
maxlength="18"
placeholder="18 位身份证号"
bindinput="onInput"
/>
</view>
<view class="field">
<text class="field-label">性别</text>
<picker
class="field-picker"
mode="selector"
range="{{sexLabels}}"
value="{{sexIndex}}"
bindchange="onSexChange"
>
<view class="field-value {{form.sex ? '' : 'placeholder'}}">
{{form.sex ? sexLabels[sexIndex] : '请选择性别'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">服务城市</text>
<input
class="field-input"
value="{{form.serviceAreas}}"
data-key="serviceAreas"
placeholder="多个城市用逗号分隔"
bindinput="onInput"
/>
</view>
<view class="field field-block">
<text class="field-label">个人简介</text>
<textarea
class="field-textarea"
value="{{form.introduction}}"
data-key="introduction"
maxlength="200"
placeholder="介绍一下你的陪诊经验、擅长科室等"
bindinput="onInput"
/>
</view>
</view>
<view class="card">
<text class="card-title">证件材料</text>
<view class="upload-row">
<view class="upload-tile" data-field="qualification" bindtap="pickImage">
<image
wx:if="{{photos.qualification}}"
class="upload-img"
src="{{photos.qualification}}"
mode="aspectFill"
/>
<view wx:else class="upload-empty">
<text class="upload-plus">+</text>
</view>
</view>
<view class="upload-meta">
<text class="upload-name">资质证书照片</text>
<text class="upload-tip">{{photos.qualification ? '已选择,点击可重新上传' : 'JPG / PNG,单张不超过 3MB'}}</text>
</view>
</view>
<view class="upload-row">
<view class="upload-tile" data-field="healthCertificate" bindtap="pickImage">
<image
wx:if="{{photos.healthCertificate}}"
class="upload-img"
src="{{photos.healthCertificate}}"
mode="aspectFill"
/>
<view wx:else class="upload-empty">
<text class="upload-plus">+</text>
</view>
</view>
<view class="upload-meta">
<text class="upload-name">健康证明照片</text>
<text class="upload-tip">{{photos.healthCertificate ? '已选择,点击可重新上传' : 'JPG / PNG,单张不超过 3MB'}}</text>
</view>
</view>
<view class="field">
<text class="field-label">健康证有效期</text>
<picker
class="field-picker"
mode="date"
value="{{healthExpireDate}}"
start="{{today}}"
bindchange="onExpireChange"
>
<view class="field-value {{healthExpireDate ? '' : 'placeholder'}}">
{{healthExpireDate || '请选择到期日期'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
</view>
<button class="submit-btn" loading="{{submitting}}" disabled="{{submitting}}" bindtap="submit">
提交申请
</button>
<view class="foot-note">
当前微信账号:{{accountName}}。如需更换账号,请在微信中切换后重新打开小程序。
</view>
</block>
</view>