feat: 完善机巢图传、拍摄阶段与任务交互
- 完善双路 RTC 接收、首帧切换及拍摄结束后的本地播放释放 - 对齐无人机状态枚举与正常拍完返航标记,新增到达后本地倒计时 - 补充准备页电量与前往回执,进入任务时移除准备页路由 - 对齐拍摄中和拍摄完成原型布局,移除详情按钮 - 补充隔离测试、接口记录与项目约定 验证:最近 157 项相关模拟器隔离测试通过,Release 无签名编译通过;未调用真实飞控或图传。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
/// shoot 业务成功后的原始 data 回执,不假设或构造飞机、任务及飞行阶段字段。
|
||||
/// 保留 shoot 原始 data,并读取明确的同任务前往回执;不补造飞机或飞行阶段字段。
|
||||
struct DroneDockShootResponse: Decodable, Equatable, Sendable {
|
||||
/// 完整 data JSON;nil 表示统一客户端未提供 data,不补造 null 或空对象。
|
||||
let dataJSON: String?
|
||||
@@ -15,6 +15,30 @@ struct DroneDockShootResponse: Decodable, Equatable, Sendable {
|
||||
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
|
||||
dataJSON = String(decoding: try encoder.encode(DroneDockShootJSONSnapshot(value: raw)), as: UTF8.self)
|
||||
}
|
||||
|
||||
/// 只认同一订单任务明确受理的前往阶段,用于进页过渡;回执不代表已经起飞或到达。
|
||||
func confirmsTravel(taskID: Int, orderNumber: String?, scenicID: Int) -> Bool {
|
||||
guard taskID > 0, scenicID > 0, let orderNumber, !orderNumber.isEmpty, let dataJSON,
|
||||
let receipt = try? JSONDecoder().decode(DroneDockSummonProgressReceipt.self, from: Data(dataJSON.utf8)),
|
||||
receipt.accepted == true, receipt.ui?.phase == "going_to_spot",
|
||||
receipt.orderFlightTask?.id == taskID,
|
||||
receipt.orderFlightTask?.orderNumber == orderNumber,
|
||||
receipt.orderFlightTask?.scenicID == scenicID else { return false }
|
||||
return receipt.orderFlightTaskID == nil || receipt.orderFlightTaskID == taskID
|
||||
}
|
||||
}
|
||||
|
||||
/// 首次召唤的已约定阶段和任务身份,仅支持显示前往中的过渡,不据此开放任何操作。
|
||||
private struct DroneDockSummonProgressReceipt: Decodable {
|
||||
let accepted: Bool?
|
||||
let ui: DroneDockShootingUI?
|
||||
let orderFlightTaskID: Int?
|
||||
let orderFlightTask: DroneDockResummonReceiptIdentity.TaskIdentity?
|
||||
|
||||
/// 顶层 task_id 是航线任务,不参与订单任务匹配。
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case accepted, ui, orderFlightTaskID = "order_flight_task_id", orderFlightTask = "order_flight_task"
|
||||
}
|
||||
}
|
||||
|
||||
/// 重新召唤回执中可核对的订单任务身份;顶层 task_id 属于实际航线任务,不作订单任务 ID 使用。
|
||||
|
||||
Reference in New Issue
Block a user