引入统一设计令牌并迁移首页、订单和数据 UI
This commit is contained in:
@ -18,18 +18,18 @@ final class HomeWorkStatusCardView: UIView {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
backgroundColor = .white
|
||||
layer.cornerRadius = 10
|
||||
backgroundColor = AppColor.cardBackground
|
||||
layer.cornerRadius = AppRadius.md
|
||||
|
||||
onlineButton.titleLabel?.font = .systemFont(ofSize: 12, weight: .medium)
|
||||
onlineButton.layer.cornerRadius = 4
|
||||
onlineButton.titleLabel?.font = .app(.captionMedium)
|
||||
onlineButton.layer.cornerRadius = AppRadius.xs
|
||||
onlineButton.contentEdgeInsets = UIEdgeInsets(top: 6, left: 12, bottom: 6, right: 12)
|
||||
onlineButton.addTarget(self, action: #selector(onlineTapped), for: .touchUpInside)
|
||||
|
||||
countdownLabel.font = .systemFont(ofSize: 16, weight: .medium)
|
||||
countdownLabel.font = .app(.subtitle)
|
||||
countdownLabel.textColor = AppColor.primary
|
||||
|
||||
reminderButton.titleLabel?.font = .systemFont(ofSize: 16, weight: .medium)
|
||||
reminderButton.titleLabel?.font = .app(.subtitle)
|
||||
reminderButton.setTitleColor(AppColor.primary, for: .normal)
|
||||
reminderButton.addTarget(self, action: #selector(reminderTapped), for: .touchUpInside)
|
||||
|
||||
@ -38,18 +38,18 @@ final class HomeWorkStatusCardView: UIView {
|
||||
addSubview(reminderButton)
|
||||
|
||||
onlineButton.snp.makeConstraints { make in
|
||||
make.leading.equalToSuperview().offset(15)
|
||||
make.leading.equalToSuperview().offset(AppSpacing.screenHorizontalInset)
|
||||
make.centerY.equalToSuperview()
|
||||
}
|
||||
countdownLabel.snp.makeConstraints { make in
|
||||
make.center.equalToSuperview()
|
||||
}
|
||||
reminderButton.snp.makeConstraints { make in
|
||||
make.trailing.equalToSuperview().offset(-15)
|
||||
make.trailing.equalToSuperview().offset(-AppSpacing.screenHorizontalInset)
|
||||
make.centerY.equalToSuperview()
|
||||
}
|
||||
snp.makeConstraints { make in
|
||||
make.height.equalTo(52)
|
||||
make.height.equalTo(AppSpacing.formRowHeight)
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,11 +61,11 @@ final class HomeWorkStatusCardView: UIView {
|
||||
func apply(isOnline: Bool, countdownText: String, reminderMinutes: Int) {
|
||||
onlineButton.setTitle(isOnline ? "在线" : "离线", for: .normal)
|
||||
if isOnline {
|
||||
onlineButton.backgroundColor = UIColor(hex: 0x22C55E)
|
||||
onlineButton.setTitleColor(UIColor(hex: 0xF0FDF4), for: .normal)
|
||||
onlineButton.backgroundColor = AppColor.online
|
||||
onlineButton.setTitleColor(AppColor.successBackground, for: .normal)
|
||||
} else {
|
||||
onlineButton.backgroundColor = UIColor(hex: 0xF4F4F4)
|
||||
onlineButton.setTitleColor(UIColor(hex: 0x7B8EAA), for: .normal)
|
||||
onlineButton.backgroundColor = AppColor.inputBackground
|
||||
onlineButton.setTitleColor(AppColor.textTabInactive, for: .normal)
|
||||
}
|
||||
countdownLabel.text = countdownText
|
||||
let reminderTitle = reminderMinutes == 0 ? "不提醒" : "提前\(reminderMinutes)分钟"
|
||||
|
||||
Reference in New Issue
Block a user