feat: update wallet punch point and report success

This commit is contained in:
2026-07-09 14:27:18 +08:00
parent 2970f1514b
commit 43e6133c21
34 changed files with 6671 additions and 71 deletions

View File

@ -12,7 +12,10 @@ final class HomeWorkStatusCardView: UIView {
var onOnlineTap: (() -> Void)?
var onReminderTap: (() -> Void)?
private let contentStackView = UIStackView()
private let onlineButton = UIButton(type: .system)
private let countdownStackView = UIStackView()
private let countdownIconView = UIImageView(image: UIImage(systemName: "clock"))
private let countdownLabel = UILabel()
private let reminderButton = UIButton(type: .system)
@ -20,36 +23,57 @@ final class HomeWorkStatusCardView: UIView {
super.init(frame: frame)
backgroundColor = AppColor.cardBackground
layer.cornerRadius = AppRadius.md
clipsToBounds = true
contentStackView.axis = .horizontal
contentStackView.alignment = .center
contentStackView.distribution = .equalSpacing
contentStackView.spacing = AppSpacing.sm
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)
countdownStackView.axis = .horizontal
countdownStackView.alignment = .center
countdownStackView.spacing = 6
countdownIconView.tintColor = AppColor.primary
countdownIconView.contentMode = .scaleAspectFit
countdownIconView.setContentCompressionResistancePriority(.required, for: .horizontal)
countdownLabel.font = .app(.subtitle)
countdownLabel.textColor = AppColor.primary
countdownLabel.adjustsFontSizeToFitWidth = true
countdownLabel.minimumScaleFactor = 0.85
countdownLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
reminderButton.titleLabel?.font = .app(.subtitle)
reminderButton.setTitleColor(AppColor.primary, for: .normal)
reminderButton.tintColor = AppColor.primary
reminderButton.setImage(UIImage(systemName: "bell.fill"), for: .normal)
reminderButton.semanticContentAttribute = .forceLeftToRight
reminderButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 6)
reminderButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: -6)
reminderButton.titleLabel?.adjustsFontSizeToFitWidth = true
reminderButton.titleLabel?.minimumScaleFactor = 0.8
reminderButton.addTarget(self, action: #selector(reminderTapped), for: .touchUpInside)
addSubview(onlineButton)
addSubview(countdownLabel)
addSubview(reminderButton)
countdownStackView.addArrangedSubview(countdownIconView)
countdownStackView.addArrangedSubview(countdownLabel)
contentStackView.addArrangedSubview(onlineButton)
contentStackView.addArrangedSubview(countdownStackView)
contentStackView.addArrangedSubview(reminderButton)
addSubview(contentStackView)
onlineButton.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(AppSpacing.screenHorizontalInset)
make.centerY.equalToSuperview()
contentStackView.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(15)
}
countdownLabel.snp.makeConstraints { make in
make.center.equalToSuperview()
}
reminderButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-AppSpacing.screenHorizontalInset)
make.centerY.equalToSuperview()
countdownIconView.snp.makeConstraints { make in
make.width.height.equalTo(15)
}
snp.makeConstraints { make in
make.height.equalTo(AppSpacing.formRowHeight)
make.height.equalTo(84)
}
}