| | |
| | | package com.okgoincar.slab |
| | | |
| | | import android.content.Context |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import android.os.Handler |
| | |
| | | import kotlinx.android.synthetic.main.dialog_select_pay_type.view.* |
| | | import kotlinx.android.synthetic.main.dialog_sure_and_del_slab.view.* |
| | | import kotlinx.android.synthetic.main.item_map_market.view.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | |
| | | class SlabTripActivity : MySlabBaseActivity() { |
| | | |
| | | private fun callOver(contexts: Context, travelFee:Double){ |
| | | if (MyApplication.currentOrderId.isEmpty()){ |
| | | cn.sinata.xldutils.utils.toast("没有进行中的订单,无法结束") |
| | | return |
| | | } |
| | | var map = getMapByAny() |
| | | map["orderId"] = MyApplication.currentOrderId |
| | | map["orderType"] = MyApplication.currentOrderType |
| | | map["travelFee"] = travelFee |
| | | map["lat"] = MyApplication.getLocation().latitude |
| | | map["lon"] = MyApplication.getLocation().longitude |
| | | map["type"] = 1 |
| | | callNet(contexts,Api.confirmFees_,map){ |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.SURE_MONEY)) |
| | | } |
| | | |
| | | } |
| | | |
| | | private fun callStatue(contexts: Context, i: Int) { |
| | | if (MyApplication.currentOrderId.isEmpty()){ |
| | | cn.sinata.xldutils.utils.toast("没有进行中的订单,无法开始") |
| | | return |
| | | } |
| | | var map = getMapByAny() |
| | | map["orderId"] = MyApplication.currentOrderId |
| | | map["orderType"] = MyApplication.currentOrderType |
| | | map["state"] = i |
| | | map["lat"] = MyApplication.getLocation().latitude |
| | | map["lon"] = MyApplication.getLocation().longitude |
| | | callNet(contexts, Api.process, map) { |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.UP_TRIP)) |
| | | } |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * // 流程操作状态(3=开始出发预约点,4=到达预约点,5=开始服务,6=服务结束) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private fun onclick() { |
| | | btn_start.clickDelay { |
| | | callStatue(this,5) |
| | | } |
| | | |
| | | btn_end.clickDelay { |
| | | callOver(this,10.0) |
| | | } |
| | | |
| | | tv_change.clickDelay { |
| | | changeMode() |
| | | } |
| | |
| | | } |
| | | |
| | | BaseEvent.SURE_MONEY -> { |
| | | startActivity<SlabOrderOverActivity>("orderId" to orderBean.data.orderId.toString() , "orderType" to orderBean.data.type.toString()) |
| | | startActivity<SlabOrderOverActivity>("orderId" to orderBean.data.orderId.toString() , "orderType" to "2") |
| | | finish() |
| | | } |
| | | } |