feat(IOS-INFO-043): trim MaterialDetailView + add toolbar to MaterialReaderView

- MaterialDetailView: remove 阅读原文件, 问这份资料, 开始学习 buttons
- MaterialReaderView: add 开始学习 toolbar button
- MaterialDetailView now serves as info page accessible from reader

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-19 11:21:43 +08:00
parent bee1f2ac33
commit fbf359ffe9
2 changed files with 12 additions and 43 deletions

View File

@ -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)

View File

@ -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)
}
}
}
}
}