添加景区选择与合作订单流程并对齐 Android

This commit is contained in:
2026-07-07 10:48:43 +08:00
parent ef1d3b4af5
commit c4057537d2
50 changed files with 5603 additions and 191 deletions

View File

@ -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,