- 移除 3 处强制深色模式,用 @AppStorage 全局切换 - 设置页「外观」按钮实时切换深色/浅色/跟随系统 - 底部导航栏 inactive 颜色改为自适应 Color.zxF03 - 12 个子页面修复:保留返回按钮 + 消除顶部空白 - 新增 LearningSessionView/ReviewCardView/ActiveRecallView - 新增 NotificationListView/SettingsView 等子页面 - 补全所有按钮 NavigationLink 跳转(0 个空白 action) - KnowledgeBase 模型对齐服务器数据 - Info.plist 补充 CFBundleIdentifier + ATS - 新增缺口分析文档 gap-analysis-1/2.md
158 lines
6.5 KiB
Markdown
158 lines
6.5 KiB
Markdown
# AIStudyApp 现状与缺口分析 - 第一篇:现有资源盘点
|
||
|
||
> 生成日期:2026-05-11
|
||
> 后端地址:http://81.70.187.179:3001
|
||
|
||
---
|
||
|
||
## 一、项目文件结构
|
||
|
||
```
|
||
AIStudyApp/
|
||
├── AIStudyAppApp.swift # 应用入口,含 5 步 Onboarding 流程
|
||
├── ContentView.swift # 主 Tab 框架(5 个 Tab + 自定义底部栏)
|
||
│
|
||
├── Core/
|
||
│ ├── DesignSystem/DesignTokens.swift # 颜色/渐变/间距/字体全局设计令牌
|
||
│ ├── Models/APIModels.swift # 20+ DTO 数据模型
|
||
│ ├── Network/
|
||
│ │ ├── APIClient.swift # 通用 HTTP 客户端(actor, async/await)
|
||
│ │ ├── APIConfig.swift # baseURL 配置
|
||
│ │ └── APIError.swift # 错误枚举(网络/服务端/解码/认证)
|
||
│ └── Services/APIService.swift # 8 个服务类,15 个公开方法
|
||
│
|
||
├── Features/
|
||
│ ├── AI/
|
||
│ │ ├── AIHomeView.swift # AI 首页 + ZXQuickAction + ZXAIInteractionRow 组件
|
||
│ │ └── DailyThinkingPage.swift # 每日思考题 + RecallTestPage / WeakPointsPage /
|
||
│ │ # AIFeedbackPageView / AIChatPage 子页面
|
||
│ ├── Analysis/
|
||
│ │ └── AnalysisHomeView.swift # 学习分析页 + ZXChartView 折线图 + ZXWeakRow 薄弱点
|
||
│ ├── Library/
|
||
│ │ ├── LibraryHomeView.swift # 知识库列表首页
|
||
│ │ └── LibrarySubpages.swift # CreateLibraryPage / LibraryDetailPage /
|
||
│ │ # AddKnowledgePage / KnowledgeDetailPage /
|
||
│ │ # ImportPage / EditKnowledgePage
|
||
│ ├── Profile/
|
||
│ │ └── ProfileView.swift # 个人中心页
|
||
│ └── Study/
|
||
│ └── StudyHomeView.swift # 学习工作台 + 今日任务 + 周活跃柱状图
|
||
│
|
||
└── Info.plist # 手动管理(ATS例外 / Bundle元数据等)
|
||
```
|
||
|
||
---
|
||
|
||
## 二、5 个 Tab 页面清单
|
||
|
||
| Tab | 标签 | SF Symbol | View |
|
||
|-----|------|-----------|------|
|
||
| 1 | AI | `brain.head.profile` | AIHomeView |
|
||
| 2 | 知识库 | `books.vertical.fill` | LibraryHomeView |
|
||
| 3 | 学习 | `bolt.fill` | StudyHomeView |
|
||
| 4 | 分析 | `chart.bar.fill` | AnalysisHomeView |
|
||
| 5 | 我的 | `person.fill` | ProfileView |
|
||
|
||
---
|
||
|
||
## 三、所有页面/子页面总览(共 21 个)
|
||
|
||
### AI 模块(1 主 + 4 子)
|
||
|
||
| 页面 | 数据来源 | 核心功能 |
|
||
|------|---------|---------|
|
||
| AIHomeView | 🔴硬编码 | API 状态检测、思考题卡片、快捷操作、互动记录、提问输入栏 |
|
||
| DailyThinkingPage | 🔴硬编码 | AI 思考题展示 + 回答提交 |
|
||
| RecallTestPage | 🔴硬编码 | 回忆测试输入 |
|
||
| WeakPointsPage | 🔴硬编码 | 薄弱知识点静态列表 |
|
||
| AIFeedbackPageView | 🔴硬编码 | AI 反馈评分 + 操作入口 |
|
||
| AIChatPage | 🔴硬编码 | AI 对话气泡界面 |
|
||
|
||
### 知识库模块(1 主 + 6 子)
|
||
|
||
| 页面 | 数据来源 | 核心功能 |
|
||
|------|---------|---------|
|
||
| LibraryHomeView | 🔴硬编码 | 知识库列表 + 搜索框 + 创建入口 |
|
||
| CreateLibraryPage | 🔴静态 | 创建表单(名称+描述) |
|
||
| LibraryDetailPage | 🔴硬编码 | 知识点静态列表 |
|
||
| AddKnowledgePage | 🔴静态 | 添加知识点表单 |
|
||
| KnowledgeDetailPage | 🔴硬编码 | 知识点详情+标签+复习/费曼入口 |
|
||
| ImportPage | 🔴静态 | 导入方式选择(拍照/文件/链接/相册) |
|
||
| EditKnowledgePage | 🔴静态 | 编辑知识点表单 |
|
||
|
||
### 学习模块(1 主)
|
||
|
||
| 页面 | 数据来源 | 核心功能 |
|
||
|------|---------|---------|
|
||
| StudyHomeView | 🔴硬编码 | 今日进度环、任务列表(5个任务)、本周活跃柱状图 |
|
||
|
||
### 分析模块(1 主)
|
||
|
||
| 页面 | 数据来源 | 核心功能 |
|
||
|------|---------|---------|
|
||
| AnalysisHomeView | 🔴硬编码 | 4项统计徽章、掌握度7日折线图、薄弱知识点列表 |
|
||
|
||
### 个人中心(1 主)
|
||
|
||
| 页面 | 数据来源 | 核心功能 |
|
||
|------|---------|---------|
|
||
| ProfileView | 🔴硬编码 | 个人卡片、菜单列表、成就徽章 |
|
||
|
||
### 启动流程(5 步 Onboarding)
|
||
|
||
| 步骤 | 页面 | 功能 |
|
||
|------|------|------|
|
||
| Step 0 | SplashPage | 品牌开屏,2 秒自动跳转 |
|
||
| Step 1 | WelcomePage | 3 大功能介绍 |
|
||
| Step 2 | LoginPage | 手机号/邮箱 + 密码表单 + 微信/Apple 登录入口 |
|
||
| Step 3 | OnboardingPage | 4 步功能轮播 |
|
||
| Step 4 | GoalSetupPage | 学习目标/方法/每日时长选择 |
|
||
|
||
---
|
||
|
||
## 四、APIService 已封装方法(15 个)
|
||
|
||
| 服务类 | 方法 | 接口 |
|
||
|--------|------|------|
|
||
| WaitlistService | `join(...)` | POST /waitlist |
|
||
| | `stats()` | GET /waitlist/stats |
|
||
| AuthService | `appleLogin(...)` | POST /auth/apple |
|
||
| | `logout()` | POST /auth/logout |
|
||
| UserService | `myProfile()` | GET /users/me |
|
||
| | `updateProfile(...)` | PATCH /users/me |
|
||
| KnowledgeBaseService | `list()` | GET /knowledge-bases |
|
||
| | `create(...)` | POST /knowledge-bases |
|
||
| | `detail(id:)` | GET /knowledge-bases/:id |
|
||
| KnowledgeItemService | `list(baseId:)` | GET /knowledge-items |
|
||
| | `detail(id:)` | GET /knowledge-items/:id |
|
||
| | `create(...)` | POST /knowledge-items |
|
||
| AIAnalysisService | `analyze(...)` | POST /ai-analysis |
|
||
| ActivityService | `summary()` | GET /activity/summary |
|
||
| ReviewService | `due()` | GET /reviews/due |
|
||
| FocusItemService | `list()` | GET /focus-items |
|
||
| FeedbackService | `submit(...)` | POST /feedback |
|
||
|
||
---
|
||
|
||
## 五、后端接口 vs App 覆盖对照表
|
||
|
||
| 后端模块 | 接口数 | App 覆盖 | 状态 |
|
||
|----------|--------|---------|------|
|
||
| System | 3 | 0 | ❌ 无 |
|
||
| Auth | 3 | 2(Service 有,View 未接) | 🔶 |
|
||
| Users | 3 | 2(Service 有,View 未接) | 🔶 |
|
||
| KnowledgeBase | 5 | 3(Service 有,View 未接) | 🔶 |
|
||
| KnowledgeItems | 4 | 3(Service 有,View 未接) | 🔶 |
|
||
| DocumentImport | 2 | 0 | ❌ 无 |
|
||
| LearningSession | 3 | 0 | ❌ 无 |
|
||
| ActiveRecall | 2 | 0 | ❌ 无 |
|
||
| AIAnalysis | 3 | 1(Service 有,View 未接) | 🔶 |
|
||
| FocusItems | 4 | 1(Service 有,View 未接) | 🔶 |
|
||
| Review | 2 | 1(Service 有,View 未接) | 🔶 |
|
||
| LearningActivity | 2 | 1(Service 有,View 未接) | 🔶 |
|
||
| Notifications | 2 | 0 | ❌ 无 |
|
||
| Feedback | 4 | 1(Service 有,View 未接) | 🔶 |
|
||
| Waitlist | 3 | 2(Service 有,View 未接) | 🔶 |
|
||
|
||
> 覆盖率:Service 层 15/48 = 31%,View 层实际接入 0/48 = 0%
|