添加景区选择与合作订单流程并对齐 Android

This commit is contained in:
2026-07-07 10:48:43 +08:00
parent ef1d3b4af5
commit c4057537d2
50 changed files with 5603 additions and 191 deletions

View File

@ -89,6 +89,11 @@ final class HomeViewController: BaseViewController {
)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if !hasInitialized {
@ -361,18 +366,17 @@ final class HomeViewController: BaseViewController {
private func presentScenicDialog() {
let alert = UIAlertController(
title: "请选择景区",
message: "使用首页功能前需要先选择当前景区",
title: "提示",
message: "您还没有选定入驻景区,请先入驻",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "稍后", style: .cancel) { [weak self] _ in
self?.viewModel.hideScenicDialog()
self?.activeDialog = nil
alert.isModalInPresentation = true
alert.addAction(UIAlertAction(title: "关闭app", style: .default) { _ in
UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
})
alert.addAction(UIAlertAction(title: "选择", style: .default) { [weak self] _ in
self?.viewModel.hideScenicDialog()
alert.addAction(UIAlertAction(title: "入驻", style: .default) { [weak self] _ in
self?.activeDialog = nil
self?.presentScenicSelection()
self?.pushScenicSelection()
})
present(alert, animated: true)
}
@ -440,24 +444,24 @@ final class HomeViewController: BaseViewController {
}
private func presentScenicSelection() {
let scenicList = AppStore.shared.roleScenicList()
guard !scenicList.isEmpty else {
showToast("暂无可选景区")
return
}
let controller = ScenicSelectionViewController(scenicList: scenicList)
controller.onSelected = { [weak self] in
pushScenicSelection()
}
private func pushScenicSelection() {
navigationController?.setNavigationBarHidden(false, animated: true)
let controller = ScenicSelectionViewController()
controller.onSelectionComplete = { [weak self] in
guard let self else { return }
Task {
await self.viewModel.reloadIfNeeded(api: self.homeAPI)
self.viewModel.refreshLocalDisplayState()
self.viewModel.rebuildCommonMenus()
await self.viewModel.loadStoreListIfNeeded(api: self.homeAPI)
self.applyViewModel()
await self.evaluateDialogsWithDelay()
await self.viewModel.evaluateDialogs(api: self.homeAPI)
await MainActor.run { self.presentDialogsIfNeeded() }
}
}
let nav = UINavigationController(rootViewController: controller)
nav.modalPresentationStyle = .pageSheet
present(nav, animated: true)
navigationController?.pushViewController(controller, animated: true)
}
private func startCountdownTimer() {