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

@ -120,6 +120,7 @@ final class DepositOrderListViewModel {
errorMessage = nil
}
/// State
private func resetState() {
orders = []
total = 0
@ -170,6 +171,7 @@ final class DepositOrderDetailViewModel {
errorMessage = nil
}
///
private func reset(message: String) {
detail = nil
loading = false
@ -220,6 +222,7 @@ final class DepositOrderShootingInfoViewModel {
errorMessage = nil
}
///
private func reset(message: String) {
detail = nil
loading = false
@ -324,10 +327,12 @@ final class OrderRefundViewModel {
return moneyText(value)
}
/// decimal
private static func decimalValue(_ text: String) -> Decimal {
Decimal(string: text.trimmingCharacters(in: .whitespacesAndNewlines).replacingOccurrences(of: ",", with: "")) ?? 0
}
/// money
private static func moneyText(_ value: Decimal) -> String {
let number = NSDecimalNumber(decimal: value)
let handler = NSDecimalNumberHandler(
@ -379,6 +384,7 @@ final class HistoricalShootingInfoViewModel {
errorMessage = nil
}
///
private func reset(message: String) {
projectName = ""
projectTypeName = ""
@ -520,6 +526,7 @@ final class MultiTravelTaskUploadViewModel {
errorMessage = nil
}
/// BeforeSubmit
private func validateBeforeSubmit(scenicId: Int?) -> SubmitContext? {
let normalizedOrderNumber = orderNumber.trimmingCharacters(in: .whitespacesAndNewlines)
guard let scenicId, scenicId > 0 else {
@ -549,6 +556,7 @@ final class MultiTravelTaskUploadViewModel {
return SubmitContext(scenicId: scenicId, orderNumber: normalizedOrderNumber, scenicSpotId: selectedSpotId)
}
/// uploadFiles
private func uploadLocalFiles(uploadService: any OSSUploadServing, scenicId: Int) async throws -> [MultiTravelUploadFileItem] {
var uploadFiles: [MultiTravelUploadFileItem] = []
for index in selectedLocalFiles.indices {
@ -583,11 +591,13 @@ final class MultiTravelTaskUploadViewModel {
return uploadFiles
}
/// LocalFileProgress
private func updateLocalFileProgress(id: UUID, progress: Int) {
guard let index = selectedLocalFiles.firstIndex(where: { $0.id == id }) else { return }
selectedLocalFiles[index].progress = progress
}
/// SpotSelection
private func resetSpotSelection() {
spots = []
selectedSpotId = nil
@ -595,11 +605,13 @@ final class MultiTravelTaskUploadViewModel {
isLoadingSpots = false
}
/// fileType
private static func fileType(for fileName: String) -> Int {
let ext = URL(fileURLWithPath: fileName).pathExtension.lowercased()
return ["mp4", "mov", "m4v", "avi"].contains(ext) ? 1 : 2
}
/// Submit
private struct SubmitContext {
let scenicId: Int
let orderNumber: String