Migrate from iOS 17 Observation to iOS 16-compatible Combine architecture.

Lower deployment target to iOS 16, replace @Observable with ObservableObject, add navigation and UI compatibility shims, and include login smoke UI tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 10:16:35 +08:00
parent c32a610ee0
commit 26f4d0e671
127 changed files with 2320 additions and 1465 deletions

View File

@ -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 {