[3.3.2]
[启动自驾页面展示order信息]
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_orderinfo"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_59"
|
||||
tools:text="用户:1234882382 目的地:环球贸易中心"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user