package com.zhaoyang.driver.ui.main
|
|
import cn.sinata.xldutils.utils.clickDelay
|
import cn.sinata.xldutils.utils.getContent
|
import com.zhaoyang.driver.R
|
import com.zhaoyang.driver.base.MyBaseActivity
|
import com.zhaoyang.driver.netUtls.Api
|
import com.zhaoyang.driver.netUtls.callNet
|
import com.zhaoyang.driver.netUtls.getMapByAny
|
import kotlinx.android.synthetic.main.activity_fill_out.*
|
import org.jetbrains.anko.startActivity
|
import org.jetbrains.anko.toast
|
|
class FillOutActivity: MyBaseActivity() {
|
|
val orderType by lazy {
|
intent.getStringExtra("orderType")
|
}
|
|
val orderId by lazy {
|
intent.getStringExtra("orderId")
|
}
|
|
|
override fun setContentView() {
|
setContentView(R.layout.activity_fill_out)
|
}
|
|
override fun initView() {
|
setTitleText("填写费用")
|
}
|
|
override fun setOnclick() {
|
tv_sure.clickDelay {
|
if (et_travel_money.getContent().isEmpty()){
|
toast("请填写全部费用")
|
return@clickDelay
|
}
|
val map = getMapByAny()
|
map["orderId"] = orderId
|
map["orderType"] = orderType
|
if (et_crossing_money.getContent().isNotEmpty()){
|
map["crossingFee"] = et_crossing_money.getContent()
|
}else{
|
map["crossingFee"] = "0"
|
}
|
if (et_parking_money.getContent().isNotEmpty()){
|
map["parkingFee"] = et_parking_money.getContent()
|
}else{
|
map["parkingFee"] = "0"
|
}
|
map["travelFee"] = et_travel_money.getContent()
|
map["type"] = 1
|
callNet(Api.confirmFees, map) {
|
startActivity<OrderOverActivity>("orderId" to orderId, "orderType" to orderType)
|
finish()
|
}
|
}
|
}
|
}
|