Pu Zhibing
2025-12-11 ab0c19e49fabdb8cc6eea454ea455bce2efbb718
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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)
//                }
            }
        }
    }
 
}