Merge pull request 'sit.0.1.5' (#102) from dev into sit
自动发布测试环境 Nacos 配置 / publish (push) Successful in 23s

Reviewed-on: #102
This commit was merged in pull request #102.
This commit is contained in:
2026-11-07 01:13:11 +08:00
404 changed files with 112288 additions and 557 deletions
+49
View File
@@ -0,0 +1,49 @@
---
name: jayu-api
description: JayuCloud 接口与权限规则:Gateway 路由前缀(/api、/api/admin、/internal)、白名单与 JWT 门禁、小程序与管理端基址差异、脱敏与授权取数出口、接口变更检查清单。用于新增/修改后端接口或前后端联调契约时;通用 API 设计方法用全局 $api-design
---
# JayuCloud 接口规则
本项目接口变更最常见的事故是**路由前缀与门禁错配**(管理接口暴露、小程序被误拦)。新增或修改接口必须按本技能核对。
## 路由与门禁基线
| 前缀 | 用途 | 门禁 |
|------|------|------|
| `/api/**` | 业务接口(小程序与前端业务路由) | Gateway JWT 初筛 + 白名单 |
| `/api/admin/**` | 管理端接口 | 管理员门禁(Core 按 URL 前缀判断) |
| `/internal/**` | 服务间内部接口 | 仅限内部调用,禁止暴露到公网路由 |
关键事实:
- Salon Core 的管理员门禁按 `/admin/**` URL 前缀判断:**小程序绝不能复用 `/api/admin` 基址**,否则店长/员工业务会被误拒;小程序用 `/api` 业务路由,需要时由 Core 提供非 `/admin` 路由别名。
- 给小程序提供别名时不得整控制器映射:只映射实际需要的端点(例如对象存储只映射上传端点,不映射列表/更新/删除)。
- 生产小程序请求走 `https://yunail.art/api/admin`(管理师小程序)与 `/api`(用户端);本地开发用 `utils/config.local.js`(不入 Git)。
- 匿名白名单:逐个端点枚举,禁止 `/wechat-mini/**` 这类宽泛前缀——后续新增认证端点会被静默暴露。白名单需同时核对服务拦截器与 Gateway 各份配置。
## 新增接口检查清单
1. 确定归属端与前缀(对照上表);拿不准时先看同域现有接口。
2. 认证与授权:匿名还是登录?管理端权限码?数据属主(门店作用域)校验写在 Service 层。
3. 请求/响应:统一 `Result<T>` 包装;参数校验注解;错误语义与现有错误码一致。
4. 隐私字段:默认脱敏返回;需要明文时走独立授权端点(一次一取,按门店/订单上下文授权),并记录审计。
5. 幂等与并发:写接口明确重复提交语义;金额/配额操作原子化。
6. 前端/小程序同步:`src/api/` 或 `api/` 封装、免登录路径、请求基址是否需要同步修改。
7. Gateway 白名单与路由是否需要同步(Nacos `gateway.yaml`)。
8. 涉及 SQL 时转 $jayu-database;涉及配置时转 $jayu-release。
## 联调约定
- 前端开发代理:`/admin/api` 与 `/api` → `VITE_DEV_PROXY_TARGET`(vite.config.ts)。
- 小程序:`utils/request.js` 统一封装;401 处理全局唯一,清会话要彻底(含 `wx.uploadFile` 路径)。
- 大数 ID:雪花 ID 传前端按字符串处理,避免 `JSON.parse` 精度丢失。
## 安全边界
- 不新增绕过门禁的「临时匿名接口」;确有需要必须逐个列出理由并提示安全评审。
- 不在接口返回中携带密钥、内部堆栈、完整隐私字段。
## 验收标准
- 清单 8 项逐一给出结论(含「不涉及」);前缀与门禁选择有依据;联调端同步修改已列出。
+59
View File
@@ -0,0 +1,59 @@
---
name: jayu-database
description: JayuCloud 数据库与迁移纪律:Flyway 版本文件规则(中文命名、已执行不可改、向前兼容补偿)、空库初始化基线、实体与迁移同步清单、MySQL 已知坑。用于新增/修改表结构、字段、索引或写 SQL 时;通用数据库设计方法用全局 $database-design
---
# JayuCloud 数据库纪律
本项目数据库变更是高危操作:DEV/SIT/PROD 由 Core 启动时 Flyway 自动执行,**没有人工补救窗口**。任何结构改动必须按本技能执行。
## 硬性规则(不可违反)
1. 结构变更只走 Flyway 版本文件:
- Salon:`JC-Salon-Core/src/main/resources/db/migration/V{n}__中文功能说明_YYYYMMDD.sql`
- ArtList:`JC-ArtList-Core/src/main/resources/db/migration/` 同规则
- 版本号取当前目录最大版本号 +1;文件名中文体现功能与日期;内容必须完整可执行。
2. 已在任一环境执行过的迁移文件**不得修改或删除**;撤销/修正必须新增向前兼容的补偿迁移。禁止 Flyway `clean`、自动 baseline、重跑初始化 SQL。
3. 空库初始化仅用 `docs/scripts/sql/init/jayucloud-salon.sql` / `jayucloud-artlist.sql`(0.0.1 基线);只有负责人明确要求重整基线时才把变更合并进初始化 SQL。
4. 生产已部署库升级不直接执行初始化 SQL,必须单独制定迁移方案。
5. Gitea 工作流不得直连数据库或绕过 Flyway;合并 SIT 前先在 DEV 验证迁移。
## 工作流程
### 1. 设计
- 先读现有表结构(初始化 SQL + 已有版本文件)与对应实体,遵循既有命名/主键/字符集约定。
- 字段类型注意:金额用 DECIMAL;时间遵循现有约定;枚举落库策略与现有一致。
- 索引从实际查询出发;唯一约束必须显式建唯一索引。
### 2. 实体与迁移同步清单(逐项核对)
- [ ] 实体类字段与 SQL 列一一对应(`@TableName`/`@TableField`)。
- [ ] 新 Mapper 包已加入 `MyBatisPlusConfig` 的 `@MapperScan` 清单(编译过≠启动过)。
- [ ] 自动填充逻辑合并进现有 `MetaObjectHandler`(只接受单例)。
- [ ] 所有插入入口都覆盖新字段(静态搜索该实体的全部保存入口)。
- [ ] 存量数据需要回填时,在同一版本文件或后续版本中写幂等回填。
- [ ] 历史迁移中不得夹带本次之外的变更。
### 3. 已知坑(写 SQL 前对照)
- 排序规则冲突:`utf8mb4_0900_ai_ci` 与旧列 `utf8mb4_unicode_ci` 混用会报 1267;跨 collation 比较显式 `CONVERT(... USING utf8mb4) COLLATE utf8mb4_unicode_ci`。
- MySQL 迁移失败不回滚已执行 DDL:可重试迁移要先检查字段/索引是否已存在(幂等)。
- `flyway repair` 只清失败历史记录,不回滚结构;独立调用 repair 必须显式设置完整 `locations`,否则可能误删历史。
- 整理/合并初始化 SQL 时检查脚本尾部 DROP 语句,别把运行必需表删掉。
- 雪花 ID:MyBatis-Plus `ASSIGN_ID` 在应用层分配,表定义可能仍是 `AUTO_INCREMENT`,判断主键策略要三处核对(注解/生成策略/SQL)。
- 无斜杠的 `test/` gitignore 规则会忽略任意层级的 test 目录,新增测试文件用 `git check-ignore -v` 确认。
### 4. 验证与交付
- 能在临时库执行就实际执行验证;不能执行时记录阻塞原因。
- 任务说明中写明:新增的版本文件路径、影响的表、是否需要回填、DEV 验证结果。
## 安全边界
- 不对任何真实环境数据库直接执行 DDL/DML;执行由 Core 启动的 Flyway 完成。
- 不在 SQL 中写入真实客户数据;种子数据只保留运行必需项(平台管理员 `xiaowang`、权限、协议、系统参数等)。
## 验收标准
- 版本文件命名与位置合规、可独立执行;实体与列一致;清单全部勾选;任务记录包含验证结论。
+54
View File
@@ -0,0 +1,54 @@
---
name: jayu-devflow
description: JayuCloud 开发与验证流程:各模块构建命令(Maven/npm/node 语法检查)、启动烟测要求、提交前检查(GitNexus detect_changes、中文提交)、常见陷阱清单。用于在本仓库写代码、构建、测试、提交时;TDD 方法论用全局 $test-driven-development,调试方法用 $systematic-debugging
---
# JayuCloud 开发流程
## 构建与验证命令(按改动范围选择)
| 改动范围 | 验证命令 | 说明 |
|----------|----------|------|
| Salon 后端 | `mvn -f JC-Salon-Core/pom.xml -DskipTests compile`(测试:`... test`) | 非聚合工程,必须 `-f` 指定模块;本机 Maven:`D:\software\apache-maven-3.9.12\bin\mvn.cmd` |
| ArtList 后端 | `mvn -f JC-ArtList-Core/pom.xml -DskipTests compile` | 同上 |
| Gateway | `mvn -f JC-Salon-Gateway/pom.xml -DskipTests compile`(ArtList 同理) | |
| 前端 | `JC-Salon-Frontend` / `JC-ArtList-Frontend` 下 `npm run build` | 开发 `npm run dev` |
| 小程序 | `node --check <改动文件>` 语法检查 | 有条件时微信开发者工具冒烟 |
| SQL | 临时库执行或记录阻塞原因 | 见 $jayu-database |
**升级规则**:涉及 Bean 装配、事务、拦截器、`@MapperScan`、自动填充的改动,编译通过后必须做一次 Core 启动烟测——编译通过不等于能启动。
## 开发节奏
1. 动手前:`git status` 确认工作区;有他人未提交改动时先按项目规则处理(中文回溯提交)。
2. 修改符号前:GitNexus impact 分析(AGENTS.md 文首规则);业务域不熟时先读 $jayu-domain。
3. 实施:遵循模块分层与命名约定;接口改动走 $jayu-api 清单;SQL 改动走 $jayu-database。
4. 验证:按上表执行对应命令;测试遵循红绿纪律,Mock 参数全字面量或全 matcher。
5. 提交前:GitNexus `detect_changes`(失败时记录原因,用 `git diff` + 测试结果兜底);只暂存本任务文件。
6. 提交:中文提交信息;任务记录写明新增/调整的版本化文件(SQL/配置说明)。
## 提交与分支纪律
- 每次任务完成后整理相关改动创建 git 提交,提交信息必须中文。
- 只暂存和提交本次任务涉及的文件,保留其他并行改动。
- 注意 `.gitignore` 陷阱:无斜杠的 `test/` 会忽略任意层级 test 目录,新增测试用 `git check-ignore -v` 确认,必要时 `git add -f`。
## 常见陷阱(改前对照,详见 references/pitfalls.md)
1. 编译过 ≠ 启动过(扫描清单、Bean 冲突在启动期暴露)。
2. 事务自调用失效;事务内远程调用不可回滚。
3. 多构造器时注入构造器要显式 `@Autowired`(Spring Boot 2.x)。
4. 共享基类字段(软删除等)并非所有实体都有,查询前先核对继承链。
5. 配置覆盖链:`secret.yaml`/环境变量可能覆盖 `infra.yaml` 与本地文件。
6. 旧 class 残留:移除组件后 clean 构建再验证。
7. 雪花 ID 传 JS 前端的精度问题(字符串传输)。
8. 小程序 401 清会话不彻底导致反复跳登录。
## 安全边界
- 不在本地验证中连接生产数据库/生产 Nacos;本地联调用 dev 环境或本机中间件。
- 验证失败如实报告,不以「应该没问题」代替证据(全局 $verification-before-completion 约束同样适用)。
## 验收标准
- 对应范围的验证命令已实际执行且输出通过;提交信息中文、范围干净;任务记录含版本化文件清单。
@@ -0,0 +1,43 @@
# JayuCloud 常见陷阱清单
来源:历史任务教训沉淀(全局 error-memory 与本项目复盘),仅保留与本项目技术栈相关的通用条目。
## Spring / MyBatis-Plus
- `MyBatisPlusConfig` 使用显式 `@MapperScan` 包清单:新增 `@Mapper` 模块包必须同步加入,否则编译通过但启动缺 Bean。
- MyBatis Mapper statement ID = namespace + 方法名(无参数类型):同一 Mapper 不能重载同名 SQL 方法,否则一条注解映射被忽略。
- MyBatis-Plus 自动填充只接受单个 `MetaObjectHandler`:新增填充逻辑合并进同一处理器;移除旧组件后 clean 构建,防止旧 class 被扫描。
- MyBatis lambda 查询共享基类字段(如 `isDelete`)前,确认具体实体继承链上确实有该字段。
- Spring Bean 多构造器时,注入构造器显式 `@Autowired`;用一次真实容器启动烟测确认。
- Mockito 验证不混用字面量与 `any()`,参数要么全字面量要么全 matcher。
- 事务:自调用不走代理;事务内不做远程调用/发消息等不可回滚操作。
## 配置与环境
- Nacos 配置写入成功后集群读回可能短暂落后:发布/回退都要做有限重试 + 内容摘要校验,失败要 fail closed。
- 排查配置问题不能只看单一文件:后加载的 `secret.yaml`、systemd `EnvironmentFile`、环境变量都可能覆盖。
- 本地 `application.yaml`/`bootstrap.yaml` 只放 Nacos 引导参数,运行配置改 Nacos 并同步 `nacos/` 仓库副本与说明文档。
## 前端 / 小程序
- 小程序不要复用 `/api/admin` 基址(管理门禁按前缀误拒业务);别名只映射需要的端点。
- 雪花 `Long` ID 经 `JSON.parse` 丢精度:前端回传按字符串保留,补回归测试。
- 上传到私有对象存储后不要直接拿响应 `fileUrl` 做预览:可能是私有桶/内网地址;先用本地临时路径预览,以服务端文件 ID 提交。
- 对象存储 URL 解析必须按环境配置处理 MinIO 内网端点、公共端点与 `oss://` 引用;签名失败不得把私有地址原样返回。
- 401 处理:清会话要覆盖 `wx.request` 与 `wx.uploadFile` 全部路径,防重状态保持到新登录成功,避免残留旧登录态反复跳登录。
- 提供 HTML demo 做参照时,实现前完整检查其 HTML/CSS/交互脚本再映射组件,不能只按截图复刻。
## 数据库 / 迁移
- 新增必需业务字段:静态搜索实体所有插入入口逐一补齐 + 幂等回填存量空值。
- 排序规则冲突(`utf8mb4_0900_ai_ci` vs `utf8mb4_unicode_ci`):跨 collation 比较显式 `CONVERT ... COLLATE`。
- MySQL 迁移失败不回滚已执行 DDL:可重试迁移先查字段/索引是否已存在。
- 独立调用 Flyway `repair` 必须显式完整 `locations`,执行后立即检查 `flyway_schema_history`。
- 整理初始化 SQL 时核对尾部 DROP 与实体表清单,防止误删运行必需表。
- 注册/申请类「取最新记录」查询:按创建时间排序后还要按雪花 ID 倒序,避免同秒提交取旧。
## 工具链
- 本机 `node`/`mvn` 可能不在 PATH:Node 在 `D:\software\nodejs`(PowerShell 用 `npm.cmd`/`npx.cmd`),Maven 在 `D:\software\apache-maven-3.9.12\bin\mvn.cmd`。
- GitNexus 特定版本在本机分析可能失败,优先用项目 `.gitnexus/run.cjs analyze --index-only` 或可用版本。
- GitNexus 对 Vue/Java 同名局部符号可能跨语言误关联:critical 风险提示先核对实际引用与构建结果再决策。
+42
View File
@@ -0,0 +1,42 @@
---
name: jayu-domain
description: JayuCloud 项目领域知识:Salon 店务与 ArtList 设计师两条产品线的模块地图、核心业务流程(预约/排班/订单/注册审核/协议/拨号/内容审核)、角色权限模型。用于理解或修改本项目业务功能前;通用需求分析方法用全局 $requirements-analysis
---
# JayuCloud 领域知识
JayuCloud 是双产品线仓库:**Salon(店务/指尖管理师)** 与 **ArtList(指尖设计师)**。修改业务代码前先读本技能与 [references/module-map.md](references/module-map.md),确认改动落在哪个业务域、影响哪些端。
## 产品线速览
| 产品线 | 服务对象 | 端 | 后端 |
|--------|----------|----|------|
| Salon | 美甲门店(平台管理员/店长/美甲师) | 管理端 Vue + 指尖管理师小程序 | JC-Salon-Core / JC-Salon-Gateway |
| ArtList | C 端用户 + 平台运营 | 用户端/管理端 Vue + 用户小程序 | JC-ArtList-Core / JC-ArtList-Gateway |
## 核心业务流程(改前必查上下游)
1. **预约与排班(Salon)**:门店每周营业排班 → 美甲师可约时段 → 客户预约(散客支持拨号联系)→ 订单履约。改动排班/预约时核对 `planning`、`order`、`shop` 三域。
2. **订单与收款**:下单 → 状态流转 → 收款(线上/线下收款登记)→ 完成。订单完成强制校验收款状态;补单创建即 PAID。
3. **注册与审核**:门店/美甲师注册申请 → 店长审核模式 → 门店经营有效期;驳回重申保留历史版本并新建申请。
4. **内容审核与协议**:对外内容审核(图片/作品)、协议版本管理、用户同意状态拦截(微信端 4510 流程)。
5. **隐私与拨号**:手机号/账号全链路加密存储(AES-GCM + hash 查询),所有接口默认脱敏返回;明文一次一取,走独立授权端点(按门店与订单上下文授权)。
6. **文件体系**:上传按 `MINIO → QINIU_KODO → ALIYUN_OSS` 优先级补副本,读取按配置的渠道优先级生成签名地址;历史数据可能存 MinIO 内网端点或 `oss://` 引用,统一 URL 工具按环境解析。
7. **ArtList 电商链路**:浏览 → 购物车 → 下单 → 评价/改派 → VIP/优惠券;订单镜像与 Salon 侧存在同步契约(事件/状态映射)。
## 角色与权限
- 角色:平台管理员(`xiaowang`)、店长、美甲师、普通用户 + 门店自定义角色。
- 权限码裁剪菜单与接口;数据属主校验(门店作用域)在 Service 层;管理端走 `/api/admin/**` 门禁。
- 新增权限/菜单种子后必须授权给平台管理员。
## 使用要求
- 修改业务功能前:先定位业务域(module-map)→ 按 AGENTS.md 要求做 GitNexus impact → 再动手。
- 涉及流程 1-7 的改动,完成后在任务说明中写明对上下游的影响。
- 本技能只提供项目知识,不替代开发流程技能($jayu-devflow)与数据库纪律($jayu-database)。
## 安全边界
- 不输出、不记录任何真实客户手机号/账号明文;示例一律用占位符。
- 隐私字段相关改动必须保持「默认脱敏、授权取明文」的基线,不得新开完整号码出口。
@@ -0,0 +1,50 @@
# JayuCloud 模块地图
> 依据 2026-11-05 源码目录核实;如有出入以源码为准。
## 后端业务域(Core `modules/`)
| 域 | Salon | ArtList | 职责 |
|----|:---:|:---:|------|
| auth | ✓ | ✓ | 登录、令牌、会话(微信登录/账号登录) |
| user | ✓ | ✓ | 用户资料、客户管理、隐私字段加密与脱敏出口 |
| shop | ✓ | ✓ | 门店/店铺、营业设置、有效期、主题 |
| artist | ✓ | ✓ | 美甲师/艺术家资料、注册申请关联 |
| product | ✓ | ✓ | 作品/服务项、分类标签、价格与时长 |
| order | ✓ | ✓ | 订单状态机、收款登记、完成校验 |
| payment | ✓ | ✓ | 支付/退款集成 |
| planning | ✓ | ✓ | 排班、预约占用、规划日历 |
| marketing | ✓ | ✓ | 优惠券、营销活动、VIP |
| message | ✓ | ✓ | 系统消息、订阅消息、跳转与弹窗 |
| content | ✓ | ✓ | 内容审核(图片/作品/对外文案) |
| file | ✓ | ✓ | 上传编排、对象存储三副本、签名地址 |
| integration | ✓ | ✓ | 第三方集成(微信审核回调、内容审核、短信等) |
| security | ✓ | ✓ | 审计日志、安全接入配置 |
| system | ✓ | ✓ | 系统参数、协议版本、诊断 |
| privacy | ✓ | — | 隐私政策、脱敏策略、拨号取号授权 |
| registration | ✓ | — | 门店/员工注册审核流 |
| manager | ✓ | — | 店长/管理端专属能力 |
| inventory | ✓ | — | 库存耗材 |
| analytics | ✓ | — | 经营分析、绩效统计 |
ArtList 已清理 inventory/manager/analytics/planning 实现等(保留订单容量校验所需依赖);新增 ArtList 功能前先确认该域仍存在。
## 端侧入口
| 端 | 页面/视图位置 | 请求封装 | 登录态 |
|----|--------------|----------|--------|
| JC-Salon-Frontend | `src/views/` | `src/api/*.ts` | Axios 拦截器 |
| JC-ArtList-Frontend | `src/views/` | `src/api/*.ts` | Axios 拦截器 |
| JC-Salon-WeChat | `pages/`(planning/customers/employees/appointment…) | `utils/request.js` | `utils/auth.js` |
| JC-ArtList-WeChat | `pages/`(home/products/cart/orders/vip-center…) | `utils/request.js` | `utils/auth.js` |
## 网关与公共件
- `JC-*-Gateway`:`filter/AuthGlobalFilter`(白名单 + JWT 初筛)、路由配置在 Nacos `gateway.yaml`。
- Core 公共:`common/`(`Result<T>`、DTO/VO 基类)、`config/`(MyBatis-Plus、加密组件、对象存储编排等)。
## 关键横切组件
- 手机号/账号加密:AES-GCM 加密组件 + `*_hash` 查询列;日志脱敏。
- 协议拦截:服务端拦截未同意最新协议用户,微信端 4510 原地同意后重试。
- 对象存储读取渠道优先级:配置项控制,历史数据多端点兼容解析。
+47
View File
@@ -0,0 +1,47 @@
---
name: jayu-release
description: JayuCloud 发布与配置管理:Nacos 配置分层(core/gateway/infra/secret/logging)、dev→sit→prod 晋级流程、Gitea 工作流边界、配置变更说明文档要求、发布回滚纪律。用于修改配置、发布环境、部署脚本或 Nacos 相关任务;线上故障排查用全局 $incident-troubleshooting
---
# JayuCloud 发布与配置管理
配置与发布是本项目的高风险动作:生产配置由 Nacos 管理、发布由 Gitea 工作流驱动、数据库迁移随应用启动自动执行。任何配置/发布改动按本技能执行。
## 配置体系
- 仓库副本:`nacos/namespaces/<environment>/<namespace>/DEFAULT_GROUP/`,environment ∈ dev/sit/prod,namespace ∈ `jayucloud-salon` / `jayucloud-artlist`。
- 每个命名空间五个 dataId:`core.yaml`(业务运行)、`gateway.yaml`(路由与网关)、`infra.yaml`(中间件地址/开关)、`secret.yaml`(敏感配置)、`logging.yaml`。
- 覆盖关系:后加载来源覆盖先加载来源;排查配置问题必须核对全部来源的最终生效值(含 systemd EnvironmentFile 与环境变量)。
- 仓库副本不得包含真实密钥;敏感值只存在于对应环境的 Nacos `secret.yaml`。
- dev 分支推送触发 Gitea 工作流自动发布 dev Nacos 配置(带失败自动回退);发布后有读回校验(SHA256 比对)。
## 发布流程(dev → sit → prod)
1. **先 DEV 验证**:迁移、配置、代码必须在 DEV 验证通过;迁移未过不得合并 SIT。
2. **SIT**:合并后由 SIT 部署流程发布;核对 Nacos 发布快照与读回校验结果。
3. **PROD**:走发布提交 + `自动部署prod环境` 工作流(构建发布包 → 部署脚本 → 记录部署,失败自动回退);生产发布前核对目标环境、备份状态与凭据注入方式,并取得确认。
4. 发布顺序契约:数据库迁移随 Core 启动由 Flyway 执行,变更设计必须向前兼容(先加后删),应用回退不会回滚数据库。
## 配置变更任务要求
1. 修改前先读取现有配置(Nacos 只读查询或仓库副本),备份原配置内容到任务记录。
2. 仓库 `nacos/` 副本与 Nacos 实际内容同步修改;dev 走分支推送自动发布,sit/prod 按既有发布流程。
3. **必须提供中文说明文档**:按「功能+日期」命名(如 `Salon××配置说明_20261105.md`),放在 `docs/scripts/`,写明变更内容、生效环境、验证方式、回退方式。
4. 涉及脚本/配置/SQL 的任务,先读 `docs/scripts/运行与发布配置总说明.md`。
5. 发布后验证:服务日志、Nacos 实例健康、读回校验结果。
## Gitea 工作流边界
- 工作流不得直连数据库、不得绕过 Flyway 执行 SQL。
- 不可绕过的分支保护检查必须由目标分支定义的工作流(`pull_request_target` 类)完成,且不得检出/执行来源分支代码。
- 修改工作流定义属于发布基础设施变更:先说明影响,单独提交。
## 安全边界
- 生产环境动作(发布、Nacos 生产写、生产 SQL)必须先取得明确确认;未授权只读。
- 不在仓库、日志、说明文档中写入密钥/口令/令牌;示例用占位符。
- 回滚优先使用工作流与发布脚本的既有回退机制;数据库问题用补偿迁移,不依赖 clean/baseline。
## 验收标准
- 配置变更有说明文档且命名合规;环境晋级顺序未跳级;发布后验证结果已记录;仓库副本与 Nacos 一致。
+3 -2
View File
@@ -8,8 +8,9 @@
# Full-regression database backups may contain development user data.
artifacts/full-regression/*backup*.sql
# Local Codex agent skill mirrors; canonical project skills live under .claude/.
.agents/
# Local agent skill mirrors stay ignored; project skills under .agents/skills/ are versioned.
.agents/*
!.agents/skills/
# BlueJ files
*.ctxt
@@ -0,0 +1,49 @@
# Ardot 图标补齐剩余步骤
## Context
用户反馈 Ardot 文件 `https://ardot.tencent.com/file/744106780552731` 中已复刻的 35 个页面(Web 11 页、小程序 24 页)图标缺失,要求用本地 MCP(`mcp_ardot_*`)补齐真实图标,不重建页面、不改页面名、不动布局文案、不删页面、不改仓库、不提交 Git。
已完成部分:
- 品牌 logo 4 页:`3:3`(`7:18`)、`3:8`(`10:40`)、`3:9`(`10:15`)、`35:4`(`35:17`),已用 `upload_images` 应用 `assets/images/app-icon.png` 并删除原文字占位。
- tabBar 4 页:`35:1`(`36:625/630/635/640`)、`35:2`(`38:81/86/91/96`)、`35:11`(`55:117/122/127/132`)、`35:9`(`48:118/123/128/133`),已用 `assets/tabbar/*.png` 替换内层 SVG 容器。
剩余问题:两个页面的缺省头像仍是字母/文字占位,需要替换为 `assets/images/default-user-avatar.png`。
## 执行步骤(均在本地 MCP,只读仓库)
### 1. 定位头像容器(只读)
- 对页面 `3:12`(salon-小程序端-个人信息)用 `batch_read` 搜索 `^管$`,已得 TEXT `15:21`(21×25,x=0,y=2)。再读取其父节点,确认 50×50 或等效头像框 id。
- 对页面 `35:3`(salon-小程序端-新增美甲师)用 `batch_read` 读取整页树(已有 JSONL:`C:\Users\21616\AppData\Local\Temp\.ardot\reads\batch_read-35_3-3987-20261105_175025311.jsonl`),定位 50×50 头像框 id。
### 2. 替换为真实头像
- `upload_images` 将 `e:\code\JayuCloud\JC-Salon-WeChat\assets\images\default-user-avatar.png` 应用到上述两个头像框。
- `batch_edit` 删除字母/文字子节点(`3:12` 的 `15:21`,以及 `35:3` 中对应占位文字),保持外框尺寸、圆角与位置不变。
### 3. Web 端图标核对(只读 + 汇报,不新增页面)
- 用 `batch_read` 抽查 `3:1`(登录)、`3:2`(首页)、`3:7` 等页面的 VECTOR 节点,确认侧栏菜单、header 刷新/审核/待处理、列表操作图标已导入并渲染(记录尺寸与描边)。
- 源码侧 `JC-Salon-Frontend/src/assets` 仅 `vue.svg`,图标全部来自 `@ant-design/icons-vue`;侧栏与登录页品牌标记源码本身是文字「S」,无图片使用 → 在汇报中标注「源码无图片使用,保持近似」。
- 整理「还原 / 近似 / 缺失」三类清单。
### 4. 最终复核
- `fetch_editor_state` 确认 pageList 仍为 35 页(`3:20` 不恢复,`0:1` 不恢复)。
- 抽查补图标页面节点(`3:3`、`3:8`、`3:9`、`35:4`、`35:1`、`35:2`、`35:9`、`35:11`、`3:12`、`35:3`),确认 fills 为 IMAGE。
### 5. 汇报
- 以「图标补齐已完成」开头,给出:
- 小程序端:品牌 logo、tabBar、缺省头像的还原清单与节点 id;
- Web 端:已存在的 Ant Design Vue 图标(近似还原)清单、源码无图片的说明;
- 仍有缺失:上传失败或工具不支持(SVG 不能 `register_assets`,必要时内联)的条目与原因。
## 验证方式
- `batch_read` 返回节点 `fills` 含 `type: "IMAGE"`;
- `fetch_editor_state` 页面数量与名称未变;
- 截图抽查 `capture_screenshot` 对应 pageId 的局部区域(可选)。
## 约束
- 只增补图标节点,不重建页面、不改页面名、不动布局文案;
- 不改仓库文件、不提交 Git、不导出;
- 上传失败贴原始错误并跳过,继续其余页面。
```
@@ -0,0 +1,161 @@
# Ardot 设计稿批次 5 收尾与批次 6 执行计划
## Summary
针对 Ardot 文件 `https://ardot.tencent.com/file/744106780552731`(当前 35 页)继续完成已确认的 8 项优化中剩余部分:
- **批次 5 收尾**:验证 `salon-小程序端-我的`(35:9)本批改动;为 `salon-小程序端-关于系统`(3:3)补「用户协议 / 隐私政策」入口与「版本更新日志」。
- **批次 6**:新增 4 个注册相关页面(`补充资料(店长)`、`补充资料(店员)`、`申请状态(店长)`、`申请状态(店员)`)。
- 全部完成后按用户要求以「任务完成」开头,按「改了什么 / 依据 / 与源码不一致处 / 推断项 / 新增页面 ID 与命名 / 截图验证结论」汇报。
约束:不重建已有页面、不改页面名、不删页;只改内容或新增页面;不改仓库文件、不提交 Git、不导出。
## Current State Analysis
### 已核实(只读读取结果)
**35:9 我的页(48:1)** — 编辑已执行,待截图验证:
- `48:28` 96×23 r11.5,内含 `69:277` 选中胶囊 42×19 #247B63、`69:278`「店长」11px Bold 白、`69:279`「美甲师」11px Regular #71807A;旧「管理端」节点 `48:29` 已删。
- 菜单卡 `48:70/48:113` 高 250,`48:73` 内 5 行 × 49:`48:74` 个人信息 → `48:80` 店铺信息 → `48:86` 账号安全 → `48:92` 订单数据 → `48:110` 关于系统(文案已按顺序改写,文案字体为 Sarasa Bold)。
- 退出登录 `48:114` 357×44 r10 #FBE9E7(r0.984,g0.914,b0.906),y=538;`48:115` 14px Sarasa Semi Bold #B3261E(r0.702,g0.149,b0.118),x=152、y=12。
**3:3 关于系统(7:1)** — 尚未修改:
- `7:1` 390×844,底色 #F5F7F4;`7:2` vertical gap 0 → `7:3` 状态栏 44、`7:8` 导航头 44(返回 18×18 @x16、标题「关于系统」17px SemiBold)、`7:16` 内容区 vertical gap 10 / padding-top 42。
- `7:16` 子节点:`7:17` 品牌卡 366×175(`7:18` logo 58×58 imageHash `ed433c1485641a6f4827a00c8dc568d176750c75`、`7:20`「甲屿手纪」20px Black、`7:22` 描述 12.5px #908865);`7:24` 信息卡 366×112 r12 白底。
- `7:24` → `7:25` vertical,padding 1/1/13/15;行 `7:26`「版本 / 0.0.1」340×43、`7:29`「定位 / 日程 / 客户 / 美甲师 / 我的」340×43;行内 padding 6/6/12/12,标签 14.5px #17211F、值 14.5px #71807A。
**35:4 注册页(40:1)** — 仅含第 1 步「选择工作身份」,第 2/3 步无画板,作为批次 6 的复用样式源:
- 页面 390×844 #F5F7F4;`40:15` 内容层为 `layout:"none"`,子节点全部 ABSOLUTE 定位。
- 品牌头 `40:16`:360.8×47.1 @(15,19),logo 45.8×45.8 r13.5 @(6.5,0.65) 同 imageHash,brand 文案列 156 宽。
- 进度条 `40:24`:360.8×40 @(15,84),三步 40×40 @x0/160/321,圆点 21.8×21.8 r10.9(激活 #247B63 / 未激活 #E0E9E2),连线 108×1 #DCE6DE @y12。
- 卡片 `40:42`:360.8×283.6 @(15,137),r12.5,填充 #FBFDFB(0.984,0.992,0.984),描边 #E7ECE9,标题 17.7px ExtraBold,描述 12px #879792,角色项 58.2 高 r8.3 #F5F7F4 描边 #E7ECE9。
- 主按钮 `40:70`:329.6×43.7 r7.3 #247B63 @(16,221),文字 14.6px Bold 白。
- 页脚注 `40:72`:11px #9AA9A0,居中 x=44。
### 源码依据(只读)
- `JC-Salon-WeChat/pages/register/index.wxml`:
- 进度条三步:选择身份 / 补充资料 / 申请状态。
- 第 2 步店长:`店铺名称*`、`店铺地址(选填)+ 地图选点` + 提示「地图选点为可选项,仅用于门店展示和预约导航,不会在后台静默获取位置。」;副标题「提交后由平台管理员审核」。
- 第 2 步店员:`选择店铺*`(picker,占位「请选择要加入的店铺」)、`昵称*`(提示「可从微信昵称中选择,也可以手动填写,最多20个字。」)、`头像*`(默认头像 + 「点击选择微信头像」)、notice「审核通过前不会获得门店业务权限」;副标题「提交后由对应店长审核,昵称和头像为必填资料」。
- 第 2 步底部:主按钮「提交审核」+ 文字链「返回上一步」。
- 第 3 步:结果图标(…/✓/!)、标题(申请已提交 / 申请已通过 / 申请未通过)、描述、`当前状态:待审核`、详情行(申请门店、申请身份、[申请昵称]、[申请编号]、提交时间)、主按钮「返回登录」(驳回态为「返回登录并重新申请」)。
- `JC-Salon-WeChat/pages/profile/index.js`:`menus` 顺序为用户协议/隐私政策在第 5/6 位,并入「关于系统」后需在 3:3 提供入口。
- `JC-Salon-WeChat/pages/about/index.wxml`:仅「版本 / 定位」两行,无协议入口、无更新日志 —— 3:3 的两处补充均属「按用户要求新增」,需在汇报中标注与源码不一致。
## Proposed Changes
### 批次 5-A:35:9 我的页截图验证(不改内容)
1. `capture_screenshot(nodeIds:["48:1"])`,核对:
- 身份切换 chip 显示「店长(选中)/ 美甲师」,无溢出、无换行;
- 菜单五项顺序为 个人信息 → 店铺信息 → 账号安全 → 订单数据 → 关于系统,行高一致无重叠;
- 退出登录为低饱和红底按钮,文字居中。
2. `capture_layout({parentId:"48:1", problemsOnly:true})` 复核裁剪/重叠。
3. 如发现渲染问题,仅做最小修正(改宽度/坐标/字号),不改结构。
### 批次 5-B:3:3 关于系统补协议入口与版本更新日志(`batch_edit` 于 `7:1`)
1. 信息卡扩容:
- `U("7:24",{"height":200})`
- `U("7:25",{"height":200})`
2. 新增两行入口(父节点 `7:25`,行样式对齐 `7:26`):
- `I("7:25",{ FRAME 名称「用户协议」340×43, layout:"none" })` → 子项:`TEXT`「用户协议」14.5px #17211F @(6,12);`TEXT`「›」22.9px #B0A79A @(320,10)
- `I("7:25",{ FRAME 名称「隐私政策」340×43, layout:"none" })` → 同上,文字「隐私政策」
3. 新增「版本更新日志」卡片(父节点 `7:16`,插入在 `7:24` 之后,顺序即视觉顺序):
- 卡片 `366×190` r12 白底 `layout:"none"`
- 标题「版本更新日志」15px Bold #17211F @(16,16)
- 条目块(横向:版本胶囊 + 日期,随后三行说明,均 11.5px):
- 版本胶囊 `58×22` r11 #E5F4ED,「0.0.1」11px Bold #247B63 居中;日期「2026-11-05」11.5px #71807A @x=82,y≈4
- 说明行 1「新增补充资料与申请状态设计稿(店长 / 店员)」@y=52
- 说明行 2「我的页支持店长 / 美甲师身份切换」@y=74
- 说明行 3「用户协议与隐私政策入口并入关于系统」@y=96
- 底部说明「后续版本更新将在此处按时间倒序展示」11px #9AA9A0 @y=140
4. 校验内容总高:42 + 175 + 10 + 200 + 10 + 190 = 627 < 800(扣除状态栏与导航头后可用 756),无溢出。
### 批次 6:新增 4 个注册相关页面
**通用构造**(每页一张 390×844 画板,页面底色 #F5F7F4,`layout:"none"` + 子节点 ABSOLUTE):
- 状态栏 44:`9:41`(13px SemiBold #17211F @x28 垂直居中)、`●●●` 与 `▮`(13px SemiBold,#17211F,gap 5,右侧 @x≈332)。
- 品牌头(复用 35:4 `40:16` 几何):logo 45.8×45.8 r13.5 @(21.5,20.3) imageHash `ed433c1485641a6f4827a00c8dc568d176750c75`;右侧文案列 @(77.2,19):主标题「Salon」20px Black #17211F,副标题「用微信身份申请门店工作权限」11.380px #879792。
- 进度条 @(15,84):三步圆点 21.8×21.8 r10.9;未激活 #E0E9E2、已激活 #247B63;完成步数字「✓」7.6px Bold 白,当前步白字「2」或「3」,未开始步 #6B7B74;步名 10px #6B7B74 / 当前步 #247B63 Bold(「选择身份」「补充资料」「申请状态」);连线 108×1 #DCE6DE @y12 @x46 与 @x207。
- 卡片 @(15,137):360.8 宽,r12.5,#FBFDFB 填充 + #E7ECE9 1px 描边。
**1) `salon-小程序端-补充资料(店长)`**
- 进度:第 1 步完成、第 2 步激活、第 3 步未开始。
- 卡片高 352:
- 标题「补充资料」17.7px ExtraBold @(16,19);副标题「提交后由平台管理员审核」12px #879792 @(16,48)
- 字段 1:标签「* 店铺名称」(`*` 6.9px #C0392B + 文案 14px #17211F)@(16,84);输入框 329.6×44 r8 #F5F7F4 描边 #E7ECE9 @(16,106),占位「请输入店铺名称」12px #9AA9A0 @(12,12)
- 字段 2:标签「店铺地址 选填」(「选填」10px #9AA9A0)@(16,166);输入框 238×44 @(16,188) 占位「可手动填写门店地址」;按钮 83.6×44 r8 #E5F4ED @(262,188),文字「地图选点」11.5px Bold #247B63
- 提示「地图选点为可选项,仅用于门店展示和预约导航,不会在后台静默获取位置。」11px #9AA9A0,宽 329.6 @(16,240),两行
- 主按钮 329.6×43.7 r7.3 #247B63 @(16,278),文字「提交审核」14.6px Bold 白
- 文字链「返回上一步」11.5px #71807A @(y=330) 居中
- 页脚注 11px #9AA9A0 居中:「OpenID 仅用于识别你的微信身份,不会在页面中展示。」
**2) `salon-小程序端-补充资料(店员)`**
- 进度同 1)。
- 卡片高 430:
- 标题「补充资料」@(16,19);副标题「提交后由对应店长审核,昵称和头像为必填资料」@(16,48)
- 字段 1「* 选择店铺」@(16,84);选择行 329.6×44 r8 @(16,106),占位「请选择要加入的店铺」12px #9AA9A0,右箭头「›」22.9px #B0A79A @x≈318
- 字段 2「* 昵称」@(16,166);输入框 329.6×44 @(16,188),占位「点击输入框选择或填写微信昵称」;提示「可从微信昵称中选择,也可以手动填写,最多20个字。」11px #9AA9A0 @(16,240)
- 字段 3「* 头像」@(16,266);头像行 @(16,288):圆形 56×56 r28 默认头像(复用 imageHash `ed433c1485641a6f4827a00c8dc568d176750c75`,若该图为品牌图则改用首字占位「微」#E5F4ED/#247B63),右侧文字「点击选择微信头像」12px #71807A;提示「请选择头像,头像会先上传并完成资料登记,提交时只引用已上传的文件。」11px @(16,350)
- 提示条 329.6×34 r8 #FDF3E7(0.992,0.953,0.906),文字「审核通过前不会获得门店业务权限」11.5px #A9743B @(16,382)
- 主按钮「提交审核」@(16,428)——卡片高需同步扩为 500,避免按钮与文字链越界
- 文字链「返回上一步」11.5px #71807A @y=484 居中
- 页脚注同 1)。
> 说明:头像占位若不使用品牌图,需在汇报中标注为「推断的默认头像占位」。
**3) `salon-小程序端-申请状态(店长)`**
- 进度:第 1、2 步完成、第 3 步激活。
- 卡片高 396:
- 结果图标 72×72 r36 #E5F4ED @(144.4,24),内「…」20px Bold #247B63 居中
- 标题「申请已提交」17.7px ExtraBold 居中 @y=112
- 描述「申请由平台管理员处理,通过后即可使用快捷登录。」12px #879792 居中,宽 300 @(30,144),两行
- 状态行「当前状态:待审核」12.5px #17211F @(16,186),「待审核」#D59A52 Bold
- 详情区 @(16,212):三行 40 高(申请门店「甲屿手纪·望京店」/ 申请身份「店长」/ 提交时间「2026-11-05 14:32」),行内左侧 11.5px #71807A、右侧 11.5px #17211F 右对齐 @x≈250;每行底部 1px #EDEDED
- 主按钮「返回登录」329.6×43.7 @(16,336)
- 页脚注「申请进度会随审核结果更新,可在登录页重新进入查看。」11px #9AA9A0 居中 @y=392(卡片外)
**4) `salon-小程序端-申请状态(店员)`**
- 进度同 3)。
- 卡片高 436:
- 结果图标、标题、描述同 3),描述为「申请由门店店长处理,通过后即可使用快捷登录。」
- 详情四行(申请门店「甲屿手纪·望京店」/ 申请身份「店员」/ 申请昵称「小雨」/ 提交时间「2026-11-05 14:32」),y 起点 212,每行 40
- 主按钮「返回登录」@(16,376)
- 页脚注同 3) @y=432
**页面创建与定位步骤(每页)**:
1. `create_new_page({name:"salon-小程序端-补充资料(店长)"})` 等 4 次,按序创建。
2. `locate_available_space` 取该页可用区(page 级插入前必须调用)。
3. `batch_edit` 在该页插入 390×844 顶层画板,`layout:"none"`,`I(pageId,{...})` 逐节点构建(每批 ≤ 60 行,操作行换行分隔,不用分号)。
4. 数字/中文混排节点显式设置 `fontName:{family:"Sarasa Gothic SC", style:"Semi Bold"}`,避免缺字回退。
## Assumptions & Decisions
| # | 决策 | 理由 |
|---|---|---|
| A1 | 4 个注册页各自独立成页,不复用 35:4 页面 | 用户明确要求「新增页面 ID 与命名」,且命名按「补充资料(店长)」等给出 |
| A2 | 新页沿用 35:4 的品牌头 + 三步进度条,第 2/3 步高亮 | 与源码 `register` 单页三步结构一致,视觉连续 |
| A3 | 不画「已通过 / 已驳回」状态 | 用户只要求「补齐补充资料与申请状态」,默认展示提交后的待审核态;其余状态列入建议清单 |
| A4 | 3:3 版本更新日志内容用 0.0.1 / 2026-11-05 + 三条本次改动说明 | 与仓库 0.0.1 基线一致,且可追溯本次设计稿改动 |
| A5 | 3:3 协议入口以「›」行形式挂在信息卡内,不新增独立页面 | 用户要求「并入关于系统」,不新建协议页 |
| A6 | 申请状态详情中的门店名/昵称/时间为示意文案 | 设计稿无真实数据源,属推断示例 |
| A7 | 若渲染异常只做最小修正(宽/坐标/字号),不改结构、不删页、不改页名 | 用户通用约束 |
## Verification
1. **批次 5-A**:`capture_screenshot(["48:1"])` + `capture_layout({parentId:"48:1",problemsOnly:true})`;确认身份 chip、5 行菜单、红色退出按钮。
2. **批次 5-B**:`capture_screenshot(["7:1"])` + `capture_layout({parentId:"7:1",problemsOnly:true})`;确认 4 行信息卡与版本日志卡不重叠、不越界。
3. **批次 6**:一次性 `capture_screenshot([四个新页画板 id])`(单次配额内);确认 4 页各自 390×844、进度高亮正确、字段与按钮不裁剪。
4. **终检**:`fetch_editor_state` 复核页面总数 39、4 个新页名称唯一且无重复、无页面被改名/删除。
5. **汇报**:以「任务完成」开头,输出 改了什么 / 依据 / 与源码不一致处(日程不做月视图;35:3 手机号必填差异;3:3 协议入口与版本日志为新增;注册页仅覆盖待审核态)/ 推断项(微信登录未关联用户列表、申请状态示例数据、店员头像占位)/ 新增页面 ID 与命名 / 截图验证结论 / 建议清单。
@@ -0,0 +1,66 @@
# Ardot 设计稿优化:批次 3 收尾与批次 4–6 执行计划
## Context
目标文件 `https://ardot.tencent.com/file/744106780552731`(35 页基线),需按用户已确认的 8 项优化逐批落地,每批用 `capture_screenshot` 验证后再进下一批。批次 1(日程周/日视图)与批次 2(客户页、预约详情页)已完成并验证;批次 3 的改派美甲师页栅格对齐与美甲师页折叠按钮/折叠态画板已完成主体编辑,截图验证后只剩 1 个视觉小问题待修。
约束:不重建已有页面、不改已有页面名、不删页;只改内容或新增页面;仅使用本地 Ardot MCP;不改仓库文件、不提交 Git。
## 已完成(供上下文,不再重复)
- 35:1 日程:主画板改「周视图状态」(69:1 周条 + 7 日卡),新增 69:52「日视图状态」;删除浮层 37:43(取消预约),35:8 已有 53:3 同名浮层。
- 35:2 客户:删除「新增」文字按钮,搜索栏满宽,新增 69:167 悬浮加号;新增客户弹窗姓名加红星(69:168)。
- 35:8 预约详情:补「呼叫」按钮(69:170/69:171);修复基线遗留的 193×844 浅绿块与竖排「呼叫」占位;重排卡片高度,六字段栅格恢复可见。
- 35:13 改派美甲师:`61:39` 宽度设为 94,三行内容列统一到 x≈94。
- 35:11 美甲师:删除旧「2 项」(55:34),新增 69:173「列表标题右侧」→ 69:174「2 项」+ 69:175「折叠按钮」+ 69:176「︿」;新增 69:177「美甲师(折叠态)」画板(含状态栏、头部、工具栏、折叠审核卡、3 张美甲师卡、底部导航)。
## 剩余执行计划
### 步骤 0:批次 3 收尾修复
- `U("69:174",{width:30})`:修「2 项」在 20px 宽内换行的问题。
- 用 `capture_layout`(problemsOnly)确认 69:177 无重叠/溢出;不额外消耗截图配额。
### 步骤 1:批次 4 —— 35:3「新增美甲师档案页」
1. 只读读取 35:3 页面结构(主画板 + 浮层组),定位姓名、手机号、微信号/微信登录、专属颜色字段节点与星号节点。
2. 必填收敛:仅「姓名」「专属颜色」加红星(#D9534F,12.5px),其余字段星号删除;与源码 `JC-Salon-WeChat/pages/employee-create` 字段必填关系比对并记录差异。
3. 「微信登录」点击态:在 35:3 浮层组新增浮层画板「浮层:未关联微信用户列表」——底部面板,标题「选择微信用户」+ 说明「仅显示尚未关联门店账号的微信用户」+ 3 条用户行(头像/昵称/最近登录时间/「选择」按钮)+ 空列表态文案。**标注为推断设计,渲染结果需用户确认。**
4. 「专属颜色」点击态:新增浮层「浮层:专属颜色设置」——色板网格(复用设计已有美甲师色 #7BA7C7/#C7A58F/#A7BFA8 + 6 个扩展色)、当前选中预览、取消/确认按钮。
5. 截图验证 35:3 主画板 + 2 个新浮层。
### 步骤 2:批次 5 —— 35:9「我的」与 3:3「关于系统」
1. 读取 35:9 主画板,找到顶部「管理端」标识与菜单列表、退出登录按钮。
2. 身份态:同一画板内把「管理端」替换为「当前身份」切换控件(店长 / 美甲师 两个 chip,店长为选中态),并在下方菜单区同时满足两角色(菜单文案差异不大,采用同页切换,不拆画板);另加一行说明「切换身份仅影响可见菜单」。
3. 菜单顺序调整为:个人信息 → 店铺信息 → 账号安全 → 订单数据 → 关于系统。
4. 「退出登录」改为低饱和红色填充按钮(浅红底 #FBE9E7 + 深红字 #B3261E,保持原尺寸与圆角)。
5. 3:3「关于系统」:新增「用户协议」「隐私政策」两个入口行,新增「版本更新日志」区(版本号 + 日期 + 2–3 条更新说明)。
6. 截图验证 35:9 与 3:3。
### 步骤 3:批次 6 —— 注册相关 4 个新页面
1. 读取 `JC-Salon-WeChat/pages/register` 与 `WorkbenchRegistrationView.vue` 的补充资料、申请状态字段作为内容依据。
2. 用 `create_new_page` 新建 4 页,命名严格为:
- `salon-小程序端-补充资料(店长)`
- `salon-小程序端-补充资料(店员)`
- `salon-小程序端-申请状态(店长)`
- `salon-小程序端-申请状态(店员)`
3. 每页用 `locate_available_space` 后插入 390×844 画板:状态栏、标题、表单/状态卡、说明文案、主按钮,风格沿用既有 token(#247B63 / #F5F7F4 / #17211F)。
4. 截图验证 4 个新页;复核总页数 39、页面名无重复。
### 步骤 4:最终汇报
以「任务完成」开头,按:改了什么 / 依据 / 与源码不一致处(含「日程不做月视图——按用户要求」)/ 推断项(微信登录未关联用户列表)/ 新增页面 ID 与命名 / 截图验证结论 / 建议清单 逐项交付。
## 验证方式
- 每批:`capture_screenshot(nodeIds)` 一次覆盖该批所有改动节点;仅当截图暴露问题且已集中修复后才允许第二次。
- 结构类问题优先 `capture_layout(problemsOnly:true)`,不占用截图配额。
- 全部完成后只读复核页面数量与命名。
## 已知风险与处理
- 更新 `characters` 会把缺失字体重置为 Sarasa Gothic SC Regular,需显式 `U(fontName)` 恢复字重。
- TEXT 不支持 `textAlign`,居中/右对齐需手动 x 定位。
- 新增子级必须指定正确 parentId,避免文字堆叠在父容器顶部(本任务已出现过两次)。
@@ -0,0 +1,84 @@
# ArtList 账号加密与场景化脱敏执行清单
> 按项目规则不新增设计文档;本文件只是 plan 模式的执行清单,实施完成后不为它单独提交。
## 零、版本号自查结论(已核实)
- 查 dev 库 `jayucloud_artlist`:库内没有 `flyway_schema_history`,表数为 0 → **V3 从未在任何环境执行过**。
- 远端 `dev` 已被并行分支先推入 `V4__隐私政策与用户协议加密脱敏条款修订_20261104.sql`(本地 HEAD `80d187d2` 已含);`core.yaml` 为 `out-of-order: false`。
- 因此把工作区里的 `V3__账号加密与账号哈希_20261104.sql` **改名为 `V5__账号加密与账号哈希_20261104.sql`**(V3 文件已删除,V5 未被占用),保证 V1→V2→V4→V5 顺序天然正确,无论 V4 是否已执行都能跑。
- 若后续发现 V3 曾执行过,则恢复 V3 命名且不改文件内容(不得改已执行迁移)。
## 一、前置结论:为什么保留 `account` 列名
- Salon 实际实现:`t_user.account` 列存密文 + `account_hash char(64) NULL` + `uk_user_account_hash`;没有 `account_cipher`。
- **不能**"新增 account_cipher 再 DROP account":V1 种子由 SQL 直接写 `account='xiaowang'`,SQL 层无密钥无法回填,DROP 会丢数据。
- 因此与 Salon 同构:`account` 改存 AES-GCM 密文(`varchar(128) NULL`)、新增 `account_hash`、删 `uk_account`、加 `uk_user_account_hash`。hash 输入 `trim()` + HMAC-SHA256 十六进制小写,与 Salon 逐字对齐。
- ArtList 唯一差异:账号允许字母数字自定义账号,**一律加密**(Salon 仅手机号形态加密)。`decryptAccount` 对无 `enc:v1:` 前缀的历史值原样返回,兼容 V1 种子。
## 二、V5 迁移(已落地)
`JC-ArtList-Core/src/main/resources/db/migration/V5__账号加密与账号哈希_20261104.sql`:
1. 幂等过程沿用 V2 风格:`sp_v5_add_column_if_not_exists`、`sp_v5_drop_index_if_exists`、`sp_v5_add_unique_index_if_not_exists`(`DELIMITER $$`,用后 DROP)。
2. `ALTER TABLE t_user MODIFY COLUMN account varchar(128) NULL COMMENT '账号AES-GCM密文(enc:v1: 前缀)'`。
3. 新增 `account_hash char(64) NULL COMMENT '账号HMAC-SHA256索引'`。
4. 删除 `uk_account`;新增 `uk_user_account_hash (account_hash)`(MySQL 唯一索引允许多行 NULL)。
5. 不做 SQL 数据迁移;历史/种子账号由启动时 `AccountHashBackfillRunner` 加密并回填 hash。
## 三、后端改造(已落地)
- `support/privacy/PhoneCrypto`:新增 `encryptAccount`(非空一律加密)、`decryptAccount`(仅 `enc:v1:` 前缀解密,legacy 明文原样返回);`index` 复用,输入仍 `trim()`;删除不再使用的 `maskIfMobile`。
- 新建 `support/privacy/AccountPhoneTypeHandler`:写 `encryptAccount`、读 `decryptAccount`。
- `UserDO`:`account` 挂 `AccountPhoneTypeHandler`;新增 `accountHash`(`@TableField("account_hash")`,与既有 phoneHash 一致,由 `MyMetaObjectHandler` 手工填充)。
- `MyMetaObjectHandler`:`fillPhoneHashes` 中补 account → accountHash。
- `UserServiceImpl`:
- 全部账号等值查询改 `.eq(UserDO::getAccountHash, phoneCrypto.index(x))`;**不在每条查询挂 legacy fallback**。
- `pageUsers` 删除 account LIKE,改 `account_hash` 精确匹配,保留 nickname like 与 phone/contactPhone hash。
- `deleteUser` 抽出包级静态 `buildSoftDeleteUpdate(...)`(供单测断言),显式 set 密文 account + accountHash,并清空 `phone`、`phoneHash`、**`contactPhone`、`contactPhoneHash`**(本次补齐的数据残留),再置 status=0、isDelete=1。
- `buildLoginFailKey` 改用 `phoneCrypto.index(account)`。
- `convertToVO(userDO, scenario)`:`getUserById`/`getUserByAccount` 传 `SELF_PROFILE`,列表/分页传 `ADMIN_LIST`。
- 新建 `support/privacy/AccountHashBackfillRunner`(`ApplicationRunner`):启动时对 `account_hash IS NULL AND account IS NOT NULL` 的行加密 account 并回填 hash,幂等。
- `UserController`、`OperationGuardService` 的账号查询/签名索引统一走 `account_hash` / `index`。
## 四、集中脱敏策略(核心,已落地)
`support/privacy/SensitiveFieldPolicy`:`Scenario` 枚举 `SELF_PROFILE / ADMIN_EDIT / ADMIN_LIST / THIRD_PARTY / DIAL / LOG`;`phone(value, scenario)`、`account(value, scenario)`。已支持先解密再处理。
| 场景 | 返回方式 | 依据 |
| --- | --- | --- |
| SELF_PROFILE(`/user/info`、本人资料回显) | 完整 | 本人查看/修改;小程序发验证码直接用 `userInfo.phone` |
| ADMIN_EDIT(`/user/get/{id}`、`/user/get/account/{account}`) | 完整 | 编辑表单需原值,配合前端"未修改不提交" |
| ADMIN_LIST(分页、列表、公告/消息作者) | 脱敏 | 批量浏览,无编辑/拨号需求 |
| DIAL(门店与客服联系方式) | 完整 | 拨号必需;受登录态、门店可见范围与 OperationGuard、限流约束 |
| THIRD_PARTY(评论昵称回退、公开主页、订单客户昵称回退) | 脱敏 | 公开/半公开场景 |
| LOG(审计、日志、短信投递记录) | 脱敏 | 多人可见的持久化介质 |
| 订单详情客户手机 | 脱敏(维持 `customerPhoneMasked`) | 拨号统一走联系方式接口,避免订单批量泄露 |
应用点:`UserServiceImpl.convertToVO`;`ContactInfoServiceImpl`(手机 DIAL 完整、姓名回退 THIRD_PARTY);`CommentServiceImpl` / `AnnouncementServiceImpl` / `SystemMessageServiceImpl` / `OrderServiceImpl`(账号回退 THIRD_PARTY 或 ADMIN_LIST);`SecurityAuditLogServiceImpl`(LOG)。
## 五、前端 / 小程序(已落地)
- `JC-ArtList-Frontend/src/views/ProfileView.vue`:打开编辑弹窗记录 `originalContactPhone`,提交时仅值变化才带 `contactPhone` 字段。
- `JC-ArtList-Frontend/src/views/AccountSettingsView.vue`:绑定/修改手机号均为用户新输入,旧号只展示不回传。
- `JC-ArtList-WeChat`:`pages/account-settings` 只提交 nickname/signature;`pages/settings`、`pages/password-settings` 的 `userInfo.phone` 仅展示/发码。
- 管理端用户编辑 UI 不在本仓库(`CreateUserRequest/UpdateUserRequest` 无页面使用)→ 未覆盖项。
## 六、验证(已执行部分)
1. `mvn -q clean test -Dtest="PhoneCryptoTest,SensitiveFieldPolicyTest,UserSoftDeleteUpdateTest,FlywayMigrationTempCheckTest"` → **EXIT=0**(含编译)。
2. 单测覆盖:account 加解密回环(含纯数字账号一律加密)、legacy `xiaowang` 原样读取 + hash trim 稳定、六场景矩阵断言、软删除 set 子句含 `account/account_hash/phone_cipher/phone_hash/contact_phone_cipher/contact_phone_hash`。
3. 临时库 `jayucloud_artlist_v5check_20261104`:V1→V2→V4→V5 四个迁移成功,二次 migrate "Schema is up to date",断言 `account_hash` 列、`uk_user_account_hash` 存在、`uk_account` 已删、`account` 长度 128;finally DROP DATABASE;临时测试文件已删除。
## 七、剩余步骤
1. 全仓检索确认无明文读写:`getAccount(`/`setAccount(`/`getPhone(`/`phone_cipher`/`account_hash`,结合上下文判断。
2. `node .gitnexus/run.cjs detect-changes --scope all --repo .`(提交前门禁;`partial/truncated` 需重跑)。
3. 中文提交,只含本次文件(V5 迁移、PhoneCrypto、AccountPhoneTypeHandler、SensitiveFieldPolicy、AccountHashBackfillRunner、UserDO、MyMetaObjectHandler、UserServiceImpl、UserController、ContactInfoServiceImpl、SecurityAuditLogServiceImpl、Comment/Announcement/SystemMessage/Order、OperationGuardService、3 个测试类、ProfileView.vue);不提交 `.trae/`、`docs/design/`。
4. `git push origin dev`(禁止 force);非快进 `git pull --rebase` 重试一次,仍失败原样报错停止。
## 八、风险与未覆盖项
- JWT claims 与 Redis 会话 value 仍含账号明文,本轮不改。
- `account` 一律加密与 Salon 条件加密存在行为差异,hash 语义一致。
- 管理端用户编辑页面不在本仓库,未覆盖。
@@ -0,0 +1,178 @@
# 散客预约拨号 + 协议新版本强制重新同意 实施计划
## Context
现有拨号取号端点 `POST /manager/customers/{customerId}/dial?orderId=...` 强制要求 `order.userId = customerId`。散客预约(`OrderDO.userId` 为空,客户信息只存在 `customerNameSnapshot` / `customerPhoneSnapshot`)无法取号,“呼叫”按钮也被前端按 `userId` 隐藏。
同时,V17 已发布 `2026.11.04` 协议,V18 只修订了该版本正文、不可再改。需要新增 V19 发布新版本 `2026.11.04-R2`,并让已登录但未同意新版本的用户强制重新同意。
目标:
1. 拨号接口支持 `appointmentId`(= 预约详情的 `orderItemId`)/ `orderId` 定位,`customerId` 可空;只校验预约/订单属于当前店铺,不要求客户有账号;号码来源优先订单快照、再客户档案;无号码返回明确业务码。
2. 发布 V19 新协议版本;复用现有 `t_user_agreement_consent` 同意记录表,新增 pending/accept 接口;前端登录后强制弹层。
3. 不修改 V18,不动 ArtList 与 `SystemSettingsView.vue`。
## 一、散客拨号(Salon Core)
### 1. 服务接口与实现
`JC-Salon-Core/src/main/java/.../modules/privacy/service/CustomerDialService.java`
- 改为 `CustomerDialVO dial(UserDO currentUser, Long customerId, Long appointmentId, Long orderId, HttpServletRequest request);`
`.../modules/privacy/service/impl/CustomerDialServiceImpl.java`
- 注入 `OrderItemMapper`(已有 `OrderMapper`、`UserService`)。
- 流程:
1. `adminScopeHelper.requireShopContext(currentUser, "请先选择店铺后再拨号")`,取 `currentShopId`;`requestThrottleService.checkCustomerDial(...)`。
2. 三个定位参数全空 → `BusinessException(400, "请提供预约或订单信息后再拨号(DIAL_TARGET_REQUIRED)")`。
3. `appointmentId` 存在:按 `orderItemMapper.selectById` 查 `OrderItemDO`(未删除),否则 `404 预约不存在`;由 `item.orderId` 取 `OrderDO`。
4. `orderId` 存在:若上一步已解析订单且不相等 → `403 预约与订单不匹配,或无权拨打`;否则按 `orderMapper.selectById` 取订单。
5. 订单存在时:未删除且 `order.shopId == currentShopId`,否则 `403 无权拨打其他店铺预约/订单客户`。
6. 客户解析:
- `customerId` 非空:加载并校验 `type=0`、未删除;`ensureUserAccessibleInCurrentShop`。
- 订单 `userId` 非空且 `customerId` 非空但不相等 → `403 该客户与订单不匹配`;订单 `userId` 为空但传了 `customerId` 同样视为不匹配 → 403。
- `customerId` 为空:若订单 `userId` 非空,用订单客户作档案兜底;散客则为 `null`。
7. `resolveProvider()` 取渠道,`provider.resolve(customer, order)`,审计 reason 固定包含 `customerId=;appointmentId=;orderId=;provider=;mode=;result=`,不含号码。
8. 成功/失败审计沿用 `SecurityAuditSupport`,失败记录 `errorCode`。
`.../modules/privacy/dial/DirectDialTargetProvider.java`
- 号码优先级改为:`order.customerPhoneSnapshot` → `customer.contactPhone` → `customer.phone`。
- 注:`OrderDO.customerPhoneSnapshot` 由 `PhoneEncryptionTypeHandler` 读取时已解密,`phoneCrypto.decrypt` 对明文是幂等 no-op,保留调用即可。
- 全部为空 → `BusinessException(422, "该预约/订单未登记可拨打的手机号(DIAL_NUMBER_UNAVAILABLE)")`,新增常量 `NUMBER_UNAVAILABLE_CODE = 422`、`NUMBER_UNAVAILABLE_BUSINESS_CODE`。
- `DialTargetProvider` / `DialTarget` / 隐私号占位实现保持不变。
### 2. 控制器
`.../modules/manager/controller/admin/AdminManagerController.java`
- 保留旧端点,参数放宽:
- `POST /manager/customers/{customerId}/dial`:`customerId` 路径参数;`orderId`、`appointmentId` 均 `required = false`。
- 新增 `POST /manager/customers/dial`:`customerId`、`appointmentId`、`orderId` 全部 `required = false`。
- 两个方法均 `@RequirePermission("user:view")`、设置 `Cache-Control: no-store`,调用新 service 签名。
### 3. 测试
`JC-Salon-Core/src/test/java/.../modules/privacy/service/impl/CustomerDialServiceImplTest.java`
- 适配 5 参数签名与新增 `OrderItemMapper` mock。
- 新增断言:
- 散客订单(`customerId=null`、`order.userId=null`、订单快照有号)取号成功,号码只来自快照。
- `appointmentId` 定位成功(订单项 → 订单)。
- `appointmentId` 与 `orderId` 归属不一致 → 403。
- 散客无快照且无客户档案 → 422 且含 `DIAL_NUMBER_UNAVAILABLE`。
- 现有“登录客户 + 订单”路径保持成功。
## 二、协议新版本 + 强制重新同意
### 1. Flyway V19(不改 V18)
新增 `JC-Salon-Core/src/main/resources/db/migration/V19__隐私政策与用户协议新版本发布_20261104.sql`:
```sql
-- 先停用当前生效的两个协议
UPDATE t_legal_agreement
SET status = 0, update_time = NOW()
WHERE agreement_type IN ('USER_TERMS', 'PRIVACY_POLICY')
AND is_delete = 0 AND status = 1;
-- 从停用前刚生效的正文复制新版本,不重复维护长文本
INSERT INTO t_legal_agreement
(id, agreement_type, title, version, content, status, effective_time, create_time, update_time, is_delete)
SELECT 313931273555140005, 'USER_TERMS', title, '2026.11.04-R2', content, 1,
'2026-11-04 00:00:00', NOW(), NOW(), 0
FROM t_legal_agreement
WHERE agreement_type = 'USER_TERMS' AND is_delete = 0
ORDER BY effective_time DESC, create_time DESC
LIMIT 1;
-- PRIVACY_POLICY 使用 id 313931273555140006,同样 INSERT ... SELECT
```
- `id` 显式常量(该表 id 无自增);`version = 2026.11.04-R2`;生效时间为本次修订日期;`status = 1`。
- 不修改 `V18__...sql`。
### 2. 同意机制:复用现有表
已确认仓库已有 `t_user_agreement_consent`(唯一键 `(user_id, agreement_type, version)`)与 `LegalAgreementServiceImpl.recordConsent/upsertConsent/getMyConsent`,**不新建 `t_user_agreement_acceptance`**。
`.../modules/system/service/LegalAgreementService.java` 新增:
- `AgreementPendingVO getPendingAgreements(Long userId);`
- `void acceptCurrentAgreements(Long userId, String clientType, HttpServletRequest request);`
新增 `.../modules/system/vo/AgreementPendingVO.java`:
- `Boolean pending`、`Map<String,String> currentVersions`、`Map<String,String> acceptedVersions`、`List<String> pendingTypes`。
`LegalAgreementServiceImpl`:
- `getPendingAgreements`:对 `USER_TERMS` / `PRIVACY_POLICY` 各取 `findCurrentAgreement`,与 `getMyConsent(userId).consentVersions` 比对;缺失或版本不同即 pending。
- `acceptCurrentAgreements`:读取两类当前发布版本,按 `upsertConsent(userId, type, version, "agreement-gate", clientType, ip)` 记录,不依赖客户端上报版本。
- 保留登录/注册链路现有 `requireAccepted` 不变。
`.../modules/system/controller/front/LegalAgreementController.java` 新增:
- `GET /legal-agreement/pending`:从 request attribute `userId` 取用户,`requestThrottleService.checkAgreementRead(request, "PENDING")`,返回 pending VO。
- `POST /legal-agreement/accept`:登录态,可选 body `{clientType}`(默认 `WEB`),记录当前版本同意。
- 两个端点**不加入** `WebMvcConfig` 白名单,因此必须登录;`/legal-agreement/current`、`/current/**` 仍免登录,协议阅读页不受影响。
### 3. 测试
新增 `JC-Salon-Core/src/test/java/.../modules/system/service/impl/LegalAgreementServiceImplTest.java`:
- 无同意记录 → `pending=true`,`pendingTypes` 含两类。
- 已同意旧版本、当前版本已变 → `pending=true`。
- 已同意当前版本 → `pending=false`。
- `acceptCurrentAgreements` 对两类各调用一次 `upsertConsent`(insert/update 均可)。
## 三、前端与小程序
### 1. 拨号按钮与参数
`JC-Salon-Frontend/src/api/user.ts`
- `dialCustomer(params: { customerId?: IdType; appointmentId?: IdType; orderId?: IdType })`,调用 `POST /manager/customers/dial`,仅传非空参数。
`JC-Salon-Frontend/src/views/ArtistOrderView.vue`
- 按钮条件:`v-if="order.customerPhoneMasked"`(去掉 `&& order.userId`)。
- `dialCustomer(order)`:只要求 `order.id`;调用 `userApi.dialCustomer({ customerId: order.userId || undefined, orderId: order.id })`。
`JC-Salon-WeChat/api/customers.js`
- `dialCustomer(params)`:`POST /manager/customers/dial`,透传 `customerId/appointmentId/orderId`。
`JC-Salon-WeChat/pages/appointment-detail/index.wxml`
- 条件改为 `appointment.customerPhoneAvailable && appointment.orderId`(去掉 `customerId`)。
`JC-Salon-WeChat/pages/appointment-detail/index.js`
- `dialCustomer()` 只要求 `customerPhoneAvailable && orderId`;传 `{ customerId: appointment.customerId, appointmentId: appointment.orderItemId, orderId: appointment.orderId }`。
### 2. Web 强制同意弹层
`JC-Salon-Frontend/src/api/auth.ts` 的 `legalAgreementApi` 新增:
- `getPending()` → `GET /legal-agreement/pending`
- `accept(clientType?)` → `POST /legal-agreement/accept`
新增 `JC-Salon-Frontend/src/utils/agreement-gate.ts`:
- 模块级 `pending` 标志与 `setAgreementPending/isAgreementPending`。
`JC-Salon-Frontend/src/api/index.ts` 请求拦截器:
- 若 `isAgreementPending()` 且 URL 不属于 `/legal-agreement/`、`/admin/auth/`、`/user/logout`,直接 reject 并提示“请先阅读并同意最新版用户协议与隐私政策”。
- 不改造鉴权链,只在现有 axios 拦截器加一个前置判断。
`JC-Salon-Frontend/src/views/admin/AdminLayout.vue`
- `onMounted` 调用 `legalAgreementApi.getPending()`;pending 时 `setAgreementPending(true)` 并显示不可关闭的 `a-modal`。
- 弹层内链接 `/legal/user-terms.html`、`/legal/privacy-policy.html`(静态页运行时读取后台当前协议)。
- “同意并继续”调用 `accept('WEB')`,成功后置 false 并关闭;不提供关闭/取消。
### 3. 小程序
- 现有 `app.js` 已在启动时用 `hasMatchingAgreementVersions(preference.agreementVersions, currentVersions)` 比对当前协议版本,不一致即清 session 并跳登录页重新勾选;登录页 `agreementPromptVisible` 弹层与 `agreementPayload()` 会把新版本写入登录请求并记录同意。V19 发布后该链路自动生效,无需改动鉴权链。
- `JC-Salon-WeChat/api/auth.js` 增加 `getPendingAgreements()` / `acceptCurrentAgreements(clientType)` 供后续页面使用(本次不改变现有登录流程)。
## 四、验证
1. 编译:`mvn -q -DskipTests compile`(`JC-Salon-Core`)。
2. 单测:`mvn -q "-Dtest=CustomerDialServiceImplTest,LegalAgreementServiceImplTest,PlanningServiceImplTest,UserServiceCustomerMatchingTest" test`。
3. 前端构建:`npm run build`(`JC-Salon-Frontend`)。
4. 微信端:`node JC-Salon-WeChat/app-login-flow.test.js`、`node JC-Salon-WeChat/employees-review.test.js`。
5. GitNexus:
- `impact` 检查 `dial`、`CustomerDialServiceImpl`、`DirectDialTargetProvider`、`LegalAgreementServiceImpl`、`LegalAgreementService`、`AdminManagerController.dialCustomer`、`LegalAgreementController`;`UNKNOWN` 用全仓文本检索交叉确认。
- `detect-changes --scope all` 必须非 partial/truncated。
6. 提交:仅暂存本次文件,中文提交;`git push origin dev`,非快进先 `git pull --rebase` 重试一次,仍失败原样报错停止。
## 五、约束与残余风险
- 不修改 `V18__隐私政策与用户协议全场景脱敏条款修订_20261104.sql`。
- 不动任何 ArtList 文件,不动 `SystemSettingsView.vue`。
- V19 假设库中存在现行协议行(V17 的 `2026.11.04`)。若某环境从未执行 V17/V18,则 `INSERT ... SELECT` 无数据可复制,新版本不会生成;需上线前确认该环境已执行到 V18。
- 散客号码优先取订单快照,可能与客户档案最新号码不一致;这是本次明确的产品口径。
- Web 同意拦截在 axios 层与弹层实现,属于前端强制;后端灰心接口仍可被直接调用,未改鉴权链。如需服务端硬拦截,后续单独增加受限路径的协议同意拦截器。
- 管理员登录本身不携带协议勾选,V19 后首次登录会出现强制同意弹层,属于预期行为。
+83
View File
@@ -62,3 +62,86 @@ This project is indexed by GitNexus as **JayuCloud** (36096 symbols, 76216 relat
- For any browser-related operation, including opening, navigating, clicking, typing, inspecting pages/devtools, taking screenshots, testing pages, or automating local/remote web targets, use the `edgedev` MCP server first.
- Do not use other browser automation providers such as Browser, browser-use, Chrome, Playwright MCP, or generic web browsing for browser operations unless `edgedev` is unavailable or the user explicitly requests a different browser/MCP in that turn.
## 项目概述
JayuCloud 是甲屿云双产品线仓库,包含两条业务线,各自拥有完整的端侧矩阵:
- **Salon(店务 / 指尖管理师)**:面向美甲门店经营的管理系统——门店与员工管理、排班规划、预约、订单履约、注册审核、协议与隐私合规。模块:`JC-Salon-Core`(后端)、`JC-Salon-Gateway`(网关)、`JC-Salon-Frontend`(Vue 管理端)、`JC-Salon-WeChat`(指尖管理师小程序)。
- **ArtList(指尖设计师)**:面向用户的设计师作品电商平台——作品浏览、购物车、下单、评价、VIP、优惠券。模块:`JC-ArtList-Core`、`JC-ArtList-Gateway`、`JC-ArtList-Frontend`(Vue 用户端+管理端)、`JC-ArtList-WeChat`(用户小程序)。
- 支撑目录:`nacos/`(各环境 Nacos 配置副本)、`scripts/` 与 `docs/scripts/`(部署脚本与中文配置说明)、`docs/`(文档)、`.gitea/`(Gitea Actions 工作流)。
项目背景、模块职责与关键业务流程详见 `docs/agent/PROJECT_CONTEXT.md`;不可违反的约束见 `docs/agent/PROJECT_CONSTRAINTS.md`。
## 技术栈与版本(已核实)
| 层 | 技术 | 版本 |
| --- | --- | --- |
| 后端语言 | Java | 17 |
| 后端框架 | Spring Boot / Spring Cloud / Spring Cloud Alibaba | 2.7.18 / 2021.0.8 / 2021.0.5.0 |
| ORM / 连接池 | MyBatis-Plus / Druid | 3.5.3.1 / 1.2.23 |
| 认证 | jjwt | 0.11.5 |
| 数据库 / 迁移 | MySQL / Flyway | 迁移文件在各 Core 的 `src/main/resources/db/migration/` |
| 缓存 / 消息 | Redis / RabbitMQ | 版本以 Nacos `infra.yaml` 为准 |
| 注册与配置中心 | Nacos | 命名空间按端侧划分(`jayucloud-salon` / `jayucloud-artlist`) |
| 对象存储 | MinIO → 七牛 Kodo → 阿里云 OSS 三副本编排 | 读取渠道优先级可配置 |
| 网关 | Spring Cloud Gateway + Reactive Redis | `AuthGlobalFilter` 负责白名单与 JWT 初筛 |
| 前端 | Vue 3 + Vite + Element Plus + Ant Design Vue(双组件库)+ Pinia + Vue Router + Axios | Vue 3.5.x |
| 小程序 | 微信原生小程序(非 Taro/uni-app) | 基础库 3.15.2 基线 |
| 构建 | Maven(各模块独立构建,非聚合工程)/ npm | Maven 3.9.x |
| CI/CD | Gitea Actions(dev Nacos 自动发布、prod 部署工作流) | 见 `.gitea/workflows/` |
不得把未经确认的目标版本写成当前使用版本;升级版本属于迁移任务,需单独方案。
## 项目架构
- 调用链:各端 → Gateway(路由、白名单、Token 初筛)→ Core(业务)→ MySQL / Redis / RabbitMQ / 对象存储;服务间内部接口走 `/internal/**`。
- Core 分层:`modules.<业务域>` 下 controller / service / mapper / entity / dto / vo;公共能力在 `common` 与 `config`;统一响应包装为 `common` 包的 `Result<T>`。
- Salon Core 业务域:`analytics、artist、auth、content、file、integration、inventory、manager、marketing、message、order、payment、planning、privacy、product、registration、security、shop、system、user`;ArtList Core 为其收敛子集(已清理 inventory/manager/analytics 等)。
- 配置体系:本地 `application.yaml`/`bootstrap.yaml` 只保留 Nacos 引导参数;运行配置在 Nacos 的 `core.yaml、gateway.yaml、infra.yaml、secret.yaml、logging.yaml`;`secret.yaml` 与 `infra.yaml` 的覆盖关系以实际加载顺序为准,敏感配置只放 Nacos,不入仓库。
- 路由与权限基线:管理端接口走 `/api/admin/**` 门禁;小程序业务走 `/api/**`;匿名白名单逐个端点枚举,禁止宽泛前缀。
## 目录与代码规范
- 新业务优先进入现有 `modules.<业务域>`;跨域引用走对方 Service,不直连他域 Mapper。
- Gateway 不承载业务写逻辑,只做路由、鉴权初筛与转发。
- 命名遵循现有风格:Java 包 `com.xiaowang.jayucloud.<salon|artlist>.<core|gateway>`;前端页面在 `src/views/`,请求封装在 `src/api/`;小程序请求封装在 `utils/request.js`、登录态在 `utils/auth.js`。
- 界面文案统一中文;前端保持现有双组件库用法与页面风格,改版式不改业务行为(接口调用、校验、权限逻辑原样保留)。
- 异常与日志:沿用现有统一异常处理与 Log4j2 配置;日志禁止输出手机号、口令、令牌等敏感明文。
## 数据库规范
- 结构变更一律走 Flyway 版本文件(规则见上方 Project Workflow Rules 与 `docs/agent/PROJECT_CONSTRAINTS.md`):`V{n}__中文功能说明_YYYYMMDD.sql`,完整可执行,已执行文件不得修改。
- 空库初始化仅用 `docs/scripts/sql/init/jayucloud-salon.sql` / `jayucloud-artlist.sql`;生产已部署库升级必须单独制定迁移方案。
- 主键与实体:遵循现有实体的主键策略与软删除/审计字段约定;新增实体需同步检查 `@MapperScan` 包清单与 MyBatis-Plus 自动填充处理器(单例合并)。
- 新增字段必须同时更新实体与版本迁移,并核对历史数据回填需求。
## API 规范
- 风格:REST 风格 + 统一 `Result<T>` 包装;URL 使用小写中划线资源名,遵循所在端既有前缀(`/api`、`/api/admin`、`/internal`)。
- 认证:Bearer JWT,Gateway 初筛 + Core 业务校验;匿名端点必须显式列入白名单并逐个说明理由。
- 权限:管理端按权限码裁剪菜单与接口;数据属主校验(门店作用域)在 Service 层完成。
- 敏感数据:手机号/账号等隐私字段默认脱敏返回,明文获取走独立授权端点(如单次拨号取号);不在列表接口返回完整隐私字段。
- 接口文档:以代码与 `docs/` 说明为准;新增对外契约需在任务说明中写明请求/响应/错误语义。
## 开发与验证要求
- 后端构建(非聚合工程,进对应模块):`mvn -f JC-Salon-Core/pom.xml -DskipTests compile`(ArtList 同理);本机 Maven 位于 `D:\software\apache-maven-3.9.12\bin\mvn.cmd`。
- 涉及 Bean 装配、事务、拦截器的改动:编译通过后还需启动烟测,编译通过不等于能启动。
- 前端:`JC-Salon-Frontend` / `JC-ArtList-Frontend` 下 `npm run build`;开发代理 `/admin/api` 与 `/api` 指向 `VITE_DEV_PROXY_TARGET`。
- 小程序:JS 改动后做 node 语法检查;有条件时用微信开发者工具冒烟。
- 测试:JUnit 5 + Mockito(spring-boot-starter-test);Mock 参数要么全字面量要么全 matcher。
- 修改符号前先做 GitNexus impact 分析,提交前做 detect_changes(见文首 GitNexus 规则);修改完成后按改动范围执行上述对应验证,并如实报告结果。
## 安全与变更保护
- 不擅自删除业务数据;不擅自操作生产环境(生产部署、Nacos 生产发布、生产 SQL 执行必须先核对环境、备份与凭据注入方式并取得确认)。
- 不擅自变更数据库结构(必须走 Flyway 版本文件);不覆盖用户已有配置;不将密钥、口令、令牌写入仓库、日志或文档。
- 重大变更(结构调整、迁移、发布)前先备份;破坏性操作必须先确认。
- 敏感配置只存放在 Nacos `secret.yaml`(按环境),仓库中的 `nacos/` 副本不得包含真实密钥。
## Agent 知识体系
- 项目级技能位于 `.agents/skills/`(`jayu-domain`、`jayu-database`、`jayu-api`、`jayu-devflow`、`jayu-release`),清单与触发条件见 `docs/agent/SKILLS_CATALOG.md`,使用说明见 `docs/agent/AGENT_SKILLS_GUIDE.md`。
- 通用能力(需求分析、架构设计、TDD、调试、评审、运维等)由全局 Skills 提供,项目级技能只承载本项目专属知识,两者不重复建设。
- 交接文档入口:`docs/handoff/`(PROJECT-MAP、CURRENT-STATE 等,部分内容滞后于代码,结论以源码为准);脚本与发布规则入口:`docs/scripts/运行与发布配置总说明.md`。
@@ -5,6 +5,7 @@ import com.xiaowang.jayucloud.salon.core.support.privacy.PhoneCrypto;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
@@ -67,7 +68,8 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
return;
}
Object value = metaObject.getValue(source);
String hash = value == null ? null : PhoneCrypto.current().index(String.valueOf(value));
String text = value == null ? null : String.valueOf(value).trim();
String hash = !StringUtils.hasText(text) ? null : PhoneCrypto.current().index(text);
metaObject.setValue(target, hash);
}
}
@@ -21,4 +21,6 @@ public interface ArtistScheduleService {
ArtistScheduleRuleVO saveRule(ArtistScheduleRuleDTO dto);
ArtistScheduleExceptionVO saveException(ArtistScheduleExceptionDTO dto);
List<ArtistScheduleExceptionVO> listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end);
}
@@ -112,10 +112,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
ArtistScheduleRuleSettingVO setting = new ArtistScheduleRuleSettingVO();
ArtistScheduleRuleDO rule = selectRule(shopId, artistId);
setting.setRule(rule == null ? defaultRuleVO(shopId, artistId) : toRuleVO(rule));
setting.setExceptions(listExceptions(shopId, artistId, LocalDate.now(), LocalDate.now().plusDays(GENERATED_DAYS - 1L))
.stream()
.map(this::toExceptionVO)
.toList());
setting.setExceptions(listExceptions(shopId, artistId, LocalDate.now(), LocalDate.now().plusDays(GENERATED_DAYS - 1L)));
return setting;
}
@@ -153,6 +150,26 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
return toExceptionVO(normalized);
}
@Override
public List<ArtistScheduleExceptionVO> listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end) {
LocalDate begin = start == null ? LocalDate.now().withDayOfMonth(1) : start;
LocalDate finish = end == null ? begin.plusDays(30) : end;
if (finish.isBefore(begin)) {
finish = begin;
}
LambdaQueryWrapper<ArtistScheduleExceptionDO> wrapper = new LambdaQueryWrapper<ArtistScheduleExceptionDO>()
.eq(ArtistScheduleExceptionDO::getShopId, shopId)
.eq(ArtistScheduleExceptionDO::getIsDelete, 0)
.between(ArtistScheduleExceptionDO::getWorkDate, begin, finish)
.orderByAsc(ArtistScheduleExceptionDO::getWorkDate);
if (artistId != null) {
wrapper.eq(ArtistScheduleExceptionDO::getArtistId, artistId);
}
return exceptionMapper.selectList(wrapper).stream()
.map(this::toExceptionVO)
.collect(Collectors.toList());
}
private ArtistScheduleRuleDO normalizeRule(ArtistScheduleRuleDTO dto) {
if (dto == null || dto.getShopId() == null || dto.getArtistId() == null) {
throw new RuntimeException("排班规则信息不完整");
@@ -220,7 +237,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
.last("LIMIT 1"));
}
private List<ArtistScheduleExceptionDO> listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end) {
private List<ArtistScheduleExceptionDO> listExceptionRecords(Long shopId, Long artistId, LocalDate start, LocalDate end) {
return exceptionMapper.selectList(new LambdaQueryWrapper<ArtistScheduleExceptionDO>()
.eq(ArtistScheduleExceptionDO::getShopId, shopId)
.eq(ArtistScheduleExceptionDO::getArtistId, artistId)
@@ -232,7 +249,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
private void refreshGeneratedSchedules(ArtistScheduleRuleDO rule) {
LocalDate start = LocalDate.now();
LocalDate end = start.plusDays(GENERATED_DAYS - 1L);
Map<LocalDate, ArtistScheduleExceptionDO> exceptionByDate = listExceptions(rule.getShopId(), rule.getArtistId(), start, end)
Map<LocalDate, ArtistScheduleExceptionDO> exceptionByDate = listExceptionRecords(rule.getShopId(), rule.getArtistId(), start, end)
.stream()
.collect(Collectors.toMap(ArtistScheduleExceptionDO::getWorkDate, Function.identity(), (a, b) -> a));
LocalDate cursor = start;
@@ -15,6 +15,8 @@ import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleRuleSet
import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleRuleVO;
import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleVO;
import com.xiaowang.jayucloud.salon.core.modules.manager.dto.ManagerCustomerCreateDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.service.OrderService;
import com.xiaowang.jayucloud.salon.core.modules.order.vo.OrderVO;
import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentCreateDTO;
import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentMoveDTO;
import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentStatusDTO;
@@ -38,6 +40,7 @@ import com.xiaowang.jayucloud.salon.core.modules.privacy.vo.CustomerDialVO;
import com.xiaowang.jayucloud.salon.core.modules.user.dto.UserDTO;
import com.xiaowang.jayucloud.salon.core.modules.user.entity.UserDO;
import com.xiaowang.jayucloud.salon.core.modules.user.service.UserService;
import com.xiaowang.jayucloud.salon.core.modules.manager.vo.UnlinkedWechatUserVO;
import com.xiaowang.jayucloud.salon.core.modules.user.vo.UserVO;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
@@ -69,6 +72,7 @@ public class AdminManagerController {
private final ShopService shopService;
private final AdminScopeHelper adminScopeHelper;
private final CustomerDialService customerDialService;
private final OrderService orderService;
@GetMapping("/planning/calendar")
@RequirePermission("schedule:view")
@@ -341,6 +345,75 @@ public class AdminManagerController {
return Result.success(artistScheduleService.saveException(dto));
}
@GetMapping("/employees/schedule-exceptions")
@RequirePermission("schedule:view")
public Result<List<ArtistScheduleExceptionVO>> listScheduleExceptions(HttpServletRequest request,
@RequestParam(required = false) Long artistId,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
Long shopId = adminScopeHelper.resolveShopScope(currentUser, null);
return Result.success(artistScheduleService.listExceptions(shopId, artistId, startDate, endDate));
}
@GetMapping("/orders/preview")
@RequirePermission("order:view")
public Result<List<OrderVO>> orderPreview(HttpServletRequest request,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
Long scopedShopId = adminScopeHelper.resolveShopScope(currentUser, null);
List<OrderVO> orders = Integer.valueOf(3).equals(currentUser.getType())
? orderService.getOrdersByArtistId(currentUser.getId())
: orderService.getAllOrders();
if (scopedShopId != null && !Integer.valueOf(3).equals(currentUser.getType())) {
orders = orders.stream().filter(order -> scopedShopId.equals(order.getShopId())).toList();
}
if (startDate != null) {
orders = orders.stream()
.filter(order -> order.getCreateTime() != null && !order.getCreateTime().toLocalDate().isBefore(startDate))
.toList();
}
if (endDate != null) {
orders = orders.stream()
.filter(order -> order.getCreateTime() != null && !order.getCreateTime().toLocalDate().isAfter(endDate))
.toList();
}
List<OrderVO> preview = orders.stream()
.sorted((left, right) -> {
if (left.getCreateTime() == null) return 1;
if (right.getCreateTime() == null) return -1;
return right.getCreateTime().compareTo(left.getCreateTime());
})
.limit(10)
.toList();
return Result.success(preview);
}
@GetMapping("/employees/users/unlinked-candidates")
@RequirePermission("user:create")
public Result<List<UnlinkedWechatUserVO>> unlinkedWechatCandidates(HttpServletRequest request,
@RequestParam(required = false) String keyword) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
Long shopId = adminScopeHelper.resolveShopScope(currentUser, null);
java.util.Set<Long> linkedUserIds = nailArtistInfoService.getByShopId(shopId).stream()
.map(NailArtistInfoDTO::getUserId)
.filter(java.util.Objects::nonNull)
.collect(java.util.stream.Collectors.toSet());
String normalizedKeyword = keyword == null ? "" : keyword.trim().toLowerCase();
List<UnlinkedWechatUserVO> candidates = userService.listUsersByShopId(shopId).stream()
.filter(user -> Integer.valueOf(1).equals(user.getType()))
.filter(user -> user.getId() != null && !linkedUserIds.contains(user.getId()))
.filter(user -> normalizedKeyword.isEmpty()
|| String.valueOf(user.getNickname() == null ? "" : user.getNickname()).toLowerCase().contains(normalizedKeyword)
|| String.valueOf(user.getMaskedPhone() == null ? "" : user.getMaskedPhone()).contains(normalizedKeyword))
.limit(50)
.map(user -> new UnlinkedWechatUserVO(user.getId(), user.getNickname(), user.getMaskedPhone(),
user.getAvatar(), user.getWechatId(), user.getCreateTime()))
.toList();
return Result.success(candidates);
}
@GetMapping("/products")
@RequirePermission("product:view")
public Result<PageResultVO<ProductVO>> products(HttpServletRequest request,
@@ -0,0 +1,17 @@
package com.xiaowang.jayucloud.salon.core.modules.manager.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@AllArgsConstructor
public class UnlinkedWechatUserVO {
private Long id;
private String nickname;
private String maskedPhone;
private String avatar;
private String wechatId;
private LocalDateTime createTime;
}
@@ -34,6 +34,8 @@ import com.xiaowang.jayucloud.salon.core.modules.planning.service.PlanningServic
import com.xiaowang.jayucloud.salon.core.modules.security.support.AdminScopeHelper;
import com.xiaowang.jayucloud.salon.core.modules.order.support.OrderStatus;
import com.xiaowang.jayucloud.salon.core.modules.file.support.ObjectStorageUrlSupport;
import com.xiaowang.jayucloud.salon.core.modules.file.service.ObjectStorageFileService;
import com.xiaowang.jayucloud.salon.core.modules.file.vo.ObjectStorageFileVO;
import com.xiaowang.jayucloud.salon.core.modules.planning.support.PlanningCalendarSupport;
import com.xiaowang.jayucloud.salon.core.modules.planning.support.PlanningTodayOverviewSupport;
import com.xiaowang.jayucloud.salon.core.support.id.TimeOrderedSnowflakeIdGenerator;
@@ -104,6 +106,7 @@ public class PlanningServiceImpl implements PlanningService {
private final WechatSubscribeMessageService wechatSubscribeMessageService;
private final TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator;
private final ObjectStorageUrlSupport objectStorageUrlSupport;
private final ObjectStorageFileService objectStorageFileService;
private final PhoneCrypto phoneCrypto;
@Override
@@ -632,6 +635,7 @@ public class PlanningServiceImpl implements PlanningService {
vo.setProductTitle(reservation != null && hasText(reservation.getProductTitle())
? reservation.getProductTitle()
: product == null ? "预约作品" : product.getTitle());
vo.setCoverImages(resolveProductCoverImages(product));
vo.setArtistId(artistId);
boolean unassigned = artistId == null;
vo.setArtistName(unassigned ? "待分配" : artist == null ? "美甲师" : artist.getName());
@@ -993,6 +997,52 @@ public class PlanningServiceImpl implements PlanningService {
.collect(Collectors.toMap(OrderItemDO::getId, Function.identity(), (a, b) -> a));
}
private List<String> resolveProductCoverImages(ProductDO product) {
if (product == null || !hasText(product.getImageFileIds())) {
return List.of();
}
Set<Long> fileIds = new HashSet<>();
for (String rawId : product.getImageFileIds().split(",")) {
String normalized = rawId == null ? "" : rawId.trim();
if (!normalized.isEmpty()) {
try {
fileIds.add(Long.parseLong(normalized));
} catch (NumberFormatException ignored) {
}
}
}
if (fileIds.isEmpty()) {
return List.of();
}
Map<Long, ObjectStorageFileVO> files = objectStorageFileService.getObjectStorageFileMapByIds(fileIds);
return parseOrderedCoverUrls(product.getImageFileIds(), files);
}
private List<String> parseOrderedCoverUrls(String imageFileIds, Map<Long, ObjectStorageFileVO> files) {
List<String> urls = new ArrayList<>();
for (String rawId : imageFileIds.split(",")) {
String normalized = rawId == null ? "" : rawId.trim();
if (normalized.isEmpty()) {
continue;
}
Long fileId;
try {
fileId = Long.parseLong(normalized);
} catch (NumberFormatException ignored) {
continue;
}
ObjectStorageFileVO file = files.get(fileId);
if (file == null) {
continue;
}
String url = objectStorageUrlSupport.toAccessibleUrl(file);
if (hasText(url)) {
urls.add(url);
}
}
return urls;
}
private Map<Long, OrderDO> loadOrders(Set<Long> orderIds) {
if (orderIds == null || orderIds.isEmpty()) {
return Map.of();
@@ -3,6 +3,7 @@ package com.xiaowang.jayucloud.salon.core.modules.planning.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class PlanningAppointmentVO {
@@ -17,6 +18,8 @@ public class PlanningAppointmentVO {
private Boolean customerPhoneAvailable;
private Long productId;
private String productTitle;
/** 作品图片访问地址,用于预约详情项目图片轮播 */
private List<String> coverImages;
private Long artistId;
private String artistName;
private String artistColor;
@@ -574,7 +574,8 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe
? null : contentModerationRecordMapper.selectById(application.getContentModerationRecordId());
return new WorkbenchRegistrationStatusVO(application.getId(), application.getApplicationNo(), application.getRoleType(),
application.getStatus(), application.getRejectReason(), application.getShopId(), application.getShopName(),
moderation == null ? null : moderation.getStatus(), moderation == null ? null : moderation.getReason());
moderation == null ? null : moderation.getStatus(), moderation == null ? null : moderation.getReason(),
application.getCreateTime());
}
private WorkbenchRegistrationReviewVO toReviewVO(WorkbenchRegistrationApplicationDO application, UserDO applicant,
@@ -3,6 +3,8 @@ package com.xiaowang.jayucloud.salon.core.modules.registration.vo;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.time.LocalDateTime;
@Getter
@AllArgsConstructor
public class WorkbenchRegistrationStatusVO {
@@ -15,4 +17,5 @@ public class WorkbenchRegistrationStatusVO {
private String shopName;
private String contentModerationStatus;
private String contentModerationReason;
private LocalDateTime createTime;
}
@@ -384,7 +384,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
if (userDTO == null || !Integer.valueOf(3).equals(userDTO.getType())) throw new IllegalArgumentException("仅支持新增美甲师");
if (shopId == null || shopId <= 0) throw new IllegalArgumentException("门店不能为空");
if (!StringUtils.hasText(userDTO.getNickname())) throw new IllegalArgumentException("美甲师姓名不能为空");
String phone = validateUserPhone(userDTO.getPhone(), null, true);
String phone = validateUserPhone(userDTO.getPhone(), null, false);
UserDO userDO = new UserDO();
userDO.setShopId(shopId);
userDO.setNickname(userDTO.getNickname().trim());
+14
View File
@@ -30,6 +30,13 @@ module.exports = {
})
},
unlinkedCandidates(params) {
return request({
url: '/manager/employees/users/unlinked-candidates',
params
})
},
schedules(params) {
return request({
url: '/manager/employees/schedules',
@@ -68,6 +75,13 @@ module.exports = {
})
},
scheduleExceptions(params) {
return request({
url: '/manager/employees/schedule-exceptions',
params
})
},
reviewSummary() {
return request({
url: '/user/workbench/registration/summary'
+7
View File
@@ -14,6 +14,13 @@ module.exports = {
})
},
orderPreview(params) {
return request({
url: '/manager/orders/preview',
params
})
},
createAppointment(data) {
return request({
url: '/manager/planning/appointments',
+22 -8
View File
@@ -48,7 +48,7 @@ button::after {
.card {
border: 1rpx solid var(--theme-border);
border-radius: 12px;
border-radius: 20rpx;
background: var(--theme-card-bg);
box-shadow: 0 10rpx 28rpx rgba(23, 33, 31, 0.06);
}
@@ -97,8 +97,8 @@ button::after {
align-items: center;
justify-content: center;
width: 100%;
min-height: 76rpx;
border-radius: 12px;
min-height: 88rpx;
border-radius: 20rpx;
font-size: 26rpx;
font-weight: 700;
}
@@ -117,16 +117,30 @@ button::after {
}
.secondary-btn {
border: 1rpx solid var(--theme-border);
background: var(--theme-card-bg);
color: var(--text-primary);
border: 1rpx solid #E7ECE9;
background: #F1F3F2;
color: #71807A;
}
.danger-btn {
background: #d98d8d;
background: #B3261E;
color: #fff;
}
.btn-row {
display: flex;
gap: 20rpx;
}
.btn-row .primary-btn,
.btn-row .secondary-btn,
.btn-row .danger-btn {
width: auto;
min-width: 0;
max-width: none;
flex: 1 1 0;
}
.text-btn {
width: auto;
min-width: 0;
@@ -185,7 +199,7 @@ button::after {
.field {
display: flex;
align-items: center;
min-height: 108rpx;
min-height: 112rpx;
border-bottom: 1rpx solid var(--theme-border);
}
@@ -0,0 +1,56 @@
Component({
data: {
visible: false,
title: '',
content: '',
icon: '',
cancelText: '',
confirmText: '确定',
confirmType: 'primary',
layout: 'column',
editable: false,
placeholderText: '',
inputValue: ''
},
methods: {
open(options = {}) {
this._onClose = typeof options.onClose === 'function' ? options.onClose : null
this.setData({
visible: true,
title: options.title || '',
content: options.content || '',
icon: options.icon || '',
cancelText: options.cancelText || '',
confirmText: options.confirmText || '确定',
confirmType: options.confirmType || 'primary',
layout: options.layout || (options.cancelText ? 'row' : 'column'),
editable: options.editable === true,
placeholderText: options.placeholderText || '',
inputValue: ''
})
},
close(result) {
this.setData({ visible: false })
const onClose = this._onClose
this._onClose = null
if (onClose) onClose(result)
},
onInput(event) {
this.setData({ inputValue: event.detail.value })
},
onConfirm() {
this.close({ confirm: true, cancel: false, content: this.data.inputValue })
},
onCancel() {
this.close({ confirm: false, cancel: true, content: this.data.inputValue })
},
stopEvent() {
}
}
})
@@ -0,0 +1,4 @@
{
"component": true,
"styleIsolation": "apply-shared"
}
@@ -0,0 +1,12 @@
<view wx:if="{{visible}}" class="action-modal-mask" catchtouchmove="stopEvent">
<view class="action-modal-card">
<view wx:if="{{icon}}" class="action-modal-icon {{icon}}">{{icon === 'warning' ? '!' : 'i'}}</view>
<text class="action-modal-title">{{title}}</text>
<text wx:if="{{content}}" class="action-modal-content">{{content}}</text>
<input wx:if="{{editable}}" class="action-modal-input" value="{{inputValue}}" maxlength="60" placeholder="{{placeholderText}}" bindinput="onInput" />
<view class="action-modal-actions {{layout === 'row' ? 'row' : ''}}">
<button wx:if="{{cancelText}}" class="action-modal-btn secondary" bindtap="onCancel">{{cancelText}}</button>
<button class="action-modal-btn {{confirmType === 'danger' ? 'danger' : 'primary'}}" bindtap="onConfirm">{{confirmText}}</button>
</view>
</view>
</view>
@@ -0,0 +1,117 @@
.action-modal-mask {
position: fixed;
z-index: 80;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 40rpx;
background: rgba(23, 33, 31, 0.45);
}
.action-modal-card {
box-sizing: border-box;
display: flex;
width: 100%;
flex-direction: column;
align-items: center;
padding: 40rpx 32rpx 32rpx;
border-radius: 28rpx;
background: #ffffff;
}
.action-modal-icon {
display: flex;
align-items: center;
justify-content: center;
width: 88rpx;
height: 88rpx;
margin-bottom: 20rpx;
border-radius: 50%;
background: #FFF1DC;
color: #8B5E24;
font-size: 44rpx;
font-weight: 800;
line-height: 1;
}
.action-modal-title {
color: #17211f;
font-size: 32rpx;
font-weight: 800;
text-align: center;
}
.action-modal-content {
margin-top: 16rpx;
color: #71807a;
font-size: 26rpx;
line-height: 1.6;
text-align: center;
}
.action-modal-input {
box-sizing: border-box;
width: 100%;
height: 88rpx;
margin-top: 24rpx;
padding: 0 24rpx;
border: 1rpx solid #e7ece9;
border-radius: 16rpx;
background: #f7faf8;
color: #17211f;
font-size: 26rpx;
}
.action-modal-actions {
display: flex;
width: 100%;
flex-direction: column;
gap: 20rpx;
margin-top: 32rpx;
}
.action-modal-actions.row {
flex-direction: row;
}
.action-modal-btn {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 88rpx;
padding: 0;
border: 0;
border-radius: 20rpx;
font-size: 26rpx;
font-weight: 700;
line-height: 88rpx;
}
.action-modal-btn::after {
border: 0;
}
.action-modal-btn.secondary {
border: 1rpx solid #E7ECE9;
background: #F1F3F2;
color: #71807A;
}
.action-modal-btn.primary {
background: #247B63;
color: #ffffff;
}
.action-modal-btn.danger {
background: #B3261E;
color: #ffffff;
}
.action-modal-actions.row .action-modal-btn {
width: auto;
min-width: 0;
flex: 1 1 0;
}
@@ -54,7 +54,7 @@
display: flex;
align-items: center;
justify-content: space-between;
min-height: 92rpx;
min-height: 96rpx;
padding: 0 28rpx;
}
@@ -96,7 +96,7 @@
.selector-search-wrap {
display: flex;
align-items: center;
min-height: 80rpx;
min-height: 83rpx;
margin: 0 28rpx 18rpx;
padding: 0 22rpx;
border: 1rpx solid #e7ece9;
@@ -155,7 +155,7 @@
.selector-sort { flex: 0 0 auto; color: #476259; }
.selector-search {
height: 78rpx;
height: 81rpx;
flex: 1;
color: #17211f;
font-size: 27rpx;
@@ -174,9 +174,9 @@
.selector-item {
display: flex;
align-items: center;
min-height: 112rpx;
min-height: 156rpx;
margin-bottom: 14rpx;
padding: 20rpx;
padding: 26rpx;
border: 1rpx solid #e7ece9;
border-radius: 24rpx;
background: #fff;
@@ -209,8 +209,8 @@
.selector-item.card-view .selector-check { position: absolute; right: 18rpx; bottom: 16rpx; }
.selector-avatar {
width: 76rpx;
height: 76rpx;
width: 80rpx;
height: 80rpx;
flex: 0 0 auto;
border-radius: 50%;
background: #e7ece9;
+6
View File
@@ -3,5 +3,11 @@ const { BRAND_CONFIG } = require('../../utils/config')
Page({
data: {
appName: BRAND_CONFIG.appName
},
goLegal(event) {
const type = event.currentTarget.dataset.type
if (!type) return
wx.navigateTo({ url: `/pages/legal/index?type=${type}` })
}
})
+23 -2
View File
@@ -5,7 +5,28 @@
<text class="desc">专为美甲店店长设计的预约排班日历子系统</text>
</view>
<view class="card about-list">
<view class="row between"><text>版本</text><text class="muted">0.0.1</text></view>
<view class="row between"><text>定位</text><text class="muted">日程 / 客户 / 美甲师 / 我的</text></view>
<view class="about-row"><text>版本</text><text class="muted">0.0.1</text></view>
<view class="about-row"><text>定位</text><text class="muted">日程 / 客户 / 美甲师 / 我的</text></view>
<view class="about-row about-link" bindtap="goLegal" data-type="USER_TERMS">
<text>用户协议</text>
<text class="about-arrow">›</text>
</view>
<view class="about-row about-link" bindtap="goLegal" data-type="PRIVACY_POLICY">
<text>隐私政策</text>
<text class="about-arrow">›</text>
</view>
</view>
<view class="log-card">
<text class="log-title">版本更新日志</text>
<view class="log-entry">
<text class="log-version">0.0.1</text>
<text class="log-date">2026-11-05</text>
</view>
<view class="log-lines">
<text class="log-line">新增补充资料与申请状态设计稿(店长 / 店员)</text>
<text class="log-line">我的页支持店长 / 美甲师身份切换</text>
<text class="log-line">用户协议与隐私政策入口并入关于系统</text>
</view>
<text class="log-foot">后续版本更新将在此处按时间倒序展示</text>
</view>
</view>
+77 -2
View File
@@ -24,12 +24,87 @@
}
.desc {
margin-top: 12rpx;
margin-top: 15rpx;
color: #90887e;
font-size: 24rpx;
}
.about-list {
margin-top: 20rpx;
padding: 24rpx;
padding: 28rpx;
}
.about-row {
display: flex;
align-items: center;
justify-content: space-between;
height: 86rpx;
font-size: 28rpx;
}
.about-link {
padding-left: 12rpx;
}
.about-arrow {
color: #b0a79e;
font-size: 44rpx;
line-height: 1;
}
.log-card {
display: flex;
flex-direction: column;
margin-top: 20rpx;
padding: 31rpx;
border-radius: 12px;
background: #ffffff;
}
.log-title {
font-size: 29rpx;
font-weight: 700;
line-height: 1.35;
}
.log-entry {
display: flex;
align-items: center;
margin-top: 19rpx;
}
.log-version {
display: flex;
align-items: center;
justify-content: center;
width: 111rpx;
height: 42rpx;
border-radius: 21rpx;
background: #e5f4ed;
color: #247b63;
font-size: 21rpx;
font-weight: 700;
}
.log-date {
margin-left: 15rpx;
color: #71807a;
font-size: 22rpx;
}
.log-lines {
margin-top: 18rpx;
}
.log-line {
display: block;
color: #17211f;
font-size: 22rpx;
line-height: 1.9;
}
.log-foot {
margin-top: 29rpx;
color: #9aa9a0;
font-size: 21rpx;
}
+12 -12
View File
@@ -2,6 +2,7 @@ const userApi = require('../../api/user')
const auth = require('../../utils/auth')
const profileCache = require('../../utils/profile-cache')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
Page({
data: {
@@ -34,14 +35,13 @@ Page({
},
async requestClosure() {
const confirmed = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '申请注销账号',
content: '申请提交后由管理人员处理。完成后会清理账号身份资料,必要业务记录仍按保存要求保留。你可以在处理前撤回。',
confirmText: '提交申请',
success: result => resolve(result.confirm),
fail: () => resolve(false)
}))
if (!confirmed) return
confirmType: 'danger'
})
if (!result.confirm) return
try {
const closureRequest = await userApi.requestAccountClosure()
this.setData({ closureRequest })
@@ -52,8 +52,8 @@ Page({
},
async withdrawClosure() {
const confirmed = await new Promise(resolve => wx.showModal({ title: '撤回注销申请', content: '确定撤回账号注销申请吗?', success: result => resolve(result.confirm), fail: () => resolve(false) }))
if (!confirmed) return
const result = await showActionModal(this, { title: '撤回注销申请', content: '确定撤回账号注销申请吗?', cancelText: '取消', confirmText: '确定' })
if (!result.confirm) return
try {
await userApi.withdrawAccountClosure()
await this.loadClosureRequest()
@@ -163,14 +163,14 @@ Page({
if (!/^\d{6}$/.test(code)) {
wx.showToast({ title: '请输入当前手机号收到的6位验证码', icon: 'none' }); return
}
const confirmed = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '解绑手机号',
content: '解绑后手机号将从账号资料中删除,短信验证码仅用于验证当前手机号。确定继续吗?',
cancelText: '取消',
confirmText: '确认解绑',
success: result => resolve(result.confirm),
fail: () => resolve(false)
}))
if (!confirmed) return
confirmType: 'danger'
})
if (!result.confirm) return
this.setData({ binding: true })
try {
await userApi.unbindPhone(code)
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "账号设置"
"navigationBarTitleText": "账号设置",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
@@ -30,4 +30,5 @@
<button wx:elif="{{!closureRequest || closureRequest.status === 'REJECTED'}}" class="closure-btn" bindtap="requestClosure">申请注销账号</button>
</block>
</view>
<action-modal id="actionModal" />
</view>
@@ -2,6 +2,7 @@ const planningApi = require('../../api/planning')
const customersApi = require('../../api/customers')
const { markPlanningRefresh } = require('../../utils/planning-refresh')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function displayValue(value, fallback) {
if (value === null || value === undefined) return fallback
@@ -18,6 +19,8 @@ Page({
data: {
id: '',
appointment: {},
coverImages: [],
coverIndex: 0,
avatarText: '',
timeText: '',
isUnassigned: false,
@@ -74,8 +77,13 @@ Page({
remarkText: displayValue(safeAppointment.remark, '暂无备注'),
cancelReasonText: displayValue(safeAppointment.cancelReason, '')
}
const coverImages = Array.isArray(safeAppointment.coverImages)
? safeAppointment.coverImages.filter(item => Boolean(item))
: []
this.setData({
appointment: normalizedAppointment,
coverImages,
coverIndex: 0,
isUnassigned,
avatarText: normalizedAppointment.customerNameText.slice(0, 1),
timeText,
@@ -87,6 +95,10 @@ Page({
})
},
onCoverChange(event) {
this.setData({ coverIndex: Number(event.detail.current) || 0 })
},
async updateStatus(status) {
if (this.data.updating || !this.data.appointment.orderId) return
if (status !== 3 && this.data.isUnassigned) {
@@ -116,21 +128,20 @@ Page({
this.updateStatus(2)
},
cancel() {
async cancel() {
if (!this.data.showCancel || this.data.updating) return
this._cancelReason = ''
wx.showModal({
const result = await showActionModal(this, {
title: '取消预约',
editable: true,
placeholderText: '可填写取消原因',
content: '',
cancelText: '取消',
confirmText: '确认取消',
success: result => {
if (!result.confirm) return
this._cancelReason = result.content || ''
this.updateStatus(3)
}
confirmType: 'danger'
})
if (!result.confirm) return
this._cancelReason = result.content || ''
this.updateStatus(3)
},
async dialCustomer() {
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "预约详情"
"navigationBarTitleText": "预约详情",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
@@ -56,6 +56,24 @@
</view>
</view>
<view wx:if="{{!loadError && coverImages.length}}" class="section cover-section">
<view class="cover-head">
<text class="section-title">项目图片</text>
<text class="cover-count">{{coverIndex + 1}} / {{coverImages.length}}</text>
</view>
<view class="cover-card">
<swiper class="cover-swiper" circular="{{coverImages.length > 1}}" bindchange="onCoverChange">
<swiper-item wx:for="{{coverImages}}" wx:key="*this">
<image class="cover-image" src="{{item}}" mode="aspectFill" />
</swiper-item>
</swiper>
<view class="cover-dots">
<view wx:for="{{coverImages}}" wx:key="*this" class="cover-dot {{index === coverIndex ? 'active' : ''}}"></view>
</view>
</view>
<text class="cover-hint">左滑查看更多项目图</text>
</view>
<view wx:if="{{!loadError}}" class="section">
<view class="section-title">备注</view>
<view class="card note-card">{{appointment.remarkText}}</view>
@@ -67,4 +85,5 @@
<button wx:if="{{showComplete}}" class="secondary-btn" loading="{{updating}}" disabled="{{updating}}" bindtap="complete">{{appointment.historicalBackfill ? '完成补单' : '完成服务'}}</button>
<button wx:if="{{showCancel}}" class="danger-btn" loading="{{updating}}" disabled="{{updating}}" bindtap="cancel">取消预约</button>
</view>
<action-modal id="actionModal" />
</view>
@@ -38,8 +38,8 @@
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 82rpx;
height: 82rpx;
width: 85rpx;
height: 85rpx;
border-radius: 50%;
background: #e5f4ed;
color: #5d8175;
@@ -76,13 +76,14 @@
.call-btn {
flex-shrink: 0;
margin: 0;
padding: 0 18rpx;
border-radius: 999rpx;
background: #edf6ef;
padding: 0 16rpx;
border: 1rpx solid #247b63;
border-radius: 20rpx;
background: #ffffff;
color: #247b63;
font-size: 22rpx;
font-weight: 800;
line-height: 44rpx;
font-size: 21rpx;
font-weight: 600;
line-height: 40rpx;
}
.status-tag {
@@ -163,6 +164,75 @@
overflow-wrap: anywhere;
}
.cover-section {
margin-top: 28rpx;
}
.cover-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.cover-count {
color: #71807a;
font-size: 22rpx;
}
.cover-card {
box-sizing: border-box;
width: 100%;
height: 304rpx;
padding: 20rpx;
border-radius: 24rpx;
background: #fbfdfb;
border: 1rpx solid #e7ece9;
}
.cover-swiper {
width: 100%;
height: 208rpx;
border-radius: 16rpx;
overflow: hidden;
}
.cover-image {
width: 100%;
height: 208rpx;
border-radius: 16rpx;
background: #e5f4ed;
}
.cover-dots {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
height: 56rpx;
}
.cover-dot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background: #d5ddd9;
transition: width 0.2s;
}
.cover-dot.active {
width: 26rpx;
border-radius: 6rpx;
background: #247b63;
}
.cover-hint {
display: block;
margin-top: 12rpx;
color: #a1aca6;
font-size: 20rpx;
}
.note-card {
padding: 24rpx;
color: #71807a;
+38 -63
View File
@@ -5,6 +5,7 @@ const dateUtil = require('../../utils/date')
const { markPlanningRefresh } = require('../../utils/planning-refresh')
const { uploadObjectFile } = require('../../utils/upload')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
const DRAFT_STORAGE_PREFIX = 'managerAppointmentDraft'
const DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1000
@@ -39,15 +40,12 @@ function isShopBusinessExpired() {
return Number(userInfo.type) === 2 && userInfo.shopBusinessExpired === true
}
function showBusinessExpiryNotice() {
return new Promise(resolve => wx.showModal({
function showBusinessExpiryNotice(page) {
return showActionModal(page, {
title: '门店经营有效期已到期',
content: '当前门店暂不能新增普通预约。历史订单、查询和补录不受影响,请联系平台管理员办理续期。',
showCancel: false,
confirmText: '知道了',
success: () => resolve(),
fail: () => resolve()
}))
confirmText: '知道了'
}).then(() => {})
}
function buildDraftKey() {
@@ -1136,14 +1134,13 @@ Page({
wx.showToast({ title: '图片上传中,请稍后再恢复默认值', icon: 'none' })
return
}
const result = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '恢复默认值',
content: '将清除本表单内容和本机草稿,但不会删除已上传图片文件。保留日历带入的日期和美甲师,确定继续吗?',
cancelText: '继续填写',
confirmText: '恢复默认',
success: resolve,
fail: () => resolve({ confirm: false })
}))
confirmType: 'danger'
})
if (!result.confirm) return
this.cancelDraftSave()
try {
@@ -1219,15 +1216,11 @@ Page({
const nextDate = event.detail.value
const today = dateUtil.formatDate(new Date())
if (nextDate < today) {
const result = await new Promise(resolve => {
wx.showModal({
title: '历史日期不能新建预约',
content: '之前的日期只能作为历史补单记录,不会校验美甲师排班,也不会占用预约时段。',
cancelText: '取消',
confirmText: '去补单',
success: resolve,
fail: () => resolve({ confirm: false })
})
const result = await showActionModal(this, {
title: '历史日期不能新建预约',
content: '之前的日期只能作为历史补单记录,不会校验美甲师排班,也不会占用预约时段。',
cancelText: '取消',
confirmText: '去补单'
})
if (result.confirm) {
const query = [`serviceDate=${encodeURIComponent(nextDate)}`]
@@ -1785,14 +1778,12 @@ Page({
},
async showBackfillPrompt(serviceDate, reason = '该日期或时段已过去') {
const result = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '转为历史补单',
content: `${reason},普通预约不能使用过去时间。可以前往补录历史订单,或取消继续选择未来时间。`,
cancelText: '取消',
confirmText: '去补录',
success: resolve,
fail: () => resolve({ confirm: false })
}))
confirmText: '去补录'
})
if (!result.confirm) return
const query = [`serviceDate=${encodeURIComponent(serviceDate || dateUtil.formatDate(new Date()))}`]
const artistId = this.data.form.artistId || this._pendingHistoricalArtistId
@@ -1905,15 +1896,11 @@ Page({
try {
const matches = await customersApi.matchIdentityForAppointment(name, wechatId || undefined, phone || undefined)
if (matches.length > 1) {
const choice = await new Promise(resolve => {
wx.showModal({
title: '找到多个同名客户',
content: phone ? '无法确定唯一客户,请选择已有客户或按散客继续。' : '请先补充手机号或选择一个已有客户,也可以按散客继续。',
cancelText: '不关联提交',
confirmText: '选择客户',
success: resolve,
fail: () => resolve({ confirm: false })
})
const choice = await showActionModal(this, {
title: '找到多个同名客户',
content: phone ? '无法确定唯一客户,请选择已有客户或按散客继续。' : '请先补充手机号或选择一个已有客户,也可以按散客继续。',
cancelText: '不关联提交',
confirmText: '选择客户'
})
if (!choice.confirm) {
this.setData({ 'form.createCustomerRecord': false })
@@ -1928,15 +1915,11 @@ Page({
}
if (matches.length > 0) {
const customer = normalizeCustomer(matches[0])
const choice = await new Promise(resolve => {
wx.showModal({
title: '客户已存在',
content: `系统中已有“${name}”${phone ? `(${phone})` : ''},是否使用该客户?`,
cancelText: '不关联提交',
confirmText: '使用已有',
success: resolve,
fail: () => resolve({ confirm: false })
})
const choice = await showActionModal(this, {
title: '客户已存在',
content: `系统中已有“${name}”${phone ? `(${phone})` : ''},是否使用该客户?`,
cancelText: '不关联提交',
confirmText: '使用已有'
})
if (choice.confirm) {
this.setData({
@@ -1950,15 +1933,11 @@ Page({
return true
}
const createChoice = await new Promise(resolve => {
wx.showModal({
title: '新建客户',
content: '系统中没有匹配客户,是否新建到客户档案?',
cancelText: '不新建',
confirmText: '确认',
success: resolve,
fail: () => resolve({ confirm: false })
})
const createChoice = await showActionModal(this, {
title: '新建客户',
content: '系统中没有匹配客户,是否新建到客户档案?',
cancelText: '不新建',
confirmText: '确认'
})
this.setData({ 'form.createCustomerRecord': Boolean(createChoice.confirm) })
return true
@@ -1979,7 +1958,7 @@ Page({
return
}
if (isShopBusinessExpired()) {
await showBusinessExpiryNotice()
await showBusinessExpiryNotice(this)
return
}
let form = this.data.form
@@ -2022,15 +2001,11 @@ Page({
return
}
if (!form.artistId) {
const result = await new Promise(resolve => {
wx.showModal({
title: '保存为待分配预约',
content: '当前未指定美甲师,预约会正常保存,但不会占用美甲师时间。可以稍后在预约详情中分配。',
cancelText: '返回选择',
confirmText: '继续保存',
success: resolve,
fail: () => resolve({ confirm: false })
})
const result = await showActionModal(this, {
title: '保存为待分配预约',
content: '当前未指定美甲师,预约会正常保存,但不会占用美甲师时间。可以稍后在预约详情中分配。',
cancelText: '返回选择',
confirmText: '继续保存'
})
if (!result.confirm) return
}
@@ -2079,7 +2054,7 @@ Page({
wx.redirectTo({ url: `/pages/appointment-detail/index?id=${result.orderItemId}` })
} catch (error) {
if ((error.message || '').includes('有效期') || (error.message || '').includes('到期')) {
await showBusinessExpiryNotice()
await showBusinessExpiryNotice(this)
} else {
showErrorToast(error, '提交失败')
}
@@ -2,6 +2,7 @@
"navigationBarTitleText": "新增预约",
"usingComponents": {
"entity-selector-sheet": "/components/entity-selector-sheet/index",
"product-selector-sheet": "/components/product-selector-sheet/index"
"product-selector-sheet": "/components/product-selector-sheet/index",
"action-modal": "/components/action-modal/index"
}
}
@@ -150,4 +150,5 @@
</view>
<view class="fixed-bottom"><view wx:if="{{canCreateAppointment}}" class="action-row"><button class="secondary-btn draft-btn" bindtap="saveDraft">保存草稿</button><button class="primary-btn submit-btn" loading="{{loading}}" bindtap="submit">提交预约</button></view></view>
<action-modal id="actionModal" />
</view>
@@ -747,7 +747,7 @@ button.link-action {
.appointment-page .form-card {
margin-bottom: 24rpx;
padding: 28rpx 30rpx 24rpx;
padding: 28rpx 34rpx 24rpx;
border: 2rpx solid #e7ece9;
border-radius: 38rpx;
background: #fff;
@@ -800,11 +800,11 @@ button.link-action {
.field-card {
display: flex;
width: 100%;
min-height: 124rpx;
min-height: 129rpx;
align-items: center;
gap: 22rpx;
padding: 20rpx 22rpx;
border: 2rpx dashed #cbdcd5;
border: 2rpx solid #cbdcd5;
border-radius: 30rpx;
background: #fbfdfc;
text-align: left;
@@ -820,12 +820,12 @@ button.full{
.field-icon {
display: flex;
width: 76rpx;
height: 76rpx;
flex: 0 0 76rpx;
width: 79rpx;
height: 79rpx;
flex: 0 0 79rpx;
align-items: center;
justify-content: center;
border-radius: 24rpx;
border-radius: 25rpx;
background: #e5f4ed;
color: #247b63;
font-size: 34rpx;
@@ -845,7 +845,7 @@ button.full{
.field-label {
width: auto;
color: #71807a;
font-size: 21rpx;
font-size: 23rpx;
font-weight: 600;
line-height: 1.35;
}
@@ -857,7 +857,7 @@ button.full{
margin-top: 5rpx;
overflow: hidden;
color: #17211f;
font-size: 27rpx;
font-size: 28rpx;
font-weight: 800;
line-height: 1.35;
text-overflow: ellipsis;
@@ -935,7 +935,7 @@ button.full{
box-sizing: border-box;
width: 100%;
min-width: 0;
height: 88rpx;
height: 92rpx;
margin: 0;
padding: 0 16rpx;
border: 2rpx solid #dce6e1;
@@ -947,10 +947,10 @@ button.full{
.customer-library-btn {
display: flex;
width: 88rpx;
min-width: 88rpx;
max-width: 88rpx;
height: 88rpx;
width: 92rpx;
min-width: 92rpx;
max-width: 92rpx;
height: 196rpx;
align-items: center;
justify-content: center;
border-radius: 24rpx;
@@ -5,6 +5,7 @@ const customersApi = require('../../api/customers')
const dateUtil = require('../../utils/date')
const { uploadObjectFile } = require('../../utils/upload')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function normalizeProduct(product, artists) {
const artistIds = String(product.bookableArtists || '').split(',').map(id => id.trim()).filter(Boolean)
@@ -42,14 +43,13 @@ Page({
wx.showToast({ title: '图片上传中,请稍后再恢复默认值', icon: 'none' })
return
}
const result = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '恢复默认值',
content: '将清除本次补录内容,但不会删除已上传图片文件。保留入口带入的日期和美甲师,确定继续吗?',
cancelText: '继续填写',
confirmText: '恢复默认',
success: resolve,
fail: () => resolve({ confirm: false })
}))
confirmType: 'danger'
})
if (!result.confirm) return
const defaults = this._entryDefaults || {}
const artistId = defaults.artistId || ''
@@ -1,4 +1,4 @@
{
"navigationBarTitleText": "补录历史订单",
"usingComponents": { "entity-selector-sheet": "/components/entity-selector-sheet/index", "product-selector-sheet": "/components/product-selector-sheet/index" }
"usingComponents": { "entity-selector-sheet": "/components/entity-selector-sheet/index", "product-selector-sheet": "/components/product-selector-sheet/index", "action-modal": "/components/action-modal/index" }
}
@@ -97,4 +97,5 @@
<view class="manual-style-footer"><button class="manual-style-confirm" bindtap="useManualProduct">用于本次补录</button><button class="manual-style-library-link" bindtap="openProductLibrary">从款式库中选择</button></view>
</view>
</view>
<action-modal id="actionModal" />
</view>
@@ -26,6 +26,45 @@
.backfill-page .customer-library-btn { width: 76rpx; min-width: 76rpx; height: 76rpx; border-radius: 18rpx; }
.backfill-page .service-status-section { padding-bottom: 24rpx; }
.backfill-page .submit-btn { width: 100%; }
.backfill-page .field-card { min-height: 116rpx; }
.status-segment {
display: flex;
gap: 12rpx;
}
.status-option {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
gap: 10rpx;
height: 68rpx;
border: 1rpx solid #e7ece9;
border-radius: 16rpx;
background: #f3f7f4;
color: #71807a;
font-size: 24rpx;
line-height: 1;
}
.status-option.active {
border-color: #9ccdbb;
background: #dff1e9;
color: #247b63;
font-weight: 700;
}
.status-indicator {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background: #c9a26a;
}
.status-indicator.in-service {
background: #247b63;
}
.backfill-manual-style-sheet { height: 70vh; }
@media (max-width: 360px) {
.backfill-page .customer-fields { gap: 6rpx; }
@@ -64,7 +64,7 @@
justify-content: center;
width: 120rpx;
height: 120rpx;
border: 8rpx solid #ffffff;
border: 2rpx solid #ffffff;
border-radius: 50%;
color: #fff;
font-size: 20rpx;
@@ -3,7 +3,7 @@
align-items: center;
justify-content: space-between;
gap: 18rpx;
padding: 24rpx;
padding: 27rpx;
}
.customer-identity {
@@ -51,7 +51,7 @@
}
.stat {
padding: 16rpx 12rpx;
padding: 18rpx 12rpx;
}
.stat-value,
@@ -75,6 +75,14 @@
display: flex;
align-items: center;
justify-content: space-between;
padding: 27rpx;
}
.meta {
display: block;
margin-top: 8rpx;
color: #928a81;
font-size: 25rpx;
}
.order-title {
+2 -2
View File
@@ -36,8 +36,8 @@ Page({
customers: list.map(item => ({
id: item.id,
name: item.nickname || item.name || item.account || '客户',
phone: item.contactPhone || item.phone || '未填写',
lastTime: item.lastOrderTime || item.lastConsumeTime || '-'
phone: item.contactPhone || item.phone || '未填写联系电话',
lastTime: item.lastOrderTime || item.lastConsumeTime || '暂无消费记录'
}))
})
} catch (error) {
+4 -4
View File
@@ -3,8 +3,8 @@
<view class="search-card card">
<input value="{{keyword}}" bindinput="onSearchInput" placeholder="搜索客户姓名或手机号" />
</view>
<button class="compact-btn" bindtap="addCustomer">新增</button>
</view>
<view class="fab" bindtap="addCustomer">+</view>
<view class="list section">
<view wx:if="{{loadError}}" class="empty card">
@@ -14,9 +14,9 @@
<view wx:elif="{{customers.length === 0}}" class="empty card">暂无客户</view>
<view wx:for="{{customers}}" wx:key="id" class="card list-card customer-card" data-id="{{item.id}}" bindtap="openDetail">
<view>
<text class="name">{{item.name}}</text>
<text class="meta">{{item.phone}}</text>
<text class="meta">最近消费 {{item.lastTime}}</text>
<text class="name">姓名: {{item.name}}</text>
<text class="meta">联系电话: {{item.phone}}</text>
<text class="meta">最近消费: {{item.lastTime}}</text>
</view>
<text class="arrow">›</text>
</view>
@@ -23,6 +23,25 @@
justify-content: space-between;
}
.fab {
position: fixed;
right: 28rpx;
bottom: 12rpx;
z-index: 40;
display: flex;
align-items: center;
justify-content: center;
width: 87rpx;
height: 87rpx;
border-radius: 44rpx;
background: #247b63;
box-shadow: 0 12rpx 28rpx rgba(36, 123, 99, 0.28);
color: #ffffff;
font-size: 48rpx;
font-weight: 400;
line-height: 1;
}
.name,
.meta {
display: block;
+255 -22
View File
@@ -1,8 +1,67 @@
const employeesApi = require('../../api/employees')
const { chooseImageFilePath, uploadObjectFile } = require('../../utils/upload')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
const { markPlanningRefresh } = require('../../utils/planning-refresh')
const EMPLOYEE_COLORS = ['#7BA7C7', '#8FB89A', '#A894C7', '#D7A86E', '#D98DA5', '#79A6A3', '#B9A16B', '#9BA9C8']
const COLOR_WHEEL_RADIUS = 110
function clamp(value, min, max) {
return Math.min(max, Math.max(min, value))
}
function normalizeHex(value) {
const raw = String(value || '').trim().replace('#', '')
if (/^[0-9a-fA-F]{3}$/.test(raw)) {
return ('#' + raw.split('').map(char => char + char).join('')).toUpperCase()
}
if (/^[0-9a-fA-F]{6}$/.test(raw)) return ('#' + raw).toUpperCase()
return ''
}
function rgbToHex(red, green, blue) {
return ('#' + [red, green, blue]
.map(value => Math.round(clamp(value, 0, 255)).toString(16).padStart(2, '0'))
.join('')).toUpperCase()
}
function hsvToHex(hue, saturation) {
const normalizedHue = ((Number(hue) % 360) + 360) % 360
const s = clamp(Number(saturation) || 0, 0, 1)
const chroma = s
const x = chroma * (1 - Math.abs(((normalizedHue / 60) % 2) - 1))
const offset = 1 - chroma
let red = 0
let green = 0
let blue = 0
if (normalizedHue < 60) { red = chroma; green = x }
else if (normalizedHue < 120) { red = x; green = chroma }
else if (normalizedHue < 180) { green = chroma; blue = x }
else if (normalizedHue < 240) { green = x; blue = chroma }
else if (normalizedHue < 300) { red = x; blue = chroma }
else { red = chroma; blue = x }
return rgbToHex((red + offset) * 255, (green + offset) * 255, (blue + offset) * 255)
}
function hexToHsv(value) {
const hex = normalizeHex(value) || '#8FB89A'
const red = parseInt(hex.slice(1, 3), 16) / 255
const green = parseInt(hex.slice(3, 5), 16) / 255
const blue = parseInt(hex.slice(5, 7), 16) / 255
const max = Math.max(red, green, blue)
const min = Math.min(red, green, blue)
const delta = max - min
let hue = 0
if (delta === 0) hue = 0
else if (max === red) hue = 60 * (((green - blue) / delta) % 6)
else if (max === green) hue = 60 * ((blue - red) / delta + 2)
else hue = 60 * ((red - green) / delta + 4)
return {
hue: ((hue % 360) + 360) % 360,
saturation: max === 0 ? 0 : delta / max
}
}
Page({
data: {
@@ -10,8 +69,20 @@ Page({
appointmentContext: { date: '', time: '', durationMinutes: '' },
applicationId: '',
employeeColors: EMPLOYEE_COLORS,
colorSheetVisible: false,
colorDraft: '#8FB89A',
colorHexInput: '#8FB89A',
wheelDotX: COLOR_WHEEL_RADIUS,
wheelDotY: 0,
onboardingVisible: false,
createdEmployee: null,
userPickerVisible: false,
userLoading: false,
userKeyword: '',
userCandidates: [],
userItems: [],
selectedWechatUserId: '',
selectedWechatUser: null,
associationSheetVisible: false,
associationLoading: false,
associationApplications: [],
@@ -49,8 +120,142 @@ Page({
this.setData({ [`form.${field}`]: value })
},
selectColor(event) {
this.setData({ 'form.color': event.currentTarget.dataset.color })
openColorSheet() {
const color = normalizeHex(this.data.form.color) || '#8FB89A'
this.setData({ colorSheetVisible: true, colorDraft: color, colorHexInput: color })
this.applyDraftColor(color)
if (typeof wx.nextTick === 'function') {
wx.nextTick(() => {
wx.createSelectorQuery().in(this).select('.color-wheel').boundingClientRect(rect => {
this._wheelRect = rect
}).exec()
})
}
},
closeColorSheet() {
this.setData({ colorSheetVisible: false })
},
stopColorSheetTap() {},
pickDraftColor(event) {
const color = normalizeHex(event.currentTarget.dataset.color)
if (color) this.applyDraftColor(color)
},
onColorHexInput(event) {
this.setData({ colorHexInput: event.detail.value })
},
applyColorHex() {
const color = normalizeHex(this.data.colorHexInput)
if (!color) {
wx.showToast({ title: '请输入有效的十六进制色值', icon: 'none' })
return
}
this.applyDraftColor(color)
},
applyDraftColor(color) {
const { hue, saturation } = hexToHsv(color)
const angle = (hue - 90) * Math.PI / 180
const distance = saturation * COLOR_WHEEL_RADIUS
this.setData({
colorDraft: color,
colorHexInput: color,
wheelDotX: Math.round(COLOR_WHEEL_RADIUS + Math.cos(angle) * distance),
wheelDotY: Math.round(COLOR_WHEEL_RADIUS + Math.sin(angle) * distance)
})
},
applyWheelPoint(clientX, clientY) {
const rect = this._wheelRect
if (!rect || !rect.width) return
const centerX = rect.left + rect.width / 2
const centerY = rect.top + rect.height / 2
const radius = rect.width / 2
const offsetX = clientX - centerX
const offsetY = clientY - centerY
const distance = Math.min(radius, Math.sqrt(offsetX * offsetX + offsetY * offsetY))
const hue = ((Math.atan2(offsetY, offsetX) * 180 / Math.PI + 90) % 360 + 360) % 360
this.applyDraftColor(hsvToHex(hue, radius ? distance / radius : 0))
},
onWheelTap(event) {
const touch = event.touches && event.touches[0]
if (touch) this.applyWheelPoint(touch.clientX, touch.clientY)
},
onWheelTouch(event) {
const touch = event.touches && event.touches[0]
if (touch) this.applyWheelPoint(touch.clientX, touch.clientY)
},
saveColorSheet() {
this.setData({ 'form.color': this.data.colorDraft, colorSheetVisible: false })
},
async openUserPicker() {
if (this.data.creating || this.data.avatarUploading) return
this.setData({ userPickerVisible: true, userLoading: true, userKeyword: '' })
try {
const list = await employeesApi.unlinkedCandidates()
this.applyUserCandidates(Array.isArray(list) ? list : (list && list.list) || [])
} catch (error) {
showErrorToast(error, '微信用户加载失败')
} finally {
this.setData({ userLoading: false })
}
},
applyUserCandidates(candidates) {
this.setData({
userCandidates: candidates,
userItems: candidates.map(item => ({
id: String(item.id),
title: item.nickname || '微信用户',
subtitle: [item.maskedPhone || item.phone, item.createTime && String(item.createTime).replace('T', ' ').slice(0, 10)].filter(Boolean).join(' · ') || '已登录小程序',
meta: item.wechatId || '',
avatar: item.avatar || ''
}))
})
},
onUserSearch(event) {
const userKeyword = String(event.detail.value || '').trim().toLowerCase()
const candidates = this.data.userCandidates
const userItems = candidates
.filter(item => !userKeyword || [item.nickname, item.maskedPhone, item.phone, item.wechatId]
.some(value => String(value || '').toLowerCase().includes(userKeyword)))
.map(item => ({
id: String(item.id),
title: item.nickname || '微信用户',
subtitle: [item.maskedPhone || item.phone, item.createTime && String(item.createTime).replace('T', ' ').slice(0, 10)].filter(Boolean).join(' · ') || '已登录小程序',
meta: item.wechatId || '',
avatar: item.avatar || ''
}))
this.setData({ userKeyword, userItems })
},
selectWechatUser(event) {
const item = event.detail && event.detail.item
if (!item) return
const candidate = this.data.userCandidates.find(user => String(user.id) === String(item.id))
if (!candidate) return
this.setData({
userPickerVisible: false,
selectedWechatUserId: String(candidate.id),
selectedWechatUser: item,
'form.nickname': candidate.nickname || '',
'form.avatar': candidate.avatar || '',
'form.avatarUrl': candidate.avatar || ''
})
},
closeUserPicker() {
if (this.data.userLoading) return
this.setData({ userPickerVisible: false })
},
async chooseAvatar() {
@@ -95,26 +300,57 @@ Page({
const nickname = String(form.nickname || '').trim()
const phone = String(form.phone || '').trim()
const wechatId = String(form.wechatId || '').trim()
if (!nickname || !phone) {
wx.showToast({ title: '请补全美甲师信息', icon: 'none' })
if (this.data.selectedWechatUserId) {
if (!nickname) {
wx.showToast({ title: '请填写美甲师姓名', icon: 'none' })
return
}
this.setData({ creating: true })
try {
const saved = await employeesApi.save({
userId: this.data.selectedWechatUserId,
nickname,
color: form.color,
avatar: form.avatar || undefined
})
const id = saved && typeof saved === 'object' ? (saved.userId || saved.id) : this.data.selectedWechatUserId
markPlanningRefresh()
this.setData({
createdEmployee: { id, name: nickname, title: nickname, avatar: form.avatar || '' },
applicationApproved: false
})
await this.offerPendingAssociation()
} catch (error) {
showErrorToast(error, '新增失败')
} finally {
this.setData({ creating: false })
}
return
}
if (!/^1[3-9]\d{9}$/.test(phone)) {
if (!nickname) {
wx.showToast({ title: '请填写美甲师姓名', icon: 'none' })
return
}
if (phone && !/^1[3-9]\d{9}$/.test(phone)) {
wx.showToast({ title: '请输入正确手机号', icon: 'none' })
return
}
this.setData({ creating: true })
try {
const result = await employeesApi.createUser({
const payload = {
nickname,
phone,
contactPhone: phone,
wechatId,
color: form.color,
avatar: form.avatar || undefined,
type: 3
})
}
if (phone) {
payload.phone = phone
payload.contactPhone = phone
}
const result = await employeesApi.createUser(payload)
const id = result && typeof result === 'object' ? (result.id || result.userId) : result
markPlanningRefresh()
const employee = { id, name: nickname, title: nickname, avatar: form.avatar || '' }
this.setData({ createdEmployee: employee, applicationApproved: false })
if (this.data.applicationId) {
@@ -143,16 +379,15 @@ Page({
wx.showToast({ title: '已关联并通过审核', icon: 'success' })
} catch (error) {
this.setData({ associatingApplication: false })
wx.showModal({
const result = await showActionModal(this, {
title: '关联审核未完成',
content: toUserMessage(error, '美甲师档案已创建,可重试关联申请。'),
icon: 'warning',
confirmText: '重试',
cancelText: '稍后处理',
success: result => {
if (result.confirm) this.associateCreatedEmployee()
else this.setData({ onboardingVisible: true })
}
cancelText: '稍后处理'
})
if (result.confirm) this.associateCreatedEmployee()
else this.setData({ onboardingVisible: true })
}
},
@@ -256,17 +491,15 @@ Page({
remark: '新建美甲师默认全年全天排班,预约仍受门店营业时间限制,可在排班设置中调整'
}).then(() => {
this.finishCreated(this.data.pickerMode, true)
}).catch(error => {
wx.showModal({
}).catch(async error => {
const result = await showActionModal(this, {
title: '默认排班设置失败',
content: toUserMessage(error, '未设置排班前,该美甲师暂不可预约。请重试或返回排班设置。'),
confirmText: '重试',
cancelText: '稍后设置',
success: result => {
if (result.confirm) this.skipFirstSchedule()
else this.setData({ savingDefaultSchedule: false })
}
cancelText: '稍后设置'
})
if (result.confirm) this.skipFirstSchedule()
else this.setData({ savingDefaultSchedule: false })
}).finally(() => {
if (this.data.onboardingVisible) this.setData({ savingDefaultSchedule: false })
})
@@ -1,6 +1,7 @@
{
"navigationBarTitleText": "新增美甲师",
"usingComponents": {
"entity-selector-sheet": "/components/entity-selector-sheet/index"
"entity-selector-sheet": "/components/entity-selector-sheet/index",
"action-modal": "/components/action-modal/index"
}
}
@@ -4,14 +4,20 @@ const employeesApi = require('../../api/employees')
let navigatedBack = false
let navigatedTo = ''
let modalConfirm = false
const storage = {}
const app = { globalData: {} }
global.wx = {
getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }),
getDeviceInfo: () => ({ platform: 'devtools' }),
showToast: () => {},
showModal: options => options.success({ confirm: modalConfirm }),
navigateBack: () => { navigatedBack = true },
navigateTo: options => { navigatedTo = options.url }
navigateTo: options => { navigatedTo = options.url },
setStorageSync: (key, value) => { storage[key] = value },
getStorageSync: key => storage[key]
}
global.getApp = () => app
global.getCurrentPages = () => []
global.setTimeout = callback => { callback(); return 1 }
let definition
@@ -65,6 +71,8 @@ async function run() {
})
assert.strictEqual(page.data.onboardingVisible, true)
assert.strictEqual(emitted, undefined)
assert.strictEqual(app.globalData.planningNeedRefresh, true)
assert.strictEqual(storage.planningNeedRefresh, '1')
let schedulePayload
page.data.pickerMode = true
@@ -9,11 +9,12 @@
<image wx:else class="avatar-preview" src="/assets/images/default-user-avatar.png" mode="aspectFit"></image>
<view class="avatar-copy">
<text class="avatar-title">美甲师头像</text>
<text class="avatar-tip">点击选择图片,可稍后补充</text>
<text class="avatar-tip">点击选择图片</text>
</view>
<text class="avatar-action">{{avatarUploading ? '上传中' : '更换'}}</text>
<!-- <text class="avatar-action">{{avatarUploading ? '上传中' : '更换'}}</text> -->
<button wx:if="{{form.avatarUrl}}" class="avatar-action" catchtap="removeAvatar" style="width: 95rpx; display: block; box-sizing: border-box; left: 58rpx; top: 0rpx; height: 24rpx; position: relative">移除</button>
</view>
<button wx:if="{{form.avatarUrl}}" class="remove-avatar" catchtap="removeAvatar">移除当前头像</button>
<view class="card form-card create-form">
<view class="field">
@@ -21,24 +22,27 @@
<input value="{{form.nickname}}" data-field="nickname" bindinput="onInput" placeholder="请输入美甲师姓名" />
</view>
<view class="field">
<text class="field-label required">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" maxlength="11" placeholder="请输入手机号" />
</view>
<view class="login-unlinked">
<text class="login-unlinked-label">微信登录</text>
<text class="login-unlinked-status">未关联</text>
<text class="login-unlinked-note">可在店长审核微信注册申请时快速关联</text>
<text class="field-label">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" maxlength="11" placeholder="选填" />
</view>
<view class="field">
<text class="field-label">微信号</text>
<input value="{{form.wechatId}}" data-field="wechatId" bindinput="onInput" placeholder="选填" />
</view>
<view class="field color-field">
<text class="field-label required">专属颜色</text>
<view class="color-options">
<view wx:for="{{employeeColors}}" wx:key="*this" class="color-option {{form.color === item ? 'selected' : ''}}" style="background: {{item}};" data-color="{{item}}" bindtap="selectColor"></view>
<text class="field-label required">日程排班
展示颜色</text>
<view class="color-current">
<view class="color-current-chip" style="background: {{form.color}};"></view>
<text class="color-current-value">{{form.color}}</text>
<view class="color-select-btn" bindtap="openColorSheet">选择颜色</view>
</view>
</view>
<view class="login-unlinked" bindtap="openUserPicker">
<text class="login-unlinked-label">微信账号</text>
<text class="login-unlinked-status">{{selectedWechatUser ? '已绑定' : '未绑定'}}</text>
<text class="login-unlinked-note">{{selectedWechatUser ? selectedWechatUser.title : '点击可选择当前店铺中未绑定身份的微信身份进行绑定'}}</text>
</view>
</view>
<view class="fixed-bottom">
@@ -53,14 +57,37 @@
<view wx:if="{{applicationId && !applicationApproved}}" class="association-retry-box">
<text>申请编号 {{applicationNo || applicationId}}</text>
<button class="primary-btn onboarding-primary" loading="{{associatingApplication}}" disabled="{{associatingApplication}}" bindtap="associateCreatedEmployee">重试关联并通过审核</button>
<button class="onboarding-skip" disabled="{{associatingApplication}}" bindtap="leaveAssociationForLater">稍后处理</button>
<button class="secondary-btn onboarding-skip" disabled="{{associatingApplication}}" bindtap="leaveAssociationForLater">稍后处理</button>
</view>
<block wx:else>
<text class="onboarding-default-note">不立即设置时,将默认全年无休、全天排班(00:00-23:59);实际预约仍受门店营业时间限制,之后可在排班设置中调整。</text>
<button class="primary-btn onboarding-primary" loading="{{savingDefaultSchedule}}" disabled="{{savingDefaultSchedule}}" bindtap="setupFirstSchedule">{{pickerMode ? '设置排班并分配' : '立即设置排班'}}</button>
<button class="onboarding-skip" loading="{{savingDefaultSchedule}}" disabled="{{savingDefaultSchedule}}" bindtap="skipFirstSchedule">{{pickerMode ? '暂不设置(使用全天排班)' : '不设置,保留全天排班'}}</button>
<button class="secondary-btn onboarding-skip" loading="{{savingDefaultSchedule}}" disabled="{{savingDefaultSchedule}}" bindtap="skipFirstSchedule">{{pickerMode ? '暂不设置(使用全天排班)' : '不设置,保留全天排班'}}</button>
</block>
</view>
</view>
<view wx:if="{{colorSheetVisible}}" class="color-sheet-mask" catchtouchmove="stopTouchMove" catchtap="closeColorSheet">
<view class="color-sheet" catchtap="stopColorSheetTap">
<view class="color-sheet-handle"></view>
<text class="color-sheet-title">选择颜色</text>
<view class="color-preview" style="background: {{colorDraft}};"></view>
<text class="color-section-title">推荐色</text>
<view class="color-grid">
<view wx:for="{{employeeColors}}" wx:key="*this" class="color-grid-item {{colorDraft === item ? 'selected' : ''}}" style="background: {{item}};" data-color="{{item}}" bindtap="pickDraftColor"></view>
</view>
<text class="color-section-title">色轮</text>
<view class="color-wheel" bindtap="onWheelTap" catchtouchmove="onWheelTouch">
<view class="color-wheel-dot" style="left: {{wheelDotX}}rpx; top: {{wheelDotY}}rpx; background: {{colorDraft}};"></view>
</view>
<text class="color-section-title">自定义色值</text>
<view class="color-hex-row">
<input class="color-hex-input" value="{{colorHexInput}}" bindinput="onColorHexInput" maxlength="7" placeholder="#8FB89A" />
<button class="color-apply-btn" bindtap="applyColorHex">应用</button>
</view>
<button class="primary-btn color-save-btn" bindtap="saveColorSheet">保存颜色</button>
</view>
</view>
<entity-selector-sheet visible="{{userPickerVisible}}" title="选择微信用户" keyword="{{userKeyword}}" placeholder="搜索昵称或手机号" items="{{userItems}}" selected-id="{{selectedWechatUserId}}" loading="{{userLoading}}" empty-text="暂无未关联的微信用户" action-text="暂不关联" bind:search="onUserSearch" bind:select="selectWechatUser" bind:action="closeUserPicker" bind:close="closeUserPicker" />
<entity-selector-sheet visible="{{associationSheetVisible}}" title="关联待审核申请" keyword="{{associationKeyword}}" placeholder="搜索申请昵称、手机号或编号" items="{{associationItems}}" selected-id="{{associationSelectedId}}" loading="{{associationLoading}}" empty-text="暂无可关联申请" action-text="暂不关联,继续" bind:search="onAssociationSearch" bind:select="selectAssociation" bind:action="skipAssociation" bind:close="skipAssociation" />
<action-modal id="actionModal" />
</view>
+156 -12
View File
@@ -37,7 +37,8 @@
.login-unlinked-label { color: #536b5d; font-size: 24rpx; font-weight: 700; }
.login-unlinked-status { margin-left: 18rpx; color: #247b63; font-size: 24rpx; font-weight: 700; }
.login-unlinked-note { flex-basis: 100%; margin-top: 10rpx; color: #829287; font-size: 21rpx; }
.login-unlinked-note { flex: 1; flex-basis: 100%; margin-top: 10rpx; color: #829287; font-size: 21rpx; }
.login-unlinked-arrow { flex-shrink: 0; margin-left: 8rpx; color: #247b63; font-size: 30rpx; font-weight: 600; line-height: 1; }
.avatar-card {
display: flex;
@@ -94,23 +95,166 @@
width: 176rpx;
}
.color-options {
.color-current {
display: flex;
flex-wrap: wrap;
gap: 18rpx;
padding: 10rpx 0;
flex: 1;
min-width: 0;
align-items: center;
gap: 16rpx;
}
.color-option {
width: 44rpx;
height: 44rpx;
border: 4rpx solid #fff;
border-radius: 50%;
.color-current-chip {
width: 56rpx;
height: 56rpx;
flex: none;
border-radius: 14rpx;
box-shadow: 0 0 0 1rpx #d9e3dd;
}
.color-option.selected {
box-shadow: 0 0 0 4rpx #287a62;
.color-current-value {
color: #71807a;
font-size: 24rpx;
}
.color-select-btn {
display: flex;
flex: none;
align-items: center;
gap: 6rpx;
height: 56rpx;
margin-left: auto;
padding: 0 20rpx;
border: 1rpx solid #e7ece9;
border-radius: 999rpx;
background: #05753d;
color: #fdfdfd;
font-size: 23rpx;
font-weight: 700;
}
.color-select-arrow {
font-size: 24rpx;
line-height: 1;
}
.color-sheet-mask {
position: fixed;
z-index: 60;
inset: 0;
display: flex;
align-items: flex-end;
background: rgba(23, 33, 31, 0.45);
}
.color-sheet {
box-sizing: border-box;
width: 100%;
padding: 12rpx 28rpx calc(28rpx + env(safe-area-inset-bottom));
border-radius: 40rpx 40rpx 0 0;
background: #ffffff;
}
.color-sheet-handle {
width: 72rpx;
height: 8rpx;
margin: 0 auto 18rpx;
border-radius: 999rpx;
background: #dfe5e2;
}
.color-sheet-title {
display: block;
color: #17211f;
font-size: 30rpx;
font-weight: 800;
text-align: center;
}
.color-preview {
height: 110rpx;
margin-top: 18rpx;
border-radius: 16rpx;
box-shadow: 0 0 0 1rpx #e7ece9 inset;
}
.color-section-title {
display: block;
margin-top: 20rpx;
color: #71807a;
font-size: 22rpx;
}
.color-grid {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 14rpx;
margin-top: 12rpx;
}
.color-grid-item {
height: 56rpx;
border-radius: 12rpx;
box-shadow: 0 0 0 1rpx #e7ece9;
}
.color-grid-item.selected {
box-shadow: 0 0 0 4rpx #247b63;
}
.color-wheel {
position: relative;
width: 220rpx;
height: 220rpx;
margin: 18rpx auto 0;
border-radius: 50%;
background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0) 72%), conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}
.color-wheel-dot {
position: absolute;
width: 26rpx;
height: 26rpx;
border: 3rpx solid #ffffff;
border-radius: 50%;
box-shadow: 0 0 0 1rpx rgba(0, 0, 0, 0.25);
transform: translate(-50%, -50%);
}
.color-hex-row {
display: flex;
align-items: center;
gap: 16rpx;
margin-top: 12rpx;
}
.color-hex-input {
flex: 1;
min-width: 0;
height: 80rpx;
padding: 0 24rpx;
border: 1rpx solid #e7ece9;
border-radius: 12rpx;
background: #f7faf8;
font-size: 26rpx;
}
.color-apply-btn {
display: flex;
flex: none;
align-items: center;
height: 80rpx;
margin: 0;
padding: 0 28rpx;
border-radius: 12rpx;
background: #e5f4ed;
color: #247b63;
font-size: 24rpx;
font-weight: 700;
line-height: 80rpx;
}
.color-save-btn {
margin-top: 24rpx;
}
.onboarding-mask {
@@ -3,6 +3,12 @@ const { toUserMessage } = require('../../utils/toast')
const EMPLOYEE_COLORS = ['#7AA9C2', '#8EB99B', '#BDA7D8', '#D7B17D', '#D98D8D']
function formatAmount(value) {
const amount = Number(value || 0)
if (!Number.isFinite(amount)) return '0'
return amount.toLocaleString('zh-CN', { maximumFractionDigits: 2 })
}
Page({
data: {
id: '',
@@ -30,7 +36,9 @@ Page({
color: data.color || EMPLOYEE_COLORS[0],
monthOrders,
monthAmount,
avgAmount: monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0
monthAmountText: formatAmount(monthAmount),
avgAmount: monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0,
avgAmountText: formatAmount(monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0)
}
})
} catch (error) {
@@ -19,11 +19,11 @@
<text class="stat-label">本月订单</text>
</view>
<view class="card stat">
<text class="stat-value">¥{{employee.monthAmount}}</text>
<text class="stat-value">¥{{employee.monthAmountText}}</text>
<text class="stat-label">本月营业额</text>
</view>
<view class="card stat">
<text class="stat-value">¥{{employee.avgAmount}}</text>
<text class="stat-value">¥{{employee.avgAmountText}}</text>
<text class="stat-label">平均客单价</text>
</view>
</view>
+8 -11
View File
@@ -2,6 +2,7 @@ const employeesApi = require('../../api/employees')
const planningApi = require('../../api/planning')
const dateUtil = require('../../utils/date')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
const EMPLOYEE_COLORS = ['#7AA9C2', '#8EB99B', '#BDA7D8', '#D7B17D', '#D98D8D']
@@ -16,12 +17,6 @@ function formatApplicationTime(value) {
return String(value).replace('T', ' ').slice(0, 16)
}
function confirmModal(options) {
return new Promise(resolve => {
wx.showModal({ ...options, success: resolve, fail: () => resolve({ confirm: false }) })
})
}
Page({
data: {
employees: [],
@@ -134,7 +129,7 @@ Page({
})
if (!artists.length) {
this.setData({ associationSheetVisible: false })
const result = await confirmModal({
const result = await showActionModal(this, {
title: '需要先新建美甲师',
content: '当前门店没有未关联微信的美甲师档案。新建后将自动关联这条申请并通过审核。',
confirmText: '去新建',
@@ -203,7 +198,7 @@ Page({
useApplicantNickname ? '采用申请昵称' : '保留门店姓名',
useApplicantAvatar ? '采用申请头像' : '保留门店头像'
].join('\n')
const confirmed = await confirmModal({ title: '确认关联并通过', content: summary, confirmText: '确认通过' })
const confirmed = await showActionModal(this, { title: '确认关联并通过', content: summary, confirmText: '确认通过' })
if (!confirmed.confirm) return
this.setData({ associationSheetVisible: false })
@@ -215,7 +210,7 @@ Page({
},
askProfileAdoption(field, value) {
return confirmModal({
return showActionModal(this, {
title: `采用申请${field}?`,
content: field === '昵称' ? `申请昵称为“${value}”,采用后会替换门店员工姓名。` : '采用后会替换门店员工当前头像。',
confirmText: `采用申请${field}`,
@@ -226,12 +221,14 @@ Page({
async rejectApplication(event) {
const id = event.currentTarget.dataset.id
if (!id || this.data.reviewingId) return
const result = await confirmModal({
const result = await showActionModal(this, {
title: '驳回美甲师申请',
content: '',
editable: true,
placeholderText: '请输入驳回原因',
confirmText: '确认驳回'
cancelText: '取消',
confirmText: '确认驳回',
confirmType: 'danger'
})
if (!result.confirm) return
const reason = String(result.content || '').trim()
+2 -1
View File
@@ -1,6 +1,7 @@
{
"navigationBarTitleText": "美甲师",
"usingComponents": {
"entity-selector-sheet": "/components/entity-selector-sheet/index"
"entity-selector-sheet": "/components/entity-selector-sheet/index",
"action-modal": "/components/action-modal/index"
}
}
@@ -43,7 +43,7 @@ function createPage() {
async function run() {
const styles = fs.readFileSync(path.join(__dirname, 'index.wxss'), 'utf8')
assert(styles.includes('min-width: 0;'))
assert(styles.includes('flex-wrap: wrap;'))
assert(styles.includes('.review-main'))
assert(styles.includes('@media (max-width: 390px)'))
assert(styles.includes('text-overflow: ellipsis;'))
const employeesApi = require('../../api/employees')
+18 -9
View File
@@ -9,8 +9,14 @@
<view wx:if="{{isManager && reviewExpanded}}" class="review-panel card">
<view class="review-panel-head">
<view><text class="review-title">美甲师申请审核</text><text class="review-subtitle">仅显示当前门店待处理申请</text></view>
<text class="review-count">{{reviewPendingCount}} 项</text>
<view class="review-head-text">
<text class="review-title">美甲师申请审核</text>
<text class="review-subtitle">仅显示当前门店待处理申请</text>
</view>
<view class="review-head-actions">
<text class="review-count">{{reviewPendingCount}} 项</text>
<view class="review-collapse" bindtap="toggleReview"><text class="review-collapse-icon">︿</text></view>
</view>
</view>
<view wx:if="{{reviewLoading}}" class="review-state">正在加载申请…</view>
<view wx:elif="{{reviewError}}" class="review-state review-error">
@@ -20,13 +26,15 @@
<view wx:elif="{{reviewApplications.length === 0}}" class="review-state">暂无待审核美甲师申请</view>
<view wx:else class="review-list">
<view wx:for="{{reviewApplications}}" wx:key="id" class="review-item">
<image class="review-avatar" src="{{item.applicantAvatar || '/assets/images/default-user-avatar.png'}}" mode="aspectFill" data-index="{{index}}" binderror="onReviewAvatarError"></image>
<view class="review-info">
<text class="review-name">{{item.applicantDisplayName}}</text>
<text wx:if="{{item.targetArtistUserId}}" class="review-meta">已预关联美甲师</text>
<text wx:if="{{item.applicantMaskedPhone}}" class="review-meta">{{item.applicantMaskedPhone}}</text>
<text class="review-meta">{{item.shopName || '当前门店'}} · {{item.applicationTimeText}}</text>
<text class="review-number">申请编号 {{item.applicationNo}}</text>
<view class="review-main">
<image class="review-avatar" src="{{item.applicantAvatar || '/assets/images/default-user-avatar.png'}}" mode="aspectFill" data-index="{{index}}" binderror="onReviewAvatarError"></image>
<view class="review-info">
<text class="review-name">{{item.applicantDisplayName}}</text>
<text wx:if="{{item.targetArtistUserId}}" class="review-meta">已预关联美甲师</text>
<text wx:if="{{item.applicantMaskedPhone}}" class="review-meta">{{item.applicantMaskedPhone}}</text>
<text class="review-meta">{{item.shopName || '当前门店'}} · {{item.applicationTimeText}}</text>
<text class="review-number">申请编号 {{item.applicationNo}}</text>
</view>
</view>
<view class="review-actions">
<button class="review-action reject" data-id="{{item.id}}" disabled="{{reviewingId}}" bindtap="rejectApplication">驳回</button>
@@ -76,4 +84,5 @@
bind:close="closeApprovalAssociation"
/>
<action-modal id="actionModal" />
</view>
+58 -34
View File
@@ -21,12 +21,13 @@
position: relative;
margin-right: 12rpx;
margin-left: 0;
border-color: #c9d8d2;
background: #eef5f2;
color: #247b63;
border-color: #247b63;
background: #247b63;
color: #fff;
}
.list-heading .review-toggle.is-open {
border-color: #247b63;
background: #247b63;
color: #fff;
}
@@ -48,23 +49,47 @@
.review-panel {
margin-bottom: 22rpx;
padding: 22rpx;
padding: 24rpx;
border: 1rpx solid #dce8e3;
background: #f8fcfa;
}
.review-panel-head,
.review-item,
.review-actions {
.review-panel-head {
display: flex;
align-items: center;
}
.review-panel-head {
justify-content: space-between;
margin-bottom: 16rpx;
}
.review-head-text {
min-width: 0;
flex: 1;
}
.review-head-actions {
display: flex;
align-items: center;
flex-shrink: 0;
gap: 12rpx;
}
.review-collapse {
display: flex;
align-items: center;
justify-content: center;
width: 48rpx;
height: 48rpx;
border-radius: 24rpx;
background: #e5f4ed;
}
.review-collapse-icon {
color: #247b63;
font-size: 22rpx;
font-weight: 700;
line-height: 1;
}
.review-title,
.review-subtitle,
.review-name,
@@ -87,8 +112,8 @@
.review-count {
color: #247b63;
font-size: 23rpx;
font-weight: 800;
font-size: 24rpx;
font-weight: 700;
}
.review-list {
@@ -99,19 +124,23 @@
.review-item {
box-sizing: border-box;
width: 100%;
gap: 14rpx;
min-width: 0;
flex-wrap: wrap;
padding: 18rpx;
border-radius: 20rpx;
background: #fff;
box-shadow: 0 5rpx 18rpx rgba(47, 111, 98, 0.07);
box-shadow: 0 6rpx 18rpx rgba(47, 111, 98, 0.07);
}
.review-main {
display: flex;
align-items: flex-start;
gap: 15rpx;
min-width: 0;
}
.review-avatar {
flex: 0 0 auto;
width: 72rpx;
height: 72rpx;
width: 75rpx;
height: 75rpx;
border-radius: 50%;
background: #e7ece9;
}
@@ -147,10 +176,12 @@
.review-actions {
box-sizing: border-box;
flex: 0 0 auto;
display: flex;
align-items: center;
max-width: 100%;
gap: 8rpx;
margin-left: auto;
margin-top: 15rpx;
padding-left: 0;
}
.review-action {
@@ -194,14 +225,7 @@
}
.review-info {
max-width: calc(100% - 100rpx);
}
.review-actions {
width: 100%;
justify-content: flex-end;
padding-left: 86rpx;
box-sizing: border-box;
max-width: calc(100% - 90rpx);
}
}
@@ -241,11 +265,11 @@
display: flex;
align-items: center;
justify-content: center;
width: 78rpx;
height: 78rpx;
width: 81rpx;
height: 81rpx;
border-radius: 50%;
color: #fff;
font-size: 28rpx;
font-size: 29rpx;
font-weight: 900;
overflow: hidden;
}
@@ -285,9 +309,9 @@
}
.color-pill {
width: 44rpx;
height: 18rpx;
border-radius: 999rpx;
width: 46rpx;
height: 20rpx;
border-radius: 10rpx;
}
.retry-btn {
+9 -17
View File
@@ -11,13 +11,6 @@ function shortDateTime(value) {
return text.length > 16 ? text.slice(0, 16) : text || '-'
}
function timeRange(item) {
const start = String(item.startTime || '').slice(11, 16)
const end = String(item.endTime || '').slice(11, 16)
if (!start && !end) return '-'
return `${start || '-'}-${end || '-'}`
}
function scheduleSummary(item) {
const mode = item.scheduleModeSummary || item.scheduleMode || ''
const time = item.scheduleTimeSummary || item.ruleTimeSummary || ''
@@ -73,21 +66,20 @@ Page({
},
async loadOrderPreview() {
const data = await planningApi.calendar({
const data = await planningApi.orderPreview({
startDate: this.data.startDate,
endDate: this.data.endDate
})
const rows = (data.appointments || []).slice(0, PREVIEW_SIZE).map((item, index) => ({
key: `order-${item.orderItemId || index}`,
date: item.date || String(item.startTime || '').slice(0, 10) || '-',
customer: item.customerName || '到店客户',
product: item.productTitle || '预约作品',
artist: item.artistName || '未分配',
time: timeRange(item),
status: item.statusText || '-'
const list = Array.isArray(data) ? data : (data.list || [])
const rows = list.slice(0, PREVIEW_SIZE).map((item, index) => ({
key: `order-${item.orderNo || item.id || index}`,
orderNo: item.orderNo || '-',
amount: item.actualAmount === null || item.actualAmount === undefined ? '-' : `¥${item.actualAmount}`,
status: item.statusText || '-',
createTime: shortDateTime(item.createTime && String(item.createTime).replace('T', ' '))
}))
this.setData({
previewColumns: ['日期', '客户', '项目', '美甲师', '时间', '状态'],
previewColumns: ['订单编号', '实付金额', '状态', '创建时间'],
previewRows: rows
})
},
+1 -1
View File
@@ -1,3 +1,3 @@
{
"navigationBarTitleText": "数据导出"
"navigationBarTitleText": "订单数据"
}
+3 -5
View File
@@ -19,12 +19,10 @@
</view>
<view wx:for="{{previewRows}}" wx:key="key" class="preview-row">
<block wx:if="{{type === '订单数据'}}">
<text class="preview-cell">{{item.date}}</text>
<text class="preview-cell">{{item.customer}}</text>
<text class="preview-cell">{{item.product}}</text>
<text class="preview-cell">{{item.artist}}</text>
<text class="preview-cell">{{item.time}}</text>
<text class="preview-cell order-no">{{item.orderNo}}</text>
<text class="preview-cell">{{item.amount}}</text>
<text class="preview-cell">{{item.status}}</text>
<text class="preview-cell">{{item.createTime}}</text>
</block>
<block wx:elif="{{type === '客户数据'}}">
<text class="preview-cell">{{item.name}}</text>
+17 -9
View File
@@ -38,12 +38,13 @@
}
.preview-table {
min-width: 920rpx;
width: 100%;
}
.preview-row {
display: flex;
min-height: 58rpx;
align-items: center;
min-height: 68rpx;
border-bottom: 1rpx solid #e7ece9;
}
@@ -52,25 +53,32 @@
}
.preview-row-head {
border-radius: 8rpx;
background: #f3f7f4;
min-height: 64rpx;
border-bottom: 0;
border-radius: 12rpx;
background: #f5f7f4;
}
.preview-cell {
display: flex;
align-items: center;
width: 150rpx;
min-width: 150rpx;
flex: 1;
min-width: 0;
padding: 0 12rpx;
overflow: hidden;
color: #5e564d;
color: #17211f;
font-size: 22rpx;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
}
.preview-cell.order-no {
flex: 1.35;
font-family: "SF Mono", Menlo, monospace;
}
.preview-row-head .preview-cell {
color: #17211f;
font-weight: 800;
color: #71807a;
font-weight: 700;
}
+2 -2
View File
@@ -1,6 +1,6 @@
.launch-page { display:flex; min-height:100vh; box-sizing:border-box; flex-direction:column; align-items:center; justify-content:center; padding-bottom:100rpx; background:#fff; }
.launch-logo { width:196rpx; height:196rpx; border-radius:46rpx; }
.launch-logo { width:204rpx; height:204rpx; border-radius:48rpx; }
.launch-name { margin-top:26rpx; color:#17211f; font-size:40rpx; font-weight:800; letter-spacing:3rpx; }
.launch-status { display:flex; align-items:center; margin-top:42rpx; color:#8a918d; font-size:23rpx; }
.loading-dot { width:14rpx; height:14rpx; margin-right:14rpx; border-radius:50%; background:#247b63; animation:pulse 1.2s ease-in-out infinite; }
.loading-dot { width:16rpx; height:16rpx; margin-right:14rpx; border-radius:50%; background:#247b63; animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity:.25; transform:scale(.75); } 50% { opacity:1; transform:scale(1); } }
+181 -6
View File
@@ -1,11 +1,186 @@
const employeesApi = require('../../api/employees')
const dateUtil = require('../../utils/date')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
function displayDate(value) {
const text = String(value || '').slice(0, 10)
return text || '-'
}
function exceptionText(item) {
const type = String(item.exceptionType || '').toUpperCase()
if (type.includes('FULL')) return '全天请假'
const start = String(item.startTime || '').slice(0, 5)
const end = String(item.endTime || '').slice(0, 5)
if (start || end) return `${start || '-'}-${end || '-'} 请假`
return '请假'
}
Page({
data: {
days: Array.from({ length: 31 }).map((_, index) => ({ day: index + 1, rest: [12, 25].includes(index + 1) })),
records: [
{ date: '2026-06-12', text: '全天请假' },
{ date: '2026-06-25', text: '下午请假' }
]
days: [],
records: [],
artists: [],
artistNames: {},
loading: false,
loadError: '',
formVisible: false,
saving: false,
form: {
artistIndex: 0,
workDate: dateUtil.formatDate(new Date()),
exceptionType: 'FULL_DAY',
startTime: '09:00',
endTime: '18:00',
remark: ''
}
},
add() { wx.showToast({ title: '请选择日期后保存', icon: 'none' }) },
onLoad() {
this.month = new Date()
this.loadRecords()
this.loadArtists()
},
async loadArtists() {
try {
const data = await employeesApi.list()
const list = data.list || data || []
const artists = list.map(item => ({
id: item.userId || item.id,
name: item.nickname || item.name || item.artistName || '美甲师'
})).filter(item => item.id)
const artistNames = artists.reduce((map, item) => {
map[item.id] = item.name
return map
}, {})
this.setData({ artists, artistNames })
} catch (error) {
// 美甲师列表失败不阻塞请假记录展示。
}
},
async loadRecords() {
const month = this.month
const startDate = `${month.getFullYear()}-${String(month.getMonth() + 1).padStart(2, '0')}-01`
const daysInMonth = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate()
const endDate = `${month.getFullYear()}-${String(month.getMonth() + 1).padStart(2, '0')}-${String(daysInMonth).padStart(2, '0')}`
this.setData({ loading: true, loadError: '' })
try {
const list = await employeesApi.scheduleExceptions({ startDate, endDate })
const exceptions = Array.isArray(list) ? list : (list && list.list) || []
const restDates = new Set(exceptions.map(item => String(item.workDate || '').slice(0, 10)))
const days = Array.from({ length: daysInMonth }).map((_, index) => {
const date = `${month.getFullYear()}-${String(month.getMonth() + 1).padStart(2, '0')}-${String(index + 1).padStart(2, '0')}`
return { date, day: index + 1, rest: restDates.has(date) }
})
const artistNames = this.data.artistNames || {}
const records = exceptions
.slice()
.sort((left, right) => String(left.workDate).localeCompare(String(right.workDate)))
.map(item => ({
key: item.id || `${item.workDate}-${item.artistId}`,
date: displayDate(item.workDate),
text: [exceptionText(item), artistNames[item.artistId]].filter(Boolean).join(' · ')
}))
this.setData({ days, records })
} catch (error) {
this.setData({ records: [], loadError: toUserMessage(error, '请假记录加载失败') })
} finally {
this.setData({ loading: false })
}
},
add() {
const artists = this.data.artists || []
if (!artists.length) {
wx.showToast({ title: '暂无可请假的美甲师', icon: 'none' })
return
}
const app = getApp()
const userInfo = app.globalData.userInfo || {}
const ownIndex = artists.findIndex(item => String(item.id) === String(userInfo.id))
this.setData({
formVisible: true,
form: {
artistIndex: ownIndex >= 0 ? ownIndex : 0,
workDate: dateUtil.formatDate(new Date()),
exceptionType: 'FULL_DAY',
startTime: '09:00',
endTime: '18:00',
remark: ''
}
})
},
closeForm() {
if (this.data.saving) return
this.setData({ formVisible: false })
},
stopTouchMove() {},
noop() {},
onArtistChange(event) {
this.setData({ 'form.artistIndex': Number(event.detail.value) })
},
onDateChange(event) {
this.setData({ 'form.workDate': event.detail.value })
},
selectType(event) {
this.setData({ 'form.exceptionType': event.currentTarget.dataset.type })
},
onStartTimeChange(event) {
this.setData({ 'form.startTime': event.detail.value })
},
onEndTimeChange(event) {
this.setData({ 'form.endTime': event.detail.value })
},
onRemarkInput(event) {
this.setData({ 'form.remark': event.detail.value })
},
async save() {
if (this.data.saving) return
const form = this.data.form
const artist = this.data.artists[form.artistIndex]
if (!artist) {
wx.showToast({ title: '请选择美甲师', icon: 'none' })
return
}
if (!form.workDate) {
wx.showToast({ title: '请选择日期后保存', icon: 'none' })
return
}
if (form.exceptionType !== 'FULL_DAY' && dateUtil.minutesOfDay(form.endTime) <= dateUtil.minutesOfDay(form.startTime)) {
wx.showToast({ title: '结束时间需晚于开始时间', icon: 'none' })
return
}
this.setData({ saving: true })
try {
await employeesApi.saveScheduleException({
artistId: artist.id,
workDate: form.workDate,
exceptionType: form.exceptionType,
startTime: form.exceptionType === 'FULL_DAY' ? undefined : form.startTime,
endTime: form.exceptionType === 'FULL_DAY' ? undefined : form.endTime,
remark: form.remark || undefined
})
this.setData({ formVisible: false })
wx.showToast({ title: '请假已保存' })
this.loadRecords()
} catch (error) {
showErrorToast(error, '请假保存失败')
} finally {
this.setData({ saving: false })
}
},
back() { wx.navigateBack() }
})
@@ -1,12 +1,72 @@
<view class="page no-tab">
<view class="card mini-calendar">
<view wx:for="{{days}}" wx:key="date" class="mini-day {{item.rest ? 'rest' : ''}}">{{item.day}}</view>
<view class="card leave-card">
<view class="leave-calendar">
<view wx:for="{{days}}" wx:key="date" class="leave-day {{item.rest ? 'rest' : ''}}">{{item.day}}</view>
</view>
</view>
<view class="section">
<view class="section-title">请假记录</view>
<view class="list">
<view wx:for="{{records}}" wx:key="date" class="card list-card">{{item.date}} {{item.text}}</view>
<view class="section-head">
<text class="section-title">请假记录</text>
<text wx:if="{{loading}}" class="section-note">加载中</text>
</view>
<view wx:if="{{loadError}}" class="card record-empty">{{loadError}}</view>
<view wx:elif="{{!records.length}}" class="card record-empty">暂无请假记录</view>
<view wx:else class="list">
<view wx:for="{{records}}" wx:key="key" class="card record-card">
<text class="record-date">{{item.date}}</text>
<text class="record-text">{{item.text}}</text>
</view>
</view>
</view>
<view class="fixed-bottom"><button class="primary-btn leave-add" bindtap="add">新增请假</button></view>
<view wx:if="{{formVisible}}" class="sheet-mask" catchtouchmove="stopTouchMove" bindtap="closeForm">
<view class="sheet" catchtap="noop">
<view class="sheet-head">
<text class="sheet-title">新增请假</text>
<text class="sheet-close" bindtap="closeForm">×</text>
</view>
<view class="sheet-body">
<view class="sheet-field">
<text class="sheet-label">美甲师</text>
<picker range="{{artists}}" range-key="name" value="{{form.artistIndex}}" bindchange="onArtistChange">
<view class="sheet-value">{{artists[form.artistIndex].name || '请选择'}}</view>
</picker>
</view>
<view class="sheet-field">
<text class="sheet-label">请假日期</text>
<picker mode="date" value="{{form.workDate}}" bindchange="onDateChange">
<view class="sheet-value">{{form.workDate}}</view>
</picker>
</view>
<view class="sheet-field">
<text class="sheet-label">请假类型</text>
<view class="type-switch">
<view class="type-option {{form.exceptionType === 'FULL_DAY' ? 'selected' : ''}}" data-type="FULL_DAY" bindtap="selectType">全天</view>
<view class="type-option {{form.exceptionType === 'TIME_RANGE' ? 'selected' : ''}}" data-type="TIME_RANGE" bindtap="selectType">时段</view>
</view>
</view>
<view wx:if="{{form.exceptionType !== 'FULL_DAY'}}" class="sheet-field">
<text class="sheet-label">请假时段</text>
<view class="time-row">
<picker mode="time" value="{{form.startTime}}" bindchange="onStartTimeChange">
<view class="time-value">{{form.startTime}}</view>
</picker>
<text class="time-separator">至</text>
<picker mode="time" value="{{form.endTime}}" bindchange="onEndTimeChange">
<view class="time-value">{{form.endTime}}</view>
</picker>
</view>
</view>
<view class="sheet-field">
<text class="sheet-label">备注</text>
<input class="sheet-input" value="{{form.remark}}" placeholder="选填" bindinput="onRemarkInput" />
</view>
</view>
<view class="sheet-actions">
<button class="secondary-btn sheet-btn" bindtap="closeForm">取消</button>
<button class="primary-btn sheet-btn" loading="{{saving}}" disabled="{{saving}}" bindtap="save">保存</button>
</view>
</view>
</view>
<view class="fixed-bottom"><button class="primary-btn" bindtap="add">新增请假</button></view>
</view>
@@ -1,22 +1,192 @@
.mini-calendar {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 10rpx;
padding: 18rpx;
.leave-card {
padding: 20rpx;
}
.mini-day {
.leave-calendar {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 8rpx;
}
.leave-day {
display: flex;
align-items: center;
justify-content: center;
height: 64rpx;
height: 66rpx;
border-radius: 10rpx;
background: #f3f7f4;
color: #71807a;
font-size: 29rpx;
font-weight: 700;
}
.mini-day.rest {
.leave-day.rest {
background: #e7f0f6;
color: #6e9fbd;
}
.section-head {
display: flex;
align-items: center;
justify-content: space-between;
}
.section-note {
color: #71807a;
font-size: 22rpx;
}
.record-empty {
padding: 36rpx 24rpx;
color: #71807a;
font-size: 24rpx;
text-align: center;
}
.record-card {
display: flex;
align-items: center;
min-height: 92rpx;
padding: 0 26rpx;
}
.record-date {
color: #17211f;
font-size: 29rpx;
font-weight: 700;
}
.record-text {
margin-left: 16rpx;
color: #71807a;
font-size: 26rpx;
}
.leave-add {
height: 80rpx;
border-radius: 24rpx;
font-size: 27rpx;
font-weight: 700;
}
.sheet-mask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 60;
display: flex;
align-items: flex-end;
background: rgba(23, 33, 31, 0.42);
}
.sheet {
box-sizing: border-box;
width: 100%;
padding: 30rpx 28rpx calc(28rpx + env(safe-area-inset-bottom));
border-radius: 28rpx 28rpx 0 0;
background: #ffffff;
}
.sheet-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12rpx;
}
.sheet-title {
color: #17211f;
font-size: 32rpx;
font-weight: 800;
}
.sheet-close {
padding: 0 10rpx;
color: #71807a;
font-size: 40rpx;
line-height: 1;
}
.sheet-field {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 88rpx;
border-bottom: 1rpx solid #e7ece9;
}
.sheet-label {
flex-shrink: 0;
color: #71807a;
font-size: 26rpx;
}
.sheet-value {
min-width: 240rpx;
color: #17211f;
font-size: 28rpx;
font-weight: 600;
text-align: right;
}
.sheet-input {
flex: 1;
margin-left: 24rpx;
color: #17211f;
font-size: 28rpx;
text-align: right;
}
.type-switch {
display: flex;
gap: 10rpx;
}
.type-option {
padding: 10rpx 26rpx;
border-radius: 999rpx;
background: #f3f7f4;
color: #71807a;
font-size: 25rpx;
font-weight: 700;
}
.type-option.selected {
background: #e5f4ed;
color: #247b63;
}
.time-row {
display: flex;
align-items: center;
gap: 14rpx;
}
.time-value {
padding: 10rpx 22rpx;
border-radius: 12rpx;
background: #f3f7f4;
color: #17211f;
font-size: 27rpx;
font-weight: 600;
}
.time-separator {
color: #71807a;
font-size: 24rpx;
}
.sheet-actions {
display: flex;
gap: 16rpx;
margin-top: 28rpx;
}
.sheet-btn {
flex: 1;
height: 80rpx;
border-radius: 20rpx;
font-size: 27rpx;
}
+16 -18
View File
@@ -4,6 +4,7 @@ const { BRAND_CONFIG } = require('../../utils/config')
const loginFlow = require('../../utils/login-flow')
const { requestSubscribeMessages } = require('../../utils/subscribe-message')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function wxLoginCode() {
return new Promise((resolve, reject) => wx.login({
@@ -135,14 +136,13 @@ Page({
async chooseRememberMode() {
if (this.data.rememberMe) return true
return new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '记住登录',
content: loginFlow.REMEMBER_LOGIN_PROMPT,
confirmText: '确认',
cancelText: '取消',
success: result => resolve(loginFlow.resolveRememberChoice(result)),
fail: () => resolve(null)
}))
cancelText: '取消'
})
return loginFlow.resolveRememberChoice(result)
},
async quickLogin() {
@@ -196,22 +196,20 @@ Page({
: status === 'NEED_MANUAL_LOGIN' ? '需要完成注册' : '登录失败'
const content = result.registrationRejectReason || toUserMessage(result, '请稍后重试')
const canRetry = status === 'ERROR' || status === 'NEED_MANUAL_LOGIN' || status === 'REJECTED'
wx.showModal({
const choice = await showActionModal(this, {
title,
content,
showCancel: canRetry,
confirmText: status === 'REJECTED' ? '重新提交' : canRetry ? '重新登录' : '知道了',
cancelText: '取消',
success: choice => {
if (!choice.confirm) return
if (status === 'REJECTED' && result.registrationTicket) this.navigateToRegistration(result)
else if (status === 'REJECTED') {
this._resumeRegistrationAfterRejected = true
this.quickLogin()
}
else if (status === 'ERROR' || status === 'NEED_MANUAL_LOGIN') this.quickLogin()
}
cancelText: canRetry ? '取消' : '',
confirmText: status === 'REJECTED' ? '重新提交' : canRetry ? '重新登录' : '知道了'
})
if (!choice.confirm) return
if (status === 'REJECTED' && result.registrationTicket) this.navigateToRegistration(result)
else if (status === 'REJECTED') {
this._resumeRegistrationAfterRejected = true
this.quickLogin()
}
else if (status === 'ERROR' || status === 'NEED_MANUAL_LOGIN') this.quickLogin()
},
navigateToRegistration(result) {
+4 -1
View File
@@ -2,5 +2,8 @@
"navigationBarTitleText": "登录",
"navigationBarBackgroundColor": "#F3F7F4",
"navigationBarTextStyle": "black",
"backgroundColor": "#F3F7F4"
"backgroundColor": "#F3F7F4",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
+4 -4
View File
@@ -81,21 +81,21 @@ async function run() {
assert.strictEqual(toastOptions.title, '请同意协议后使用')
const statePage = createPage()
statePage.handleResult({ status: 'PENDING_REVIEW', message: '申请审核中' })
await statePage.handleResult({ status: 'PENDING_REVIEW', message: '申请审核中' })
assert.strictEqual(modalOptions.title, '申请审核中')
assert.strictEqual(modalOptions.showCancel, false)
assert.strictEqual(statePage._presentedLoginState.startsWith('PENDING_REVIEW:'), true)
const modalCountBeforeError = modalCount
const errorPage = createPage()
errorPage.handleResult({ status: 'ERROR', message: '网络连接失败' })
errorPage.handleResult({ status: 'ERROR', message: '网络连接失败' })
await errorPage.handleResult({ status: 'ERROR', message: '网络连接失败' })
await errorPage.handleResult({ status: 'ERROR', message: '网络连接失败' })
assert.strictEqual(modalOptions.title, '登录失败')
assert.strictEqual(modalCount, modalCountBeforeError + 1)
modalChoice = { confirm: true, cancel: false }
const rejectedPage = createPage()
rejectedPage.handleResult({ status: 'REJECTED', message: '资料需修改', registrationTicket: 'ticket-1', registrationApplicationId: 23, registrationRole: 'STAFF' })
await rejectedPage.handleResult({ status: 'REJECTED', message: '资料需修改', registrationTicket: 'ticket-1', registrationApplicationId: 23, registrationRole: 'STAFF' })
assert.match(navigatedTo, /registrationTicket=ticket-1/)
assert.match(navigatedTo, /applicationId=23/)
assert.match(navigatedTo, /role=STAFF/)
+1
View File
@@ -49,4 +49,5 @@
</view><text wx:if="{{switchingShop}}" class="switching">正在进入门店…</text>
</view>
</view>
<action-modal id="actionModal" />
</view>
+31 -30
View File
@@ -21,9 +21,9 @@
}
.login-logo {
width: 196rpx;
height: 196rpx;
border-radius: 46rpx;
width: 204rpx;
height: 204rpx;
border-radius: 48rpx;
}
.brand-name {
@@ -49,13 +49,13 @@
display: flex;
align-items: center;
justify-content: center;
height: 92rpx;
height: 96rpx;
border-radius: 999rpx;
background: #247b63;
color: #fff;
font-size: 30rpx;
font-weight: 500;
line-height: 92rpx;
line-height: 96rpx;
box-shadow: 0 10rpx 20rpx rgba(47, 143, 120, .16);
}
@@ -157,24 +157,25 @@
box-sizing: border-box;
width: 100%;
overflow: hidden;
border-radius: 30rpx;
padding-bottom: 28rpx;
border-radius: 28rpx;
background: #fff;
}
.agreement-prompt-title {
display: block;
padding: 48rpx 28rpx 0;
color: #171a18;
font-size: 36rpx;
font-weight: 700;
padding: 44rpx 28rpx 0;
color: #17211f;
font-size: 32rpx;
font-weight: 800;
line-height: 1.45;
text-align: center;
}
.agreement-prompt-body {
padding: 56rpx 38rpx 48rpx;
color: #8a8e8b;
font-size: 29rpx;
padding: 24rpx 28rpx 8rpx;
color: #71807a;
font-size: 27rpx;
line-height: 1.72;
text-align: center;
}
@@ -190,21 +191,20 @@
.agreement-prompt-actions {
display: flex;
align-items: center;
height: 112rpx;
border-top: 1rpx solid #e5e5e5;
gap: 20rpx;
padding: 24rpx 28rpx 0;
}
.agreement-prompt-button {
box-sizing: border-box;
height: 100%;
flex: 1;
height: 88rpx;
flex: 1 1 0;
margin: 0;
padding: 0 12rpx;
border: 0;
border-radius: 0;
background: #fff;
font-size: 30rpx;
line-height: 112rpx;
border-radius: 20rpx;
font-size: 26rpx;
font-weight: 700;
line-height: 88rpx;
}
.agreement-prompt-button::after {
@@ -212,17 +212,18 @@
}
.agreement-prompt-decline {
color: #888d8a;
border: 1rpx solid #E7ECE9;
background: #F1F3F2;
color: #71807A;
}
.agreement-prompt-accept {
color: #247b63;
background: #247B63;
color: #ffffff;
}
.agreement-prompt-divider {
width: 1rpx;
height: 100%;
background: #e5e5e5;
display: none;
}
.modal-mask {
@@ -279,7 +280,7 @@
height: 38vh;
margin-top: 24rpx;
color: #707773;
font-size: 25rpx;
font-size: 26rpx;
line-height: 1.75;
white-space: pre-wrap;
}
@@ -291,11 +292,11 @@
}
.sheet-btn {
height: 88rpx;
height: 92rpx;
flex: 1;
border-radius: 14rpx;
font-size: 29rpx;
line-height: 88rpx;
line-height: 92rpx;
}
.sheet-btn.secondary {
+83 -36
View File
@@ -7,6 +7,7 @@ const { normalizeAvatar } = require('../../utils/profile-card')
const profileCache = require('../../utils/profile-cache')
const employeesApi = require('../../api/employees')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function canCreateAppointment() {
const app = getApp()
@@ -18,6 +19,37 @@ function resolveCalendarErrorMessage(error) {
return toUserMessage(error, '日程数据加载失败')
}
const LANE_TINTS = ['#EAF3FA', '#FBF1EB', '#EEF5EF']
const DESIGN_ARTIST_COLORS = {
张小雨: '#43789E',
林小满: '#96684B',
陈小桃: '#587959'
}
const LEGACY_ARTIST_COLORS = {
'#7BA7C7': '#43789E',
'#D7A86E': '#96684B',
'#8FB89A': '#587959'
}
function resolveDisplayColor(artist = {}, fallback) {
const name = String(artist.nickname || artist.name || artist.artistName || '')
const matchedName = Object.keys(DESIGN_ARTIST_COLORS).find(key => name.includes(key))
if (matchedName) return DESIGN_ARTIST_COLORS[matchedName]
const color = String(artist.color || fallback || '')
return LEGACY_ARTIST_COLORS[color.toUpperCase()] || color || '#B8B0A6'
}
function buildWeekSegments(artistCounts) {
const counts = (artistCounts || []).map(count => ({ ...count, width: Math.round(count.count * 75.2) }))
const usable = 396 - Math.max(0, counts.length - 1) * 4
const rawTotal = counts.reduce((total, count) => total + count.width, 0)
if (rawTotal <= usable || rawTotal === 0) return counts
const scale = usable / rawTotal
return counts.map(count => ({ ...count, width: Math.max(8, Math.floor(count.width * scale)) }))
}
function toLocalDate(value) {
return value instanceof Date ? new Date(value.getTime()) : new Date(String(value).replace(/-/g, '/'))
}
@@ -164,6 +196,10 @@ Page({
artists: [],
monthDays: [],
weekDays: [],
weekTotalCount: 0,
weekUnassignedTotal: 0,
weekLegend: [],
todayText: dateUtil.formatDate(new Date()),
dayLanes: [],
hours: [],
hasTimedAppointments: false,
@@ -252,15 +288,11 @@ Page({
}
if (!summary.noticeEnabled || Number(summary.pendingCount || 0) <= 0) return false
app.globalData.reviewNoticeShown = true
const result = await new Promise(resolve => {
wx.showModal({
title: '有美甲师申请待审核',
content: `当前有 ${summary.pendingCount} 条美甲师加入申请,请在小程序员工页面审核。是否立即处理?`,
cancelText: '稍后处理',
confirmText: '立即审核',
success: resolve,
fail: () => resolve({ confirm: false })
})
const result = await showActionModal(this, {
title: '有美甲师申请待审核',
content: `当前有 ${summary.pendingCount} 条美甲师加入申请,请在小程序员工页面审核。是否立即处理?`,
cancelText: '稍后处理',
confirmText: '立即审核'
})
if (!result.confirm) return false
app.globalData.openEmployeeReview = true
@@ -447,6 +479,9 @@ Page({
artists: [],
monthDays: [],
weekDays: [],
weekTotalCount: 0,
weekUnassignedTotal: 0,
weekLegend: [],
dayLanes: [],
hours: [],
hasTimedAppointments: false,
@@ -482,7 +517,10 @@ Page({
businessStartTime: businessHours ? businessHours.start : '',
businessEndTime: businessHours ? businessHours.end : '',
businessHoursConfigured: hasBusinessHours(calendar),
artists: Array.isArray(calendar.artists) ? calendar.artists : [],
artists: (Array.isArray(calendar.artists) ? calendar.artists : []).map(artist => ({
...artist,
color: resolveDisplayColor({ name: artist.name || artist.nickname, color: artist.color })
})),
appointments: Array.isArray(calendar.appointments) ? calendar.appointments : [],
daySummaries: Array.isArray(calendar.daySummaries) ? calendar.daySummaries : []
}
@@ -534,7 +572,22 @@ Page({
return state
}
if (this.data.viewMode === 'week') {
state.weekDays = this.buildWeekDays(calendar)
const weekDays = this.buildWeekDays(calendar)
const legendMap = {}
weekDays.forEach(day => {
day.artistCounts.forEach(count => {
if (!count.artistId || count.artistId === '__unassigned__' || legendMap[count.artistId]) return
legendMap[count.artistId] = {
artistId: count.artistId,
name: count.artistName || count.shortName || '?',
color: count.color
}
})
})
state.weekDays = weekDays
state.weekTotalCount = weekDays.reduce((total, day) => total + Number(day.totalCount || 0), 0)
state.weekUnassignedTotal = weekDays.reduce((total, day) => total + Number(day.unassignedCount || 0), 0)
state.weekLegend = Object.keys(legendMap).map(key => legendMap[key])
return state
}
return { ...state, ...this.buildDayView(calendar) }
@@ -574,15 +627,13 @@ Page({
buildWeekDays(calendar) {
const start = dateUtil.startOfWeek(this.data.currentDateText)
const summaryMap = this.summaryMap(calendar)
return this.data.weekLabels.map((label, index) => {
const days = this.data.weekLabels.map((label, index) => {
const target = dateUtil.addDays(start, index)
const date = dateUtil.formatDate(target)
const summary = summaryMap[date] || { artistCounts: [], totalCount: 0 }
const unassignedCount = Number(summary.unassignedCount || 0)
const artistCounts = this.withUnassignedCount(
this.normalizeArtistCounts(summary.artistCounts || [], calendar),
unassignedCount
).filter(count => count.count > 0)
const artistCounts = this.normalizeArtistCounts(summary.artistCounts || [], calendar)
.filter(count => count.count > 0 && count.artistId !== '__unassigned__')
return {
date,
weekName: `周${label}`,
@@ -590,16 +641,11 @@ Page({
totalCount: summary.totalCount || 0,
unassignedCount,
shopOpen: summary.shopOpen !== false,
statusText: this.resolveDisplayStatus(summary, artistCounts) === 'rest'
? '休'
: this.resolveDisplayStatus(summary, artistCounts) === 'full' ? '满' : '营业',
artistCounts: artistCounts.map(count => ({
...count,
width: Math.max(12, Math.min(100, count.count * 22)),
barWidth: Math.max(14, Math.min(100, count.count * 18))
}))
statusText: this.resolveDisplayStatus(summary, artistCounts) === 'rest' ? '休' : '营业',
artistCounts: buildWeekSegments(artistCounts)
}
})
return days
},
buildDayView(calendar) {
@@ -657,7 +703,8 @@ Page({
top: (cursor - startMinute) * minuteScale + laneHeaderHeight
})
}
const employeeLanes = filteredArtists.map(artist => {
const employeeLanes = filteredArtists.map((artist, artistIndex) => {
const tint = LANE_TINTS[artistIndex % LANE_TINTS.length]
const blocks = dayAppointments
.filter(item => String(item.artistId) === String(artist.id))
.filter(item => item.startTime)
@@ -670,7 +717,8 @@ Page({
left: 12,
width: 224,
compact: Number(item.durationMinutes || 60) <= 15,
timeText: resolveAppointmentTimeText(item)
timeText: resolveAppointmentTimeText(item),
tint
}
})
return { ...artist, artistId: artist.id, blocks, width: 248 }
@@ -682,7 +730,7 @@ Page({
laneHeaderHeight,
248
)
const unassignedBlocks = unassignedLayout.blocks
const unassignedBlocks = unassignedLayout.blocks.map(block => ({ ...block, tint: '#FFF3E7' }))
const lanes = this.data.selectedArtistId ? employeeLanes : [{
id: '__unassigned__',
artistId: '__unassigned__',
@@ -771,10 +819,12 @@ Page({
}, {})
return (counts || []).map(count => {
const artist = colorMap[count.artistId] || {}
const artistName = count.artistName || artist.name || artist.nickname || ''
return {
...count,
color: count.color || artist.color || '#B8B0A6',
color: resolveDisplayColor({ name: artistName, color: count.color || artist.color }),
shortName: count.shortName || artist.shortName || '?',
artistName,
count: Number(count.count || 0)
}
})
@@ -881,21 +931,18 @@ Page({
wx.navigateTo({ url: `/pages/artist-transfer/index?id=${event.currentTarget.dataset.id}` })
},
quickCancel(event) {
async quickCancel(event) {
const appointment = (this._calendarData && this._calendarData.appointments || []).find(item => String(item.orderItemId) === String(event.currentTarget.dataset.id))
if (!appointment) return
wx.showModal({
const result = await showActionModal(this, {
title: '取消预约',
editable: true,
placeholderText: '可填写取消原因',
content: '',
cancelText: '取消',
confirmText: '确认取消',
success: result => {
if (result.confirm) {
this.updateAppointmentStatus(appointment.orderId, 3, result.content || '')
}
}
confirmType: 'danger'
})
if (result.confirm) this.updateAppointmentStatus(appointment.orderId, 3, result.content || '')
},
async updateAppointmentStatus(orderId, status, cancelReason) {
+4 -1
View File
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "日程"
"navigationBarTitleText": "日程",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
+7 -3
View File
@@ -111,7 +111,7 @@ async function run() {
daySummaries: [{ date: weekStart, totalCount: 2, unassignedCount: 2, artistCounts: [] }]
})
assert.strictEqual(weekDays[0].unassignedCount, 2)
assert.strictEqual(weekDays[0].artistCounts[0].artistId, '__unassigned__')
assert.strictEqual(weekDays[0].artistCounts.some(count => count.artistId === '__unassigned__'), false)
const dayPage = createPage({ currentDateText: '2026-10-12', selectedArtistId: '' })
const dayState = dayPage.buildDayView({
@@ -196,7 +196,11 @@ async function run() {
assert.match(planningWxml, /class="lane-unassigned-tag">不占档期/)
assert.match(planningWxml, /门店营业时间未设置/)
assert.match(planningWxml, /bindtap="openShopSettings"/)
assert.match(planningWxml, /class="week-unassigned-count">待 \{\{item\.unassignedCount\}\}/)
assert.match(planningWxml, /class="week-card card"/)
assert.match(planningWxml, /class="week-row-pending">待分配 \{\{item\.unassignedCount\}\}/)
assert.match(planningWxml, /class="week-segment" style="width: \{\{count\.width\}\}rpx;/)
assert.match(planningWxss, /\.week-track\s*\{[^}]*width:\s*396rpx;[^}]*height:\s*28rpx;/)
assert.match(planningWxss, /\.week-row\s*\{[^}]*height:\s*108rpx;/)
assert.match(planningWxml, /wx:if="\{\{canCreateAppointment && businessHoursConfigured && !calendarError && \(viewMode !== 'day' \|\| currentShopOpen\)\}\}" class="fab" bindtap="createAppointment"/)
assert.match(planningWxml, /class="month-unassigned-count">待 \{\{item\.unassignedCount\}\}/)
assert.doesNotMatch(planningWxss, /background-size:\s*100% 240rpx/)
@@ -287,7 +291,7 @@ async function run() {
assert.match(planningWxml, /bindtap="selectMonthDate" aria-label="查看\{\{item\.date\}\}日程"/)
assert.match(planningWxml, /bindtap="selectWeekDate" aria-label="查看\{\{item\.date\}\}日程"/)
assert.match(planningWxss, /grid-template-columns:\s*repeat\(7,\s*minmax\(0,\s*1fr\)\)/)
assert.match(planningWxss, /\.week-list\s*\{/)
}
run().catch(error => {
+43 -13
View File
@@ -48,7 +48,7 @@
<view class="wechat-avatar-hint">{{profileSaving ? '上传中' : '点击更换'}}</view>
</button>
<input class="wechat-nickname" type="nickname" value="{{profileForm.nickname}}" bindinput="onNicknameInput" placeholder="填写微信昵称" />
<button class="profile-save" loading="{{profileSaving}}" bindtap="saveWechatProfile">保存资料</button><button class="profile-skip" bindtap="skipProfilePrompt">暂时跳过</button>
<button class="primary-btn profile-save" loading="{{profileSaving}}" bindtap="saveWechatProfile">保存资料</button><button class="secondary-btn profile-skip" bindtap="skipProfilePrompt">暂时跳过</button>
</view>
</view>
@@ -110,7 +110,7 @@
<text wx:if="{{item.isUnassigned}}" class="lane-unassigned-tag">不占档期</text>
</view>
<view wx:for="{{hours}}" wx:for-item="hour" wx:key="value" class="hour-line" style="top: {{hour.top}}rpx;"></view>
<view wx:for="{{item.blocks}}" wx:for-item="block" wx:key="orderItemId" class="appointment-block {{item.isUnassigned ? 'unassigned-block' : ''}} {{block.status === 0 ? 'pending' : ''}} {{block.compact ? 'compact' : ''}}" style="top: {{block.top}}rpx; left: {{block.left}}rpx; width: {{block.width}}rpx; height: {{block.height}}rpx; border-left-color: {{item.color}};" data-id="{{block.orderItemId}}" bindtap="openAppointment">
<view wx:for="{{item.blocks}}" wx:for-item="block" wx:key="orderItemId" class="appointment-block {{item.isUnassigned ? 'unassigned-block' : ''}} {{block.status === 0 ? 'pending' : ''}} {{block.compact ? 'compact' : ''}}" style="top: {{block.top}}rpx; left: {{block.left}}rpx; width: {{block.width}}rpx; height: {{block.height}}rpx; background: {{block.tint || '#ffffff'}}; border-left-color: {{item.color}};" data-id="{{block.orderItemId}}" bindtap="openAppointment">
<text class="block-title">{{block.customerName}}</text>
<text class="block-meta">{{block.timeText}} · {{block.productTitle}}</text>
<view class="block-footer">
@@ -132,14 +132,43 @@
</view>
<view wx:if="{{viewMode === 'week'}}" class="section">
<view class="week-strip">
<view wx:for="{{weekDays}}" wx:key="date" class="week-day-card card {{item.date === currentDateText ? 'active' : ''}}" data-date="{{item.date}}" bindtap="selectWeekDate" aria-label="查看{{item.date}}日程">
<view class="week-card-head"><text class="week-name">{{item.weekName}}</text><text class="week-status {{item.statusText === '休' ? 'rest' : ''}}">{{item.statusText}}</text></view>
<text class="week-date">{{item.day}}</text>
<text class="week-total">{{item.totalCount}}单</text>
<text wx:if="{{item.unassignedCount > 0}}" class="week-unassigned-count">待 {{item.unassignedCount}}</text>
<view class="week-bars {{item.totalCount === 0 ? 'empty' : ''}}">
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:key="artistId" class="week-bar" style="background: {{count.color}}; width: {{count.width}}%;"></view>
<view class="week-card card">
<view class="week-card-head">
<view class="week-card-title">
<text class="week-title">本周安排</text>
<text class="week-range">{{weekRange}}</text>
</view>
<text class="week-summary">共 {{weekTotalCount}} 单 · 待分配 {{weekUnassignedTotal}}</text>
</view>
<view class="week-legend">
<view wx:for="{{weekLegend}}" wx:key="artistId" class="week-legend-item">
<view class="week-legend-dot" style="background: {{item.color}};"></view>
<text class="week-legend-name">{{item.name}}</text>
</view>
<text wx:if="{{!weekLegend.length}}" class="week-legend-empty">暂无美甲师单量</text>
</view>
<view class="week-list">
<view wx:for="{{weekDays}}" wx:key="date" class="week-row {{item.date === todayText ? 'today' : ''}}" data-date="{{item.date}}" bindtap="selectWeekDate" aria-label="查看{{item.date}}日程">
<view class="week-row-date">
<text class="week-row-name">{{item.weekName}}</text>
<text class="week-row-day">{{item.day}}</text>
<text class="week-row-suffix">日</text>
</view>
<text class="week-row-status {{item.statusText === '休' ? 'rest' : ''}}">{{item.statusText}}</text>
<block wx:if="{{item.totalCount === 0}}">
<text wx:if="{{item.statusText !== '休'}}" class="week-row-empty">暂无预约</text>
</block>
<block wx:else>
<view class="week-track">
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:for-index="countIndex" wx:key="artistId" class="week-segment" style="width: {{count.width}}rpx; background: {{count.color}};">
<text class="week-segment-text">{{count.artistName || count.shortName}}{{count.count}}</text>
</view>
</view>
<view class="week-row-tail">
<text class="week-row-total">{{item.totalCount}}单</text>
<text wx:if="{{item.unassignedCount > 0}}" class="week-row-pending">待分配 {{item.unassignedCount}}</text>
</view>
</block>
</view>
</view>
</view>
@@ -176,18 +205,18 @@
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:key="artistId" wx:if="{{count.count > 0}}" class="month-artist-bar" style="background: {{count.color}};">
<text>{{count.shortName}}{{count.count}}</text>
</view>
<view wx:if="{{item.totalCount === 0}}" class="month-empty">空</view>
<view wx:if="{{item.totalCount === 0 && item.dayStatus !== 'rest'}}" class="month-empty">暂无预约</view>
</view>
<view wx:else class="month-blocks">
<block wx:if="{{monthDisplayMode === 'blocks'}}">
<view wx:for="{{item.expandedBlocks}}" wx:for-item="block" wx:key="key" class="month-order-block" style="background: {{block.color}};"></view>
<view wx:if="{{item.totalCount === 0}}" class="month-empty">空</view>
<view wx:if="{{item.totalCount === 0 && item.dayStatus !== 'rest'}}" class="month-empty">暂无预约</view>
</block>
<block wx:else>
<view wx:for="{{item.rowBlocks}}" wx:for-item="block" wx:key="key" class="month-row-block {{monthRowLabelVisible ? 'named' : ''}}" style="background: {{block.color}};">
<text wx:if="{{monthRowLabelVisible}}">{{block.artistName}}</text>
</view>
<view wx:if="{{item.totalCount === 0}}" class="month-empty">空</view>
<view wx:if="{{item.totalCount === 0 && item.dayStatus !== 'rest'}}" class="month-empty">暂无预约</view>
</block>
</view>
</view>
@@ -197,4 +226,5 @@
</block>
<button wx:if="{{canCreateAppointment && businessHoursConfigured && !calendarError && (viewMode !== 'day' || currentShopOpen)}}" class="fab" bindtap="createAppointment">+</button>
<action-modal id="actionModal" />
</view>
+188 -62
View File
@@ -2,7 +2,7 @@
padding-top: 18rpx;
}
.phone-banner { display:flex; align-items:center; margin-bottom:18rpx; padding:16rpx 18rpx; border-radius:14rpx; background:#fff2d8; color:#815f2b; overflow:hidden; }.phone-banner-track { display:flex; flex:1; width:0; gap:50rpx; white-space:nowrap; animation:phoneBannerScroll 10s linear infinite; font-size:22rpx; }.phone-banner-close { position:relative; z-index:2; margin-left:18rpx; padding:6rpx; background:#fff2d8; font-size:32rpx; }.profile-prompt-mask { position:fixed; z-index:30; inset:0; display:flex; align-items:center; justify-content:center; padding:40rpx; background:rgba(25,41,33,.55); }.profile-prompt { box-sizing:border-box; display:flex; width:100%; flex-direction:column; align-items:center; padding:36rpx; border-radius:24rpx; background:#fff; }.profile-prompt-title { color:#17211f; font-size:32rpx; font-weight:800; }.profile-prompt-desc { margin-top:10rpx; color:#71807a; font-size:22rpx; text-align:center; }.wechat-nickname { box-sizing:border-box; width:100%; height:80rpx; margin-top:24rpx; padding:0 22rpx; border:1rpx solid #dce8df; border-radius:13rpx; background:#f7faf8; }.profile-save { width:100%; height:80rpx; margin-top:22rpx; border-radius:14rpx; background:#247b63; color:#fff; line-height:80rpx; }.profile-skip { margin-top:12rpx; background:transparent; color:#7e8e85; font-size:23rpx; }
.phone-banner { display:flex; align-items:center; margin-bottom:18rpx; padding:16rpx 18rpx; border-radius:14rpx; background:#fff2d8; color:#815f2b; overflow:hidden; }.phone-banner-track { display:flex; flex:1; width:0; gap:50rpx; white-space:nowrap; animation:phoneBannerScroll 10s linear infinite; font-size:22rpx; }.phone-banner-close { position:relative; z-index:2; margin-left:18rpx; padding:6rpx; background:#fff2d8; font-size:32rpx; }.profile-prompt-mask { position:fixed; z-index:30; inset:0; display:flex; align-items:center; justify-content:center; padding:40rpx; background:rgba(25,41,33,.55); }.profile-prompt { box-sizing:border-box; display:flex; width:100%; flex-direction:column; align-items:center; padding:36rpx; border-radius:24rpx; background:#fff; }.profile-prompt-title { color:#17211f; font-size:32rpx; font-weight:800; }.profile-prompt-desc { margin-top:10rpx; color:#71807a; font-size:22rpx; text-align:center; }.wechat-nickname { box-sizing:border-box; width:100%; height:80rpx; margin-top:24rpx; padding:0 22rpx; border:1rpx solid #dce8df; border-radius:13rpx; background:#f7faf8; }.profile-save { margin-top:22rpx; }.profile-skip { margin-top:20rpx; }
.wechat-avatar {
position: relative;
@@ -40,16 +40,18 @@
.wechat-avatar-hint {
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 38rpx;
background: rgba(22, 27, 25, 0.68);
left: 50%;
height: 44rpx;
padding: 0 24rpx;
border-radius: 22rpx;
background: rgba(0, 0, 0, 0.55);
color: #fff;
font-size: 19rpx;
font-size: 22rpx;
font-weight: 600;
line-height: 38rpx;
text-align: center;
line-height: 44rpx;
white-space: nowrap;
transform: translateX(-50%);
}
@keyframes phoneBannerScroll { from { transform:translateX(0); } to { transform:translateX(-48%); } }
@@ -341,13 +343,14 @@
}
.summary-item {
min-height: 116rpx;
padding: 16rpx;
}
.summary-value {
display: block;
color: #17211f;
font-size: 34rpx;
font-size: 36rpx;
font-weight: 800;
}
@@ -457,8 +460,8 @@
gap: 2rpx;
overflow: hidden;
padding: 6rpx 10rpx;
border-left: 8rpx solid #7ba7c7;
border-radius: 10px;
border-left: 6rpx solid #7ba7c7;
border-radius: 16rpx;
background: #fff7ee;
border-top: 1rpx solid rgba(58, 48, 34, 0.06);
border-right: 1rpx solid rgba(58, 48, 34, 0.06);
@@ -554,72 +557,194 @@
font-size: 22rpx;
}
.week-strip {
display: grid;
grid-template-columns: repeat(7, minmax(0, 1fr));
gap: 6rpx;
width: 100%;
.week-card {
padding: 20rpx;
}
.week-day-card {
.week-card-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12rpx;
}
.week-card-title {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 104rpx;
margin: 0;
padding: 8rpx 4rpx;
align-items: center;
align-items: baseline;
gap: 10rpx;
}
.week-day-card.active {
outline: 3rpx solid #8fb89a;
}
.week-name,
.week-total {
color: #8f877e;
font-size: 18rpx;
}
.week-card-head { display:flex; width:100%; align-items:center; justify-content:space-between; gap:2rpx; }
.week-status { color:#247b63; font-size:17rpx; font-weight:800; }
.week-status.rest { color:#a08a78; }
.week-unassigned-count {
display: inline-flex;
align-self: flex-start;
margin-top: 4rpx;
padding: 2rpx 4rpx;
border-radius: 6rpx;
background: #fff1dc;
color: #a56b24;
font-size: 15rpx;
font-weight: 800;
}
.week-date {
margin: 3rpx 0;
.week-title {
color: #17211f;
font-size: 24rpx;
font-size: 28rpx;
font-weight: 800;
}
.week-bars {
.week-range {
color: #71807a;
font-size: 20rpx;
}
.week-summary {
flex: none;
color: #71807a;
font-size: 20rpx;
}
.week-legend {
display: flex;
flex-wrap: wrap;
gap: 8rpx 18rpx;
margin-top: 12rpx;
}
.week-legend-item {
display: flex;
align-items: center;
gap: 8rpx;
}
.week-legend-dot {
width: 14rpx;
height: 14rpx;
flex: none;
border-radius: 50%;
}
.week-legend-name {
color: #71807a;
font-size: 20rpx;
}
.week-legend-empty {
color: #a1aca6;
font-size: 20rpx;
}
.week-list {
margin-top: 8rpx;
}
.week-row {
display: flex;
align-items: center;
gap: 8rpx;
box-sizing: border-box;
height: 108rpx;
border-bottom: 1rpx solid #f0f3f1;
}
.week-row:last-child {
border-bottom: none;
}
.week-row.today {
margin: 0 -20rpx;
padding: 0 20rpx 0 14rpx;
border-left: 6rpx solid #247b63;
background: #e5f4ed;
}
.week-row-date {
display: flex;
width: 92rpx;
flex: none;
align-items: baseline;
gap: 4rpx;
}
.week-row-name {
color: #71807a;
font-size: 20rpx;
}
.week-row-day {
color: #17211f;
font-size: 30rpx;
font-weight: 800;
}
.week-row-suffix {
color: #71807a;
font-size: 16rpx;
}
.week-row-status {
width: 40rpx;
flex: none;
color: #247b63;
font-size: 18rpx;
font-weight: 800;
}
.week-row-status.rest {
color: #a1aca6;
}
.week-track {
display: flex;
width: 396rpx;
height: 28rpx;
flex: none;
gap: 4rpx;
box-sizing: border-box;
overflow: hidden;
border-radius: 14rpx;
background: #eef3f0;
}
.week-segment {
display: flex;
height: 28rpx;
flex: none;
align-items: center;
justify-content: center;
overflow: hidden;
border-radius: 14rpx;
}
.week-segment-text {
box-sizing: border-box;
max-width: 100%;
padding: 0 6rpx;
overflow: hidden;
color: #ffffff;
font-size: 18rpx;
line-height: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
}
.week-row-tail {
display: flex;
min-width: 0;
flex: 1;
flex-direction: column;
gap: 3rpx;
width: 90%;
margin-top: 3rpx;
min-height: 10rpx;
align-items: flex-end;
gap: 2rpx;
}
.week-bars.empty {
min-height: 10rpx;
.week-row-empty {
flex: 1;
min-width: 0;
color: #71807a;
font-size: 20rpx;
}
.week-bar {
height: 5rpx;
border-radius: 999rpx;
.week-row-total {
color: #17211f;
font-size: 20rpx;
font-weight: 800;
}
.week-row-pending {
padding: 2rpx 8rpx;
border-radius: 8rpx;
background: #fff1dc;
color: #8b5e24;
font-size: 16rpx;
font-weight: 700;
white-space: nowrap;
}
.week-grid {
@@ -796,7 +921,7 @@
}
.month-cell {
min-height: 168rpx;
min-height: 136rpx;
padding: 8rpx 5rpx;
border-right: 1rpx solid #e7ece9;
border-bottom: 1rpx solid #e7ece9;
@@ -930,6 +1055,7 @@
.month-empty {
margin-top: 10rpx;
white-space: nowrap;
color: #b5ada4;
font-size: 20rpx;
text-align: center;
+46 -14
View File
@@ -5,6 +5,7 @@ const { buildProfileCard } = require('../../utils/profile-card')
const profileCache = require('../../utils/profile-cache')
const authApi = require('../../api/auth')
const { showErrorToast } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function resolveRoleText(type) {
const role = Number(type)
@@ -14,9 +15,28 @@ function resolveRoleText(type) {
return '管理端'
}
function resolveIdentityRole(type) {
const role = Number(type)
if (role === 2) return 'manager'
if (role === 3) return 'artist'
return ''
}
const MANAGER_MENUS = [
{ title: '个人信息', url: '/pages/profile-edit/index' },
{ title: '店铺信息', url: '/pages/shop-settings/index' },
{ title: '账号安全', url: '/pages/account-settings/index' },
{ title: '订单数据', url: '/pages/export/index' },
{ title: '关于系统', url: '/pages/about/index' }
]
const ARTIST_MENUS = MANAGER_MENUS.filter(item => item.title !== '店铺信息')
Page({
data: {
roleText: '管理端',
identityRole: '',
activeRole: '',
profileCard: buildProfileCard({}, BRAND_CONFIG.defaultShopName),
overviewLoading: false,
overview: {
@@ -29,15 +49,7 @@ Page({
shopOpen: true,
shopStatus: '营业中'
},
menus: [
{ title: '个人信息', url: '/pages/profile-edit/index' },
{ title: '账号设置', url: '/pages/account-settings/index' },
{ title: '店铺设置', url: '/pages/shop-settings/index' },
{ title: '数据导出', url: '/pages/export/index' },
{ title: '用户协议', url: '/pages/legal/index?type=USER_TERMS' },
{ title: '隐私政策', url: '/pages/legal/index?type=PRIVACY_POLICY' },
{ title: '关于系统', url: '/pages/about/index' }
]
menus: MANAGER_MENUS
},
onShow() {
@@ -82,24 +94,39 @@ Page({
const app = getApp()
const userInfo = app.globalData.userInfo || {}
const fallbackShopName = app.globalData.shopName || BRAND_CONFIG.defaultShopName
const identityRole = resolveIdentityRole(userInfo.type)
const activeRole = this.data.activeRole || identityRole
this.setData({
roleText: resolveRoleText(userInfo.type),
identityRole,
activeRole,
menus: activeRole === 'artist' ? ARTIST_MENUS : MANAGER_MENUS,
profileCard: buildProfileCard(userInfo, fallbackShopName)
})
},
switchRole(event) {
const role = event.currentTarget.dataset.role
if (!role || role === this.data.activeRole) return
this.setData({
activeRole: role,
menus: role === 'artist' ? ARTIST_MENUS : MANAGER_MENUS
})
},
go(event) {
wx.navigateTo({ url: event.currentTarget.dataset.url })
},
async logout() {
const confirmed = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '退出登录',
content: '退出后将关闭自动登录,并清除本机提醒设置。',
success: result => resolve(result.confirm),
fail: () => resolve(false)
}))
if (!confirmed) return
cancelText: '取消',
confirmText: '确定',
confirmType: 'danger'
})
if (!result.confirm) return
try { await authApi.logout() } catch (error) {}
getApp().logoutDevice()
wx.reLaunch({ url: '/pages/login/index' })
@@ -143,8 +170,13 @@ Page({
shopName: nextUserInfo.shopName || session.shopName,
userInfo: nextUserInfo
})
const identityRole = resolveIdentityRole(nextUserInfo.type)
const activeRole = this.data.activeRole || identityRole
this.setData({
roleText: resolveRoleText(nextUserInfo.type),
identityRole,
activeRole,
menus: activeRole === 'artist' ? ARTIST_MENUS : MANAGER_MENUS,
profileCard: buildProfileCard(nextUserInfo, BRAND_CONFIG.defaultShopName)
})
}
+4 -1
View File
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "我的"
"navigationBarTitleText": "我的",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
+6 -1
View File
@@ -10,7 +10,11 @@
<text class="profile-shop">{{profileCard.shopName}}</text>
</view>
</view>
<text class="role-badge">{{roleText}}</text>
<view wx:if="{{identityRole}}" class="role-switch">
<text class="role-chip {{activeRole === 'manager' ? 'is-active' : ''}}" data-role="manager" bindtap="switchRole">店长</text>
<text class="role-chip {{activeRole === 'artist' ? 'is-active' : ''}}" data-role="artist" bindtap="switchRole">美甲师</text>
</view>
<text wx:else class="role-badge">{{roleText}}</text>
</view>
<view class="card overview-card">
@@ -56,4 +60,5 @@
</view>
<button class="profile-logout" bindtap="logout">退出登录</button>
<action-modal id="actionModal" />
</view>
+53 -8
View File
@@ -3,7 +3,7 @@
align-items: center;
justify-content: space-between;
gap: 20rpx;
padding: 28rpx;
padding: 26rpx;
}
.profile-main {
@@ -22,10 +22,10 @@
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 96rpx;
height: 96rpx;
width: 100rpx;
height: 100rpx;
overflow: hidden;
border-radius: 24rpx;
border-radius: 25rpx;
background: #247b63;
color: #fff;
font-size: 40rpx;
@@ -67,6 +67,39 @@
line-height: 1.2;
}
.role-switch {
display: flex;
align-items: center;
flex-shrink: 0;
width: 184rpx;
height: 44rpx;
padding: 4rpx;
border-radius: 23rpx;
background: #e5f4ed;
}
.role-chip {
display: flex;
align-items: center;
justify-content: center;
height: 37rpx;
border-radius: 18rpx;
color: #71807a;
font-size: 21rpx;
line-height: 1;
}
.role-chip.is-active {
width: 81rpx;
background: #247b63;
color: #ffffff;
font-weight: 700;
}
.role-chip:not(.is-active) {
width: 95rpx;
}
.overview-card {
margin-top: 20rpx;
padding: 24rpx;
@@ -104,7 +137,7 @@
.overview-item {
display: flex;
min-height: 112rpx;
min-height: 104rpx;
align-items: center;
justify-content: center;
flex-direction: column;
@@ -154,6 +187,7 @@
}
.menu-list {
margin-top: 16rpx;
overflow: hidden;
}
@@ -161,8 +195,8 @@
display: flex;
align-items: center;
justify-content: space-between;
min-height: 104rpx;
padding: 0 26rpx;
min-height: 94rpx;
padding: 0 27rpx;
border-bottom: 1rpx solid #e7ece9;
color: #17211f;
font-size: 28rpx;
@@ -177,4 +211,15 @@
color: #b0a79e;
font-size: 44rpx;
}
.profile-logout { margin:48rpx 8rpx 24rpx; background:transparent; color:#a24f42; font-size:25rpx; }
.profile-logout {
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
margin: 40rpx 8rpx 24rpx;
border-radius: 20rpx;
background: #fbe9e7;
color: #b3261e;
font-size: 28rpx;
font-weight: 600;
}
+5 -1
View File
@@ -157,11 +157,15 @@ Page({
RETRY: '资料内容待重新审核,审核完成前不会展示',
MISSING: '资料尚未进入审核,请联系门店负责人确认'
}[moderationStatus] || ''
const submittedAt = result && result.createTime
? this.formatSubmissionTime(new Date(String(result.createTime).replace('T', ' ').replace(/-/g, '/')))
: ''
return {
registrationStatus: result || null,
registrationStatusText: statusText,
contentStatusText,
contentStatusReason: result && result.contentModerationReason || ''
contentStatusReason: result && result.contentModerationReason || '',
...(submittedAt ? { applicationSubmittedAt: submittedAt } : {})
}
},
+1 -1
View File
@@ -3,7 +3,7 @@
<view class="progress-row"><view class="progress-step {{step >= 1 ? 'active' : ''}}"><text>1</text><label>选择身份</label></view><view class="progress-line {{step >= 2 ? 'active' : ''}}"></view><view class="progress-step {{step >= 2 ? 'active' : ''}}"><text>2</text><label>补充资料</label></view><view class="progress-line {{step >= 3 ? 'active' : ''}}"></view><view class="progress-step {{step >= 3 ? 'active' : ''}}"><text>3</text><label>申请状态</label></view></view>
<view wx:if="{{ticketInvalid}}" class="card result-card"><view class="result-icon">!</view><view class="section-title">申请入口已失效</view><view class="section-desc">这次注册凭证已过期或已使用,请返回登录页重新点击微信快捷登录获取新凭证。</view><button class="primary-btn" bindtap="back">重新快捷登录</button></view>
<view wx:elif="{{step === 1}}" class="card form-card"><view class="section-title"><text class="required-mark">*</text>选择工作身份</view><view class="section-desc">无需手机号和密码,审核人会根据你的身份处理申请</view><view class="role-list"><view class="role-option {{role === 'manager' ? 'selected' : ''}}" data-role="manager" bindtap="selectRole"><view class="role-icon">店</view><view class="role-copy"><text class="role-title">店长</text><text class="role-desc">创建并负责一家 Salon 门店</text></view><text class="role-mark">{{role === 'manager' ? '✓' : '○'}}</text></view><view class="role-option {{role === 'staff' ? 'selected' : ''}}" data-role="staff" bindtap="selectRole"><view class="role-icon">员</view><view class="role-copy"><text class="role-title">店员</text><text class="role-desc">加入已有门店协同工作</text></view><text class="role-mark">{{role === 'staff' ? '✓' : '○'}}</text></view></view><button class="primary-btn" bindtap="continueFromRole">继续</button></view>
<view wx:elif="{{step === 2}}" class="card form-card"><view class="section-title">补充资料</view><view class="section-desc">{{role === 'manager' ? '提交后由平台管理员审核' : '提交后由对应店长审核,昵称和头像为必填资料'}}</view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label"><text class="required-mark">*</text>店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="请输入店铺名称" /></view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label">店铺地址 <text class="optional-mark">选填</text></text><view class="address-entry"><input value="{{form.shopAddress}}" data-field="shopAddress" bindinput="onInput" placeholder="可手动填写门店地址" /><button class="map-pick-btn" bindtap="chooseShopLocation">地图选点</button></view><text class="field-hint">地图选点为可选项,仅用于门店展示和预约导航,不会在后台静默获取位置。</text></view><view wx:if="{{role === 'staff'}}" class="field"><text class="field-label"><text class="required-mark">*</text>选择店铺</text><view class="picker-value {{selectedShopName ? 'filled' : ''}}" bindtap="openShopSheet"><text>{{selectedShopName || '请选择要加入的店铺'}}</text><text class="picker-arrow">›</text></view></view><view wx:if="{{role === 'staff'}}" class="field"><text class="field-label"><text class="required-mark">*</text>昵称</text><input type="nickname" maxlength="20" value="{{form.applicantNickname}}" data-field="applicantNickname" bindinput="onInput" placeholder="点击输入框选择或填写微信昵称" /><text class="field-hint">可从微信昵称中选择,也可以手动填写,最多20个字。</text></view><view wx:if="{{role === 'staff'}}" class="field avatar-pick-field"><text class="field-label"><text class="required-mark">*</text>头像</text><button class="avatar-pick" open-type="chooseAvatar" bindchooseavatar="chooseApplicantAvatar"><image src="{{form.applicantAvatarUrl || '/assets/images/default-user-avatar.png'}}" mode="aspectFill"></image><text>{{avatarUploading ? '上传中...' : '点击选择微信头像'}}</text></button><text class="field-hint">请选择头像,头像会先上传并完成资料登记,提交时只引用已上传的文件。</text></view><view wx:if="{{role === 'staff'}}" class="notice">审核通过前不会获得门店业务权限</view><button class="primary-btn" loading="{{loading}}" disabled="{{avatarUploading}}" bindtap="submit">提交审核</button><view class="back-entry" bindtap="goBackStep">返回上一步</view></view>
<view wx:elif="{{step === 2}}" class="card form-card"><view class="section-title">补充资料</view><view class="section-desc">{{role === 'manager' ? '提交后由平台管理员审核' : '提交后由对应店长审核,昵称和头像为必填资料'}}</view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label"><text class="required-mark">*</text>店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="请输入店铺名称" /></view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label">店铺地址 <text class="optional-mark">选填</text></text><view class="address-entry"><input value="{{form.shopAddress}}" data-field="shopAddress" bindinput="onInput" placeholder="可手动填写门店地址" /><button class="map-pick-btn" bindtap="chooseShopLocation">地图选点</button></view><text class="field-hint">地图选点为可选项,仅用于门店展示和预约导航,不会在后台静默获取位置。</text></view><view wx:if="{{role === 'staff'}}" class="field"><text class="field-label"><text class="required-mark">*</text>选择店铺</text><view class="picker-value {{selectedShopName ? 'filled' : ''}}" bindtap="openShopSheet"><text>{{selectedShopName || '请选择要加入的店铺'}}</text><text class="picker-arrow">›</text></view></view><view wx:if="{{role === 'staff'}}" class="field"><text class="field-label"><text class="required-mark">*</text>昵称</text><input type="nickname" maxlength="20" value="{{form.applicantNickname}}" data-field="applicantNickname" bindinput="onInput" placeholder="点击输入框选择或填写微信昵称" /><text class="field-hint">可从微信昵称中选择,也可以手动填写,最多20个字。</text></view><view wx:if="{{role === 'staff'}}" class="field avatar-pick-field"><text class="field-label"><text class="required-mark">*</text>头像</text><view class="avatar-row"><image class="avatar-pick-image" src="{{form.applicantAvatarUrl || '/assets/images/default-user-avatar.png'}}" mode="aspectFill"></image><button class="avatar-outline-btn" open-type="chooseAvatar" bindchooseavatar="chooseApplicantAvatar">{{avatarUploading ? '上传中...' : '点击选择微信头像'}}</button></view><text class="field-hint">请选择头像,头像会先上传并完成资料登记,提交时只引用已上传的文件。</text></view><view wx:if="{{role === 'staff'}}" class="notice">审核通过前不会获得门店业务权限</view><button class="primary-btn" loading="{{loading}}" disabled="{{avatarUploading}}" bindtap="submit">提交审核</button><button class="secondary-btn back-entry" bindtap="goBackStep">返回上一步</button></view>
<view wx:elif="{{step === 3}}" class="card result-card"><view class="result-icon {{registrationStatusText === '已驳回' ? 'rejected' : registrationStatusText === '已通过' ? 'approved' : ''}}">{{registrationStatusText === '已驳回' ? '!' : registrationStatusText === '已通过' ? '✓' : '…'}}</view><view class="section-title">{{registrationStatusText === '已通过' ? '申请已通过' : registrationStatusText === '已驳回' ? '申请未通过' : '申请已提交'}}</view><view class="section-desc">{{registrationStatusText === '已通过' ? '现在可以返回登录页,使用微信快捷登录。' : registrationStatusText === '已驳回' ? (registrationStatus.rejectReason || '返回登录并重新快捷登录后,可修改资料再次申请。') : (role === 'manager' ? '申请由平台管理员处理,通过后即可使用快捷登录。' : '申请由门店店长处理,通过后即可使用快捷登录。')}}</view><view class="result-status">当前状态:<text>{{registrationStatusText}}</text></view><view class="registration-details"><view class="registration-detail"><text>申请门店</text><text>{{registrationStatus.shopName || selectedShopName || form.shopName || '—'}}</text></view><view class="registration-detail"><text>申请身份</text><text>{{role === 'manager' ? '店长' : '店员'}}</text></view><view wx:if="{{role === 'staff'}}" class="registration-detail"><text>申请昵称</text><text>{{form.applicantNickname || '—'}}</text></view><view wx:if="{{registrationStatus.applicationNo}}" class="registration-detail"><text>申请编号</text><text>{{registrationStatus.applicationNo}}</text></view><view class="registration-detail"><text>提交时间</text><text>{{applicationSubmittedAt || '刚刚'}}</text></view></view><view wx:if="{{contentStatusText}}" class="content-review-status"><text>{{contentStatusText}}</text><text wx:if="{{contentStatusReason}}" class="content-review-reason">{{contentStatusReason}}</text></view><button wx:if="{{registrationStatusText === '已驳回'}}" class="primary-btn" bindtap="reapply">返回登录并重新申请</button><button wx:else class="primary-btn" bindtap="back">返回登录</button></view>
<entity-selector-sheet visible="{{shopSheetVisible}}" title="选择门店" keyword="{{shopKeyword}}" placeholder="搜索门店名称或地址" items="{{shopSelectorItems}}" selected-id="{{form.shopId}}" loading="{{shopLoading}}" error-text="{{shopError}}" empty-text="暂无匹配门店" bind:search="onShopSearch" bind:select="selectShop" bind:retry="loadShops" bind:close="closeShopSheet" />
<view class="safe-note">OpenID 仅用于识别你的微信身份,不会在页面中展示。</view>
+71 -38
View File
@@ -10,9 +10,9 @@
}
.logo {
width: 88rpx;
height: 88rpx;
border-radius: 26rpx;
width: 92rpx;
height: 92rpx;
border-radius: 27rpx;
background: #e5f4ed;
box-shadow: 0 12rpx 28rpx rgba(55, 94, 72, .14);
}
@@ -34,6 +34,8 @@
.progress-step {
display: flex;
width: 104rpx;
flex: none;
flex-direction: column;
align-items: center;
color: #a3b0a7;
@@ -54,7 +56,7 @@
font-weight: 700;
}
.progress-step label { margin-top: 8rpx; }
.progress-step label { display: block; margin-top: 8rpx; text-align: center; }
.progress-step.active { color: #247b63; }
.progress-step.active text { background: #247b63; color: #fff; }
@@ -165,26 +167,29 @@
font-weight: 500;
}
.secondary-entry,
.back-entry {
.secondary-entry {
margin-top: 24rpx;
color: #5b806b;
font-size: 24rpx;
text-align: center;
}
.back-entry {
margin-top: 20rpx;
}
.secondary-entry text { margin-left: 8rpx; font-size: 30rpx; }
.password-panel { padding-bottom: 4rpx; }
.primary-btn {
height: 84rpx;
height: 88rpx;
margin-top: 30rpx;
border-radius: 14rpx;
border-radius: 20rpx;
background: #247b63;
color: #fff;
font-size: 28rpx;
font-weight: 700;
line-height: 84rpx;
line-height: 88rpx;
}
.role-list { margin-top: 28rpx; }
@@ -192,7 +197,7 @@
.role-option {
display: flex;
align-items: center;
min-height: 112rpx;
min-height: 116rpx;
margin-top: 16rpx;
padding: 0 20rpx;
border: 1rpx solid #e7ece9;
@@ -225,8 +230,8 @@
.role-mark { color: #6f9780; font-size: 34rpx; }
.notice {
margin-top: 18rpx;
padding: 18rpx;
margin: 26rpx 0 0;
padding: 20rpx 24rpx;
border-radius: 12rpx;
background: #e5f4ed;
color: #718579;
@@ -238,7 +243,7 @@
display: flex;
flex-direction: column;
align-items: center;
padding-top: 64rpx;
padding-top: 48rpx;
text-align: center;
}
@@ -246,12 +251,12 @@
display: flex;
align-items: center;
justify-content: center;
width: 92rpx;
height: 92rpx;
width: 144rpx;
height: 144rpx;
border-radius: 50%;
background: #e5f4ed;
color: #247b63;
font-size: 48rpx;
font-size: 40rpx;
font-weight: 800;
}
.result-icon.approved { background: #e5f4ed; color: #247b63; }
@@ -259,32 +264,60 @@
.content-review-status { width: 100%; box-sizing: border-box; margin-top: 16rpx; padding: 16rpx 20rpx; border-radius: 12rpx; background: #f3f7f4; color: #587061; font-size: 22rpx; line-height: 1.5; }
.content-review-reason { display: block; margin-top: 6rpx; color: #a24f42; }
.result-card .section-title { margin-top: 24rpx; }
.result-status { margin-top: 28rpx; padding: 18rpx 28rpx; border-radius: 12rpx; background: #e5f4ed; color: #75887b; font-size: 24rpx; }
.result-status text { color: #c28b47; font-weight: 700; }
.registration-details { width: 100%; box-sizing: border-box; margin-top: 20rpx; padding: 8rpx 18rpx; border-radius: 14rpx; background: #f3f8f3; text-align: left; }
.registration-detail { display: flex; align-items: flex-start; justify-content: space-between; gap: 20rpx; padding: 12rpx 0; border-bottom: 1rpx solid #e2ebe3; font-size: 22rpx; line-height: 1.45; }
.result-card .section-title { margin-top: 36rpx; }
.result-status { width: 100%; box-sizing: border-box; margin-top: 32rpx; color: #17211f; font-size: 25rpx; text-align: left; }
.result-status text { color: #d59a52; font-weight: 700; }
.registration-details { width: 100%; box-sizing: border-box; margin-top: 12rpx; padding: 0; background: transparent; text-align: left; }
.registration-detail { display: flex; align-items: flex-start; justify-content: space-between; gap: 20rpx; padding: 16rpx 0; border-bottom: 1rpx solid #ededed; font-size: 23rpx; line-height: 1.45; }
.registration-detail:last-child { border-bottom: 0; }
.registration-detail text:first-child { flex: none; color: #8b9a91; }
.registration-detail text:last-child { min-width: 0; color: #425b4c; text-align: right; overflow-wrap: anywhere; }
.registration-detail text:first-child { flex: none; color: #71807a; }
.registration-detail text:last-child { min-width: 0; color: #17211f; text-align: right; overflow-wrap: anywhere; }
.safe-note { margin-top: 28rpx; color: #9aa9a0; font-size: 21rpx; line-height: 1.5; text-align: center; }
.avatar-pick-field { margin-top: 26rpx; }
.avatar-pick {
.avatar-row {
display: flex;
align-items: center;
width: 100%;
height: 104rpx;
padding: 0 20rpx;
border: 1rpx solid #dfe9e1;
border-radius: 14rpx;
background: #f3f7f4;
color: #4d7660;
font-size: 25rpx;
text-align: left;
gap: 20rpx;
}
.avatar-pick-image {
width: 72rpx;
height: 72rpx;
flex: none;
border-radius: 50%;
background: #e5f4ed;
}
.avatar-outline-btn {
width: auto;
min-width: 0;
height: 72rpx;
margin: 0;
padding: 0 24rpx;
border: 1rpx solid #e7ece9;
border-radius: 16rpx;
background: #ffffff;
color: #17211f;
font-size: 23rpx;
font-weight: 600;
line-height: 72rpx;
white-space: nowrap;
}
.avatar-outline-btn::after { border: 0; }
.address-entry { display:flex; align-items:flex-start; gap:12rpx; }
.address-entry input { min-width:0; flex:1; height:84rpx; }
.map-pick-btn {
flex: none;
width: auto;
min-width: 0;
height: 84rpx;
margin: 0;
padding: 0 22rpx;
border: 1rpx solid #e7ece9;
border-radius: 12rpx;
background: #f1f3f2;
color: #71807a;
font-size: 22rpx;
font-weight: 600;
line-height: 84rpx;
white-space: nowrap;
}
.avatar-pick::after { border: 0; }
.avatar-pick image { width: 72rpx; height: 72rpx; margin-right: 20rpx; border-radius: 50%; background: #e5f4ed; }
.address-entry { display:flex; align-items:center; gap:12rpx; }
.address-entry input { min-width:0; flex:1; }
.map-pick-btn { flex:none; width:132rpx; height:64rpx; margin:0; padding:0; border-radius:10rpx; background:#e5f4ed; color:#247b63; font-size:21rpx; line-height:64rpx; }
.field-hint { display:block; margin-top:10rpx; color:#819087; font-size:20rpx; line-height:1.5; }
@@ -2,6 +2,7 @@ const employeesApi = require('../../api/employees')
const dateUtil = require('../../utils/date')
const { markPlanningRefresh } = require('../../utils/planning-refresh')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
const PRESETS = [
{ value: 'DOUBLE_REST', label: '双休', workDays: [1, 2, 3, 4, 5], startTime: '09:00', endTime: '17:00' },
@@ -254,7 +255,7 @@ Page({
}
} catch (error) {
const message = toUserMessage(error, '保存失败')
wx.showModal({ title: '排班保存失败', content: message, showCancel: false, confirmText: '知道了' })
await showActionModal(this, { title: '排班保存失败', content: message, confirmText: '知道了' })
} finally {
this.setData({ saving: false })
}
@@ -285,7 +286,7 @@ Page({
await this.loadRule()
} catch (error) {
const message = toUserMessage(error, '例外保存失败')
wx.showModal({ title: '特殊日期保存失败', content: message, showCancel: false, confirmText: '知道了' })
await showActionModal(this, { title: '特殊日期保存失败', content: message, confirmText: '知道了' })
} finally {
this.setData({ saving: false })
}
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "排班设置"
"navigationBarTitleText": "排班设置",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
@@ -69,4 +69,5 @@
<view class="fixed-bottom">
<button class="primary-btn" loading="{{saving}}" bindtap="save">{{onboarding && onboardingSource === 'appointment' ? '保存排班并继续分配' : '保存排班规则'}}</button>
</view>
<action-modal id="actionModal" />
</view>
@@ -1,5 +1,6 @@
.rule-card {
padding: 20rpx 24rpx;
box-shadow: none;
}
.onboarding-context {
+3 -3
View File
@@ -2,6 +2,7 @@ const { BRAND_CONFIG } = require('../../utils/config')
const profileCache = require('../../utils/profile-cache')
const shopApi = require('../../api/shop')
const { showErrorToast, toUserMessage } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function resolveNameStatus(value) {
const status = String(value || '').toUpperCase()
@@ -164,11 +165,10 @@ Page({
}
},
explainDefaultDuration() {
wx.showModal({
async explainDefaultDuration() {
await showActionModal(this, {
title: '默认时长',
content: '用于新建预约表单的初始值和未设置款式时的后备时长。已选款式的时长或你在预约中修改的时长优先。',
showCancel: false,
confirmText: '知道了'
})
},
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "店铺设置"
"navigationBarTitleText": "店铺设置",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
@@ -19,4 +19,5 @@
<button class="settings-action" loading="{{settingsSaving}}" disabled="{{settingsSaving}}" bindtap="saveAppointmentSettings">保存预约设置</button>
</view>
<view wx:elif="{{settingsLoading}}" class="settings-loading">正在加载店铺设置…</view>
<action-modal id="actionModal" />
</view>
@@ -7,9 +7,9 @@
.settings-section-note { margin-top: 8rpx; color: #7a8981; font-size: 21rpx; line-height: 1.45; }
.moderation-status { flex: none; color: #58826a; font-size: 21rpx; }
.shop-name-field { margin-top: 20rpx; }
.shop-name-field input { box-sizing: border-box; width: 100%; height: 82rpx; padding: 0 20rpx; border: 1rpx solid #dce8e0; border-radius: 12rpx; background: #f7faf8; color: #17211f; font-size: 25rpx; }
.shop-name-field input { box-sizing: border-box; width: 100%; height: 85rpx; padding: 0 20rpx; border: 1rpx solid #dce8e0; border-radius: 12rpx; background: #f7faf8; color: #17211f; font-size: 26rpx; }
.pending-name-note { margin-top: 12rpx; color: #8b7554; font-size: 21rpx; }
.settings-action { height: 76rpx; margin: 18rpx 0 0; padding: 0 26rpx; border-radius: 12rpx; background: #247b63; color: #fff; font-size: 24rpx; line-height: 76rpx; }
.settings-action { height: 80rpx; margin: 18rpx 0 0; padding: 0 26rpx; border-radius: 12rpx; background: #247b63; color: #fff; font-size: 25rpx; line-height: 80rpx; }
.settings-action.secondary { background: #e9f3ed; color: #397055; }
.settings-divider { height: 1rpx; margin: 32rpx 0 28rpx; background: #e4ebe6; }
.settings-field-row { display: flex; min-height: 90rpx; align-items: center; justify-content: space-between; gap: 20rpx; border-bottom: 1rpx solid #e8eee9; }

Some files were not shown because too many files have changed in this diff Show More