This commit is contained in:
anlicheng 2025-06-30 18:49:47 +08:00
parent 72d73f9a2f
commit e7549803b6

View File

@ -25,23 +25,19 @@ struct SearchView: View {
@State private var isFocused: Bool = true
var body: some View {
VStack(spacing: 12) {
if showSearchResult {
if searchModel.dramaGroups.isEmpty {
Spacer()
Text("什么都没有找到")
.font(.system(size: 18))
.foregroundColor(Color(hex: "#333333"))
Spacer()
} else {
VStack(spacing: 0) {
Color.clear
.frame(height: 8)
VStack {
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(alignment: .center, spacing: 10) {
ForEach(searchModel.dramaGroups, id: \.group_id) { group in
SearchDramaGroupView(group: group)
}
}
.padding(.top, 8)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.onTapGesture {
isFocused = false
}
@ -51,14 +47,13 @@ struct SearchView: View {
}
)
}
} else {
//
Spacer()
.overlay(alignment: .center) {
Text("什么都没有找到")
.font(.system(size: 18))
.foregroundColor(Color(hex: "#333333"))
.opacity(showSearchResult && searchModel.dramaGroups.isEmpty ? 1 : 0)
}
}
.padding(.top, 10)
.background(Color(.systemBackground))
.navigationTitle("")
.toolbar {
ToolbarItem(placement: .principal) {
@ -69,8 +64,6 @@ struct SearchView: View {
.id(toolbarID)
}
}
.padding(.horizontal, 12)
.ignoresSafeArea(.keyboard, edges: .bottom) //
.onAppear {
toolbarID = UUID()
}