| | |
| | | } |
| | | |
| | | private fun addSockectCancel() { |
| | | MyApplication.addOrderView(object : MyApplication.OrderStatueView { |
| | | override fun orderInfo(data: OrderSimpleData?) { |
| | | data?.let { |
| | | if (it.status == 10 || it.status == 12) { |
| | | Handler(Looper.getMainLooper()).post { |
| | | MyApplication.addOrderView(orderView) |
| | | } |
| | | |
| | | var orderView = object : MyApplication.OrderStatueView { |
| | | override fun orderInfo(data: OrderSimpleData?) { |
| | | data?.let { |
| | | if (it.status == 10 || it.status == 11) { |
| | | Handler(Looper.getMainLooper()).post { |
| | | if (it.status == 10){ |
| | | toast("用户已取消订单") |
| | | MyApplication.getTTsManager().setVideoText("用户已取消订单") |
| | | finish() |
| | | }else{ |
| | | toast("用户已改派订单") |
| | | MyApplication.getTTsManager().setVideoText("用户已改派订单") |
| | | } |
| | | finish() |
| | | } |
| | | } |
| | | if (it.orderType == 4 || it.orderType == 5 && it.orderId.toString() == orderId) { |
| | | Handler(Looper.getMainLooper()).post { |
| | | initView() |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | override fun finish() { |
| | | MyApplication.removeOrderView(orderView) |
| | | super.finish() |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | |
| | | } |
| | | |
| | | tv_gap_money.clickDelay { |
| | | if (orderBean.data.orderState == 12){ |
| | | toast("用户已支付差价,不能修改") |
| | | return@clickDelay |
| | | } |
| | | showGaoMoneyDialog() |
| | | } |
| | | |
| | |
| | | showStatueMapUI(it) |
| | | } |
| | | 5, 6 -> { |
| | | it.data.orderState = 6 |
| | | showChangeCargoDialog() |
| | | sendCode { |
| | | it.data.orderState = 6 |
| | | showChangeCargoDialog() |
| | | } |
| | | |
| | | } |
| | | 12 -> { |
| | | it.data.orderState = 5 |
| | |
| | | } |
| | | } |
| | | |
| | | private fun sendCode(function: () -> Unit) { |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | callNet(true,Api.sendVerificationCode, map) { |
| | | function() |
| | | } |
| | | } |
| | | |
| | | |
| | | private fun callNumberCargo(num: String, click: () -> Unit) { |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | |
| | | private fun callseatmoney(num: String, click: () -> Unit) { |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | map["difference"] = num |
| | | map["difference"] = doubleTwo(num.toDouble()) |
| | | callNet(true,Api.makeUpTheDifference, map) { |
| | | click() |
| | | } |
| | |
| | | tv_red_money.gone() |
| | | } |
| | | tv_phone.text = orderBean.data.phone |
| | | if (!it.data.differenceMoney.isNullOrEmpty() && it.data.differenceMoney.toDouble() > 0){ |
| | | tv_gap_money.text = "¥"+doubleTwo(it.data.differenceMoney.toDouble())+"差价(点击修改)" |
| | | } |
| | | showStatueMapUI(it) |
| | | } |
| | | } |
| | |
| | | callNumberCargo(num){ |
| | | dialog.dismiss() |
| | | callStartOrder(this,6){ |
| | | onBackPressed() |
| | | startActivity<SlabCargoOverActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | finish() |
| | | } |
| | | } |
| | | } |
| | |
| | | toast("请输入金额") |
| | | return@setOnClickListener |
| | | } |
| | | if (num.toDouble() > 9999) { |
| | | toast("金额不能大于9999元") |
| | | return@setOnClickListener |
| | | } |
| | | callseatmoney(num){ |
| | | dialog.dismiss() |
| | | tv_gap_money.text = "¥"+doubleTwo(num.toDouble())+"差价(点击修改)" |
| | | toast("设置成功") |
| | | } |
| | | } |