18034727885
6 天以前 9ce248f0287e566b26fa73e795599ed27fdea24c
app/src/main/java/com/fuban/driver/ui/main/TripActivity.kt
@@ -86,27 +86,27 @@
    private fun addSockectCancel() {
        checkOrderStatue()
        MyApplication.addOrderView(object : MyApplication.OrderStatueView {
            override fun orderInfo(data: OrderSimpleData?) {
                data?.let {
                    when(it.orderType){
                        1,2,3 -> {
                            if (it.status == 10 || it.status == 12) {
                                Handler(Looper.getMainLooper()).post {
                                    toast("用户已取消订单")
                                    MyApplication.getTTsManager().setVideoText("用户已取消订单")
                                    MyApplication.currentOrderType = ""
                                    MyApplication.currentOrderId = ""
                                    finish()
                                }
                            }
        MyApplication.addOrderView(listener)
    }
private val listener=object : MyApplication.OrderStatueView {
    override fun orderInfo(data: OrderSimpleData?) {
        data?.let {
            when(it.orderType){
                1,2,3 -> {
                    if (it.status == 10 || it.status == 12) {
                        Handler(Looper.getMainLooper()).post {
                            toast("用户已取消订单")
                            MyApplication.getTTsManager().setVideoText("用户已取消订单")
                            MyApplication.currentOrderType = ""
                            MyApplication.currentOrderId = ""
                            finish()
                        }
                    }
                }
            }
        })
        }
    }
}
    var handler: Handler? = null
    fun checkOrderStatue() {
        var map = getMapByAny()
@@ -601,6 +601,7 @@
            handler?.removeCallbacksAndMessages(null)
        }
        closeTimeStart()
        MyApplication.removeOrderView(listener)
    }