feat(drone-dock): 接通任务召唤与状态页并固定拍摄布局
接入 plane-status、tasks/create、shoot 与 shooting,保持同一任务 ID 串接、重复提交保护和只读单次刷新。拍摄任务页固定顶部参数与底部安全控制,中间状态区域适配小屏且不滚动;同步接口记录、脱敏响应及相关测试。
This commit is contained in:
@@ -416,6 +416,9 @@ final class DronePreparationFooterView: UIView {
|
||||
let divider = UIView()
|
||||
divider.backgroundColor = DroneDockStyle.border
|
||||
let deviceRow = UIStackView(arrangedSubviews: [deviceCaption, deviceLabel, UIView()])
|
||||
deviceLabel.accessibilityIdentifier = "drone.preparation.planeStatus"
|
||||
deviceLabel.numberOfLines = 2
|
||||
deviceLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
||||
deviceRow.axis = .horizontal
|
||||
deviceRow.alignment = .center
|
||||
deviceRow.spacing = 3
|
||||
@@ -497,20 +500,25 @@ final class DronePreparationFooterView: UIView {
|
||||
refreshButton.isHidden = !viewModel.shouldShowSummonRefresh
|
||||
}
|
||||
|
||||
/// 展示真实准备状态;本阶段保留召唤按钮文案,但尚不提供飞行执行入口。
|
||||
/// 按购买权限启用待飞任务创建;本阶段不提供无人机召唤或起飞入口。
|
||||
func apply(preparationViewModel viewModel: DroneDockPreparationViewModel, isRefreshing: Bool = false) {
|
||||
connectionLabel.apply(title: viewModel.connectionTitle, tone: viewModel.connectionTone)
|
||||
selectionLabel.text = viewModel.selectionSummary
|
||||
selectionLabel.numberOfLines = 2
|
||||
deviceLabel.apply(title: viewModel.deviceStatusText, tone: viewModel.deviceTone)
|
||||
primaryButton.setTitle(viewModel.primaryButtonTitle, for: .normal)
|
||||
primaryButton.isEnabled = false
|
||||
primaryButton.backgroundColor = UIColor(hex: 0xE1E7F0)
|
||||
primaryButton.isEnabled = (viewModel.isPrimaryActionEnabled || viewModel.canOpenShootingTask) && !isRefreshing
|
||||
primaryButton.backgroundColor = primaryButton.isEnabled ? DroneDockStyle.primary : UIColor(hex: 0xE1E7F0)
|
||||
primaryButton.setTitleColor(.white, for: .normal)
|
||||
primaryButton.setTitleColor(UIColor(hex: 0x8792A5), for: .disabled)
|
||||
messageLabel.text = viewModel.admissionMessage
|
||||
if viewModel.isTaskSelectionLocked || viewModel.taskCreationErrorMessage != nil {
|
||||
messageLabel.text = viewModel.admissionMessage
|
||||
} else {
|
||||
messageLabel.text = viewModel.planeStatusErrorMessage.map { "无人机状态获取失败:\($0)" } ?? viewModel.admissionMessage
|
||||
}
|
||||
messageLabel.textColor = DroneDockStyle.secondary
|
||||
refreshButton.isHidden = false
|
||||
refreshButton.isEnabled = !viewModel.isLoading && !isRefreshing
|
||||
refreshButton.isEnabled = !viewModel.isLoading && !viewModel.isCreatingTask && !viewModel.isSummoning && !isRefreshing
|
||||
}
|
||||
|
||||
@objc private func primaryTapped() { onPrimaryTap?() }
|
||||
|
||||
Reference in New Issue
Block a user