实现订单 Tab 并接入扫码核销流程

This commit is contained in:
2026-07-06 16:59:53 +08:00
parent 9464e32a0a
commit c0ffe4c1d8
27 changed files with 4226 additions and 17 deletions

View File

@ -0,0 +1,47 @@
//
// OrderStatusBadgeView.swift
// suixinkan
//
import SnapKit
import UIKit
///
final class OrderStatusBadgeView: UIView {
private let label = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
label.font = .systemFont(ofSize: 14, weight: .medium)
label.textAlignment = .center
addSubview(label)
label.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 2, left: 4, bottom: 2, right: 4))
}
layer.cornerRadius = 4
clipsToBounds = true
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func apply(status: Int, text: String) {
label.text = text
switch status {
case 18, 20:
label.textColor = UIColor(hex: 0x0073FF)
backgroundColor = UIColor(hex: 0xEFF6FF)
case 30:
label.textColor = UIColor(hex: 0x10B981)
backgroundColor = UIColor(hex: 0xF0FDF4)
case 50:
label.textColor = UIColor(hex: 0xEF4444)
backgroundColor = UIColor(hex: 0xFFE7E7)
default:
label.textColor = UIColor(hex: 0xFF7B00)
backgroundColor = UIColor(hex: 0xFFF0E2)
}
}
}