Rebuild order list UI to strictly match Android OrderView and DepositOrderCard.

Add OrderTokens and shared order components, restore filter bar pills, list loading states, and role-specific card layouts with deposit badge mapping tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 09:12:06 +08:00
parent 87696a4774
commit fe84a7e8f4
17 changed files with 1235 additions and 379 deletions

View File

@ -0,0 +1,61 @@
//
// OrderGiftStepperView.swift
// suixinkan
//
import SnapKit
import UIKit
/// /+/- Android
final class OrderGiftStepperView: UIView {
var onMinusTap: (() -> Void)?
var onPlusTap: (() -> Void)?
private let minusButton = UIButton(type: .system)
private let plusButton = UIButton(type: .system)
private let valueLabel = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
[minusButton, plusButton].forEach { button in
button.layer.cornerRadius = 12
button.layer.borderWidth = 1
button.layer.borderColor = OrderTokens.giftBorder.cgColor
button.titleLabel?.font = .systemFont(ofSize: 16, weight: .bold)
button.setTitleColor(OrderTokens.giftBorder, for: .normal)
button.snp.makeConstraints { make in
make.width.height.equalTo(24)
}
}
minusButton.setTitle("-", for: .normal)
plusButton.setTitle("+", for: .normal)
minusButton.addTarget(self, action: #selector(minusTapped), for: .touchUpInside)
plusButton.addTarget(self, action: #selector(plusTapped), for: .touchUpInside)
valueLabel.font = .systemFont(ofSize: 14, weight: .medium)
valueLabel.textColor = OrderTokens.valueBlack
valueLabel.textAlignment = .center
let stack = UIStackView(arrangedSubviews: [minusButton, valueLabel, plusButton])
stack.axis = .horizontal
stack.spacing = AppSpacing.xs
stack.alignment = .center
addSubview(stack)
stack.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func apply(text: String) {
valueLabel.text = text
}
@objc private func minusTapped() { onMinusTap?() }
@objc private func plusTapped() { onPlusTap?() }
}