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:
@ -80,7 +80,7 @@ enum StatisticsPeriod: String, CaseIterable, Identifiable {
|
||||
}
|
||||
|
||||
/// 数据统计汇总实体,表示订单金额、数量、客单价、实收和退款。
|
||||
struct StatisticsSummaryResponse: Decodable, Equatable {
|
||||
struct StatisticsSummaryResponse: Decodable, Equatable, Hashable {
|
||||
let orderAmountSum: String
|
||||
let orderCount: Int
|
||||
let orderPriceAverage: String
|
||||
@ -92,6 +92,7 @@ struct StatisticsSummaryResponse: Decodable, Equatable {
|
||||
var receivedAmountValue: Double { Self.parseAmount(receivedAmountSum) }
|
||||
var refundAmountValue: Double { Self.parseAmount(refundAmountSum) }
|
||||
|
||||
/// 枚举,定义相关常量或状态。
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case orderAmountSum = "order_amount_sum"
|
||||
case orderCount = "order_count"
|
||||
@ -125,6 +126,7 @@ struct StatisticsSummaryResponse: Decodable, Equatable {
|
||||
refundAmountSum = try container.decodeLossyString(forKey: .refundAmountSum)
|
||||
}
|
||||
|
||||
/// 解析Amount数据。
|
||||
private static func parseAmount(_ text: String) -> Double {
|
||||
let normalized = text.filter { "0123456789.-".contains($0) }
|
||||
return Double(normalized) ?? 0
|
||||
@ -132,7 +134,7 @@ struct StatisticsSummaryResponse: Decodable, Equatable {
|
||||
}
|
||||
|
||||
/// 每日统计实体,表示某天订单数、客单价、退款和实收。
|
||||
struct StatisticsDailyItem: Decodable, Identifiable, Equatable {
|
||||
struct StatisticsDailyItem: Decodable, Identifiable, Equatable, Hashable {
|
||||
var id: String { date }
|
||||
|
||||
let date: String
|
||||
@ -145,6 +147,7 @@ struct StatisticsDailyItem: Decodable, Identifiable, Equatable {
|
||||
var refundValue: Double { Self.parseAmount(refund) }
|
||||
var receivedValue: Double { Self.parseAmount(received) }
|
||||
|
||||
/// 枚举,定义相关常量或状态。
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case date
|
||||
case orderCount = "order_count"
|
||||
@ -163,6 +166,7 @@ struct StatisticsDailyItem: Decodable, Identifiable, Equatable {
|
||||
received = try container.decodeLossyString(forKey: .received)
|
||||
}
|
||||
|
||||
/// 解析Amount数据。
|
||||
private static func parseAmount(_ text: String) -> Double {
|
||||
let normalized = text.filter { "0123456789.-".contains($0) }
|
||||
return Double(normalized) ?? 0
|
||||
|
||||
Reference in New Issue
Block a user