feat: integrate JPush notifications
This commit is contained in:
@ -65,6 +65,38 @@ final class MainTabBarController: UITabBarController {
|
||||
}
|
||||
}
|
||||
|
||||
/// 响应推送点击,切换到目标 Tab 并打开对应业务页面。
|
||||
func openPushDestination(_ destination: PushDestination) {
|
||||
let targetTab: AppTab = switch destination {
|
||||
case .orders, .verificationOrders:
|
||||
.orders
|
||||
case .payment, .task, .queue, .messageCenter:
|
||||
.home
|
||||
}
|
||||
|
||||
selectTab(targetTab)
|
||||
guard let navigationController = tabNavigationControllers[targetTab] else { return }
|
||||
_ = navigationController.popToRootViewController(animated: false)
|
||||
|
||||
let controller: UIViewController?
|
||||
switch destination {
|
||||
case .payment:
|
||||
controller = PaymentCollectionDetailsViewController()
|
||||
case .task:
|
||||
controller = TaskAddViewController()
|
||||
case .queue:
|
||||
controller = ScenicQueueViewController()
|
||||
case .messageCenter:
|
||||
controller = MessageCenterViewController()
|
||||
case .orders, .verificationOrders:
|
||||
controller = nil
|
||||
}
|
||||
|
||||
if let controller {
|
||||
navigationController.pushViewController(controller, animated: false)
|
||||
}
|
||||
}
|
||||
|
||||
private func configureTabBarAppearance() {
|
||||
tabBar.tintColor = AppColor.primary
|
||||
tabBar.unselectedItemTintColor = AppColor.textTabInactive
|
||||
|
||||
Reference in New Issue
Block a user