| | |
| | | package com.zhaoyang.driver.ui.main |
| | | |
| | | import android.graphics.Color |
| | | import android.os.Bundle |
| | | import android.os.CountDownTimer |
| | | import android.view.View |
| | |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | map_view.onPause() |
| | | } |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | map_view.onResume() |
| | | } |
| | | |
| | | override fun onLowMemory() { |
| | | super.onLowMemory() |
| | | map_view.onLowMemory() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | map_view.onDestroy() |
| | | time.cancel() |
| | | } |
| | | |
| | |
| | | callNet(this, Api.queryPushOrder, map) { |
| | | val data = Gson().fromJson<OrderBean>(it, OrderBean::class.java).data |
| | | sysErr(data) |
| | | if (data.reservation == 2){ |
| | | rl_top.setBackgroundResource(R.drawable.car_get_top_red) |
| | | tv_reassign.setTextColor(Color.parseColor("#D42A23")) |
| | | } |
| | | val startView = createView(R.layout.item_map_market, this) |
| | | val endView = createView(R.layout.item_map_market, this) |
| | | startView.iv_img.setImageResource(R.mipmap.starting_point) |
| | |
| | | callNet(this, Api.grabOrder, map) { |
| | | Toast.create(this).show("抢单成功") |
| | | onBackPressed() |
| | | when (orderType) { |
| | | "2" -> { |
| | | this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType) |
| | | if (MyApplication.currentOrderId.isEmpty()) //判断上一单是否结束 |
| | | when (orderType) { |
| | | "2" -> { |
| | | this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType) |
| | | } |
| | | "1" -> { |
| | | this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType) |
| | | } |
| | | "3" -> { |
| | | this.startActivity<TripCityActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | } |
| | | "4","5" -> { |
| | | this.startActivity<SmallCargoActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | } |
| | | } |
| | | "1" -> { |
| | | this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType) |
| | | } |
| | | "3" -> { |
| | | this.startActivity<TripCityActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | } |
| | | "4","5" -> { |
| | | this.startActivity<SmallCargoActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |