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:
49
suixinkan/UI/Orders/Views/OrderActionButton.swift
Normal file
49
suixinkan/UI/Orders/Views/OrderActionButton.swift
Normal file
@ -0,0 +1,49 @@
|
||||
//
|
||||
// OrderActionButton.swift
|
||||
// suixinkan
|
||||
//
|
||||
|
||||
import SnapKit
|
||||
import UIKit
|
||||
|
||||
/// 订单卡片操作按钮,对齐 Android `AppButton` 在订单页的样式。
|
||||
final class OrderActionButton: UIButton {
|
||||
|
||||
enum Style {
|
||||
case destructiveLight
|
||||
case primaryFilled
|
||||
case primaryLight
|
||||
case dangerFilled
|
||||
}
|
||||
|
||||
init(title: String, style: Style) {
|
||||
super.init(frame: .zero)
|
||||
setTitle(title, for: .normal)
|
||||
titleLabel?.font = .app(.subtitle)
|
||||
layer.cornerRadius = AppRadius.sm
|
||||
clipsToBounds = true
|
||||
switch style {
|
||||
case .destructiveLight:
|
||||
setTitleColor(AppColor.danger, for: .normal)
|
||||
backgroundColor = AppColor.dangerBackground
|
||||
case .primaryFilled:
|
||||
setTitleColor(.white, for: .normal)
|
||||
backgroundColor = AppColor.primary
|
||||
case .primaryLight:
|
||||
setTitleColor(AppColor.primary, for: .normal)
|
||||
backgroundColor = OrderTokens.chipBackground
|
||||
layer.cornerRadius = AppRadius.lg
|
||||
case .dangerFilled:
|
||||
setTitleColor(.white, for: .normal)
|
||||
backgroundColor = AppColor.danger
|
||||
}
|
||||
snp.makeConstraints { make in
|
||||
make.height.equalTo(OrderTokens.actionButtonHeight)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user