Integrate高德 SDK with simulator-safe build flags, add map views for operating area and punch points, refactor main tabs and key feature screens to UIKit with Diffable lists, and document Swift concurrency defaults in AGENTS.md. Co-authored-by: Cursor <cursoragent@cursor.com>
61 lines
2.5 KiB
Swift
61 lines
2.5 KiB
Swift
//
|
||
// HomeMenuRouting.swift
|
||
// suixinkan
|
||
//
|
||
|
||
import UIKit
|
||
|
||
@MainActor
|
||
/// 首页菜单 UIKit 路由,将权限 URI 解析结果映射为 Tab 切换或 Navigation push。
|
||
enum HomeMenuRouting {
|
||
|
||
/// 打开首页菜单项对应的目标。
|
||
static func openMenu(_ item: HomeMenuItem, from viewController: UIViewController) {
|
||
openRoute(HomeMenuRouter.resolve(uri: item.uri, title: item.title), from: viewController)
|
||
}
|
||
|
||
/// 打开首页 URI 解析结果。
|
||
static func openRoute(_ route: HomeMenuResolvedRoute, from viewController: UIViewController) {
|
||
let services = AppServices.shared
|
||
switch route {
|
||
case .tab(let tab):
|
||
services.appRouter.select(tab)
|
||
case .orders(let entry):
|
||
services.appRouter.selectOrders(entry: entry)
|
||
case .destination(let homeRoute):
|
||
push(homeRoute, from: viewController)
|
||
case .unsupported(let uri, let title, _):
|
||
pushPlaceholder(title: title, uri: uri, from: viewController)
|
||
case .placeholder(let uri, let title):
|
||
HomeRouteDiagnostics.recordUnknown(uri: uri, title: title)
|
||
pushPlaceholder(title: title, uri: uri, from: viewController)
|
||
}
|
||
}
|
||
|
||
/// Push 首页二级路由页面。
|
||
static func push(_ route: HomeRoute, from viewController: UIViewController) {
|
||
let target = AppRouteViewControllerFactory.makeViewController(for: route, services: AppServices.shared)
|
||
viewController.navigationController?.pushViewController(target, animated: true)
|
||
}
|
||
|
||
/// Push 订单模块路由页面。
|
||
static func pushOrders(_ route: OrdersRoute, from viewController: UIViewController) {
|
||
let target = AppRouteViewControllerFactory.makeViewController(for: .orders(route), services: AppServices.shared)
|
||
viewController.navigationController?.pushViewController(target, animated: true)
|
||
}
|
||
|
||
/// Push 个人中心二级路由页面。
|
||
static func pushProfile(_ route: ProfileRoute, from viewController: UIViewController) {
|
||
let target = AppRouteViewControllerFactory.makeViewController(for: .profile(route), services: AppServices.shared)
|
||
viewController.navigationController?.pushViewController(target, animated: true)
|
||
}
|
||
|
||
/// Push Placeholder页面。
|
||
private static func pushPlaceholder(title: String, uri: String, from viewController: UIViewController) {
|
||
viewController.navigationController?.pushViewController(
|
||
FeaturePlaceholderViewController(title: title, uri: uri),
|
||
animated: true
|
||
)
|
||
}
|
||
}
|