fix: 优化点位展示、选择滚动和收款信息
This commit is contained in:
@@ -485,7 +485,16 @@ extension DroneDockRemotePreparationViewController: UICollectionViewDelegate {
|
||||
viewModel.createdTask == nil, !viewModel.taskCreationOutcomeUnknown,
|
||||
let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
||||
switch item {
|
||||
case .point(let id): viewModel.selectSpot(id: id)
|
||||
case .point(let id):
|
||||
viewModel.selectSpot(id: id)
|
||||
applySnapshot(animated: true) { [weak self] in
|
||||
guard let self, self.viewModel.selectedSpotID == id,
|
||||
let path = self.dataSource.indexPath(for: .point(id)) else { return }
|
||||
let pointsWidth = CGFloat(self.viewModel.spots.count) * 200 + CGFloat(max(0, self.viewModel.spots.count - 1)) * 8 + 32
|
||||
guard pointsWidth > collectionView.bounds.width else { return }
|
||||
collectionView.scrollToItem(at: path, at: .centeredHorizontally, animated: true)
|
||||
}
|
||||
return
|
||||
case .route(let id): viewModel.selectRoute(id: id)
|
||||
default: return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user