fix(ios): 知识库页面优化 - 去掉中间创建按钮,右上角+改为创建

- 移除列表中部的虚线"创建新知识库"按钮
- 右上角+按钮从 libraryImport 改为 libraryCreate
- 空状态提示更新

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-05-27 21:24:44 +08:00
parent e4132dd1c3
commit 9aa9fd76c7

View File

@ -18,12 +18,12 @@ struct LibraryHomeView: View {
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.zxBorder008, lineWidth: 1))
}
.accessibilityLabel("搜索知识库")
NavigationLink(value: Route.libraryImport) {
NavigationLink(value: Route.libraryCreate) {
Image(systemName: "plus").font(.system(size: 18)).foregroundColor(.white)
.frame(width: 36, height: 36).background(ZXGradient.brand)
.clipShape(RoundedRectangle(cornerRadius: 10))
}
.accessibilityLabel("导入新知识库")
.accessibilityLabel("创建新知识库")
}
.padding(.horizontal, 20).padding(.top, 8).padding(.bottom, 12)
HStack(spacing: 8) { Image(systemName: "magnifyingglass").font(.system(size: 16)).foregroundColor(Color.zxF03); TextField("搜索知识库或知识点…", text: $s).font(.system(size: 14)).tint(Color.zxPurple).accessibilityLabel("搜索知识库") }
@ -40,19 +40,11 @@ struct LibraryHomeView: View {
}
}
if viewModel.knowledgeBases.isEmpty && !viewModel.isLoading {
Text("还没有知识库,点击右上角 + 创建").font(.system(size: 13)).foregroundColor(Color.zxF03).padding(.top, 40)
Text("还没有知识库,点击右上角 + 创建").font(.system(size: 14)).foregroundColor(Color.zxF04).padding(.top, 60)
}
if viewModel.hasMore {
ZXLoadMoreFooter { await viewModel.loadMore() }
}
NavigationLink(value: Route.libraryCreate) {
HStack(spacing: 8) { Image(systemName: "plus").font(.system(size: 16)); Text("创建新知识库").font(.system(size: 14, weight: .semibold)) }
.foregroundColor(Color.zxF05).frame(maxWidth: .infinity).frame(height: 52).background(Color.zxFill003)
.overlay(RoundedRectangle(cornerRadius: 16).strokeBorder(style: StrokeStyle(lineWidth: 1.5, dash: [6, 4]), antialiased: true).foregroundColor(Color.zxBorder01))
.clipShape(RoundedRectangle(cornerRadius: 16))
}
.accessibilityLabel("创建新知识库")
.accessibilityHint("导入文档或文本生成结构化知识库")
}.padding(.horizontal, 20).padding(.bottom, 120) }
.scrollIndicators(.hidden)
.zxPullToRefresh { await viewModel.refresh() }