Files
汉秋 a1c031c9b7 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>
2026-06-26 16:36:18 +08:00

3.2 KiB
Raw Permalink Blame History

Home 模块业务逻辑

模块职责

Home 模块负责登录后的首页工作台,包括当前景区展示、工作状态、位置上报入口、快捷操作、常用应用和全部功能入口。

首页菜单来自 PermissionContext 中的角色权限。当前模块只同步首页壳和入口路由,入口背后的业务子模块后续逐个迁移。

菜单生成

HomeViewModel 从当前角色的权限树递归提取菜单:

  • 当前角色 ID 存在但找不到时清空菜单。
  • 当前角色 ID 为空时使用第一个角色。
  • URI 按旧工程顺序排序。
  • 同义 URI 按 HomeMenuRouter.menuAliasKey 去重。

常用应用

HomeCommonMenuStore 使用 UserDefaults 保存常用应用 URI

  • 首次无配置时写入默认常用应用。
  • 读取时按当前角色权限过滤不可用 URI。
  • 添加和移除时按同义 URI 去重。

路由规则

HomeMenuRouter 将权限 URI 分为四类:

  • tab:切换到订单或数据 Tab。
  • destination:进入已接入的本地页面,如个人信息、景区选择、权限申请、全部功能。
  • unsupported:已知 iOS 不支持的入口,进入占位说明。
  • placeholder:未知或未迁移入口,记录诊断并进入占位说明。

HomeMenuRouting 只作为首页菜单到 AppNavigator 的适配层:本地业务页面沿当前 UIKit 导航栈 push订单和数据等一级入口交给导航器切换 Tab未迁移入口进入占位页。

后续迁移

目前 payment_collectionpayment_qrpayment_code 已由 Features/Payment 的真实收款页面接管,wallet 已由 Features/Wallet 的真实钱包页面接管,scenicselectionpermission_applypermission_apply_statusscenicapplication 已由 Features/ScenicPermission 接管,task_managementtask_management_editortask_create 已由 Features/Tasks 接管,cloud_managementcloud_storage_transitasset_managementmaterial_uploadalbum_listalbum_trailersample_managementsample_upload 已由 Features/Assets 接管,checkin_points 已由 Features/PunchPoint 接管,location_reportlocation_report_history 已由 Features/LocationReport 接管,pmproject_edit 已由 Features/Projects 的摄影师项目管理接管,pm_manager 已由店铺项目管理接管,schedule_management 已由 Features/Schedule 接管,registration_invitationphotographer_inviteinvite_record 已由 Features/Invite 接管,deposit_order_detaildeposit_orderdeposit_order_shooting_info 已由 Features/Orders 的押金订单页接管,withdrawal_audit 已由 Features/WithdrawalAudit 接管,scenic_settlementscenic_settlement_review 已由 Features/ScenicSettlement 接管,message_center 已由 Features/MessageCenter 接管,/scenic-queuequeue_management 已由 Features/QueueManagement 接管,live_stream_managementlive_album 已由 Features/Live 接管,operating-area 已由 Features/OperatingArea 接管,pilot_cert 已由 Features/PilotCertification 接管。

后续迁移具体首页子模块时,应先在 HomeRoute 增加目标页面,再更新 HomeMenuRouter.resolve 对应 URI 的映射,并同步补充单元测试。