fix: 优化点位展示、选择滚动和收款信息

This commit is contained in:
2026-11-04 11:13:12 +08:00
parent 7a63ea3432
commit 1c766ff12f
7 changed files with 116 additions and 38 deletions
@@ -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
}