fix(ios): 选择模式下点击卡片任意位置即可选中/取消
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
3f80f9aaf8
commit
c021370a82
@ -61,21 +61,23 @@ struct LibraryDetailPage: View {
|
|||||||
.frame(maxWidth: .infinity).padding(.top, 80)
|
.frame(maxWidth: .infinity).padding(.top, 80)
|
||||||
}
|
}
|
||||||
ForEach(viewModel.items) { item in
|
ForEach(viewModel.items) { item in
|
||||||
HStack(spacing: 10) {
|
|
||||||
if isSelectMode {
|
if isSelectMode {
|
||||||
Button {
|
Button {
|
||||||
if selectedIds.contains(item.id) { selectedIds.remove(item.id) }
|
if selectedIds.contains(item.id) { selectedIds.remove(item.id) }
|
||||||
else { selectedIds.insert(item.id) }
|
else { selectedIds.insert(item.id) }
|
||||||
} label: {
|
} label: {
|
||||||
|
HStack(spacing: 10) {
|
||||||
Image(systemName: selectedIds.contains(item.id) ? "checkmark.circle.fill" : "circle")
|
Image(systemName: selectedIds.contains(item.id) ? "checkmark.circle.fill" : "circle")
|
||||||
.font(.system(size: 20))
|
.font(.system(size: 20))
|
||||||
.foregroundColor(selectedIds.contains(item.id) ? Color.zxPrimary : Color.zxF03)
|
.foregroundColor(selectedIds.contains(item.id) ? Color.zxPrimary : Color.zxF03)
|
||||||
|
ZXCardRow(icon: "doc.text", title: item.title, desc: item.summary ?? item.content ?? "", status: item.status ?? "active", c: Color.zxGreen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
} else {
|
||||||
NavigationLink(value: Route.knowledgeDetail(item: item)) {
|
NavigationLink(value: Route.knowledgeDetail(item: item)) {
|
||||||
ZXCardRow(icon: "doc.text", title: item.title, desc: item.summary ?? item.content ?? "", status: item.status ?? "active", c: Color.zxGreen)
|
ZXCardRow(icon: "doc.text", title: item.title, desc: item.summary ?? item.content ?? "", status: item.status ?? "active", c: Color.zxGreen)
|
||||||
}
|
}
|
||||||
.disabled(isSelectMode)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if viewModel.items.isEmpty && !viewModel.isLoading {
|
if viewModel.items.isEmpty && !viewModel.isLoading {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user