Introduce unified design tokens and migrate Home, Orders, and Statistics UI.

Establish AppColor/AppFont/AppSpacing/AppRadius theming, shared components, and design-system docs so pilot screens align with Android while keeping iOS-native spacing and touch targets.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-06 17:58:18 +08:00
parent 39186cfe25
commit 87696a4774
31 changed files with 737 additions and 213 deletions

View File

@ -6,7 +6,7 @@
import SnapKit
import UIKit
///
/// `AppStatusBadge`
final class ProfileStatusBadgeView: UIView {
enum Style {
@ -20,18 +20,14 @@ final class ProfileStatusBadgeView: UIView {
case bankRejected
}
private let label = UILabel()
private let badge = AppStatusBadge()
override init(frame: CGRect) {
super.init(frame: frame)
label.font = .systemFont(ofSize: 12, weight: .medium)
label.textAlignment = .center
addSubview(label)
label.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 3, left: 8, bottom: 3, right: 8))
addSubview(badge)
badge.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
layer.cornerRadius = 4
clipsToBounds = true
}
@available(*, unavailable)
@ -40,23 +36,15 @@ final class ProfileStatusBadgeView: UIView {
}
func apply(style: Style, text: String) {
label.text = text
switch style {
case .accountActive:
label.textColor = UIColor(hex: 0x22C55E)
backgroundColor = UIColor(hex: 0xF0FDF4)
case .scenic:
label.textColor = AppColor.primary
backgroundColor = UIColor(hex: 0xEFF6FF)
badge.apply(tone: .success, text: text)
case .scenic, .auditApproved, .bankApproved:
badge.apply(tone: .info, text: text)
case .auditPending, .bankPending:
label.textColor = UIColor(hex: 0xFF7B00)
backgroundColor = UIColor(hex: 0xFFF0E2)
case .auditApproved, .bankApproved:
label.textColor = AppColor.primary
backgroundColor = UIColor(hex: 0xEFF6FF)
badge.apply(tone: .warning, text: text)
case .auditRejected, .bankRejected:
label.textColor = UIColor(hex: 0xEF4444)
backgroundColor = UIColor(hex: 0xFFE7E7)
badge.apply(tone: .danger, text: text)
}
}
}