From 887578fe6329b840e9647722b0f39649a11ea065 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 18 Jul 2023 16:56:13 +0800 Subject: [PATCH] =?UTF-8?q?[3.3.2]=20[=E5=90=AF=E5=8A=A8=E8=87=AA=E9=A9=BE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B1=95=E7=A4=BAorder=E4=BF=A1=E6=81=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/startautopilot/StartAutopilotView.kt | 5 +++++ .../startautopilot/StartAutopilotViewModel.kt | 21 +++++++++++++++++++ .../layout/taxi_p_start_autopilot_view.xml | 14 +++++++++++++ 3 files changed, 40 insertions(+) diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotView.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotView.kt index 0762d7c937..d089a2602e 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotView.kt +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotView.kt @@ -15,6 +15,7 @@ import com.mogo.eagle.core.utilcode.util.OverlayViewUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.common.module.utils.AnimatorDrawableUtil import com.mogo.och.taxi.passenger.R +import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.actv_orderinfo import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.starting_autopilot_view_close import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.taxi_p_autopilot_btn_bg import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.taxi_p_autopilot_starting @@ -113,6 +114,10 @@ class StartAutopilotView : RelativeLayout, StartAutopilotViewModel.StartAutopilo } } + override fun setOrderInfo(show: String) { + actv_orderinfo.text = show + } + fun closeAllAnimsAndView() { isStarting = false clearStartingAnimFrame() diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotViewModel.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotViewModel.kt index caca8b9050..8d0e7814d0 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotViewModel.kt +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/startautopilot/StartAutopilotViewModel.kt @@ -18,8 +18,28 @@ class StartAutopilotViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback fun setStartAutopilotCallback(viewCallback:StartAutopilotCallback){ this.viewCallback = viewCallback TaxiPassengerModel.startOrStopReadyToAutopilotLoop(true) + setOrderInfo() } + private fun setOrderInfo() { + val currentOCHOrder = TaxiPassengerModel.currentOCHOrder + currentOCHOrder?.let { + val phone = it.passengerPhone + var show = "" + if(phone.length>8) { + //截取电话号码前三位 + val phoneNumPre = phone.substring(0, 3); + //截取电话号码后四位 + val phoneNumFix = phone.substring(7); + + show ="用户:$phoneNumPre****$phoneNumFix 目的地:${it.endSiteAddr}" + }else{ + show ="用户:${phone} 目的地:${it.endSiteAddr}" + } + viewCallback?.setOrderInfo(show) + } + } + override fun onCleared() { super.onCleared() this.viewCallback = null @@ -41,5 +61,6 @@ class StartAutopilotViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback interface StartAutopilotCallback{ fun handleStartAutopilotBtnStatus(isBoarded: Boolean) + fun setOrderInfo(show: String) } } \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml index dcadc6ed59..a9b12cf7c2 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml +++ b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml @@ -30,6 +30,7 @@ android:layout_width="1000dp" android:layout_height="500dp" android:clickable="false" + android:layout_marginBottom="@dimen/dp_143" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> @@ -49,4 +50,17 @@ app:layout_constraintLeft_toLeftOf="@+id/taxi_p_autopilot_btn_bg" app:layout_constraintRight_toRightOf="@+id/taxi_p_autopilot_btn_bg" /> + + + \ No newline at end of file