从 iOS 17 Observation 迁移至 iOS 16 兼容的 Combine 架构
将最低部署版本降至 iOS 16,以 ObservableObject 替换 @Observable,新增导航与 UI 兼容层,并补充登录冒烟 UI 测试。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -9,9 +9,9 @@ import SwiftUI
|
||||
|
||||
/// 提现审核列表页,以审核视角展示钱包提现记录和处理进度。
|
||||
struct WithdrawalAuditView: View {
|
||||
@Environment(WalletAPI.self) private var walletAPI
|
||||
@Environment(ToastCenter.self) private var toastCenter
|
||||
@State private var viewModel = WithdrawalAuditViewModel()
|
||||
@Environment(\.walletAPI) private var walletAPI
|
||||
@EnvironmentObject private var toastCenter: ToastCenter
|
||||
@StateObject private var viewModel = WithdrawalAuditViewModel()
|
||||
@State private var selectedRecord: WalletWithdrawRecord?
|
||||
|
||||
var body: some View {
|
||||
@ -37,7 +37,7 @@ struct WithdrawalAuditView: View {
|
||||
WithdrawalAuditDetailView(record: record)
|
||||
}
|
||||
}
|
||||
.onChange(of: viewModel.errorMessage) { _, message in
|
||||
.onChange(of: viewModel.errorMessage) { message in
|
||||
guard let message else { return }
|
||||
toastCenter.show(message)
|
||||
viewModel.errorMessage = nil
|
||||
@ -82,7 +82,7 @@ struct WithdrawalAuditView: View {
|
||||
.background(.white, in: RoundedRectangle(cornerRadius: 12))
|
||||
} else if viewModel.loadFailed && viewModel.records.isEmpty {
|
||||
VStack(spacing: AppMetrics.Spacing.small) {
|
||||
ContentUnavailableView(
|
||||
AppContentUnavailableView(
|
||||
"提现审核记录加载失败",
|
||||
systemImage: "exclamationmark.triangle",
|
||||
description: Text(viewModel.loadFailureReason ?? "请检查网络后重试")
|
||||
@ -100,7 +100,7 @@ struct WithdrawalAuditView: View {
|
||||
.frame(maxWidth: .infinity, minHeight: 220)
|
||||
.background(.white, in: RoundedRectangle(cornerRadius: 12))
|
||||
} else if viewModel.filteredRecords.isEmpty {
|
||||
ContentUnavailableView("暂无提现审核记录", systemImage: "tray", description: Text("可切换筛选条件或下拉刷新"))
|
||||
AppContentUnavailableView("暂无提现审核记录", systemImage: "tray", description: Text("可切换筛选条件或下拉刷新"))
|
||||
.frame(maxWidth: .infinity, minHeight: 220)
|
||||
.background(.white, in: RoundedRectangle(cornerRadius: 12))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user