From 1128afd3a9e45d09d8c345d2ed901a1e585a4393 Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期四, 13 六月 2024 15:44:43 +0800
Subject: [PATCH] 简化代客下单

---
 app/src/main/java/com/future/driver/ui/main/TripActivity.kt |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/app/src/main/java/com/future/driver/ui/main/TripActivity.kt b/app/src/main/java/com/future/driver/ui/main/TripActivity.kt
index a6aed92..ac4b014 100644
--- a/app/src/main/java/com/future/driver/ui/main/TripActivity.kt
+++ b/app/src/main/java/com/future/driver/ui/main/TripActivity.kt
@@ -104,7 +104,7 @@
                 data?.let {
                     when (it.orderType) {
                         1, 2, 3,7 -> {
-                            if (it.status == 10 || it.status == 12) {
+                            if ((it.status == 10 || it.status == 12)&&MyApplication.currentOrderId.isNotEmpty()&&it.orderId.toString() == orderId) {
                                 Handler(Looper.getMainLooper()).post {
                                     toast("用户已取消订单")
                                     MyApplication.getTTsManager().setVideoText("用户已取消订单")
@@ -134,7 +134,7 @@
             orderSimpleData?.let {
                 if (it.status == 10 || it.status == 12) {
                     Handler(Looper.getMainLooper()).post {
-                        toast("用户已取消订单")
+//                        toast("用户已取消订单")
                         MyApplication.getTTsManager().setVideoText("用户已取消订单")
                         MyApplication.currentOrderType = ""
                         MyApplication.currentOrderId = ""
@@ -171,7 +171,7 @@
                         "orderType" to orderType
                     )
                 } else {
-                    DialogUtil.getDelAndSureDialog(
+                    val d = DialogUtil.getDelAndSureDialog(
                         this,
                         "现在改派将收取" + data.data.amount + "元改派费,您是否要进行改派?",
                         {},
@@ -183,9 +183,9 @@
                                 "money" to data.data.amount.toString()
                             )
                         })
+                    val view = DialogUtil.getView(d)
+                    view.tv_view_two_base.gravity = Gravity.CENTER
                 }
-
-
             }
         }
         iv_move.setOnClickListener {
@@ -273,11 +273,21 @@
                             return@let
                         }
                         if (it.data.endAddress.isNullOrEmpty()&&it.data.orderState == 4){
-                            DialogUtil.getDelAndSureDialog(this,"去填写","取消","乘客未填写目的地,请代乘客填写目的地后开始行程",{
-                            }){
+                            val delAndSureDialog = DialogUtil.getDelAndSureDialog(
+                                this,
+                                "去填写",
+                                "取消",
+                                "乘客未填写目的地,请代乘客填写目的地后开始行程",
+                                {
+                                }) {
                                 byChangeEnd = true
-                                startActivity<SearchSiteActivity>("currentCityName" to (MyApplication.aMapLocation?.city?:""),"type" to "3")
+                                startActivity<SearchSiteActivity>(
+                                    "currentCityName" to (MyApplication.aMapLocation?.city ?: ""),
+                                    "type" to "3"
+                                )
                             }
+                            val view = DialogUtil.getView(delAndSureDialog)
+                            view.tv_view_two_base.gravity = Gravity.CENTER
                             return@let
                         }
                         it.data.orderState++

--
Gitblit v1.7.1