package com.dahe.gldriver.adapter

import android.content.Context
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.gldriver.R
import com.dahe.gldriver.bean.DriverBean
import com.dahe.gldriver.bean.InviteRecord
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.utils.ImageLoader

/**
 * @ClassName WaybillAdapter
 * @Author 用户
 * @Date 2024/1/23 16:27
 * @Description TODO
 */
class InviteRecordAdapter() :
    BaseQuickAdapter<InviteRecord, QuickViewHolder>() {
    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: InviteRecord?) {
        item?.let {
            holder.run {
                setText(R.id.tvTime,it.createTime)
                setText(R.id.tvContent, """${if (it.joinStatus=="0")"邀请" else ""}${it.driverName} ${it.driverPhone} ${if (it.joinStatus=="2") "拒绝加入车队" else "加入车队"}""")
                setText(R.id.tvReason,it.reason)


                setGone(R.id.tvReason,it.joinStatus!="2")



            }
        }
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): QuickViewHolder {
        // 返回一个 ViewHolder
        return QuickViewHolder(R.layout.item_invite_record, parent)
    }
}