startup-plan/技术设计/ios-projects/已完成/[已完成]-已实现功能汇总.md
WangDL fe608da385 docs: 重构技术设计目录结构 + 更新待完成清单
- 文档从扁平结构迁移至分类目录 (api-server/ios-projects/web-projects/长期规划)
- 更新总待完成清单 (B1-B6 全部完成, I1-I7 全部完成)
- 新增后端实现状态、已实现功能汇总等已完成文档
- 新增 iOS 功能需求清单、架构设计、差距分析等文档
- 清理旧版未维护文档

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 19:08:59 +08:00

150 lines
4.5 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.

---
updated: 2026-05-17
---
# 知习 iOS 已实现功能汇总
> 从各设计/计划文档中提取的已完成内容,集中存放。原文档中已移除这些内容,仅保留待推进部分。
---
## 一、项目基础
| 项目 | 状态 |
|------|------|
| SwiftUI iOS 17+ | ✅ |
| 自定义 DesignTokens | ✅ 颜色/渐变/圆角/间距/字体/排版 |
| Xcode 项目 | ✅ 使用 PBXFileSystemSynchronizedRootGroupobjectVersion 77 |
| 目标平台 | iPhoneiOS 17+ |
---
## 二、架构层
### 已完成搭建
| 层 | 说明 |
|------|------|
| Model 层 | 10 个数据实体AuthModels、User、KnowledgeBase 等) |
| Network 层 | APIClient + APIEndpoint + APIError |
| Storage 层 | KeychainStore + TokenStore |
| Service 层 | 5 个 Service 协议 + 实现 + 20 个 APIEndpoint |
| Auth 体系 | AuthService + AuthServiceProtocol |
| AppSession | @MainActor 全局登录状态,驱动路由分流 |
| ViewModel 层 | 起步ReviewPlanViewModel、AIChatViewModel、StudyHomeViewModel |
| DesignSystem | DesignTokens.swift颜色/渐变/圆角/间距/字号/排版 |
---
## 三、页面22 页全部完成 UI
### Onboarding 流程
| 页面 | 状态 |
|------|------|
| SplashPage启动页 | ✅ |
| WelcomePage欢迎页 | ✅ |
| LoginPage登录页仅 Apple 登录) | ✅ |
| OnboardingPage功能引导 | ✅ |
| GoalSetupPage学习目标设置 | ✅ |
### 主界面 5-Tab
| Tab | 页面 | 状态 |
|-----|------|------|
| AI | AIHomeView | ✅ |
| AI | DailyThinkingPage | ✅ |
| AI | RecallTestPage | ✅ |
| AI | WeakPointsPage | ✅ |
| AI | AIFeedbackPageView | ✅ |
| AI | AIChatPage | ✅ |
| 知识库 | LibraryHomeView | ✅ |
| 知识库 | LibraryDetailPage | ✅ |
| 知识库 | CreateLibraryPage | ✅ |
| 知识库 | AddKnowledgePage | ✅ |
| 知识库 | ImportPage | ✅ |
| 知识库 | EditKnowledgePage | ✅ |
| 知识库 | KnowledgeDetailPage | ✅ |
| 学习 | StudyHomeView | ✅ |
| 分析 | AnalysisHomeView | ✅ |
| 我的 | ProfileView | ✅ |
### 独立功能页
| 页面 | 状态 |
|------|------|
| ReviewPlanView复习计划 | ✅ |
| FeedbackView + FeedbackViewModel | ✅ |
| 设置子页面5 个) | ✅ |
---
## 四、Auth / 登录
- Sign in with Apple 集成ASAuthorizationController
- Apple entitlements 已配置
- APIClient 自动注入 Authorization header
- 401 自动 refresh token 重试
- Token 存 Keychain不存 UserDefaults
- AppSession 驱动路由(替代 @AppStorage
- 启动时自动 checkSession → refresh → /users/me
---
## 五、设计系统
### 颜色
- 28 个颜色 token 双主题化(浅色/深色自适应)
- `Color(light:dark:)` 基于 `UITraitCollection.userInterfaceStyle`
### 组件29 个共享组件)
```
Shared/Components/
├── ZXTabBar, ZXBackHeader, ZXIconBtn, ZXScoreBox
├── ZXAIInputBar, ZXOutlineBtn, ZXQuickAction
├── ZXAIInteractionRow, ZXCardRow, ZXChip
├── ZXImportOption, ZXWeakRow, ZXStatBadge
├── ZXProfileStat, ZXProfileMenuRow, ZXAchievementBadge
├── ZXChartView, ZXSTaskRow, FeatureRow, ReviewTaskRow
├── ZXLoadingView, ZXErrorView, ZXEmptyView
```
### 主题切换
- ColorSchemeManager系统/浅色/深色三选一
- @AppStorage 持久化
- 4 处 `.preferredColorScheme(.dark)` 已移除
- 13 处内联 `Color(hex:)` 替换为自适应 token
---
## 六、代码质量
| 项目 | 说明 |
|------|------|
| 大文件拆分 | 3 个大文件拆为 15+ 个独立文件 |
| 共享组件集中 | `Shared/Components/` 下 20+ 组件 |
| 加载/错误/空状态 | ZXLoadingView / ZXErrorView / ZXEmptyView |
| 语言系统 | Localizable.strings (Base=中文) + ZXStrings + LanguageManager |
| 反馈页 | FeedbackView + FeedbackViewModel4 类反馈分类 |
| 设置页 | 5 个子页面 + 外观/语言切换 |
---
## 七、已对接的后端 API
| API | 状态 |
|-----|------|
| POST /api/auth/apple | ✅ |
| POST /api/auth/refresh | ✅ |
| POST /api/auth/logout | ✅ |
| GET /api/users/me | ✅ |
| PATCH /api/users/me | ✅ |
---
## 八、已废弃/清理的内容
- 旧 LoginPage含手机号/邮箱/微信入口)→ 替换为仅 Apple 登录的 LoginView
- `@AppStorage("hasCompletedOnboarding")` 路由控制 → 替换为 AppSession
- 3 个大文件中内联的子页面定义 → 拆分为独立文件
- 分散在各 View 中的共享组件定义 → 集中到 `Shared/Components/`
- 强制暗黑模式 `.preferredColorScheme(.dark)` → 移除
- 13 处内联 `Color(hex:)` → 替换为 token 引用