Advance UIKit rewrite with AMap integration and core UI modules.
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>
This commit is contained in:
@ -13,6 +13,7 @@ final class PilotCertificationViewController: ModuleTableViewController {
|
||||
private let viewModel = PilotCertificationViewModel()
|
||||
private let statusLabel = UILabel()
|
||||
|
||||
/// 视图加载完成后的 UI 初始化与数据绑定。
|
||||
override func viewDidLoad() {
|
||||
title = "飞手认证"
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
||||
@ -26,6 +27,7 @@ final class PilotCertificationViewController: ModuleTableViewController {
|
||||
wireViewModel(viewModel) { [weak self] in self?.updateHeader() }
|
||||
}
|
||||
|
||||
/// 初始化Header相关 UI 或状态。
|
||||
private func setupHeader() {
|
||||
statusLabel.numberOfLines = 0
|
||||
statusLabel.font = .systemFont(ofSize: 14)
|
||||
@ -34,17 +36,21 @@ final class PilotCertificationViewController: ModuleTableViewController {
|
||||
tableView.tableHeaderView = statusLabel
|
||||
}
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int { 2 }
|
||||
/// 返回列表 section 数量。
|
||||
override func numberOfTableSections() -> Int { 2 }
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
/// 返回指定 section 行数。
|
||||
override func tableRowCount(in section: Int) -> Int {
|
||||
section == 0 ? formRows.count : 1
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
||||
/// section 标题。
|
||||
override func tableSectionTitle(for section: Int) -> String? {
|
||||
section == 0 ? "认证信息" : "操作"
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
/// 提供自定义 Cell。
|
||||
override func tableCell(for indexPath: IndexPath, row: ModuleTableRow, in tableView: UITableView) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(
|
||||
withIdentifier: TitleSubtitleTableViewCell.reuseIdentifier,
|
||||
for: indexPath
|
||||
@ -58,8 +64,8 @@ final class PilotCertificationViewController: ModuleTableViewController {
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
/// 处理行选中。
|
||||
override func didSelectTableRow(at indexPath: IndexPath) {
|
||||
if indexPath.section == 1 {
|
||||
Task {
|
||||
do {
|
||||
@ -72,11 +78,13 @@ final class PilotCertificationViewController: ModuleTableViewController {
|
||||
}
|
||||
}
|
||||
|
||||
/// 刷新Content。
|
||||
override func reloadContent() async {
|
||||
await viewModel.load(api: services.pilotCertificationAPI, realNameAPI: services.profileAPI)
|
||||
updateHeader()
|
||||
}
|
||||
|
||||
/// 提交。
|
||||
@objc private func submit() {
|
||||
Task {
|
||||
do {
|
||||
@ -102,6 +110,7 @@ final class PilotCertificationViewController: ModuleTableViewController {
|
||||
]
|
||||
}
|
||||
|
||||
/// 更新Header状态。
|
||||
private func updateHeader() {
|
||||
let status = viewModel.auditStatusText
|
||||
statusLabel.text = "状态:\(status)\n\(viewModel.statusMessage ?? "")"
|
||||
|
||||
Reference in New Issue
Block a user