fix(ios): 文件上传模式隐藏标题,标题仅在手写模式显示
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
2b464df7cf
commit
ed3e587bf0
@ -128,15 +128,6 @@ struct AddKnowledgePage: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack { Color.zxBg0.ignoresSafeArea(); VStack(spacing: 0) {
|
ZStack { Color.zxBg0.ignoresSafeArea(); VStack(spacing: 0) {
|
||||||
ScrollView { VStack(spacing: 16) {
|
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) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("内容来源").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
|
Text("内容来源").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
|
||||||
@ -149,6 +140,13 @@ struct AddKnowledgePage: View {
|
|||||||
// 内容区
|
// 内容区
|
||||||
switch sourceType {
|
switch sourceType {
|
||||||
case .manual:
|
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) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("内容").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
|
Text("内容").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
|
||||||
TextEditor(text: $content)
|
TextEditor(text: $content)
|
||||||
@ -253,7 +251,7 @@ struct AddKnowledgePage: View {
|
|||||||
|
|
||||||
private var canSave: Bool {
|
private var canSave: Bool {
|
||||||
switch sourceType {
|
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
|
case .file: return !selectedFiles.isEmpty && !isUploading
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user