# 页面名:performance(我的业绩) > PRD 参考:P7 `docs/prd/specs/P7-miniapp-fe-performance.md` > 已实现:否 ## 页面说明 展示助教业绩全貌:收入档位、本月/上月业绩明细(含服务记录)、新客和常客列表。多个区域支持展开/收起和"查看全部"跳转。 ## Banner 主题 `banner-bg theme-blue texture-aurora`(蓝色主题) ## 状态变量 | 变量名 | 类型 | 初始值 | 说明 | |--------|------|--------|------| | performanceSummary | object | null | 业绩汇总(收入、档位、工资预估) | | thisMonthRecordsExpanded | boolean | false | 本月服务记录展开状态 | | lastMonthRecordsExpanded | boolean | false | 上月服务记录展开状态 | | newCustomerExpanded | boolean | false | 新客列表展开状态 | | regularCustomerExpanded | boolean | false | 常客列表展开状态 | | loading | boolean | true | 数据加载中 | | error | boolean | false | 加载失败 | ## 页面区域结构(忠于原型 HTML) 1. Banner(个人信息:花名/身份/门店 + 核心数据:本月预计收入 + 上月收入) 2. 收入情况(`bg-primary` 圆点)— 当前档位 + 下一阶段目标 + 升级提示(「距下一阶段需完成 X 小时,到达即得 Y 元」) - 跳档激励计算公式(PRD 补充):YYY = max(跳档线差值最小值, 实际差值) - 各档差值:Tier0→1: 1200元 / Tier1→2: 750元 / Tier2→3: 540元 / Tier3→4: 420元 3. 本月业绩 预估(`bg-success` 圆点)— 基础课时费/激励课时费/充值激励/TOP3销冠奖/合计 + 我的服务记录明细 4. 上月收入(`bg-warning` 圆点)— 同结构 + 我的服务记录明细 5. 我的新客(`bg-cyan-500` 圆点)— 按时间顺序 6. 我的常客(`bg-pink-500` 圆点)— 近2月贡献TOP20 ## 用户操作 → 响应 | 操作 | 触发条件 | 响应行为 | 目标状态 | |------|----------|----------|----------| | 页面加载 | 进入页面 | 请求业绩汇总+服务记录+新客+常客 | loading→false | | 点击"展开更多"(本月服务记录) | thisMonthRecordsExpanded=false | 显示隐藏的更多记录条目,按钮文字变「收起」 | thisMonthRecordsExpanded=true | | 点击"收起"(本月服务记录) | thisMonthRecordsExpanded=true | 隐藏多余记录条目,按钮文字变「展开更多」 | thisMonthRecordsExpanded=false | | 点击"展开更多"(上月服务记录) | lastMonthRecordsExpanded=false | 同上 | lastMonthRecordsExpanded=true | | 点击"收起"(上月服务记录) | lastMonthRecordsExpanded=true | 同上 | lastMonthRecordsExpanded=false | | 点击"查看全部"(本月) | 服务记录区域 | navigateTo performance-records(本月口径) | — | | 点击"查看全部"(上月) | 服务记录区域 | navigateTo performance-records(上月口径) | — | | 点击"查看更多 ↓"(新客列表) | newCustomerExpanded=false | 展开完整新客列表 | newCustomerExpanded=true | | 点击"收起 ↑"(新客列表) | newCustomerExpanded=true | 收起新客列表 | newCustomerExpanded=false | | 点击"查看更多 ↓"(常客列表) | regularCustomerExpanded=false | 展开完整常客列表 | regularCustomerExpanded=true | | 点击"收起 ↑"(常客列表) | regularCustomerExpanded=true | 收起常客列表 | regularCustomerExpanded=false | | 点击新客/常客卡片 | 无 | navigateTo task-detail(按该客户当前任务类型跳转对应详情页) | — | | 点击返回 | 顶部导航栏 | navigateBack / history.back() | — | | 点击"重试" | error=true | 重新请求数据 | loading=true | ## 服务记录展示 - 按天归总,每天显示服务次数和总时长 - 默认显示前几条,其余折叠 - 展开/收起按钮:`id="thisMonthRecordsToggle"` / `id="lastMonthRecordsToggle"` - "查看全部"链接跳转 `performance-records.html` ## 新客/常客展示 - 我的新客:该助教首次服务 + 2 月内 + 服务次数 ≤2,按最后服务时间排列 - 我的常客:近2月贡献TOP20,按服务次数降序,展示次数、小时数、工资合计 - 两个列表均支持展开/收起(`toggleNewCustomer()` / `toggleRegularCustomer()`) ## 业绩数据说明 - 营业日以 08:00 为分割点("本月"= 当月1日 08:00 ~ 次月1日 08:00) - 当月数据标记"预估" ## 页面状态枚举 | 状态名 | 视觉表现 | 触发条件 | |--------|----------|----------| | 加载中 | 区域文案"加载中..." | loading=true | | 正常态 | 完整业绩展示 | 有数据 | | 空数据态 | 各区域"暂无数据" | 对应列表为空 | | 错误态 | "加载失败,请点击重试" + 重试按钮 | error=true | ## 后端 API 依赖 | API | 方法 | 说明 | |-----|------|------| | `GET /api/performance/summary` | GET | 当月绩效汇总 | | `GET /api/performance/service-records` | GET | 服务记录明细(分页) | | `GET /api/performance/my-new-customers` | GET | 我的新客列表 | | `GET /api/performance/my-regulars` | GET | 我的常客列表 | ## 页面导航 - 来源:task-list(点击 Banner 业绩区域) - 去向:performance-records(查看全部)/ task-detail*(点击新客/常客卡片) ## 全局组件 - 自定义顶部导航栏(返回按钮 + "我的业绩") - AI 悬浮按钮