| | |
| | | import com.okgoincar.base.AMapKit.initMap |
| | | import com.okgoincar.base.AMapKit.moveCamera |
| | | import com.okgoincar.base.BaseEvent |
| | | import com.okgoincar.base.MoneyBroadCastReceiver |
| | | import com.okgoincar.base.MyApplication |
| | | import com.okgoincar.base.gpsnav.GPSNaviActivity |
| | | import com.okgoincar.bean.OrderBean |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | import java.lang.Exception |
| | | 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)) |
| | | } |
| | | |
| | | MoneyBroadCastReceiver.callOver(contexts, travelFee) |
| | | } |
| | | |
| | | 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)) |
| | | } |
| | | MoneyBroadCastReceiver.callStatue(contexts, i) |
| | | } |
| | | |
| | | |
| | |
| | | if (it.status == 10 || it.status == 12) { |
| | | Handler(Looper.getMainLooper()).post { |
| | | toast("用户已取消订单") |
| | | MyApplication.getTTsManager().setVideoText("用户已取消订单") |
| | | MyApplication.currentOrderType = "" |
| | | MyApplication.currentOrderId = "" |
| | | finish() |
| | |
| | | tv_change.setBackgroundResource(R.drawable.bg_login) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private fun onclick() { |
| | |
| | | } |
| | | |
| | | BaseEvent.SURE_MONEY -> { |
| | | startActivity<SlabOrderOverActivity>("orderId" to orderBean.data.orderId.toString() , "orderType" to "2") |
| | | startActivity<SlabOrderOverActivity>( |
| | | "orderId" to orderBean.data.orderId.toString(), |
| | | "orderType" to "2" |
| | | ) |
| | | finish() |
| | | } |
| | | BaseEvent.ERROR_INFO -> { |
| | | onBackPressed() |
| | | } |
| | | } |
| | | } |
| | | } |