Files
Neo-ZQYY/docs/h5_ui/interactions/chat-history.md

48 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 页面名chat-history对话历史
> PRD 参考P9 `docs/prd/specs/P9-miniapp-fe-details.md``apps/miniprogram/doc/prd.md` 第十节
> 已实现:否
## 页面说明
展示历史 AI 对话记录列表,按时间倒序排列。点击可进入继续对话。
## 状态变量
| 变量名 | 类型 | 初始值 | 说明 |
|--------|------|--------|------|
| conversations | array | [] | 历史对话列表 |
| loading | boolean | true | 数据加载中 |
| error | boolean | false | 加载失败 |
## 用户操作 → 响应
| 操作 | 触发条件 | 响应行为 | 目标状态 |
|------|----------|----------|----------|
| 页面加载 | 进入页面 | GET /api/chat/conversations | loading→false |
| 点击对话记录 | 无 | navigateTo chat带 sessionId继续对话 | — |
| 点击返回 | 顶部导航栏 | navigateBack | — |
| 点击"重试" | error=true | 重新请求数据 | loading=true |
## 列表展示
- 按时间倒序排列
- 每条记录:对话标题/摘要 + 最后消息时间 + 消息数量
## 页面状态枚举
| 状态名 | 视觉表现 | 触发条件 |
|--------|----------|----------|
| 加载中 | 区域文案"加载中..." | loading=true |
| 正常态 | 对话列表 | 有数据 |
| 空数据态 | "暂无数据" | conversations 为空 |
| 错误态 | "加载失败,请点击重试" + 重试按钮 | error=true |
## 后端 API 依赖
| API | 方法 | 说明 |
|-----|------|------|
| `GET /api/chat/conversations` | GET | 对话历史列表 |
## 页面导航
- 来源my-profile点击"助手对话记录"
- 去向chat点击对话记录继续对话
## 全局组件
- 自定义顶部导航栏(返回按钮 + "对话记录"
- AI 悬浮按钮