feat: 完善机巢任务实时状态、双路图传与继续查看入口
This commit is contained in:
@@ -10,6 +10,7 @@ final class DroneDockOrdersViewController: BaseViewController {
|
||||
private let materialsControllerFactory: (DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController
|
||||
private let deliveryControllerFactory: (DroneDockHomeOrder, DroneDockHomeContext, Int?) -> UIViewController
|
||||
private let confirmationControllerFactory: (DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController
|
||||
private let taskControllerFactory: (Int, DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController
|
||||
private let countLabel = DroneDockStyle.label(size: 17, weight: .semibold)
|
||||
private let descriptionLabel = DroneDockStyle.label("分配给我的全部订单,含已完成订单", size: 12, color: DroneDockStyle.secondary)
|
||||
private let filterView = DroneShootingOrderFilterView()
|
||||
@@ -29,12 +30,14 @@ final class DroneDockOrdersViewController: BaseViewController {
|
||||
preparationControllerFactory: @escaping (DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController,
|
||||
materialsControllerFactory: @escaping (DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController,
|
||||
deliveryControllerFactory: ((DroneDockHomeOrder, DroneDockHomeContext, Int?) -> UIViewController)? = nil,
|
||||
confirmationControllerFactory: ((DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController)? = nil) {
|
||||
confirmationControllerFactory: ((DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController)? = nil,
|
||||
taskControllerFactory: ((Int, DroneDockHomeOrder, DroneDockHomeContext) -> UIViewController)? = nil) {
|
||||
self.viewModel = viewModel
|
||||
self.preparationControllerFactory = preparationControllerFactory
|
||||
self.materialsControllerFactory = materialsControllerFactory
|
||||
self.deliveryControllerFactory = deliveryControllerFactory ?? DroneDockDeliveryEntry.makeController
|
||||
self.confirmationControllerFactory = confirmationControllerFactory ?? DroneDockConfirmationEntry.makeController
|
||||
self.taskControllerFactory = taskControllerFactory ?? DroneDockShootingTaskEntry.makeController
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
hidesBottomBarWhenPushed = true
|
||||
}
|
||||
@@ -117,7 +120,7 @@ final class DroneDockOrdersViewController: BaseViewController {
|
||||
if let order = self.viewModel.orders.first(where: { $0.orderID == id }) {
|
||||
cell.accessibilityIdentifier = "drone.orders.order.\(id)"
|
||||
cell.cardView.apply(homeOrder: order)
|
||||
cell.cardView.onShootingTap = { [weak self] in self?.openPreparation(orderID: id) }
|
||||
cell.cardView.onShootingTap = { [weak self] in self?.openShooting(orderID: id) }
|
||||
cell.cardView.onMaterialsTap = { [weak self] in self?.openMaterials(orderID: id) }
|
||||
cell.cardView.onDeliveryTap = { [weak self] in self?.openDelivery(orderID: id) }
|
||||
cell.cardView.onConfirmationTap = { [weak self] in self?.openConfirmation(orderID: id) }
|
||||
@@ -194,8 +197,15 @@ final class DroneDockOrdersViewController: BaseViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private func openPreparation(orderID: String) {
|
||||
/// 优先继续查看服务端选定的既有任务,无任务时才进入拍摄准备。
|
||||
private func openShooting(orderID: String) {
|
||||
guard operation == nil, let order = viewModel.orders.first(where: { $0.orderID == orderID }) else { return }
|
||||
if let taskID = order.activeTaskID {
|
||||
guard let navigationController, navigationController.topViewController === self,
|
||||
presentedViewController == nil else { return }
|
||||
navigationController.pushViewController(taskControllerFactory(taskID, order, viewModel.context), animated: true)
|
||||
return
|
||||
}
|
||||
guard order.primaryAction == "start_shoot" else {
|
||||
showUnavailable(order.actionTitle ?? "拍摄订单")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user