| | |
| | | import com.xianning.driver.base.gaode.AMapKit |
| | | import com.xianning.driver.base.gaode.BaiduUtils |
| | | import com.xianning.driver.bean.OrderBean |
| | | import com.xianning.driver.netUtls.Api |
| | | import com.xianning.driver.netUtls.callNet |
| | | import com.xianning.driver.netUtls.createView |
| | | import com.xianning.driver.netUtls.getMapByAny |
| | | import com.xianning.driver.netUtls.* |
| | | import com.xianning.driver.ui.UiUtil |
| | | import com.xianning.driver.ui.main.TripActivity |
| | | import kotlinx.android.synthetic.main.item_get_order.* |
| | | import kotlinx.android.synthetic.main.item_map_market.view.* |
| | | import org.jetbrains.anko.startActivity |
| | |
| | | intent?.getStringExtra("orderType") |
| | | } |
| | | |
| | | val timeDown by lazy { |
| | | intent?.getIntExtra("time", 30)?:30 |
| | | } |
| | | val type by lazy { |
| | | intent?.getIntExtra("type", -1) |
| | | } |
| | | |
| | | lateinit var time: CountDownTimer |
| | | |
| | | |
| | |
| | | //实例化语音引擎 |
| | | aMap = AMapKit.initMap(savedInstanceState, map_view) |
| | | var strBtn = "确定" |
| | | if (type == 1){ |
| | | strBtn = "抢单" |
| | | time = timeOver((timeDown.toLong() * 1000L)) { |
| | | if (it == 0) { |
| | | finish() |
| | | } else { |
| | | tv_sure.text = strBtn + it.toString() + "S" |
| | | } |
| | | } |
| | | } |
| | | tv_sure.text = strBtn |
| | | tv_close.clickDelay { |
| | | finish() |
| | | } |
| | | callOrderDetail() |
| | | tv_sure.clickDelay { |
| | | this.startActivity<TripCityActivity>("orderId" to orderId, "orderType" to orderType) |
| | | finish() |
| | | if (type == 1) { |
| | | showGetOrder() |
| | | } else{ |
| | | this.startActivity<TripCityActivity>("orderId" to orderId, "orderType" to orderType) |
| | | finish() |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun showGetOrder() { |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | map["orderType"] = orderType |
| | | callNet(this, Api.grabOrder, map) { |
| | | Toast.create(this).show("抢单成功") |
| | | onBackPressed() |
| | | when (orderType) { |
| | | "3" -> { |
| | | this.startActivity<TripCityActivity>("orderId" to orderId, "orderType" to orderType) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | override fun initView() { |
| | | |
| | | } |