MoviaBox/MoviaBox/Class/Wallet/View/SPConsumptionRecordsCell.swift
2025-04-29 18:01:10 +08:00

88 lines
2.4 KiB
Swift

//
// SPConsumptionRecordsCell.swift
// MoviaBox
//
// Created by on 2025/4/29.
//
import UIKit
class SPConsumptionRecordsCell: SPTableViewCell {
//MARK: UI
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = .fontRegular(ofSize: 12)
label.textColor = .colorFF3232()
return label
}()
private lazy var timeLabel: UILabel = {
let label = UILabel()
label.font = .fontRegular(ofSize: 12)
label.textColor = .colorFFFFFF()
return label
}()
private lazy var desLabel: UILabel = {
let label = UILabel()
label.font = .fontRegular(ofSize: 12)
label.textColor = .colorFFFFFF()
return label
}()
private lazy var coinLabel: UILabel = {
let label = UILabel()
label.font = .fontRegular(ofSize: 12)
label.textColor = .colorFF3232()
return label
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
titleLabel.text = "Purchase Single Episode"
timeLabel.text = "2024-6-10 23:41:18"
desLabel.text = "Ep.8 Romantic Flash Marriage In Progress"
coinLabel.text = "-500 Coins"
_setupUI()
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension SPConsumptionRecordsCell {
private func _setupUI() {
contentView.addSubview(titleLabel)
contentView.addSubview(timeLabel)
contentView.addSubview(desLabel)
contentView.addSubview(coinLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(32)
make.top.equalToSuperview().offset(16)
}
timeLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-32)
make.centerY.equalTo(titleLabel)
}
desLabel.snp.makeConstraints { make in
make.left.equalTo(titleLabel)
make.bottom.equalToSuperview().offset(-16)
make.width.lessThanOrEqualTo(kSPScreenWidth - 190)
}
coinLabel.snp.makeConstraints { make in
make.centerY.equalTo(desLabel)
make.right.equalTo(timeLabel)
}
}
}