| | |
| | | import android.content.Intent |
| | | import android.view.View |
| | | import android.widget.TextView |
| | | import cn.sinata.rxnetty.LogHelper |
| | | import cn.sinata.xldutils.callPhone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.optInt |
| | |
| | | myToast(getString(R.string.请填写目的地)) |
| | | }else{ |
| | | tv_action.isEnabled = false |
| | | HttpManager.addTaxiOrder(endName,endLat,endLon,2,type,IGoApplication.lat,IGoApplication.lon, startName, |
| | | startLat,startLon,0,0, System.currentTimeMillis().toTime("yyyy-MM-dd HH:mm"), |
| | | driver.id,null,null,null,1,type).request(this,success = {_,data-> |
| | | val currentLocation = IGoApplication.getCurrentLocation() |
| | | HttpManager.addTaxiOrder( |
| | | endName, |
| | | endLat, |
| | | endLon, |
| | | 2, |
| | | type, |
| | | currentLocation.latitude, |
| | | currentLocation.longitude, |
| | | startName, |
| | | startLat, |
| | | startLon, |
| | | 0, |
| | | 0, |
| | | System.currentTimeMillis().toTime("yyyy-MM-dd HH:mm"), |
| | | driver.id, |
| | | null, |
| | | null, |
| | | null, |
| | | 1, |
| | | type |
| | | ).request(this, success = { _, data -> |
| | | data?.let { |
| | | LogHelper.logRecord("下单orderId:${it.optInt("id")} orderType:${type}") |
| | | startActivity<TripActivity>("type" to type,"id" to it.optInt("id")) |
| | | setResult(Activity.RESULT_OK) |
| | | finish() |