Fix image preview presentation when order source sheet is open.

Present previews from the top of the presentation chain so tapping lead images inside the sheet no longer conflicts with the already-presented picker.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 11:14:57 +08:00
parent 77fec21563
commit 5a2b7b6097
4 changed files with 31 additions and 20 deletions

View File

@ -16,7 +16,6 @@ final class OrderSourceLeadListViewController: BaseViewController, UITableViewDa
private let loadLeads: (OrderSourcePerson) async -> Void
private let onLeadBound: (OrderSourceSelection) -> Void
private let onCallPhone: (String) -> Void
private let onPreviewImages: ([String], Int) -> Void
private let phoneRow = UIStackView()
private let phoneLabel = UILabel()
@ -32,8 +31,7 @@ final class OrderSourceLeadListViewController: BaseViewController, UITableViewDa
referralOrder: BoundReferralOrderEntity?,
loadLeads: @escaping (OrderSourcePerson) async -> Void,
onLeadBound: @escaping (OrderSourceSelection) -> Void,
onCallPhone: @escaping (String) -> Void,
onPreviewImages: @escaping ([String], Int) -> Void
onCallPhone: @escaping (String) -> Void
) {
self.person = person
self.orderNumber = orderNumber
@ -42,7 +40,6 @@ final class OrderSourceLeadListViewController: BaseViewController, UITableViewDa
self.loadLeads = loadLeads
self.onLeadBound = onLeadBound
self.onCallPhone = onCallPhone
self.onPreviewImages = onPreviewImages
super.init(nibName: nil, bundle: nil)
}
@ -178,7 +175,9 @@ final class OrderSourceLeadListViewController: BaseViewController, UITableViewDa
&& currentSelection?.lead.key == lead.key
cell.configure(lead: lead, selected: selected)
cell.onCallPhone = onCallPhone
cell.onImageTap = onPreviewImages
cell.onImageTap = { [weak self] urls, index in
self?.presentImagePreview(imageURLs: urls, startIndex: index)
}
cell.onSelect = { [weak self] in
guard let self else { return }
let selection = OrderSourceSelection(person: self.person, lead: lead)