Initial commit: suixinkan_ios UIKit rewrite project.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 14:33:31 +08:00
commit 9edf993432
297 changed files with 47151 additions and 0 deletions

View File

@ -0,0 +1,87 @@
//
// QueueManagementViewControllers.swift
// suixinkan
//
// Created by Codex on 2026/6/26.
//
import UIKit
///
final class QueueManagementViewController: ModuleTableViewController {
private let viewModel = QueueManagementViewModel()
override func viewDidLoad() {
title = "排队管理"
navigationItem.rightBarButtonItem = UIBarButtonItem(
title: "设置",
style: .plain,
target: self,
action: #selector(openSettings)
)
super.viewDidLoad()
wireViewModel(viewModel) { [weak self] in self?.updateTitle() }
}
override func tableRowCount() -> Int { viewModel.items.count }
override func configureCell(_ cell: TitleSubtitleTableViewCell, at indexPath: IndexPath) {
let item = viewModel.items[indexPath.row]
cell.configure(title: item.phoneMasked, subtitle: item.statusText, detail: item.queueCode)
}
override func reloadContent() async {
await viewModel.reload(
api: services.scenicQueueAPI,
scenicId: services.currentScenicId,
userId: services.userId,
spots: services.scenicSpotContext.spots
)
updateTitle()
}
private func updateTitle() {
title = "排队 \(viewModel.queueCount)"
}
@objc private func openSettings() {
navigationController?.pushViewController(ScenicQueueSettingsViewController(), animated: true)
}
}
extension QueueManagementViewModel: ViewModelBindable {}
///
final class ScenicQueueSettingsViewController: ModuleTableViewController {
private let viewModel = ScenicQueueSettingsViewModel()
override func viewDidLoad() {
title = "排队设置"
super.viewDidLoad()
wireViewModel(viewModel) { }
}
override func tableRowCount() -> Int { viewModel.scenicSpots.count }
override func configureCell(_ cell: TitleSubtitleTableViewCell, at indexPath: IndexPath) {
let spot = viewModel.scenicSpots[indexPath.row]
let selected = viewModel.selectedSpotId == spot.id
cell.configure(title: spot.name, subtitle: selected ? "当前打卡点" : nil)
cell.accessoryType = selected ? .checkmark : .none
}
override func didSelectTableRow(at indexPath: IndexPath) {
viewModel.selectedSpotId = viewModel.scenicSpots[indexPath.row].id
}
override func reloadContent() async {
await viewModel.load(
api: services.scenicQueueAPI,
scenicId: services.currentScenicId,
userId: services.userId,
spots: services.scenicSpotContext.spots
)
}
}
extension ScenicQueueSettingsViewModel: ViewModelBindable {}