Integrate CYLTabBar center scan button and unify UIKit navigation.

Add CYLTabBarController with a global scan entry, promote MainTabBarController to the window root after login, replace RouterPath-based navigation with AppNavigator, and fix Profile diffable cell reconfiguration crashes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 16:36:18 +08:00
parent 24a7339b68
commit a1c031c9b7
31 changed files with 838 additions and 517 deletions

View File

@ -15,7 +15,7 @@ final class PushNotificationManager: NSObject, UNUserNotificationCenterDelegate
private var api: PushAPI?
private weak var session: AppSession?
private weak var router: AppRouter?
private weak var navigator: AppNavigator?
private var latestDeviceToken: String?
private var latestAuthorizationStatus: UNAuthorizationStatus = .notDetermined
private let tokenDefaultsKey = "apns_device_token"
@ -27,10 +27,10 @@ final class PushNotificationManager: NSObject, UNUserNotificationCenterDelegate
}
///
func configure(api: PushAPI, session: AppSession, router: AppRouter) {
func configure(api: PushAPI, session: AppSession, navigator: AppNavigator) {
self.api = api
self.session = session
self.router = router
self.navigator = navigator
UNUserNotificationCenter.current().delegate = self
latestDeviceToken = UserDefaults.standard.string(forKey: tokenDefaultsKey)
}
@ -128,29 +128,21 @@ final class PushNotificationManager: NSObject, UNUserNotificationCenterDelegate
///
private func route(from payload: PushPayload) {
guard let router else { return }
guard let navigator else { return }
switch payload.route {
case .payment:
navigateHomeRoute(.paymentCollection)
navigator.openHome(.paymentCollection, policy: .tabRoot(.home))
case .order:
router.selectOrders(entry: .storeOrders)
navigator.openOrdersEntry(.storeOrders)
case .verificationOrder:
router.selectOrders(entry: .verificationOrders)
navigator.openOrdersEntry(.verificationOrders)
case .task:
navigateHomeRoute(.taskManagement)
navigator.openHome(.taskManagement, policy: .tabRoot(.home))
case .queue:
navigateHomeRoute(.queueManagement)
navigator.openHome(.queueManagement, policy: .tabRoot(.home))
case .messageCenter:
navigateHomeRoute(.messageCenter)
navigator.openHome(.messageCenter, policy: .tabRoot(.home))
}
}
/// HomeRoute
private func navigateHomeRoute(_ route: HomeRoute) {
guard let router else { return }
router.select(.home)
router.router(for: .home).navigate(to: .home(route))
UIKitAppNavigation.pushHomeRoute(route, animated: true)
}
}