feat: 完善机巢图传、拍摄阶段与任务交互
- 完善双路 RTC 接收、首帧切换及拍摄结束后的本地播放释放 - 对齐无人机状态枚举与正常拍完返航标记,新增到达后本地倒计时 - 补充准备页电量与前往回执,进入任务时移除准备页路由 - 对齐拍摄中和拍摄完成原型布局,移除详情按钮 - 补充隔离测试、接口记录与项目约定 验证:最近 157 项相关模拟器隔离测试通过,Release 无签名编译通过;未调用真实飞控或图传。
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
import SnapKit
|
||||
import UIKit
|
||||
|
||||
/// 与任务原型一致的录制完成提示;只引导查看素材,不宣告上传成功或扣减次数。
|
||||
@MainActor
|
||||
final class DroneDockRecordingCompletionView: UIView {
|
||||
/// 关闭提示并继续留在任务页。
|
||||
var onLater: (() -> Void)?
|
||||
/// 前往当前订单素材库。
|
||||
var onViewMaterials: (() -> Void)?
|
||||
|
||||
/// 创建居中结果卡片,覆盖任务页但不触发生命周期或暂停只读状态更新。
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setupUI()
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
||||
|
||||
private func setupUI() {
|
||||
backgroundColor = .black.withAlphaComponent(0.5)
|
||||
accessibilityViewIsModal = true
|
||||
accessibilityIdentifier = "drone.task.recordingCompletion"
|
||||
let card = UIView()
|
||||
card.backgroundColor = .white
|
||||
card.layer.cornerRadius = 14
|
||||
addSubview(card)
|
||||
let symbol = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
||||
symbol.tintColor = DroneDockStyle.success
|
||||
symbol.contentMode = .scaleAspectFit
|
||||
let title = DroneDockStyle.label(size: 20, weight: .semibold)
|
||||
title.text = "拍摄已完成"
|
||||
title.textAlignment = .center
|
||||
let message = DroneDockStyle.label(size: 14, color: DroneDockStyle.secondary)
|
||||
message.text = "本次拍摄已完成,\n可前往订单素材库查看上传进度和素材。"
|
||||
message.numberOfLines = 0
|
||||
message.textAlignment = .center
|
||||
let later = button("稍后再去", primary: false, action: #selector(laterTapped))
|
||||
let materials = button("去查看", primary: true, action: #selector(materialsTapped))
|
||||
later.accessibilityIdentifier = "drone.task.recordingCompletion.later"
|
||||
materials.accessibilityIdentifier = "drone.task.recordingCompletion.materials"
|
||||
let actions = UIStackView(arrangedSubviews: [later, materials])
|
||||
actions.spacing = 10
|
||||
actions.distribution = .fillEqually
|
||||
[symbol, title, message, actions].forEach { card.addSubview($0) }
|
||||
card.snp.makeConstraints { make in
|
||||
make.center.equalToSuperview()
|
||||
make.width.equalTo(320).priority(.high)
|
||||
make.leading.greaterThanOrEqualToSuperview().offset(24)
|
||||
make.trailing.lessThanOrEqualToSuperview().offset(-24)
|
||||
}
|
||||
symbol.snp.makeConstraints { make in
|
||||
make.top.equalToSuperview().offset(24)
|
||||
make.centerX.equalToSuperview()
|
||||
make.size.equalTo(50)
|
||||
}
|
||||
title.snp.makeConstraints { make in
|
||||
make.top.equalTo(symbol.snp.bottom).offset(16)
|
||||
make.leading.trailing.equalToSuperview().inset(20)
|
||||
}
|
||||
message.snp.makeConstraints { make in
|
||||
make.top.equalTo(title.snp.bottom).offset(12)
|
||||
make.leading.trailing.equalToSuperview().inset(20)
|
||||
}
|
||||
actions.snp.makeConstraints { make in
|
||||
make.top.equalTo(message.snp.bottom).offset(24)
|
||||
make.leading.trailing.bottom.equalToSuperview().inset(16)
|
||||
make.height.equalTo(46)
|
||||
}
|
||||
}
|
||||
|
||||
private func button(_ title: String, primary: Bool, action: Selector) -> UIButton {
|
||||
let button = UIButton(type: .system)
|
||||
button.setTitle(title, for: .normal)
|
||||
button.setTitleColor(primary ? .white : DroneDockStyle.text, for: .normal)
|
||||
button.titleLabel?.font = .systemFont(ofSize: 15, weight: .semibold)
|
||||
button.backgroundColor = primary ? DroneDockStyle.primary : UIColor(hex: 0xEEF0F6)
|
||||
button.layer.cornerRadius = 7
|
||||
button.addTarget(self, action: action, for: .touchUpInside)
|
||||
return button
|
||||
}
|
||||
|
||||
@objc private func laterTapped() { onLater?() }
|
||||
@objc private func materialsTapped() { onViewMaterials?() }
|
||||
}
|
||||
Reference in New Issue
Block a user