| | |
| | | package com.future.driver.ui.to_city |
| | | |
| | | import android.os.Bundle |
| | | import android.os.CountDownTimer |
| | | import android.os.Handler |
| | | import android.os.Looper |
| | | import android.view.Gravity |
| | | import android.view.View |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.utils.* |
| | |
| | | import com.future.driver.ui.DialogUtil |
| | | import com.future.driver.ui.adapter.CityOverMoneyAdapter |
| | | import com.future.driver.ui.adapter.TripItemAdapter |
| | | import com.future.driver.ui.main.FillOutActivity |
| | | import com.future.driver.ui.main.OrderOverActivity |
| | | import com.future.driver.utils.DateUtil |
| | | import com.future.driver.utils.MyUtils |
| | | import com.google.gson.Gson |
| | |
| | | import io.reactivex.schedulers.Schedulers |
| | | import kotlinx.android.synthetic.main.activity_trip_city.* |
| | | import kotlinx.android.synthetic.main.dialog_select_pay_type.view.* |
| | | import kotlinx.android.synthetic.main.dialog_sure_and_del.view.* |
| | | import kotlinx.android.synthetic.main.item_city_over.* |
| | | import kotlinx.android.synthetic.main.item_city_over.view.* |
| | | import kotlinx.android.synthetic.main.item_map_market.view.* |
| | |
| | | setTitleText("已完成") |
| | | tv_Right.text = "申请改派" |
| | | orderId = intent.getStringExtra("orderId") |
| | | |
| | | MyApplication.recordOrderId = orderId |
| | | MyApplication.recordOrderType = orderType |
| | | |
| | | recycler_view_order_list.layoutManager = LinearLayoutManager(this) |
| | | recycler_view_order_list.adapter = tripItemAdapter |
| | | callOrder() |
| | |
| | | * 全部完成 走流程 |
| | | */ |
| | | private fun allOver() { |
| | | MyApplication.currentOrderType = "" |
| | | MyApplication.currentOrderId = "" |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.FINISH_RECORD)) |
| | | if (tripItemAdapter.data.size == 0) { |
| | | toast("订单已取消") |
| | | onBackPressed() |
| | |
| | | setTitleText("已完成") |
| | | map_view.gone() |
| | | slide_btn.gone() |
| | | iv_police.gone() |
| | | iv_move.gone() |
| | | iv_to_gd.gone() |
| | | cl_over_view.visible() |
| | |
| | | } |
| | | } |
| | | return b |
| | | } |
| | | |
| | | private fun showRecordDialog(){ |
| | | val onlySureDialog = DialogUtil.getOnlySureDialog(this, "即将开始行程,\n行程中平台自动开启录音") {} |
| | | val view = DialogUtil.getView(onlySureDialog) |
| | | view.tv_view_two_base.gravity = Gravity.CENTER |
| | | view.view_hint_close_base.visibility = View.INVISIBLE |
| | | view.tv_count_timer.visible() |
| | | val timer = object: CountDownTimer(3000, 1000){ |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | view.tv_count_timer.text = "${(millisUntilFinished/1000)+1}S" |
| | | } |
| | | |
| | | override fun onFinish() { |
| | | view.tv_sure_base.callOnClick() |
| | | } |
| | | }.start() |
| | | onlySureDialog.setOnDismissListener { |
| | | timer.cancel() |
| | | } |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.START_RECORD)) |
| | | } |
| | | |
| | | private fun getAllByOrder(): String? { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private fun showMoneyTypeDialog() { |
| | | var pop = DialogUtil.getPopupwindow(this, R.layout.dialog_select_pay_type) |
| | | var payType = 1 //支付方式(1=快运平台收款,2=其他方式收款) |
| | | pop.showDown(window.decorView) |
| | | pop.contentView.tv_cancel.setOnClickListener { |
| | | pop.dismiss() |
| | | } |
| | | pop.contentView.tv_ok.setOnClickListener { |
| | | pop.dismiss() |
| | | if (payType == 1) { |
| | | callStatue(6,{ |
| | | startActivity<FillOutActivity>("orderId" to orderId, "orderType" to orderType) |
| | | finish() |
| | | }) { |
| | | |
| | | } |
| | | } else { |
| | | DialogUtil.getDelAndSureDialog(this, "请确定是否收款?", {}, { |
| | | pop.dismiss() |
| | | val map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | map["orderType"] = orderType |
| | | map["type"] = payType |
| | | callStatue(6,{ |
| | | callNet(Api.confirmFees, map) { |
| | | finish() |
| | | startActivity<OrderOverActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | | ) |
| | | } |
| | | }) { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | pop.contentView.tv_select_ok.setOnClickListener { |
| | | pop.contentView.tv_select_ok.alpha = 1f |
| | | pop.contentView.tv_select_ok.textSize = 16f |
| | | pop.contentView.tv_select_or.alpha = 0.6f |
| | | pop.contentView.tv_select_or.textSize = 14f |
| | | payType = 1 |
| | | } |
| | | pop.contentView.tv_select_or.setOnClickListener { |
| | | pop.contentView.tv_select_ok.alpha = 0.6f |
| | | pop.contentView.tv_select_ok.textSize = 14f |
| | | pop.contentView.tv_select_or.alpha = 1f |
| | | pop.contentView.tv_select_or.textSize = 16f |
| | | payType = 2 |
| | | } |
| | | } |
| | | |
| | | |
| | | /*** |
| | |
| | | changeCarFive(true) |
| | | setTitleText("服务中") |
| | | slide_btn.changeButtonText("送达乘客$orderPosition") |
| | | if (!MyApplication.isRecording) |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.START_RECORD)) |
| | | } |
| | | } |
| | | } |