| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | map["orderType"] = orderType |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private fun showUi(orderBean: OrderBean?) { |
| | | orderBean?.let { |
| | | MyApplication.getTTsManager() |
| | | .setVideoText("请确认乘客车内付款后,再点击返回首页") |
| | | time = timeOver(60000 * 6) { |
| | | tv_title_slab.text = "已完成($it)" |
| | | if (it == 0) { |
| | | if (time != null) { |
| | | time!!.cancel() |
| | | } |
| | | try { |
| | | finish() |
| | | } catch (e: Exception) { |
| | | } |
| | | } |
| | | } |
| | | tv_title_slab.text = "待支付" |
| | | tv_name.text = it.data.nickName |
| | | tv_car_num.text = it.data.historyNum.toString() + "次乘车" |
| | |
| | | } |
| | | } |
| | | |
| | | private fun addSocketLisener(orderBean: OrderBean?) { |
| | | MyApplication.addOrderView(object : MyApplication.OrderStatueView { |
| | | override fun orderInfo(data: OrderSimpleData?) { |
| | | data?.let { |
| | | if (it.status == 8 || it.status == 7) { |
| | | tv_pay_result_money.textColor( |
| | | this@SlabOrderOverActivity, |
| | | R.color.slab_green_over |
| | | ) |
| | | fun overOrder(){ |
| | | callComplete() { |
| | | Handler(Looper.getMainLooper()).post { |
| | | if (isPlay) { |
| | | return@post |
| | | } |
| | | isPlay = true |
| | | MyApplication.getTTsManager() |
| | | .setVideoText("乘客已支付" + orderBean?.data?.orderMoney.toString() + "元") |
| | | time = timeOver(20000) { |
| | | tv_title_slab.text = "已完成($it)" |
| | | if (it == 0) { |
| | | if (time != null) { |
| | | time!!.cancel() |
| | | } |
| | | try { |
| | | onBackPressed() |
| | | } catch (e: Exception) { |
| | | time?.cancel() |
| | | time?.onFinish() |
| | | finish() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // android.os.Handler(Looper.getMainLooper()).post { |
| | | // orderBean.data.orderState = 8 |
| | | // showUi(orderBean) |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | // if (handler == null) { |
| | | // handler = android.os.Handler(mainLooper) |
| | | // handler!!.postDelayed({ |
| | | // checkOrderStatue() |
| | | // }, 3000) |
| | | // } |
| | | } |
| | | |
| | | var handler: Handler? = null |
| | |
| | | tv_to_main.visible() |
| | | MyApplication.getTTsManager() |
| | | .setVideoText("乘客已支付" + orderBean.data?.orderMoney.toString() + "元") |
| | | time?.cancel() |
| | | time = timeOver(20000) { |
| | | tv_title_slab.text = "已完成($it)" |
| | | if (it == 0) { |
| | |
| | | time!!.cancel() |
| | | } |
| | | try { |
| | | onBackPressed() |
| | | finish() |
| | | } catch (e: Exception) { |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | tv_complete.clickDelay { |
| | | callComplete() { |
| | | tv_complete.gone() |
| | | tv_to_main.visible() |
| | | tv_pay_result_money.textColor( |
| | | this@SlabOrderOverActivity, |
| | | R.color.slab_green_over |
| | | ) |
| | | Handler(Looper.getMainLooper()).post { |
| | | if (isPlay) { |
| | | return@post |
| | | } |
| | | isPlay = true |
| | | MyApplication.getTTsManager() |
| | | .setVideoText("乘客已支付" + orderBean.data?.orderMoney.toString() + "元") |
| | | time = timeOver(20000) { |
| | | tv_title_slab.text = "已完成($it)" |
| | | if (it == 0) { |
| | | if (time != null) { |
| | | time!!.cancel() |
| | | } |
| | | try { |
| | | onBackPressed() |
| | | } catch (e: Exception) { |
| | | overOrder() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | overOrder() |
| | | } |
| | | |
| | | private fun callComplete(function: () -> Unit) { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private fun addSocketLisener(orderBean: OrderBean?) { |
| | | MyApplication.addOrderView(object : MyApplication.OrderStatueView { |
| | | override fun orderInfo(data: OrderSimpleData?) { |
| | | data?.let { |
| | | if (it.status == 8 || it.status == 7) { |
| | | tv_pay_result_money.textColor( |
| | | this@SlabOrderOverActivity, |
| | | R.color.slab_green_over |
| | | ) |
| | | Handler(Looper.getMainLooper()).post { |
| | | if (isPlay) { |
| | | return@post |
| | | } |
| | | isPlay = true |
| | | MyApplication.getTTsManager() |
| | | .setVideoText("乘客已支付" + orderBean?.data?.orderMoney.toString() + "元") |
| | | time = timeOver(20000) { |
| | | tv_title_slab.text = "已完成($it)" |
| | | if (it == 0) { |
| | | if (time != null) { |
| | | time!!.cancel() |
| | | } |
| | | try { |
| | | finish() |
| | | } catch (e: Exception) { |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // android.os.Handler(Looper.getMainLooper()).post { |
| | | // orderBean.data.orderState = 8 |
| | | // showUi(orderBean) |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | // if (handler == null) { |
| | | // handler = android.os.Handler(mainLooper) |
| | | // handler!!.postDelayed({ |
| | | // checkOrderStatue() |
| | | // }, 3000) |
| | | // } |
| | | } |
| | | |
| | | } |