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:
@ -10,6 +10,7 @@ import Foundation
|
||||
@MainActor
|
||||
/// 飞手认证实名认证读取协议,便于 ViewModel 单测替换。
|
||||
protocol PilotRealNameServing {
|
||||
/// realNameInfo相关逻辑。
|
||||
func realNameInfo() async throws -> RealNameInfoResponse
|
||||
}
|
||||
|
||||
@ -167,6 +168,7 @@ final class PilotCertificationViewModel {
|
||||
flyer?.certificationLogs.last { $0.action == 2 || $0.action == 3 }
|
||||
}
|
||||
|
||||
/// apply 业务逻辑。
|
||||
private func apply(_ flyer: FlyerDetailResponse) {
|
||||
self.flyer = flyer
|
||||
name = flyer.name
|
||||
@ -183,6 +185,7 @@ final class PilotCertificationViewModel {
|
||||
uploadProgress = nil
|
||||
}
|
||||
|
||||
/// upload待处理Certificate图片相关逻辑。
|
||||
private func uploadPendingCertificateImage(uploader: any OSSUploadServing, scenicId: Int?) async throws {
|
||||
guard let data = pendingCertificateImageData else { return }
|
||||
guard let scenicId, scenicId > 0 else {
|
||||
@ -203,6 +206,7 @@ final class PilotCertificationViewModel {
|
||||
pendingCertificateFileName = nil
|
||||
}
|
||||
|
||||
/// 创建ApplyRequest实例。
|
||||
private func makeApplyRequest() -> FlyerApplyRequest {
|
||||
FlyerApplyRequest(
|
||||
name: name.trimmedForPilot,
|
||||
@ -219,6 +223,7 @@ final class PilotCertificationViewModel {
|
||||
)
|
||||
}
|
||||
|
||||
/// 创建EditRequest实例。
|
||||
private func makeEditRequest() -> FlyerEditRequest {
|
||||
let apply = makeApplyRequest()
|
||||
return FlyerEditRequest(
|
||||
@ -237,6 +242,7 @@ final class PilotCertificationViewModel {
|
||||
)
|
||||
}
|
||||
|
||||
/// statusName相关逻辑。
|
||||
private static func statusName(for status: Int) -> String {
|
||||
switch status {
|
||||
case 1: "审核中"
|
||||
@ -254,6 +260,7 @@ final class PilotCertificationViewModel {
|
||||
return formatter
|
||||
}()
|
||||
|
||||
/// date 业务逻辑。
|
||||
private static func date(from value: String) -> Date? {
|
||||
let text = String(value.prefix(10))
|
||||
guard !text.isEmpty else { return nil }
|
||||
@ -261,9 +268,11 @@ final class PilotCertificationViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
/// PilotEmptyRealName服务协议,定义模块对外能力。
|
||||
private struct PilotEmptyRealNameServing: PilotRealNameServing {
|
||||
let info: RealNameInfo?
|
||||
|
||||
/// realNameInfo相关逻辑。
|
||||
func realNameInfo() async throws -> RealNameInfoResponse {
|
||||
RealNameInfoResponse(realNameInfo: info)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user