Files
suixinkan_uikit/suixinkan/UI/Orders/Views/OrderInfoRowView.swift
汉秋 fe84a7e8f4 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>
2026-07-07 09:12:06 +08:00

47 lines
1.5 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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
}
}