完善钱包提现状态展示与举报摄影师列表交互。

对齐 Android 提现进度与时间线映射,优化钱包与积分兑换页刷新逻辑,并补充相关单元测试与真机测试说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-13 16:51:32 +08:00
parent 5138c1c11a
commit 05804ba7d6
9 changed files with 440 additions and 99 deletions

View File

@ -372,11 +372,12 @@ private final class PointWithdrawRecordCell: UITableViewCell {
amountLabel.text = record.amount != nil && record.status == 2 ? "+\(formatAmount(record.amount))" : ""
amountLabel.isHidden = amountLabel.text?.isEmpty ?? true
timeLabel.text = record.createdAt.isEmpty ? "----" : record.createdAt
let style = statusStyle(for: record.status)
statusLabel.text = statusText(for: record.status)
let display = PointWithdrawStatusDisplay(status: record.status)
let style = statusStyle(for: display.tone)
statusLabel.text = display.title
statusLabel.textColor = style.text
statusLabel.backgroundColor = style.background
let progress = progress(for: record.status)
let progress = display.progress
progressView.progress = Float(progress) / 100.0
progressView.progressTintColor = style.progress
progressView.isHidden = progress == 0
@ -498,45 +499,28 @@ private final class PointWithdrawRecordCell: UITableViewCell {
}
}
private func statusText(for status: Int) -> String {
switch status {
case 2: "提现成功"
case 1: "提现中"
case 3: "提现失败"
default: "未知"
}
}
private func statusStyle(for status: Int) -> (background: UIColor, text: UIColor, progress: UIColor) {
switch status {
case 2:
private func statusStyle(for tone: WalletStatusTone) -> (background: UIColor, text: UIColor, progress: UIColor) {
switch tone {
case .success:
(WalletTokens.successBackground, WalletTokens.success, WalletTokens.summaryBackground)
case 1:
case .warning:
(WalletTokens.pointsPendingBackground, WalletTokens.points, WalletTokens.summaryBackground)
case 3:
case .danger:
(WalletTokens.dangerBackground, WalletTokens.danger, WalletTokens.progressDanger)
default:
case .info:
(WalletTokens.infoBackground, WalletTokens.summaryBackground, WalletTokens.summaryBackground)
}
}
private func progress(for status: Int) -> Int {
switch status {
case 1: 40
case 3: 100
default: 0
}
}
private func infoText(for record: PointWithdrawItem) -> String {
let display = PointWithdrawStatusDisplay(status: record.status)
let value: String
switch record.status {
case 3:
return "审核时间:\(record.reviewedAt.isEmpty ? "暂无" : record.reviewedAt)"
case 2:
return "到账时间:\(record.paymentTime.isEmpty ? "暂无" : record.paymentTime)"
default:
return "预计到账时间:\(record.estimatedReceiptTime.isEmpty ? "暂无" : record.estimatedReceiptTime)"
case 3: value = record.reviewedAt
case 2: value = record.paymentTime
default: value = record.estimatedReceiptTime
}
return "\(display.timeTitle)\(value.isEmpty ? "暂无" : value)"
}
private func formatAmount(_ value: Double?) -> String {