| | |
| | | import android.widget.ImageView |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.utils.* |
| | | import com.google.android.gms.maps.model.LatLng |
| | | import com.google.android.gms.maps.model.Marker |
| | | import com.driver.igotrip.R |
| | | import com.driver.igotrip.base.BaseEvent |
| | | import com.driver.igotrip.base.Const |
| | |
| | | import com.driver.igotrip.ui.DialogUtil |
| | | import com.driver.igotrip.ui.UiUtil |
| | | import com.driver.igotrip.ui.main.ReassignActivity |
| | | import com.driver.igotrip.ui.main.major.MajorSureMoneyActivity |
| | | import com.driver.igotrip.utils.DateUtil |
| | | import com.driver.igotrip.utils.MyUtils |
| | | import com.driver.igotrip.utils.view.SlidingButton |
| | | import com.google.android.gms.maps.GoogleMap |
| | | import com.google.android.gms.maps.SupportMapFragment |
| | | import com.google.android.gms.maps.model.LatLng |
| | | import com.google.android.gms.maps.model.Marker |
| | | import com.google.android.gms.maps.model.Polyline |
| | | import com.google.gson.Gson |
| | | import com.trello.rxlifecycle3.android.ActivityEvent |
| | |
| | | import io.reactivex.android.schedulers.AndroidSchedulers |
| | | import io.reactivex.disposables.Disposable |
| | | import io.reactivex.schedulers.Schedulers |
| | | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.find |
| | | import org.jetbrains.anko.startActivity |
| | |
| | | when (it.data.orderState) { |
| | | 2, 3, 4 -> { |
| | | if (it.data.orderState == 4) { |
| | | // showNumDialog { num -> |
| | | if (orderType == "4") { |
| | | DialogUtil.getDelAndSureDialog( |
| | | this, |
| | | getString(R.string.确认现金金额).format(it.data.expressPayAllMoney) |
| | | .replace(",", "."), |
| | | {}, |
| | | { |
| | | it.data.orderState++ |
| | | callStatue("1", it.data.orderState) { |
| | | iv_to_gd.callOnClick() |
| | | } |
| | | showStatueMapUI(it) |
| | | // } |
| | | }) |
| | | } else { |
| | | it.data.orderState++ |
| | | callStatue("1", it.data.orderState) { |
| | | iv_to_gd.callOnClick() |
| | | } |
| | | showStatueMapUI(it) |
| | | } |
| | | } else { |
| | | it.data.orderState++ |
| | | callStatue(it.data.orderState, "") { |
| | |
| | | if (it.data.driverPay == "1") { |
| | | tv_money.visible() |
| | | tv_money.text = |
| | | getString(R.string.确认现金金额).format(if (it.data.payMoney == 0.0) it.data.orderMoney else it.data.payMoney) |
| | | getString(R.string.确认现金金额).format(if (orderType == "4") it.data.expressPayAllMoney else if (it.data.payMoney == 0.0) it.data.orderMoney else it.data.payMoney) |
| | | .replace(",", ".") |
| | | } |
| | | tv_sure_car_num.setOnClickListener { |
| | |
| | | map["state"] = i |
| | | if (!num.isNullOrEmpty()) |
| | | map["pickUpCode"] = num |
| | | Log.e("定位==============》", "${MyApplication.getLocation()?.latitude},${MyApplication.getLocation()?.longitude}") |
| | | Log.e( |
| | | "定位==============》", |
| | | "${MyApplication.getLocation()?.latitude},${MyApplication.getLocation()?.longitude}" |
| | | ) |
| | | map["lat"] = MyApplication.getLocation()?.latitude ?: 0.0 |
| | | map["lon"] = MyApplication.getLocation()?.longitude ?: 0.0 |
| | | callNet(Api.process, map) { |
| | |
| | | 2, 3 -> { |
| | | changeCarThree(false) |
| | | } |
| | | |
| | | 4->{ |
| | | //getTripInfo(4,false) |
| | | changeCarThree(false) |
| | | } |
| | | |
| | | 5, 6 -> { |
| | | changeCarFive(false) |
| | | } |
| | |
| | | showUi(orderBean) |
| | | function() |
| | | if (reNavi){ |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.RELOAD_NAVI,orderBean!!.data.endLat.toString(),orderBean!!.data.endLon.toString())) |
| | | EventBus.getDefault().post( |
| | | BaseEvent( |
| | | BaseEvent.RELOAD_NAVI, |
| | | orderBean!!.data.endLat.toString(), |
| | | orderBean!!.data.endLon.toString() |
| | | ) |
| | | ) |
| | | } |
| | | } |
| | | } |
| | |
| | | // tv_money_cargo.gone() |
| | | // } |
| | | if (!it.data.differenceMoney.isNullOrEmpty() && it.data.differenceMoney.toDouble() > 0) { |
| | | btn_gap_money.text = getString(R.string.差价点击修改).format(it.data.differenceMoney.toDouble()) |
| | | btn_gap_money.text = |
| | | getString(R.string.差价点击修改).format(it.data.differenceMoney.toDouble()) |
| | | btn_gap_money.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0) |
| | | } |
| | | var latLngList = mutableListOf<LatLng>() |
| | |
| | | MyApplication.currentOrderType = "" |
| | | finish() |
| | | } |
| | | |
| | | BaseEvent.BACK_CAR_OVER -> { |
| | | finish() |
| | | } |
| | | |
| | | BaseEvent.DIFF_PRICE_AGREE -> { |
| | | if (mapInitStatus) initView2() |
| | | } |
| | | |
| | | BaseEvent.DIFF_PRICE_REFUSE -> { |
| | | btn_gap_money.text = getString(R.string.补差价) |
| | | btn_gap_money.setCompoundDrawablesRelativeWithIntrinsicBounds(R.mipmap.ic_add,0,0,0) |
| | | btn_gap_money.setCompoundDrawablesRelativeWithIntrinsicBounds( |
| | | R.mipmap.ic_add, |
| | | 0, |
| | | 0, |
| | | 0 |
| | | ) |
| | | } |
| | | |
| | | BaseEvent.MODIFY_ADDRESS_SUC -> { |
| | | callOrder(true){} |
| | | } |