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

@ -17,23 +17,23 @@ final class HomeLocationReportCardView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
layer.cornerRadius = 10
backgroundColor = AppColor.cardBackground
layer.cornerRadius = AppRadius.md
titleLabel.text = "位置上报"
titleLabel.font = .systemFont(ofSize: 16, weight: .semibold)
titleLabel.textColor = AppColor.text333
titleLabel.font = .app(.title)
titleLabel.textColor = AppColor.textPrimary
addressLabel.font = .systemFont(ofSize: 13)
addressLabel.textColor = AppColor.text666
addressLabel.font = .app(.body)
addressLabel.textColor = AppColor.textSecondary
addressLabel.numberOfLines = 2
reportButton.setTitle("立即上报", for: .normal)
reportButton.setTitleColor(.white, for: .normal)
reportButton.backgroundColor = AppColor.primary
reportButton.layer.cornerRadius = 6
reportButton.titleLabel?.font = .systemFont(ofSize: 14, weight: .medium)
reportButton.contentEdgeInsets = UIEdgeInsets(top: 8, left: 14, bottom: 8, right: 14)
reportButton.layer.cornerRadius = AppRadius.sm
reportButton.titleLabel?.font = .app(.bodyMedium)
reportButton.contentEdgeInsets = UIEdgeInsets(top: AppSpacing.xs, left: 14, bottom: AppSpacing.xs, right: 14)
reportButton.addTarget(self, action: #selector(reportTapped), for: .touchUpInside)
addSubview(titleLabel)
@ -41,16 +41,16 @@ final class HomeLocationReportCardView: UIView {
addSubview(reportButton)
titleLabel.snp.makeConstraints { make in
make.top.leading.equalToSuperview().offset(15)
make.top.leading.equalToSuperview().offset(AppSpacing.screenHorizontalInset)
}
addressLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(8)
make.leading.equalToSuperview().offset(15)
make.bottom.equalToSuperview().offset(-15)
make.trailing.lessThanOrEqualTo(reportButton.snp.leading).offset(-12)
make.top.equalTo(titleLabel.snp.bottom).offset(AppSpacing.xs)
make.leading.equalToSuperview().offset(AppSpacing.screenHorizontalInset)
make.bottom.equalToSuperview().offset(-AppSpacing.screenHorizontalInset)
make.trailing.lessThanOrEqualTo(reportButton.snp.leading).offset(-AppSpacing.sm)
}
reportButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-15)
make.trailing.equalToSuperview().offset(-AppSpacing.screenHorizontalInset)
make.centerY.equalToSuperview()
}
}