包含多个会话的累积代码变更: - backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔 - admin-web: ETL 状态页、任务管理、调度配置、登录优化 - miniprogram: 看板页面、聊天集成、UI 组件、导航更新 - etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强 - tenant-admin: 项目初始化 - db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8) - packages/shared: 枚举和工具函数更新 - tools: 数据库工具、报表生成、健康检查 - docs: PRD/架构/部署/合约文档更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
69 lines
2.2 KiB
Markdown
69 lines
2.2 KiB
Markdown
# P8→NS1/RNS1 缺失项 #11:看板数据加载失败时的错误展示
|
||
|
||
## 简要结论
|
||
- 状态:✅ 已解决
|
||
- 风险等级:🟡 低
|
||
- 三个看板页面均已实现错误态展示和重试按钮
|
||
|
||
## 详细审查
|
||
|
||
### 审查范围
|
||
- `apps/miniprogram/miniprogram/pages/board-finance/board-finance.wxml` + `.ts`
|
||
- `apps/miniprogram/miniprogram/pages/board-customer/board-customer.wxml` + `.ts`
|
||
- `apps/miniprogram/miniprogram/pages/board-coach/board-coach.wxml` + `.ts`
|
||
|
||
### 发现
|
||
1. **pageState 状态机已定义**:三个页面均定义了 `pageState: 'loading' | 'empty' | 'normal' | 'error'` 四态
|
||
2. **错误态 UI 已实现**:三个页面 WXML 均包含 `wx:elif="{{pageState === 'error'}}"` 条件渲染的错误态视图
|
||
3. **重试按钮已实现**:错误态视图中均包含 `bindtap="onRetry"` 的重试按钮
|
||
4. **onRetry 方法已实现**:三个页面 TS 均实现了 `onRetry()` 方法,调用 `loadData()` 或相应的数据加载方法
|
||
5. **loadData 中有 catch 处理**:`board-customer` 和 `board-coach` 的 `loadData()` 使用 try-catch,catch 中设置 `pageState: 'error'`
|
||
|
||
### 证据
|
||
|
||
board-coach.wxml 错误态:
|
||
```xml
|
||
<view class="page-error" wx:elif="{{pageState === 'error'}}">
|
||
<t-empty description="加载失败" />
|
||
<view class="retry-btn" bindtap="onRetry">点击重试</view>
|
||
</view>
|
||
```
|
||
|
||
board-customer.wxml 错误态(结构一致):
|
||
```xml
|
||
<view class="page-error" wx:elif="{{pageState === 'error'}}">
|
||
<t-empty description="加载失败" />
|
||
<view class="retry-btn" bindtap="onRetry">点击重试</view>
|
||
</view>
|
||
```
|
||
|
||
board-finance.wxml 错误态:
|
||
```xml
|
||
<view class="page-error" wx:elif="{{pageState === 'error'}}">
|
||
<t-empty description="加载失败" />
|
||
<view class="retry-btn" bindtap="onRetry">
|
||
<text class="retry-btn-text">点击重试</text>
|
||
</view>
|
||
</view>
|
||
```
|
||
|
||
board-coach.ts 错误处理:
|
||
```typescript
|
||
loadData() {
|
||
this.setData({ pageState: 'loading' })
|
||
setTimeout(() => {
|
||
try {
|
||
// ...
|
||
} catch {
|
||
this.setData({ pageState: 'error' })
|
||
}
|
||
}, 400)
|
||
},
|
||
onRetry() {
|
||
this.loadData()
|
||
},
|
||
```
|
||
|
||
### 建议
|
||
无。功能已完整实现。三个看板页面均具备 loading → normal/empty/error 四态切换,错误态有 `<t-empty>` 空态组件 + 重试按钮。
|