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
+6 -1
View File
@@ -1,5 +1,6 @@
// pages/customer/index.js
const API = require('../../utils/api.js')
const role = require('../../utils/role.js')
// 性别映射
const SEX_MAP = {
@@ -32,11 +33,15 @@ Page({
},
onLoad(options) {
this.loadCustomerList();
// 客户管理仅管理员可用
role.guardAdminPage().then(ok => {
if (ok) this.loadCustomerList()
})
},
onShow() {
// 页面显示时如果已有数据则刷新
if (role.getRoleSync() !== 'admin') return
if (this.data.customerList.length > 0) {
this.refreshData();
}