package com.igo.user.ui.mine
|
|
import android.view.View
|
import android.widget.LinearLayout
|
import android.widget.TextView
|
import cn.sinata.xldutils.callPhone
|
import com.facebook.drawee.view.SimpleDraweeView
|
import com.igo.user.R
|
import com.igo.user.network.HttpManager
|
import com.igo.user.network.request
|
import com.igo.user.ui.TransparentStatusBarActivity
|
import org.jetbrains.anko.find
|
|
class LogisticsOrderDetailActivity : TransparentStatusBarActivity() {
|
override fun setContentView() = R.layout.activity_logistics_detail
|
|
private val id by lazy {
|
intent.getIntExtra("id",0)
|
}
|
|
override fun initClick() {
|
}
|
|
private val tv_start by lazy { find<TextView>(R.id.tv_start) }
|
private val tv_end by lazy { find<TextView>(R.id.tv_end) }
|
private val tv_time by lazy { find<TextView>(R.id.tv_time) }
|
private val iv_header_home by lazy { find<SimpleDraweeView>(R.id.iv_header_home) }
|
private val tv_name by lazy { find<TextView>(R.id.tv_name) }
|
private val tv_car_info by lazy { find<TextView>(R.id.tv_car_info) }
|
private val tv_score by lazy { find<TextView>(R.id.tv_score) }
|
private val tv_count by lazy { find<TextView>(R.id.tv_count) }
|
private val iv_call by lazy { find<View>(R.id.iv_call) }
|
private val tv_money by lazy { find<TextView>(R.id.tv_money) }
|
private val ll_detail by lazy { find<LinearLayout>(R.id.ll_detail) }
|
|
|
override fun initView() {
|
title = getString(R.string.订单详情)
|
// titleBar.addRightButton(getString(R.string.开收据),onClickListener = View.OnClickListener {
|
// startActivity<InvokeActivity>()
|
// })
|
showDialog()
|
getData()
|
}
|
|
private fun getData(){
|
HttpManager.queryOrderInfo(id,4).request(this){ _, data->
|
data?.run {
|
tv_start.text = startAddress
|
tv_end.text = endAddress
|
tv_time.text = travelTime
|
iv_header_home.setImageURI(driverAvatar)
|
tv_name.text = "$driverName $licensePlate"
|
tv_car_info.text = "$brand·$carColor"
|
tv_score.text = String.format("%.1f",score)
|
tv_count.text = getString(R.string.单数,orderNum)
|
iv_call.setOnClickListener {
|
callPhone(driverPhone)
|
}
|
tv_money.text = getString(R.string.money_is,payMoney)
|
val view = layoutInflater.inflate(R.layout.item_price_detail, null)
|
view.find<TextView>(R.id.tv_name).text = getString(R.string.里程费及公里数,mileage).replace(",",".")
|
view.find<TextView>(R.id.tv_price).text = getString(R.string.money_is,mileageMoney)
|
ll_detail.addView(view)
|
// if (differenceMoney!=0.0){
|
val view1 = layoutInflater.inflate(R.layout.item_price_detail, null)
|
view1.find<TextView>(R.id.tv_name).text = getString(R.string.补差价)
|
view1.find<TextView>(R.id.tv_price).text = getString(R.string.money_is,differenceMoney)
|
ll_detail.addView(view1)
|
// }
|
// if (couponMoney!=0.0){
|
val view2 = layoutInflater.inflate(R.layout.item_price_detail, null)
|
view2.find<TextView>(R.id.tv_name).text = getString(R.string.优惠券)
|
view2.find<TextView>(R.id.tv_price).text = getString(R.string.money_is,couponMoney)
|
ll_detail.addView(view2)
|
// }
|
}
|
}
|
}
|
|
}
|