05e173b293
Replace the WebView shell with SwiftUI screens, add account-scoped Wiki and TTS APIs with adaptive review and photo scan support, and keep web/iOS pages usable while data loads asynchronously. Co-authored-by: Cursor <cursoragent@cursor.com>
49 lines
1.6 KiB
Markdown
49 lines
1.6 KiB
Markdown
# WordLoop iOS App
|
||
|
||
全原生 SwiftUI 应用,直接调用生产服务器 API,不再内嵌 Vue 前端。
|
||
|
||
## 打开工程
|
||
|
||
```bash
|
||
open ios/WordLoop/WordLoop.xcodeproj
|
||
```
|
||
|
||
在 Xcode 中选择你的 **Team**(Signing & Capabilities),然后运行到模拟器或真机。
|
||
|
||
## 服务器配置
|
||
|
||
API 固定为 `https://w.tkmind.cn/api`,可在 `Models/ServerEnvironment.swift` 修改。
|
||
|
||
登录 Token 保存在 Keychain,勾选「记住登录状态」后下次打开自动进入首页。
|
||
|
||
## 架构说明
|
||
|
||
- **UI 层**:SwiftUI(登录、首页、测验、记忆曲线、对话、设置等)
|
||
- **网络层**:`APIClient` + `URLSession`,Bearer Token 鉴权
|
||
- **数据层**:FastAPI 生产服务器 `/api`
|
||
|
||
## 功能对照
|
||
|
||
| 功能 | 原生页面 |
|
||
|------|----------|
|
||
| 登录 / 注册 | `LoginView` / `RegisterView` |
|
||
| 首页双模式 | `DashboardView` |
|
||
| 选择题练习 | `DailyQuizView` |
|
||
| 拼写练习 | `SpellQuizView` |
|
||
| 错题库 | `ErrorBankView` |
|
||
| 记忆曲线 / 词库 | `WordLibraryView` |
|
||
| 记忆对话 | `MemoryCoachView` |
|
||
| 翻译加词 | `TranslateSheet` |
|
||
| 拍照录入 | `PhotoImportView`(服务端 OCR) |
|
||
| 设置 / Wiki | `SettingsView` 及子页面 |
|
||
|
||
## 权限
|
||
|
||
`Info.plist` 已声明相机与相册权限。模拟器无真实相机,请用「从相册选择」测试拍照录入。
|
||
|
||
## 与 Web 版差异
|
||
|
||
- 词图可视化(`WordGraphCanvas`)目前简化为列表 + 曲线图,后续可补 SwiftUI Canvas 版
|
||
- 测验会话暂不做本地断点续练(Web 版有 localStorage 恢复)
|
||
- iOS 不再打包 `www/` 前端资源,编译更快
|