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,12 +9,12 @@ import SwiftUI
///
struct QueueManagementView: View {
@Environment(AccountContext.self) private var accountContext
@Environment(ScenicSpotContext.self) private var scenicSpotContext
@Environment(ScenicQueueAPI.self) private var queueAPI
@Environment(ScenicQueueRuntime.self) private var queueRuntime
@Environment(ToastCenter.self) private var toastCenter
@State private var viewModel = QueueManagementViewModel()
@EnvironmentObject private var accountContext: AccountContext
@EnvironmentObject private var scenicSpotContext: ScenicSpotContext
@Environment(\.scenicQueueAPI) private var queueAPI
@EnvironmentObject private var queueRuntime: ScenicQueueRuntime
@EnvironmentObject private var toastCenter: ToastCenter
@StateObject private var viewModel = QueueManagementViewModel()
@State private var pendingAction: QueueActionConfirmation?
@State private var markTarget: QueueItem?
@State private var processingId: Int64?
@ -27,7 +27,7 @@ struct QueueManagementView: View {
VStack(spacing: AppMetrics.Spacing.medium) {
header
if currentScenicId == nil {
ContentUnavailableView("请先选择景区", systemImage: "map", description: Text("排队管理需要当前景区上下文"))
AppContentUnavailableView("请先选择景区", systemImage: "map", description: Text("排队管理需要当前景区上下文"))
.frame(minHeight: 260)
} else if !viewModel.queueGatePassed {
gateCard
@ -79,12 +79,12 @@ struct QueueManagementView: View {
.refreshable {
await reload()
}
.onChange(of: viewModel.remoteCallAnnouncement) { _, announcement in
.onChange(of: viewModel.remoteCallAnnouncement) { announcement in
if let announcement {
toastCenter.show("远端已叫号 \(announcement.queueCode.isEmpty ? "当前游客" : announcement.queueCode)")
}
}
.onChange(of: viewModel.errorMessage) { _, message in
.onChange(of: viewModel.errorMessage) { message in
if let message { toastCenter.show(message) }
}
}
@ -163,7 +163,7 @@ struct QueueManagementView: View {
ProgressView("加载中...")
.frame(maxWidth: .infinity, minHeight: 240)
} else if viewModel.items.isEmpty {
ContentUnavailableView(viewModel.selectedListType.emptyText, systemImage: "person.crop.circle.badge.questionmark")
AppContentUnavailableView(viewModel.selectedListType.emptyText, systemImage: "person.crop.circle.badge.questionmark")
.frame(maxWidth: .infinity, minHeight: 240)
.background(.white, in: RoundedRectangle(cornerRadius: AppMetrics.CornerRadius.card))
} else {