- Replace all deprecated NavigationLink(destination:) with NavigationLink(value: Route) - Add Route enum with navigationDestination mapping in new Core/Navigation/ - Extract 7 new sub-page files (AIChatPage, AIFeedbackPageView, RecallTestPage, WeakPointsPage, FeedbackFormView, GoalSettingDetailView, MethodPreferenceView) - Add @ScaledMetric-based zxFontScaled modifier for Dynamic Type - Fix ZXPressModifier gesture conflict with ScrollView using onLongPressGesture - Enlarge touch targets from 36pt to 44pt - Add accessibility labels to TextField and other controls Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
18 lines
1.8 KiB
Swift
18 lines
1.8 KiB
Swift
import SwiftUI
|
||
|
||
struct DailyThinkingPage: View {
|
||
@State private var answer = ""; @State private var submitted = false
|
||
var body: some View {
|
||
ZStack { Color.zxBg0.ignoresSafeArea()
|
||
ScrollView { VStack(spacing: 16) {
|
||
VStack(alignment: .leading, spacing: 12) {
|
||
HStack { Image(systemName:"sparkles").foregroundColor(Color.zxAccent); Text("解释\"注意力机制\"在 Transformer 中的作用").zxFontScaled(size:15,weight:.bold).foregroundColor(Color.zxF0) }
|
||
Text("AI会从三个方面评估你的回答:核心概念理解 · 理论深度 · 实际应用能力").zxFontScaled(size:12).foregroundColor(Color.zxF04)
|
||
}.padding(16).background(ZXGradient.thinkingCard).clipShape(RoundedRectangle(cornerRadius:16))
|
||
VStack(alignment:.leading,spacing:8){Text("你的回答").font(.system(size:13,weight:.semibold)).foregroundColor(Color.zxF04);TextEditor(text:$answer).zxFontScaled(size:13).foregroundColor(Color.zxF0).tint(Color.zxPurple).frame(minHeight:160).scrollContentBackground(.hidden).padding(12).background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius:14)).overlay(RoundedRectangle(cornerRadius:14).stroke(Color.zxBorder008,lineWidth:1))}
|
||
if !submitted{ NavigationLink(value: Route.aiFeedback){ Text("提交回答,获取 AI 反馈").font(.system(size:14,weight:.bold)).foregroundColor(.white).frame(maxWidth:.infinity).frame(height:52).background(ZXGradient.ctaPurple).clipShape(RoundedRectangle(cornerRadius:16)).shadow(color:Color(hex:"#7C6EFA",opacity:0.3),radius:24) }.zxPressable() }
|
||
}.padding(.horizontal,20).padding(.top, 8).padding(.bottom,120) }.scrollIndicators(.hidden)
|
||
}.navigationBarTitleDisplayMode(.inline).toolbarBackground(.hidden,for:.navigationBar)
|
||
}
|
||
}
|