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:
@ -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)
|
||||
}
|
||||
|
||||
/// upload本地Files相关逻辑。
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user