feat: 完善机巢图传、拍摄阶段与任务交互

- 完善双路 RTC 接收、首帧切换及拍摄结束后的本地播放释放
- 对齐无人机状态枚举与正常拍完返航标记,新增到达后本地倒计时
- 补充准备页电量与前往回执,进入任务时移除准备页路由
- 对齐拍摄中和拍摄完成原型布局,移除详情按钮
- 补充隔离测试、接口记录与项目约定

验证:最近 157 项相关模拟器隔离测试通过,Release 无签名编译通过;未调用真实飞控或图传。
This commit is contained in:
2026-11-03 16:43:23 +08:00
parent 0ed0077ec4
commit 54210925f0
33 changed files with 3242 additions and 205 deletions
@@ -16,6 +16,8 @@ struct DroneDockShootingResponse: Decodable, Equatable, Sendable {
let metricsUpdatedAt: String?
/// 设备缓存过期时保留数值,但标为非实时读数。
let metricsStale: Bool?
/// 后端确认本批次正常拍完并开始返航;缺失表示旧合同,不能从工作态忙闲推断。
let shootCompleteReturning: Bool?
/// 后端若明确提供订单号则保留,不由请求上下文伪造响应身份。
let orderNumber: String?
/// 实测返回的订单飞行任务身份;存在时必须与请求上下文核对。
@@ -48,6 +50,7 @@ struct DroneDockShootingResponse: Decodable, Equatable, Sendable {
case orderFlightTaskID = "order_flight_task_id", stateVersion = "state_version"
case executionBatch = "execution_batch", snapshotKind = "snapshot_kind"
case stateUpdatedAt = "state_updated_at", metricsUpdatedAt = "metrics_updated_at", metricsStale = "metrics_stale"
case shootCompleteReturning = "shoot_complete_returning"
case orderNumber = "order_number", orderFlightTask = "order_flight_task", task
case scenic, scenicSpot = "scenic_spot", airLine = "air_line"
case header, currentPlane = "current_plane", executeGate = "execute_gate", ui
@@ -64,6 +67,7 @@ struct DroneDockShootingResponse: Decodable, Equatable, Sendable {
stateUpdatedAt = try container.decodeIfPresent(String.self, forKey: .stateUpdatedAt)
metricsUpdatedAt = try container.decodeIfPresent(String.self, forKey: .metricsUpdatedAt)
metricsStale = try container.decodeIfPresent(Bool.self, forKey: .metricsStale)
shootCompleteReturning = try container.decodeIfPresent(Bool.self, forKey: .shootCompleteReturning)
orderNumber = try container.decodeIfPresent(String.self, forKey: .orderNumber)
orderFlightTask = try container.decodeIfPresent(DroneDockShootingTaskIdentity.self, forKey: .orderFlightTask)
task = try container.decodeIfPresent(DroneDockShootingTaskIdentity.self, forKey: .task)
@@ -91,22 +95,25 @@ struct DroneDockShootingTaskIdentity: Decodable, Equatable, Sendable {
let orderNumber: String?
/// 任务所属景区。
let scenicID: Int?
/// 后端原始任务状态,不与订单状态混用。
/// 订单飞行任务状态:10 待执行、20 执行中、30 成功、40 失败、50 取消、60 待确认。
let status: Int?
/// 服务端任务状态文案。
let statusLabel: String?
/// 实测航线任务状态,与订单飞行任务状态分别保留。
/// 航线状态独立保留:29/39/49/91 失败,90 取消,24/30/40 为录制后的素材处理。
let waylineStatus: Int?
/// 服务端航线状态文案;执行失败优先于笼统的订单任务执行中。
let waylineStatusLabel: String?
/// 服务端实际记录的任务结果原因,空值不视为具体失败说明。
let resultMessage: String?
/// 任务结果原因码;return_home 表示手动返航中断,不能展示正常拍完提示。
let resultCode: String?
/// 已确认嵌套任务字段映射。
private enum CodingKeys: String, CodingKey {
case id, orderNumber = "order_number", scenicID = "scenic_id", status, statusLabel = "status_label"
case waylineStatus = "wayline_status", waylineStatusLabel = "wayline_status_label"
case resultMessage = "result_message"
case resultCode = "result_code"
}
}
@@ -169,7 +176,7 @@ struct DroneDockShootingPlane: Decodable, Equatable, Sendable {
let id: Int?
/// 当前设备序列号。
let snNumber: String?
/// 服务端连接状态;实测 2 为离线,不从电量推导连接状态。
/// 飞机表在线标记:1 在线,0/2 等非 1 为离线;不覆盖明确的机巢工作态。
let onlineStatus: Int?
/// 文档工作状态:0 离线、1 空闲、2 拍摄中;不据此推断返航完成。
let workStatus: Int?
@@ -213,15 +220,28 @@ struct DroneDockShootingUI: Decodable, Equatable, Sendable {
let title: String?
/// 服务端阶段说明,不由 GET 请求成功拼造飞行进度。
let message: String?
/// 拍摄环节子阶段,shoot_done_returning 表示正常拍完后开始返航。
let waylineStage: String?
/// 页面层的正常拍完返航标记,和顶层字段共同保留。
let shootCompleteReturning: Bool?
/// 服务端实际提供的安全指令;缺失时保持未知,不据阶段文案自行补齐。
let commands: [DroneDockShootingCommand]?
/// 保留既有展示构造方式,新增动作列表默认为未知。
init(phase: String?, title: String?, message: String?, commands: [DroneDockShootingCommand]? = nil) {
init(phase: String?, title: String?, message: String?, commands: [DroneDockShootingCommand]? = nil,
waylineStage: String? = nil, shootCompleteReturning: Bool? = nil) {
self.phase = phase
self.title = title
self.message = message
self.commands = commands
self.waylineStage = waylineStage
self.shootCompleteReturning = shootCompleteReturning
}
/// 保留现有页面字段,并映射新增返航标记的原始命名。
private enum CodingKeys: String, CodingKey {
case phase, title, message, commands
case waylineStage = "wayline_stage", shootCompleteReturning = "shoot_complete_returning"
}
}