feat(drone-dock): 新增独立套餐收款页并接入收款接口
This commit is contained in:
@@ -5,6 +5,7 @@ import UIKit
|
||||
final class DroneDockHomeViewController: BaseViewController {
|
||||
/// 与演示数据源隔离的首页状态。
|
||||
let viewModel: DroneDockHomeViewModel
|
||||
private let paymentControllerFactory: (() -> UIViewController)?
|
||||
private var refreshTask: Task<Void, Never>?
|
||||
private var isRefreshing = false
|
||||
private var devicePage = 0
|
||||
@@ -27,8 +28,9 @@ final class DroneDockHomeViewController: BaseViewController {
|
||||
}
|
||||
|
||||
/// 注入可测试的数据源,不加载演示数据。
|
||||
init(viewModel: DroneDockHomeViewModel) {
|
||||
init(viewModel: DroneDockHomeViewModel, paymentControllerFactory: (() -> UIViewController)? = nil) {
|
||||
self.viewModel = viewModel
|
||||
self.paymentControllerFactory = paymentControllerFactory
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
hidesBottomBarWhenPushed = true
|
||||
}
|
||||
@@ -232,7 +234,10 @@ final class DroneDockHomeViewController: BaseViewController {
|
||||
showAlert(title: feature, message: "该功能暂未开放")
|
||||
}
|
||||
|
||||
@objc private func receiptTapped() { showUnavailable("套餐收款") }
|
||||
@objc private func receiptTapped() {
|
||||
let controller = paymentControllerFactory?() ?? DroneDockPaymentViewController()
|
||||
navigationController?.pushViewController(controller, animated: true)
|
||||
}
|
||||
@objc private func refreshTriggered() { refreshHome() }
|
||||
|
||||
#if DEBUG
|
||||
|
||||
Reference in New Issue
Block a user