fix(ios): 文件上传模式隐藏标题,标题仅在手写模式显示

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-05-27 22:29:13 +08:00
parent 2b464df7cf
commit ed3e587bf0

View File

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