package com.lukouguoji.gjc.holder

import android.view.View
import com.lukouguoji.gjc.databinding.ItemAssembleWaybillBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.AssembleWaybillBean

/**
 * 运单列表ViewHolder
 */
class AssembleWaybillViewHolder(view: View) :
    BaseViewHolder<AssembleWaybillBean, ItemAssembleWaybillBinding>(view) {

    override fun onBind(item: Any?, position: Int) {
        val bean = getItemBean(item) ?: return
        binding.bean = bean
        binding.position = position

        // 点击整行触发选择事件（单选模式，通过回调处理）
        itemView.setOnClickListener {
            clickListener?.onItemClick(position, 1)  // type=1表示运单列表点击
        }

        binding.executePendingBindings()
    }
}
