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:
@ -18,8 +18,8 @@ final class StatisticsSummaryCardView: UIView {
|
||||
|
||||
private let totalAmountCard = StatisticsStatCardView(
|
||||
title: "订单总金额",
|
||||
valueColor: UIColor(hex: 0x22C55E),
|
||||
backgroundColor: UIColor(hex: 0xF0FDF4),
|
||||
valueColor: AppColor.online,
|
||||
backgroundColor: AppColor.successBackground,
|
||||
iconName: "icon_data_statistics_total_amount"
|
||||
)
|
||||
private let totalOrderCard = StatisticsStatCardView(
|
||||
@ -30,20 +30,20 @@ final class StatisticsSummaryCardView: UIView {
|
||||
)
|
||||
private let receivedCard = StatisticsStatCardView(
|
||||
title: "实收金额",
|
||||
valueColor: UIColor(hex: 0x22C55E),
|
||||
backgroundColor: UIColor(hex: 0xFFF0E2),
|
||||
valueColor: AppColor.online,
|
||||
backgroundColor: AppColor.warningBackground,
|
||||
iconName: "icon_data_statistics_get_amount"
|
||||
)
|
||||
private let averageCard = StatisticsStatCardView(
|
||||
title: "客单价",
|
||||
valueColor: UIColor(hex: 0x0073FF),
|
||||
backgroundColor: UIColor(hex: 0xEFF6FF),
|
||||
valueColor: AppColor.primary,
|
||||
backgroundColor: AppColor.primaryLight,
|
||||
iconName: "icon_data_statistics_average_amount"
|
||||
)
|
||||
private let refundCard = StatisticsStatCardView(
|
||||
title: "退款金额",
|
||||
valueColor: UIColor(hex: 0xEF4444),
|
||||
backgroundColor: UIColor(hex: 0xFFE7E7),
|
||||
valueColor: AppColor.danger,
|
||||
backgroundColor: AppColor.dangerBackground,
|
||||
iconName: "icon_data_statistics_refund_amount"
|
||||
)
|
||||
|
||||
@ -69,15 +69,15 @@ final class StatisticsSummaryCardView: UIView {
|
||||
}
|
||||
|
||||
private func setupUI() {
|
||||
backgroundColor = .white
|
||||
layer.cornerRadius = 12
|
||||
backgroundColor = AppColor.cardBackground
|
||||
layer.cornerRadius = AppRadius.lg
|
||||
clipsToBounds = true
|
||||
|
||||
datePrefixLabel.text = "已选日期:"
|
||||
datePrefixLabel.font = .systemFont(ofSize: 14)
|
||||
datePrefixLabel.textColor = AppColor.text333
|
||||
datePrefixLabel.font = .app(.body)
|
||||
datePrefixLabel.textColor = AppColor.textPrimary
|
||||
|
||||
dateValueLabel.font = .systemFont(ofSize: 14)
|
||||
dateValueLabel.font = .app(.body)
|
||||
dateValueLabel.textColor = AppColor.primary
|
||||
dateValueLabel.numberOfLines = 1
|
||||
|
||||
@ -95,17 +95,17 @@ final class StatisticsSummaryCardView: UIView {
|
||||
|
||||
let row1 = UIStackView(arrangedSubviews: [totalOrderCard, receivedCard])
|
||||
row1.axis = .horizontal
|
||||
row1.spacing = 12
|
||||
row1.spacing = AppSpacing.sm
|
||||
row1.distribution = .fillEqually
|
||||
|
||||
let row2 = UIStackView(arrangedSubviews: [averageCard, refundCard])
|
||||
row2.axis = .horizontal
|
||||
row2.spacing = 12
|
||||
row2.spacing = AppSpacing.sm
|
||||
row2.distribution = .fillEqually
|
||||
|
||||
let cardStack = UIStackView(arrangedSubviews: [totalAmountCard, row1, row2])
|
||||
cardStack.axis = .vertical
|
||||
cardStack.spacing = 12
|
||||
cardStack.spacing = AppSpacing.sm
|
||||
|
||||
let dateRow = UIStackView(arrangedSubviews: [datePrefixLabel, dateValueLabel, UIView()])
|
||||
dateRow.axis = .horizontal
|
||||
@ -114,11 +114,11 @@ final class StatisticsSummaryCardView: UIView {
|
||||
|
||||
let contentStack = UIStackView(arrangedSubviews: [dateRow, periodStack, cardStack])
|
||||
contentStack.axis = .vertical
|
||||
contentStack.spacing = 12
|
||||
contentStack.spacing = AppSpacing.sm
|
||||
|
||||
addSubview(contentStack)
|
||||
contentStack.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(16)
|
||||
make.edges.equalToSuperview().inset(AppSpacing.md)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user