package com.dahe.pass.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.dahe.pass.R
import com.dahe.pass.bean.PassBean

/**
 * @ClassName ApplyAdapter
 * @Author 用户
 * @Date 2022/1/13 15:18
 * @Description TODO
 */
class GoneAdapter(layoutResId: Int) : BaseQuickAdapter<PassBean, BaseViewHolder>(R.layout.item_gone) {
    override fun convert(holder: BaseViewHolder, item: PassBean) {
        holder.setText(R.id.tvBh,item.passNo)
            .setText(R.id.tvCph,item.vehicle)
            .setText(R.id.tvSj,"""${item.useStartTime} 至 ${item.useEndTime}""")
            .setText(R.id.tvQd,item.startPoint)
            .setText(R.id.tvZd,item.endPoint)
            .setText(R.id.tvDs,item.transportTonnage)
            .setText(R.id.tvZl,item.itemTypeName)
            .setText(R.id.tvSjName,item.driverName)
            .setText(R.id.tvDh,item.driverPhone)
            .setText(R.id.tvStartSj,item.startTime)
            .setText(R.id.tvEndTime,item.endTime)
            .setText(R.id.tvBz,item.remarks)
            .setText(R.id.tvSfzh,item.driverIdcard)
            .setText(R.id.tvType,"""(${item.chargeType})""")
            .setTextColorRes(R.id.tvType,if (item.chargeType.contains("收费")) R.color.color_down_time else R.color.color_green)
    }
}