feat(drone-dock): 拆分首页设备订单与统计接口

This commit is contained in:
2026-10-28 16:04:19 +08:00
parent 79884cf588
commit d01d18d5b3
11 changed files with 1290 additions and 636 deletions
@@ -48,7 +48,7 @@ final class DroneDockCompactOrderCell: UICollectionViewCell {
accessibilityIdentifier = "drone.home.\(order.id)"
}
/// 展示 home 的真实订单快照,缺失字段保持未知,按钮只向页面报告点击。
/// 展示张工 orders 的真实摘要,权限决定按钮入口,点击交给页面处理。
func apply(homeOrder order: DroneDockHomeOrder) {
customerLabel.text = order.touristTitle
orderNumberLabel.isHidden = false
@@ -65,9 +65,14 @@ final class DroneDockCompactOrderCell: UICollectionViewCell {
actionButton.backgroundColor = actionButton.isEnabled ? DroneDockStyle.primary : DroneDockStyle.secondary
actionButton.accessibilityIdentifier = "drone.home.order.\(order.orderID).primary"
let materialTitle = order.mediaStatusTitle ?? ""
let materialStatus = order.mediaStatus?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
footer.isHidden = materialStatus.isEmpty || materialStatus == "none" || materialTitle.isEmpty
applyMaterial(title: materialTitle, symbol: "photo.on.rectangle.angled", tone: .gray)
footer.isHidden = materialTitle.isEmpty
let materialTone: DroneDockStatusTone = switch order.materialStatus {
case 1: .green
case 2: .blue
case 3: .red
default: .gray
}
applyMaterial(title: materialTitle, symbol: "photo.on.rectangle.angled", tone: materialTone)
accessibilityIdentifier = "drone.home.order.\(order.orderID)"
}