| | |
| | | } |
| | | |
| | | slide_btn.onSwipeListener = { |
| | | orderBean?.let { |
| | | when (it.data.orderState) { |
| | | 2, 3, 4 -> { |
| | | var timeByLo = (DateUtil.dateToStamp( |
| | | DateUtil.TYPE0, |
| | | it.data.travelTime |
| | | ) - System.currentTimeMillis()) / 1000L |
| | | if (it.data.orderState == 2 && it.data.reservation == 2 && timeByLo > 1800L) {//判断预约单时间滑动是否有效 |
| | | toast(getString(R.string.只能在预约时间的半小时内出行)) |
| | | return@let |
| | | } |
| | | if (it.data.orderState == 4) { |
| | | if (MyApplication.getLocation() == null) { |
| | | toast(getString(R.string.定位中)) |
| | | } else { |
| | | orderBean?.let { |
| | | when (it.data.orderState) { |
| | | 2, 3, 4 -> { |
| | | var timeByLo = (DateUtil.dateToStamp( |
| | | DateUtil.TYPE0, |
| | | it.data.travelTime |
| | | ) - System.currentTimeMillis()) / 1000L |
| | | if (it.data.orderState == 2 && it.data.reservation == 2 && timeByLo > 1800L) {//判断预约单时间滑动是否有效 |
| | | toast(getString(R.string.只能在预约时间的半小时内出行)) |
| | | return@let |
| | | } |
| | | if (it.data.orderState == 4) { |
| | | // showNumDialog { num -> |
| | | it.data.orderState++ |
| | | callStatue("", it.data.orderState, { |
| | | showStatueMapUI(it) |
| | | iv_to_gd.callOnClick() |
| | | }) { |
| | | it.data.orderState-- |
| | | } |
| | | // } |
| | | } else { |
| | | it.data.orderState++ |
| | | callStatue(it.data.orderState) { |
| | | if (it.data.orderState == 3){ |
| | | it.data.orderState++ |
| | | callStatue("", it.data.orderState, { |
| | | showStatueMapUI(it) |
| | | iv_to_gd.callOnClick() |
| | | }) { |
| | | it.data.orderState-- |
| | | } |
| | | // } |
| | | } else { |
| | | it.data.orderState++ |
| | | callStatue(it.data.orderState) { |
| | | if (it.data.orderState == 3){ |
| | | iv_to_gd.callOnClick() |
| | | } |
| | | } |
| | | showStatueMapUI(it) |
| | | } |
| | | showStatueMapUI(it) |
| | | } |
| | | } |
| | | 5, 6 -> { |
| | | it.data.orderState = 6 |
| | | when (orderType) { |
| | | "2" -> { |
| | | showMoneyTypeDialog() |
| | | } |
| | | "1" -> { |
| | | callStatue(6) { |
| | | startActivity<MajorSureMoneyActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | finish() |
| | | 5, 6 -> { |
| | | it.data.orderState = 6 |
| | | when (orderType) { |
| | | "2" -> { |
| | | showMoneyTypeDialog() |
| | | } |
| | | "1" -> { |
| | | callStatue(6) { |
| | | startActivity<MajorSureMoneyActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | finish() |
| | | } |
| | | } |
| | | } |
| | | } |