Add scenic selection and cooperation order flows aligned with Android.
Upgrade scenic picker with search, location sorting, permission apply/status, and blocking home dialog; add cooperation order module and order source picker improvements with unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -20,6 +20,7 @@ struct OrderCardActions {
|
||||
var onRefinedChanged: ((Int) -> Void)?
|
||||
var onHistoricalPhoto: (() -> Void)?
|
||||
var onOrderSourceTap: (() -> Void)?
|
||||
var onOrderSourceImageTap: (([String], Int) -> Void)?
|
||||
}
|
||||
|
||||
/// 摄影师订单卡片,严格对齐 Android `OrderView`。
|
||||
@ -34,8 +35,7 @@ final class OrderCardCell: UITableViewCell {
|
||||
private let statusBadge = OrderStatusBadgeView()
|
||||
private let createdAtLabel = UILabel()
|
||||
private let typeChip = OrderTypeChipView()
|
||||
private let orderSourceContainer = UIView()
|
||||
private let orderSourceButton = UIButton(type: .system)
|
||||
private let orderSourceEntryView = OrderSourceEntryView()
|
||||
private let actionRow = UIStackView()
|
||||
private let refundButton = OrderActionButton(title: "退款", style: .destructiveLight)
|
||||
private let verifyButton = OrderActionButton(title: "核销订单", style: .primaryFilled)
|
||||
@ -79,7 +79,7 @@ final class OrderCardCell: UITableViewCell {
|
||||
hideWriteActions: Bool,
|
||||
actions: OrderCardActions,
|
||||
showOrderSource: Bool,
|
||||
sourceText: String?
|
||||
sourceSelection: OrderSourceSelection?
|
||||
) {
|
||||
self.actions = actions
|
||||
orderNumberLabel.text = "订单号:\(order.orderNumber)"
|
||||
@ -98,8 +98,10 @@ final class OrderCardCell: UITableViewCell {
|
||||
|
||||
uploadTaskButton.isHidden = hideWriteActions || order.orderType != 19
|
||||
|
||||
orderSourceContainer.isHidden = !showOrderSource
|
||||
orderSourceButton.setTitle(sourceText ?? "选择订单来源", for: .normal)
|
||||
orderSourceEntryView.isHidden = !showOrderSource
|
||||
if showOrderSource {
|
||||
orderSourceEntryView.apply(selection: sourceSelection)
|
||||
}
|
||||
|
||||
let showEdit = (order.orderStatus == 18 || order.orderStatus == 30) && order.orderType != 19
|
||||
editOptionView.isHidden = !showEdit
|
||||
@ -149,17 +151,9 @@ final class OrderCardCell: UITableViewCell {
|
||||
headerRow.addArrangedSubview(orderNumberLabel)
|
||||
headerRow.addArrangedSubview(statusBadge)
|
||||
|
||||
orderSourceContainer.backgroundColor = OrderTokens.sourceBackground
|
||||
orderSourceContainer.layer.cornerRadius = AppRadius.sm
|
||||
orderSourceContainer.layer.borderWidth = 1
|
||||
orderSourceContainer.layer.borderColor = OrderTokens.sourceBorder.cgColor
|
||||
orderSourceButton.setTitleColor(AppColor.primary, for: .normal)
|
||||
orderSourceButton.titleLabel?.font = .app(.body)
|
||||
orderSourceButton.contentHorizontalAlignment = .leading
|
||||
orderSourceButton.addTarget(self, action: #selector(orderSourceTapped), for: .touchUpInside)
|
||||
orderSourceContainer.addSubview(orderSourceButton)
|
||||
orderSourceButton.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(AppSpacing.sm)
|
||||
orderSourceEntryView.addTarget(self, action: #selector(orderSourceTapped), for: .touchUpInside)
|
||||
orderSourceEntryView.onImageTap = { [weak self] images, index in
|
||||
self?.actions.onOrderSourceImageTap?(images, index)
|
||||
}
|
||||
|
||||
actionRow.axis = .horizontal
|
||||
@ -211,7 +205,7 @@ final class OrderCardCell: UITableViewCell {
|
||||
headerRow,
|
||||
createdAtLabel,
|
||||
typeChip,
|
||||
orderSourceContainer,
|
||||
orderSourceEntryView,
|
||||
actionRow,
|
||||
uploadTaskButton,
|
||||
editOptionView,
|
||||
|
||||
Reference in New Issue
Block a user