| | |
| | | import android.content.BroadcastReceiver |
| | | import android.content.Context |
| | | import android.content.Intent |
| | | import android.net.ConnectivityManager |
| | | import android.os.Handler |
| | | import android.os.Looper |
| | | import cn.sinata.xldutils.netstatus.NetUtils |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import java.lang.Exception |
| | | |
| | | /*** |
| | | * 为了支持本页面所需的 MyApplication.currentOrderId 所以在订单列表获取处,订单页面,设置了这个常量的值 |
| | | * |
| | | * 1:接单后 重车时无网 |
| | | * --车载屏无反应 |
| | | * 缓存 订单开始状态 |
| | | * 来网后空车时 --》 查看是否有进行中id,是否有缓存 |
| | | * |
| | | * |
| | | * 2:接单后 空车时无网 |
| | | * |
| | | * |
| | | * |
| | | * 3:接单后 正常状态 |
| | | * |
| | | * |
| | | * |
| | | * 4:接单后 都没有网络 |
| | | * |
| | | * |
| | | */ |
| | | class MoneyBroadCastReceiver : BroadcastReceiver() { |
| | | override fun onReceive(contexts: Context?, intent: Intent?) { |
| | | if (intent == null && contexts == null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | fun callOver(contexts: Context, travelFee: Double) { |
| | | if (MyApplication.currentOrderId.isEmpty()) { |
| | |
| | | if (bean.startTime <= 0L) { |
| | | if (NetUtils.isNetworkConnected(MyApplication.getInstance())){ |
| | | CacheKey.saveLocalOrderBeanNull() |
| | | MyApplication.currentOrderId = "" |
| | | 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 |