From 2dc31c20ff4db480d619d9186cebd07e79b7a6a9 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 14 Jul 2025 11:56:43 +0800 Subject: [PATCH] =?UTF-8?q?[8.1.0]=20[routing]=20[fix]=20[=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E8=AE=BE=E7=BD=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/runing/other/TaskRunningModel.kt | 26 ++++++++++++------- .../ui/runing/other/TaskRunningView.kt | 26 ++++++++++++++----- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt index 334127c472..384ad6b122 100644 --- a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt +++ b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt @@ -54,7 +54,7 @@ class TaskRunningModel : ViewModel() { /** * 是否可以进行进站操作 */ - private var arrivedStation:Boolean = false + var arrivedStation:Boolean = false companion object { var currentIndex = -1 @@ -74,6 +74,9 @@ class TaskRunningModel : ViewModel() { this.currentContrailBean = data.contrail this.currentGrayId = data.taskId this.stationList = data.stationList + this.stationList?.forEach { + it.isLeaving = false + } currentIndex = 0 this.stationList?.let { val startStationNext = it[currentIndex] @@ -134,7 +137,7 @@ class TaskRunningModel : ViewModel() { startStation.isLeaving = true arrivedStation = true startStation.drivingStatus = 2 - CallerLogger.d(TAG,"setNewData index:${currentIndex} ${startStation.name}---${endStation.name}") + CallerLogger.d(TAG,"leaveStation index:${currentIndex} ${startStation.name}---${endStation.name}") this.viewCallback?.notifyItemChange(currentIndex) this.viewCallback?.showArriverStationAndCompleteTask() if (CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING @@ -150,29 +153,34 @@ class TaskRunningModel : ViewModel() { fun arriveStation() { stationList?.let { val startStation = it[currentIndex] - startStation.isLeaving = false - arrivedStation = false - startStation.drivingStatus = 1 if (currentIndex + 2 >= it.size) { + startStation.isLeaving = true this.viewCallback?.showCompleteTask() }else { + startStation.isLeaving = false + arrivedStation = false + startStation.drivingStatus = 1 currentIndex += 1 val startStationNext = it[currentIndex] val endStation = it[currentIndex + 1] CallerLogger.d(TAG, "setNewData index:${currentIndex} ${startStationNext.name}----${endStation.name}") LineManager.setStartAndEndStation(startStationNext, endStation) } + LineManager.getStations { start, end -> + BizLoopManager.runInMainThread{ + this.viewCallback?.onArrivedStation(start.isLeaving) + } + } + } - BizLoopManager.runInMainThread{ - this.viewCallback?.onArrivedStation() - } + } interface SwtichLineViewCallback { // 到站 - fun onArrivedStation() + fun onArrivedStation(leaving: Boolean) // 结束服务成功 fun onSubmitEndTaskSuccess() diff --git a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningView.kt b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningView.kt index 82e2654da4..0a4e18d186 100644 --- a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningView.kt +++ b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningView.kt @@ -82,10 +82,17 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac aciv_task_leave_station_slide_bg.setSlideListener(object : CommonSlideView.SlideListener { override fun slideEnd() { if (TaskRunningModel.currentIndex == mAdapter.mData.size-2) { - aciv_task_leave_station_slide_bg.setTextValue("单程结束") - aciv_task_leave_station_slide_bg.reset() - viewModel?.data?.taskId?.let { - showFeedbackDialog(it) + LineManager.getStations { start, end -> + if (viewModel?.arrivedStation == true && start.isLeaving) { + aciv_task_leave_station_slide_bg.setTextValue("单程结束") + aciv_task_leave_station_slide_bg.reset() + viewModel?.data?.taskId?.let { + showFeedbackDialog(it) + } + }else{ + aciv_task_leave_station_slide_bg.setTextValue("滑动出发") + viewModel?.leaveStation() + } } } else { aciv_task_leave_station_slide_bg.setTextValue("滑动出发") @@ -190,13 +197,20 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac /** * 到达目的地 */ - override fun onArrivedStation() { + override fun onArrivedStation(leaving: Boolean) { // showLeaveStationView() loading_arrive_station.visibility = GONE notifyItemChange(0) if (TaskRunningModel.currentIndex == mAdapter.mData.size-2) { - aciv_task_leave_station_slide_bg.setTextValue("单程结束") + LineManager.getStations { start, end -> + if(start.isLeaving){ + aciv_task_leave_station_slide_bg.setTextValue("单程结束") + }else{ + aciv_task_leave_station_slide_bg.setTextValue("滑动出发") + } + } + } else { aciv_task_leave_station_slide_bg.setTextValue("滑动出发") }