package com.future.dispatch.ui.order.car_manager
|
|
import com.example.oktrip.netUtls.callNet
|
import com.example.oktrip.netUtls.getMapByAny
|
import com.future.dispatch.R
|
import com.future.dispatch.base.MyBaseActivity
|
import com.future.dispatch.bean.CarDetailBean
|
import com.future.dispatch.netUtls.Api
|
import com.future.dispatch.utils.clickDelay
|
import com.future.dispatch.utils.textColor
|
import kotlinx.android.synthetic.main.activity_car_detail.*
|
import org.jetbrains.anko.startActivity
|
|
/**
|
* @ClassName CarDetailActivity
|
* @Description 川E-12345
|
* @Author Administrator
|
* @Date 2020/10/9 15:35
|
* @Version 1.0
|
*/
|
class CarDetailActivity : MyBaseActivity(){
|
|
val id by lazy {
|
intent.getStringExtra("id")
|
}
|
|
val name by lazy {
|
intent.getStringExtra("name")
|
}
|
override fun setContentView() {
|
setContentView(R.layout.activity_car_detail)
|
}
|
|
override fun initView() {
|
setTitleText(name)
|
var map = getMapByAny()
|
map["id"] = id
|
callNet(Api.queryCarInfo,map){
|
var bean = gson.fromJson<CarDetailBean>(it,CarDetailBean::class.java)
|
tv_name.text = bean.data.driver
|
if ( bean.data.driver.isNullOrEmpty()){
|
tv_name.text = "暂无"
|
}
|
tv_brank.text = bean.data.brand
|
tv_type.text = bean.data.carModel
|
tv_color.text = bean.data.color
|
if (bean.data.state == 2){
|
tv_statue.text = "营业中"
|
tv_statue.textColor(this,R.color.gray_add)
|
|
}else{
|
tv_statue.text = "空闲中"
|
tv_statue.textColor(this,R.color.end_red)
|
tv_name.clickDelay {
|
startActivity<ManagerChangeNowActivity>("carId" to id,"haveDriver" to (if(bean.data.driver.isNullOrEmpty()) "0" else "1"))
|
}
|
}
|
}
|
}
|
|
override fun setOnclick() {
|
}
|
|
override fun onRestart() {
|
super.onRestart()
|
initView()
|
}
|
|
}
|