- 架构层:ViewModel/ObservableObject、Service/Repository、网络层 APIClient/APIEndpoint/APIError - 设计系统:Color(light:dark:) 自适应 28 色 Token、ColorSchemeManager 深浅色切换 - 全页面:AI 对话/反馈/回忆/薄弱点、知识库 CRUD、学习工作台、复习计划、学习分析、个人中心/设置 - 登录与引导:Sign in with Apple、AppSession 状态管理、引导流程、演示模式 - 本地持久化:FileCache + PersistenceController(学习任务/复习任务/学习记录) - 本地化:zh-Hans Localizable.strings ~120 条、ZXStrings 程序化引用、LanguageManager - 组件库:ZXTabBar/ZXBackHeader/ZXSTaskRow/ZXChartView/ZXTypingIndicator 等 22 个共享组件 - 等待名单:WaitlistView 邮箱收集表单 - 动效:ZXTypingIndicator AI 打字动画、ZXShimmerModifier 骨架屏 - 测试:StudyHomeViewModel/AIChatViewModel/ReviewPlanViewModel/FileCache 共 28 条 - Dynamic Type 支持 + 范围限制 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
69 lines
2.5 KiB
Swift
69 lines
2.5 KiB
Swift
import SwiftUI
|
|
|
|
struct ReviewPlanView: View {
|
|
@StateObject private var vm = ReviewPlanViewModel()
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
ZXGradient.page.ignoresSafeArea()
|
|
|
|
VStack(spacing: 0) {
|
|
HStack {
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text("复习计划")
|
|
.font(.system(size: 22, weight: .heavy))
|
|
.foregroundColor(Color.zxF0)
|
|
.tracking(-0.5)
|
|
Text("\(vm.totalCount) 个待复习")
|
|
.font(.system(size: 12))
|
|
.foregroundColor(Color.zxF04)
|
|
}
|
|
Spacer()
|
|
}
|
|
.padding(.horizontal, 20)
|
|
.padding(.top, ZXSpacing.statusBarH + 16)
|
|
.padding(.bottom, 16)
|
|
|
|
ScrollView {
|
|
VStack(spacing: 20) {
|
|
sectionView(title: "今天", icon: "sun.max.fill", tasks: vm.todayTasks, color: Color.zxOrange)
|
|
sectionView(title: "明天", icon: "sunrise.fill", tasks: vm.tomorrowTasks, color: Color.zxPurple)
|
|
sectionView(title: "本周", icon: "calendar", tasks: vm.weekTasks, color: Color.zxTeal)
|
|
}
|
|
.padding(.horizontal, 20)
|
|
.padding(.bottom, 120)
|
|
}
|
|
.scrollIndicators(.hidden)
|
|
}
|
|
}
|
|
.navigationBarHidden(true)
|
|
}
|
|
|
|
func sectionView(title: String, icon: String, tasks: [ReviewTaskEntity], color: Color) -> some View {
|
|
VStack(alignment: .leading, spacing: 12) {
|
|
HStack(spacing: 8) {
|
|
Image(systemName: icon)
|
|
.font(.system(size: 14))
|
|
.foregroundColor(color)
|
|
Text(title)
|
|
.font(.system(size: 15, weight: .bold))
|
|
.foregroundColor(Color.zxF0)
|
|
Spacer()
|
|
Text("\(tasks.count) 项")
|
|
.font(.system(size: 12))
|
|
.foregroundColor(Color.zxF04)
|
|
}
|
|
|
|
if tasks.isEmpty {
|
|
ZXEmptyView(icon: "checkmark.circle", title: "暂无复习任务", subtitle: "完成学习后 AI 会自动生成复习计划")
|
|
} else {
|
|
ForEach(tasks) { task in
|
|
ReviewTaskRow(task: task) {
|
|
vm.toggleTask(task)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|