完善景区排队设置页与全局按钮配置迁移。

重构排队设置与变更日志交互,补充 Overlay 与资源,并将多页面主操作按钮统一到 UIButton Configuration,同步更新相关单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-14 16:51:23 +08:00
parent 6336feff27
commit 5eef31b8da
17 changed files with 181 additions and 124 deletions

View File

@ -6,14 +6,15 @@
import Foundation
/// Android `GeocodeSearch`
@MainActor
final class LocationGeocoder: NSObject, AMapSearchDelegate {
static let shared = LocationGeocoder()
nonisolated static let shared = LocationGeocoder()
private var searchAPI: AMapSearchAPI?
private var continuation: CheckedContinuation<String, Never>?
private override init() {
nonisolated private override init() {
super.init()
}

View File

@ -7,19 +7,19 @@ import CoreLocation
import Foundation
/// `AMapLocationManager` Android `LocationProvider`
@MainActor
final class LocationProvider: NSObject, LocationProviding {
static let shared = LocationProvider()
nonisolated static let shared = LocationProvider()
private let permissionManager = CLLocationManager()
private let geocoder: LocationGeocoder
private let geocoder = LocationGeocoder.shared
init(geocoder: LocationGeocoder = .shared) {
self.geocoder = geocoder
nonisolated override init() {
super.init()
permissionManager.desiredAccuracy = kCLLocationAccuracyBest
}
@MainActor
func requestSnapshot(desiredAccuracy: CLLocationAccuracy = kCLLocationAccuracyBest) async throws -> HomeLocationSnapshot {
try AMapBootstrap.requireConfigured()
try await ensureLocationPermission()
@ -51,6 +51,7 @@ final class LocationProvider: NSObject, LocationProviding {
}
}
@MainActor
func requestCoordinate(desiredAccuracy: CLLocationAccuracy) async throws -> CLLocationCoordinate2D {
try AMapBootstrap.requireConfigured()
try await ensureLocationPermission()
@ -77,12 +78,14 @@ final class LocationProvider: NSObject, LocationProviding {
}
}
@MainActor
func reverseGeocode(latitude: Double, longitude: Double) async -> String {
await geocoder.reverseGeocode(latitude: latitude, longitude: longitude)
}
///
func ensureLocationPermission() async throws {
permissionManager.desiredAccuracy = kCLLocationAccuracyBest
let initialStatus = permissionManager.authorizationStatus
if initialStatus == .notDetermined {
permissionManager.requestWhenInUseAuthorization()