| | |
| | | import com.okgoincar.netUtls.Api |
| | | import com.okgoincar.netUtls.callNet |
| | | import com.okgoincar.netUtls.getMapByAny |
| | | import com.okgoincar.slab.util.DialogUtil |
| | | import com.okgoincar.utils.Cache.CacheKey |
| | | import io.netty.util.NetUtil |
| | | import org.greenrobot.eventbus.EventBus |
| | | import java.lang.Exception |
| | | |
| | |
| | | var price = intent.getDoubleExtra("price", 0.0) //计价器价格,单位为元 |
| | | var mileage = intent.getDoubleExtra("mileage", 0.0) //里程,单位为km |
| | | callOver(contexts!!, price) |
| | | } |
| | | |
| | | "android.net.conn.CONNECTIVITY_SUCCESS", "android.net.conn.CONNECTIVITY_FAILURE", "android.net.conn.CONNECTIVITY_CHANGE" -> { |
| | | toast("收到网络变化") |
| | | if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { |
| | | callErrorOrder(contexts!!) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } else { |
| | | val bean = CacheKey.getLocalOrderBean() |
| | | bean?.let { |
| | | if (bean.money >= 0.0) { |
| | | if (bean.money > 0.0) { |
| | | return@callOver |
| | | } |
| | | bean.endTime = System.currentTimeMillis() |
| | |
| | | /*** |
| | | * 上传异常订单 |
| | | */ |
| | | private fun callErrorOrder(contexts: Context) { |
| | | fun callErrorOrder(contexts: Context) { |
| | | var bean = CacheKey.getLocalOrderBean() |
| | | bean?.let { |
| | | if (bean.money <= 0.0) { |
| | | return@let |
| | | } |
| | | CacheKey.saveLocalOrderBeanNull() |
| | | val map = getMapByAny() |
| | | map["orderId"] = bean.orderId |
| | | map["orderType"] = bean.orderType |
| | |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.ERROR_INFO)) |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private fun callStartOrder(contexts: Context, i: Int) { |