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:
2026-06-26 15:16:12 +08:00
parent 9edf993432
commit d99a5b1bf8
124 changed files with 5195 additions and 1536 deletions

View File

@ -20,6 +20,7 @@ final class PhotographerInviteViewController: UIViewController {
private let rulesLabel = UILabel()
private let activityIndicator = UIActivityIndicatorView(style: .medium)
/// UI
override func viewDidLoad() {
super.viewDidLoad()
title = "邀请摄影师"
@ -29,6 +30,7 @@ final class PhotographerInviteViewController: UIViewController {
Task { await viewModel.reload(api: services.inviteAPI) }
}
/// UI UI
private func setupUI() {
navigationItem.rightBarButtonItems = [
UIBarButtonItem(title: "复制码", style: .plain, target: self, action: #selector(copyCode)),
@ -64,6 +66,7 @@ final class PhotographerInviteViewController: UIViewController {
contentStack.addArrangedSubview(rulesLabel)
}
/// render
private func render() {
activityIndicator.isHidden = !viewModel.loading
if viewModel.loading { activityIndicator.startAnimating() } else { activityIndicator.stopAnimating() }
@ -76,7 +79,9 @@ final class PhotographerInviteViewController: UIViewController {
}
}
///
@objc private func copyCode() { viewModel.copyInviteCode() }
///
@objc private func copyURL() { viewModel.copyInviteUrl() }
}
@ -87,6 +92,7 @@ final class InviteRecordViewController: ModuleTableViewController {
private let viewModel = InviteRecordViewModel()
private let summaryLabel = UILabel()
/// UI
override func viewDidLoad() {
title = "邀请记录"
navigationItem.rightBarButtonItem = UIBarButtonItem(
@ -103,6 +109,7 @@ final class InviteRecordViewController: ModuleTableViewController {
}
}
/// Header UI
private func setupHeader() {
summaryLabel.font = .systemFont(ofSize: 14)
summaryLabel.textColor = AppDesign.textSecondary
@ -112,10 +119,12 @@ final class InviteRecordViewController: ModuleTableViewController {
tableView.tableHeaderView = summaryLabel
}
/// tableCount
override func tableRowCount() -> Int {
viewModel.displayRows.count
}
/// Cell
override func configureCell(_ cell: TitleSubtitleTableViewCell, at indexPath: IndexPath) {
let row = viewModel.displayRows[indexPath.row]
cell.configure(
@ -125,6 +134,7 @@ final class InviteRecordViewController: ModuleTableViewController {
)
}
/// Content
override func reloadContent() async {
await viewModel.reload(
inviteAPI: services.inviteAPI,
@ -134,11 +144,13 @@ final class InviteRecordViewController: ModuleTableViewController {
updateSummary()
}
/// Summary
private func updateSummary() {
summaryLabel.text = "累计奖励 \(viewModel.totalRewardText) · 可提现 \(viewModel.withdrawableText)"
navigationItem.rightBarButtonItem?.title = viewModel.tab == .invite ? "奖励明细" : "邀请用户"
}
/// toggleTab
@objc private func toggleTab() {
Task {
let next: InviteRecordTab = viewModel.tab == .invite ? .reward : .invite