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

对齐 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

@ -173,6 +173,16 @@ final class WalletViewModel {
await loadWithdraw(api: api, refresh: true)
}
/// Tab
func refreshSelectedTab(api: any WalletPageServing) async {
switch selectedTab {
case .withdraw:
await refreshWithdraw(api: api)
case .transaction:
await refreshTransaction(api: api)
}
}
///
func loadMoreWithdrawIfNeeded(currentIndex: Int, api: any WalletPageServing) async {
guard currentIndex >= withdrawRecords.count - 2, withdrawCanLoadMore, !withdrawLoading else { return }
@ -336,6 +346,85 @@ enum WalletTransactionEntry: Hashable {
case item(EarningDetailItem)
}
///
enum WalletStatusTone: Equatable {
case info
case success
case warning
case danger
}
/// Android 线
struct WalletWithdrawStatusDisplay: Equatable {
let tone: WalletStatusTone
let progress: Int
let showsTimeline: Bool
///
init(status: Int) {
switch status {
case 20:
tone = .success
progress = 80
showsTimeline = true
case 30:
tone = .danger
progress = 100
showsTimeline = true
case 40:
tone = .warning
progress = 40
showsTimeline = true
case 50:
tone = .success
progress = 100
showsTimeline = false
case 60:
tone = .danger
progress = 0
showsTimeline = true
default:
tone = .info
progress = status == 10 ? 10 : 100
showsTimeline = true
}
}
}
///
struct PointWithdrawStatusDisplay: Equatable {
let title: String
let tone: WalletStatusTone
let progress: Int
let timeTitle: String
///
init(status: Int) {
switch status {
case 1:
title = "提现中"
tone = .warning
progress = 40
timeTitle = "预计到账时间:"
case 2:
title = "提现成功"
tone = .success
progress = 0
timeTitle = "到账时间:"
case 3:
title = "提现失败"
tone = .danger
progress = 100
timeTitle = "审核时间:"
default:
title = "未知"
tone = .info
progress = 0
timeTitle = "预计到账时间:"
}
}
}
/// ViewModel
final class WithdrawViewModel {
private(set) var withdrawInfo: WithdrawInfoResponse?

View File

@ -888,8 +888,7 @@ struct WildReportDetailData: Decodable, Equatable, Hashable {
id: content.id > 0 ? String(content.id) : content.time,
submitTime: content.time,
text: content.desc,
imageCount: content.imageCount,
videoCount: content.videoCount
evidences: content.evidences
)
}
}
@ -956,8 +955,11 @@ struct WildReportSupplementaryEvidence: Hashable {
let id: String
let submitTime: String
let text: String
let imageCount: Int
let videoCount: Int
let evidences: [WildReportDetailEvidence]
var imageCount: Int { evidences.filter(\.isImage).count }
var videoCount: Int { evidences.filter(\.isVideo).count }
var hasMedia: Bool { imageCount > 0 || videoCount > 0 }
var summaryText: String {
var parts: [String] = []