feat(drone-dock): 接入素材下载并限制拍满后游客确认

This commit is contained in:
2026-10-30 17:46:22 +08:00
parent e0da4728e5
commit 2913273e35
21 changed files with 1173 additions and 53 deletions
@@ -303,10 +303,19 @@ struct DroneDockHomeOrder: Decodable, Equatable, Sendable {
return "已拍摄 \(used)/\(total) 次,剩余 \(remain) 次"
}
/// 依据后端权限提供入口标识;不从剩余次数猜测是否可拍。
/// 套餐成功拍摄次数已全部完成;未知或零次套餐不能作为邀请确认依据。
var hasCompletedShootingQuota: Bool {
guard let total = shotTotal, total > 0, let used = shotUsed else { return false }
return used >= total
}
/// 邀请游客确认须拍满套餐次数,且后端明确允许发起确认。
var canInviteVisitorConfirmation: Bool { hasCompletedShootingQuota && canConfirm == true }
/// 依据后端权限提供入口标识;邀请确认额外要求成功拍满套餐次数。
var primaryAction: String? {
if canCreateTask == true { return "start_shoot" }
if canConfirm == true { return "confirm_delivery" }
if canInviteVisitorConfirmation { return "confirm_delivery" }
if canUploadFilm == true { return "view_materials" }
return nil
}
@@ -270,6 +270,10 @@ struct DroneShootingOrder: Hashable, Sendable {
/// 剩余次数只由成功数计算;查看任务、上传和交付不扣次。
var remainingShootingCount: Int { max(0, totalShootingCount - successfulShootingCount) }
/// 本地演示与真实订单一致,拍满有效套餐次数后才展示游客确认入口。
var hasCompletedShootingQuota: Bool {
totalShootingCount > 0 && successfulShootingCount >= totalShootingCount
}
/// 拍摄进度,防止除零或异常值溢出进度条。
var progress: Double {
guard totalShootingCount > 0 else { return 0 }