From ed3e587bf0140e6ae64ec57a87037e9645cf7843 Mon Sep 17 00:00:00 2001 From: wangdl Date: Wed, 27 May 2026 22:29:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(ios):=20=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=A8=A1=E5=BC=8F=E9=9A=90=E8=97=8F=E6=A0=87=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E6=A0=87=E9=A2=98=E4=BB=85=E5=9C=A8=E6=89=8B=E5=86=99?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- .../Features/Library/LibrarySubpages.swift | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/AIStudyApp/AIStudyApp/Features/Library/LibrarySubpages.swift b/AIStudyApp/AIStudyApp/Features/Library/LibrarySubpages.swift index fd612fe..7d86e3d 100644 --- a/AIStudyApp/AIStudyApp/Features/Library/LibrarySubpages.swift +++ b/AIStudyApp/AIStudyApp/Features/Library/LibrarySubpages.swift @@ -128,15 +128,6 @@ struct AddKnowledgePage: View { var body: some View { ZStack { Color.zxBg0.ignoresSafeArea(); VStack(spacing: 0) { ScrollView { VStack(spacing: 16) { - // 标题 - VStack(alignment: .leading, spacing: 8) { - Text("标题(可选,留空使用文件名)").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035) - TextField("输入知识点标题,留空则用文件名", text: $title).font(.system(size: 15)).tint(Color.zxPurple) - .padding(.horizontal, 16).frame(height: 52) - .background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)) - .overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) - } - // 内容来源选择 VStack(alignment: .leading, spacing: 8) { Text("内容来源").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035) @@ -149,6 +140,13 @@ struct AddKnowledgePage: View { // 内容区 switch sourceType { case .manual: + VStack(alignment: .leading, spacing: 8) { + Text("标题").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035) + TextField("输入知识点标题", text: $title).font(.system(size: 15)).tint(Color.zxPurple) + .padding(.horizontal, 16).frame(height: 52) + .background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)) + .overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) + } VStack(alignment: .leading, spacing: 8) { Text("内容").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035) TextEditor(text: $content) @@ -253,7 +251,7 @@ struct AddKnowledgePage: View { private var canSave: Bool { switch sourceType { - case .manual: return !content.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + case .manual: return !title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty && !content.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty case .file: return !selectedFiles.isEmpty && !isUploading } }