From 75ba68eb8d65a32251704c604b3e27f3121808ce Mon Sep 17 00:00:00 2001
From: liugl <liugl@sinata.cn>
Date: 星期四, 07 一月 2021 09:22:58 +0800
Subject: [PATCH] Merge branches 'cargo_small' and 'master' of http://sinata.cn:10101/gitblit/r/android/OkGoinCar into cargo_small

---
 app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt b/app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt
index ec84a09..b720235 100644
--- a/app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt
+++ b/app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt
@@ -146,19 +146,20 @@
                 if (bean.startTime <= 0L) {
                     if (NetUtils.isNetworkConnected(MyApplication.getInstance())){
                         CacheKey.saveLocalOrderBeanNull()
-                        MyApplication.currentOrderId = ""
+                        toast("调用正常结束,在异常订单中")
                         callEndOrder(contexts,bean.money)
                     }
                 }else{
                     if (NetUtils.isNetworkConnected(MyApplication.getInstance())){
-                        CacheKey.saveLocalOrderBeanNull()
-                        MyApplication.currentOrderId = ""
                         val map = getMapByAny()
                         map["orderId"] = bean.orderId
                         map["orderType"] = bean.orderType
                         map["type"] = "1"
                         map["travelFee"] = bean.money
+                        CacheKey.saveLocalOrderBeanNull()
+                        toast("调用异常结束,在异常订单中 id==="+bean.orderId)
                         callNet(contexts, "api/order/confirmFees$", map,{
+                            MyApplication.currentOrderId = ""
                             toast("上传异常订单成功")
                             EventBus.getDefault().post(BaseEvent(BaseEvent.ERROR_INFO))
                         }) {
@@ -167,11 +168,10 @@
                         }
                     }
                 }
-
             }
         }
 
-        private fun callStartOrder(contexts: Context, i: Int) {
+         fun callStartOrder(contexts: Context, i: Int) {
             var map = getMapByAny()
             map["orderId"] = MyApplication.currentOrderId
             map["orderType"] = MyApplication.currentOrderType
@@ -203,9 +203,11 @@
                 mapOrder["orderType"] = MyApplication.currentOrderType
                 callNet(contexts, Api.queryOrderInfo, mapOrder) {
                     var orderBean = Gson().fromJson(it, OrderBean::class.java)
+                    EventBus.getDefault().post(BaseEvent(BaseEvent.UPDATA_MAIN_CAR))
                     if (orderBean.data.orderState == 7){
                         EventBus.getDefault().post(BaseEvent(BaseEvent.SURE_MONEY))
                     }
+                    MyApplication.currentOrderId = ""
                     if (orderBean.data.orderState == 2 ||orderBean.data.orderState == 3 || orderBean.data.orderState == 4 ){
                         Handler(Looper.getMainLooper()).postDelayed({
                             toast("发送网约")

--
Gitblit v1.7.1