[charter]
[3.2.0] [选择线路的部分逻辑]
This commit is contained in:
@@ -114,6 +114,7 @@ object CharterPassengerModel {
|
||||
private var carTypeChageListener: IOrderChangeCallback?=null
|
||||
|
||||
private var subscribeCountDown: Disposable?=null
|
||||
var switchLine5minWait: Disposable?=null
|
||||
|
||||
fun init() {
|
||||
initListeners()
|
||||
@@ -866,6 +867,12 @@ object CharterPassengerModel {
|
||||
)
|
||||
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "到站发送数据${msg}")
|
||||
|
||||
switchLine5minWait?.let {
|
||||
if (!it.isDisposed) {
|
||||
it.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
// 到站结束自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
// 结束路距计算
|
||||
|
||||
@@ -194,12 +194,15 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
|
||||
checkLine?.let {
|
||||
mView?.lineAdapterSubmit(it)
|
||||
}
|
||||
mView?.go2StartCar()
|
||||
mView?.hideDataDriverAgree()
|
||||
CharterPassengerModel.switchLine5minWait = RxUtils.createSubscribe(5 * 60 * 1000) {
|
||||
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "5分钟倒计时可以选择线路了")
|
||||
}
|
||||
CharterPassengerModel.queryOrder()
|
||||
CharterPassengerModel.cleanbroadcastListInfo()
|
||||
} else {
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
mView?.endAni()
|
||||
mView?.hideDataDriverRefuse()
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
@@ -240,7 +243,7 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
|
||||
)
|
||||
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "发送数据:切换站点${msg}")
|
||||
}
|
||||
mView?.startAni()
|
||||
mView?.hideDataWaitDriverMsg()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
@@ -250,14 +253,14 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
mView?.endAni()
|
||||
mView?.hideDataDriverRefuse()
|
||||
}
|
||||
}
|
||||
private fun checkServerStatus() {
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showShort("断开和司机端连接、请联系安全员")
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
mView?.endAni()
|
||||
mView?.hideDataDriverRefuse()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni666")
|
||||
}
|
||||
}
|
||||
@@ -267,7 +270,6 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderLineFragment?) :
|
||||
}
|
||||
|
||||
fun canSwitchLine():Boolean {
|
||||
return true
|
||||
val gnssSpeed =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed
|
||||
if (gnssSpeed < 0.5) {
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -16,12 +13,14 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionOrderPresenter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.view.BottomDecoration
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -102,11 +101,14 @@ class M1OrderLineFragment :
|
||||
mPresenter?.resetData()
|
||||
}
|
||||
tv_site_submit.onClick {
|
||||
CharterPassengerModel.switchLine5minWait?.let {
|
||||
if (!it.isDisposed) {
|
||||
ToastUtils.showShort("选择线路后5分钟内不可用选")
|
||||
return@onClick
|
||||
}
|
||||
}
|
||||
mPresenter?.changeSites(siteList)
|
||||
}
|
||||
tv_loading_wait_driver_title.onClick {
|
||||
endAni()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -122,39 +124,57 @@ class M1OrderLineFragment :
|
||||
}
|
||||
}
|
||||
|
||||
fun startAni() {
|
||||
fun hideDataWaitDriverMsg() {
|
||||
g_lines_sites_data.visibility = View.GONE
|
||||
g_loading_group.visibility = View.VISIBLE
|
||||
val animationDrawable = iv_loading_wait_driver.drawable as AnimationDrawable
|
||||
animationDrawable.start()
|
||||
}
|
||||
|
||||
fun endAni() {
|
||||
fun showSelectData() {
|
||||
UiThreadHandler.post {
|
||||
g_lines_sites_data.visibility = View.VISIBLE
|
||||
g_loading_group.visibility = View.GONE
|
||||
val animationDrawable = iv_loading_wait_driver.drawable as AnimationDrawable
|
||||
group_driver_agrenn_line.visibility = View.GONE
|
||||
aciv_driver_refuse_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun hideDataDriverAgree(){
|
||||
group_driver_agrenn_line.visibility = View.VISIBLE
|
||||
aciv_driver_refuse_group.visibility = View.GONE
|
||||
g_loading_group.visibility = View.GONE
|
||||
g_lines_sites_data.visibility = View.GONE
|
||||
RxUtils.createSubscribe {
|
||||
dismiss?.closeDialog()
|
||||
}
|
||||
}
|
||||
fun hideDataDriverRefuse(){
|
||||
group_driver_agrenn_line.visibility = View.GONE
|
||||
aciv_driver_refuse_group.visibility = View.VISIBLE
|
||||
g_loading_group.visibility = View.GONE
|
||||
g_lines_sites_data.visibility = View.GONE
|
||||
RxUtils.createSubscribe {
|
||||
showSelectData()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun setViewByOrderStatus(currentStatus: OrderStatusEnum) {
|
||||
when (currentStatus) {
|
||||
OrderStatusEnum.NoOrderUnuse -> {
|
||||
// 无订单页面
|
||||
m1_order_noorder.visibility = View.VISIBLE
|
||||
m1_order_early_end.visibility = View.GONE
|
||||
lsv_line_site.visibility = View.GONE
|
||||
}
|
||||
OrderStatusEnum.OrderNoLine -> {
|
||||
// 选择线路页面
|
||||
m1_order_noorder.visibility = View.GONE
|
||||
m1_order_early_end.visibility = View.GONE
|
||||
lsv_line_site.visibility = View.VISIBLE
|
||||
}
|
||||
OrderStatusEnum.OrdersWithLine -> {
|
||||
// 选择线路页面
|
||||
m1_order_noorder.visibility = View.GONE
|
||||
m1_order_early_end.visibility = View.GONE
|
||||
lsv_line_site.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
|
||||
import com.mogo.och.bus.passenger.R
|
||||
|
||||
class EarlyEndOrderView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_order_early_end, this, true)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -1,83 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/bus_p_function_setting_soft_b_shape"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1031:500"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.53698">
|
||||
<!--提前结束包车页面-->
|
||||
<ImageView
|
||||
android:id="@+id/iv_early_end"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/m1_order_early_end"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_83"
|
||||
android:layout_width="@dimen/dp_252"
|
||||
android:layout_height="@dimen/dp_172"/>
|
||||
|
||||
<TextView
|
||||
android:text="未到包车时间,提前结束不退款\n请确认是否结束?"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_52"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/bus_p_m1_4a5375"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_early_end"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_375"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_early_end_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_site_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_early_end_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -102,8 +102,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_site_cancle_submit_guide" />
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_site_cancle_submit_guide"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -115,9 +113,7 @@
|
||||
android:id="@+id/g_side_cancle_submit_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="tv_site_submit,tv_site_cancle,tv_site_cancle,tv_site_submit" />
|
||||
|
||||
|
||||
app:constraint_referenced_ids="tv_site_submit,tv_site_cancle" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
@@ -126,6 +122,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="cl_line_list,cl_side_list,tv_site_submit,tv_site_cancle" />
|
||||
|
||||
<!--region 等待司机同意或者拒绝-->
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading_wait_driver"
|
||||
android:layout_width="@dimen/dp_600"
|
||||
@@ -153,15 +150,89 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="iv_loading_wait_driver,tv_loading_wait_driver_title" />
|
||||
<!--endregion 等待司机同意或者拒绝-->
|
||||
|
||||
<!--region 司机同意显示-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_driver_agree_image"
|
||||
android:layout_width="@dimen/dp_235"
|
||||
android:layout_height="@dimen/dp_223"
|
||||
android:layout_marginTop="@dimen/dp_61"
|
||||
android:src="@drawable/charter_p_driver_agree"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_driver_agree_title_top"
|
||||
app:layout_constraintStart_toStartOf="@+id/aciv_driver_agree_image"
|
||||
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_agree_image"
|
||||
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_agree_image"
|
||||
android:text="确认完毕!"
|
||||
android:textColor="@color/bus_p_m1_112b57"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_driver_agree_title_bottom"
|
||||
app:layout_constraintStart_toStartOf="@+id/aciv_driver_agree_image"
|
||||
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_agree_image"
|
||||
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_agree_title_top"
|
||||
android:text="小助手已记录您的选择。"
|
||||
android:textColor="@color/bus_p_m1_112b57"
|
||||
android:textSize="@dimen/dp_29"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_driver_agrenn_line"
|
||||
app:constraint_referenced_ids="aciv_driver_agree_image,aciv_driver_agree_title_top,aciv_driver_agree_title_bottom"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<!--endregion 司机同意显示-->
|
||||
|
||||
<!--region 司机拒绝显示-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_driver_refuse_image"
|
||||
android:layout_width="@dimen/dp_395"
|
||||
android:layout_height="@dimen/dp_234"
|
||||
android:layout_marginTop="@dimen/dp_61"
|
||||
android:src="@drawable/charter_p_driver_refuse"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_driver_refuse_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/aciv_driver_refuse_image"
|
||||
app:layout_constraintEnd_toEndOf="@+id/aciv_driver_refuse_image"
|
||||
app:layout_constraintTop_toBottomOf="@+id/aciv_driver_refuse_image"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
android:gravity="center"
|
||||
android:text="啊哦,加载失败了\n联系车内领航员,或尝试再次提交。"
|
||||
android:textColor="@color/bus_p_m1_112b57"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/aciv_driver_refuse_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="aciv_driver_refuse_image,aciv_driver_refuse_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<!--endregion 司机拒绝显示-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/m1_order_early_end"
|
||||
layout="@layout/m1_order_early_end"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
android:id="@+id/m1_order_noorder"
|
||||
layout="@layout/m1_order_noorder"
|
||||
|
||||
Reference in New Issue
Block a user