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:
46
suixinkan/UI/Orders/Views/OrderInfoRowView.swift
Normal file
46
suixinkan/UI/Orders/Views/OrderInfoRowView.swift
Normal file
@ -0,0 +1,46 @@
|
||||
//
|
||||
// OrderInfoRowView.swift
|
||||
// suixinkan
|
||||
//
|
||||
|
||||
import SnapKit
|
||||
import UIKit
|
||||
|
||||
/// 订单详情 key-value 行,对齐 Android InfoRow。
|
||||
final class OrderInfoRowView: UIView {
|
||||
|
||||
private let titleLabel = UILabel()
|
||||
private let valueLabel = UILabel()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
titleLabel.font = .app(.body)
|
||||
titleLabel.textColor = OrderTokens.label563
|
||||
valueLabel.font = .systemFont(ofSize: 14, weight: .medium)
|
||||
valueLabel.textColor = OrderTokens.valueBlack
|
||||
valueLabel.textAlignment = .right
|
||||
valueLabel.numberOfLines = 0
|
||||
|
||||
addSubview(titleLabel)
|
||||
addSubview(valueLabel)
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.leading.top.bottom.equalToSuperview()
|
||||
make.width.lessThanOrEqualToSuperview().multipliedBy(0.45)
|
||||
}
|
||||
valueLabel.snp.makeConstraints { make in
|
||||
make.trailing.top.bottom.equalToSuperview()
|
||||
make.leading.greaterThanOrEqualTo(titleLabel.snp.trailing).offset(AppSpacing.xs)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func apply(title: String, value: String, valueColor: UIColor = OrderTokens.valueBlack, usesPrimaryValue: Bool = false) {
|
||||
titleLabel.text = "\(title):"
|
||||
valueLabel.text = value
|
||||
valueLabel.textColor = usesPrimaryValue ? AppColor.primary : valueColor
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user