完善钱包提现状态展示与举报摄影师列表交互。
对齐 Android 提现进度与时间线映射,优化钱包与积分兑换页刷新逻辑,并补充相关单元测试与真机测试说明。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -33,14 +33,16 @@ final class WalletWithdrawRecordCell: UITableViewCell {
|
||||
amountLabel.text = WalletViewModel.formatAmount(record.amount)
|
||||
statusLabel.text = record.statusLabel.isEmpty ? "--" : record.statusLabel
|
||||
timeLabel.text = record.createdAt.isEmpty ? "--" : record.createdAt
|
||||
let style = statusStyle(for: record.settlementStatus)
|
||||
let display = WalletWithdrawStatusDisplay(status: record.settlementStatus)
|
||||
let style = statusStyle(for: display.tone)
|
||||
statusLabel.textColor = style.text
|
||||
statusLabel.backgroundColor = style.background
|
||||
progressView.progressTintColor = style.progress
|
||||
progressView.progress = progress(for: record.settlementStatus)
|
||||
configureSteps(progress: progress(for: record.settlementStatus), tint: style.progress)
|
||||
progressView.isHidden = record.settlementStatus == 50
|
||||
stepsStack.isHidden = record.settlementStatus == 50
|
||||
let progress = Float(display.progress) / 100
|
||||
progressView.progress = progress
|
||||
configureSteps(progress: progress, tint: style.progress)
|
||||
progressView.isHidden = !display.showsTimeline
|
||||
stepsStack.isHidden = !display.showsTimeline
|
||||
infoLabel.attributedText = infoText(for: record)
|
||||
infoLabel.isHidden = infoLabel.attributedText?.length == 0
|
||||
infoLabel.snp.remakeConstraints { make in
|
||||
@ -141,30 +143,19 @@ final class WalletWithdrawRecordCell: UITableViewCell {
|
||||
stepsStack.addArrangedSubview(percent)
|
||||
}
|
||||
|
||||
private func statusStyle(for status: Int) -> (background: UIColor, text: UIColor, progress: UIColor) {
|
||||
switch status {
|
||||
case 50, 20:
|
||||
private func statusStyle(for tone: WalletStatusTone) -> (background: UIColor, text: UIColor, progress: UIColor) {
|
||||
switch tone {
|
||||
case .success:
|
||||
(WalletTokens.settlementSuccessBackground, WalletTokens.settlementSuccess, WalletTokens.summaryBackground)
|
||||
case 60, 30:
|
||||
case .danger:
|
||||
(WalletTokens.settlementDangerBackground, WalletTokens.progressDanger, WalletTokens.progressDanger)
|
||||
case 40:
|
||||
case .warning:
|
||||
(WalletTokens.warningBackground, WalletTokens.warning, WalletTokens.summaryBackground)
|
||||
default:
|
||||
case .info:
|
||||
(WalletTokens.infoBackground, WalletTokens.summaryBackground, WalletTokens.summaryBackground)
|
||||
}
|
||||
}
|
||||
|
||||
private func progress(for status: Int) -> Float {
|
||||
switch status {
|
||||
case 10: 0.1
|
||||
case 40: 0.4
|
||||
case 20: 0.8
|
||||
case 30: 1.0
|
||||
case 60: 0.0
|
||||
default: 1.0
|
||||
}
|
||||
}
|
||||
|
||||
private func infoText(for record: WalletWithdrawItem) -> NSAttributedString {
|
||||
let result = NSMutableAttributedString()
|
||||
let normal: [NSAttributedString.Key: Any] = [
|
||||
|
||||
Reference in New Issue
Block a user