diff --git a/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialDetailView.swift b/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialDetailView.swift index a6b70a1..485edaa 100644 --- a/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialDetailView.swift +++ b/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialDetailView.swift @@ -182,25 +182,6 @@ struct MaterialDetailView: View { if let status = vm.readingStatus, status != "not_started" { readingProgressCard } - - // Read original file button - NavigationLink(value: Route.materialReader( - materialId: knowledgeBaseId, - filePath: filePath, - materialType: fileType, - knowledgeBaseId: knowledgeBaseId, - title: fileName - )) { - HStack(spacing: 8) { - Image(systemName: fileType == .pdf || fileType == .word || fileType == .excel ? "eye" : "book") - Text("阅读原文件") - } - .font(.system(size: 15, weight: .bold)) - .foregroundColor(.white) - .frame(maxWidth: .infinity).frame(height: 48) - .background(ZXGradient.brand) - .clipShape(RoundedRectangle(cornerRadius: ZXRadius.lg)) - } } } @@ -319,30 +300,6 @@ struct MaterialDetailView: View { statBox(count: vm.quizCount, label: "测验", icon: "list.bullet.clipboard", color: Color.zxAccent) } - // Action buttons - HStack(spacing: 12) { - NavigationLink(value: Route.aiChat(context: ChatEntryContext(scopeType: .material, scopeId: nil, scopeName: fileName, parentKnowledgeBaseId: knowledgeBaseId, createdFrom: "material_detail"))) { - Label("问这份资料", systemImage: "bubble.left.and.bubble.right") - .font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0) - .frame(maxWidth: .infinity).frame(height: 44) - .background(Color.zxFill005) - .clipShape(RoundedRectangle(cornerRadius: 14)) - .overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) - } - - NavigationLink(value: Route.learningSession( - taskTitle: vm.kb?.title ?? "学习资料", - taskType: "study", - taskColorHex: "#3D7FFB" - )) { - Text("开始学习") - .font(.system(size: 14, weight: .bold)).foregroundColor(.white) - .frame(maxWidth: .infinity).frame(height: 44) - .background(ZXGradient.brandPurple) - .clipShape(RoundedRectangle(cornerRadius: 14)) - } - } - if vm.aiStatus == .processing { Text("知习正在整理知识点,完成后可开始学习和自测") .font(.system(size: 12)).foregroundColor(Color.zxF03) diff --git a/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialReaderView.swift b/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialReaderView.swift index 7335f13..7a4875b 100644 --- a/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialReaderView.swift +++ b/AIStudyApp/AIStudyApp/Features/MaterialReader/MaterialReaderView.swift @@ -189,6 +189,18 @@ struct MaterialReaderView: View { .font(.system(size: 16)) .foregroundColor(Color.zxF05) } + + if let kbId = knowledgeBaseId { + NavigationLink(value: Route.learningSession( + taskTitle: title.isEmpty ? "学习资料" : title, + taskType: "study", + taskColorHex: "#3D7FFB" + )) { + Image(systemName: "arrow.triangle.2.circlepath") + .font(.system(size: 16)) + .foregroundColor(Color.zxF05) + } + } } } }