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>
68 lines
2.1 KiB
Swift
68 lines
2.1 KiB
Swift
//
|
|
// WithdrawalAuditViewController.swift
|
|
// suixinkan
|
|
//
|
|
// Created by Codex on 2026/6/26.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
/// 提现审核列表页。
|
|
final class WithdrawalAuditViewController: ModuleTableViewController {
|
|
private let viewModel = WithdrawalAuditViewModel()
|
|
|
|
/// 视图加载完成后的 UI 初始化与数据绑定。
|
|
override func viewDidLoad() {
|
|
title = "提现审核"
|
|
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
|
title: "全部",
|
|
style: .plain,
|
|
target: self,
|
|
action: #selector(cycleFilter)
|
|
)
|
|
super.viewDidLoad()
|
|
wireViewModel(viewModel) { [weak self] in self?.updateFilterTitle() }
|
|
}
|
|
|
|
/// table行Count相关逻辑。
|
|
override func tableRowCount() -> Int {
|
|
viewModel.filteredRecords.count
|
|
}
|
|
|
|
/// 配置Cell展示内容。
|
|
override func configureCell(_ cell: TitleSubtitleTableViewCell, at indexPath: IndexPath) {
|
|
let record = viewModel.filteredRecords[indexPath.row]
|
|
cell.configure(title: "¥\(record.amount)", subtitle: record.statusLabel, detail: record.createdAt)
|
|
}
|
|
|
|
/// 刷新Content。
|
|
override func reloadContent() async {
|
|
await viewModel.reload(api: services.walletAPI)
|
|
updateFilterTitle()
|
|
}
|
|
|
|
/// willDisplayTableRow 回调处理。
|
|
override func willDisplayTableRow(at indexPath: IndexPath) {
|
|
guard indexPath.row >= viewModel.filteredRecords.count - 2 else { return }
|
|
Task { await viewModel.loadMore(api: services.walletAPI) }
|
|
}
|
|
|
|
/// cycle筛选相关逻辑。
|
|
@objc private func cycleFilter() {
|
|
let filters = WithdrawalAuditFilter.allCases
|
|
guard let index = filters.firstIndex(of: viewModel.selectedFilter) else { return }
|
|
let next = filters[(index + 1) % filters.count]
|
|
Task {
|
|
viewModel.selectFilter(next)
|
|
reloadTable()
|
|
}
|
|
}
|
|
|
|
/// 更新FilterTitle状态。
|
|
private func updateFilterTitle() {
|
|
navigationItem.rightBarButtonItem?.title = viewModel.selectedFilter.title
|
|
}
|
|
}
|
|
|
|
extension WithdrawalAuditViewModel: ViewModelBindable {}
|