package xn.hxp.ui.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import xn.hxp.R
import com.rc.httpcore.bean.QueryTwoListBean
import xn.hxp.weidith.TextTool

class UesItemDetail :
    BaseQuickAdapter<QueryTwoListBean, BaseViewHolder>(R.layout.item_ues_details) {

    override fun convert(holder: BaseViewHolder, item: QueryTwoListBean) {
        holder.setText(R.id.tagCode, "${item.tagCode}")
        val tagCodeTV = holder.getView<TextView>(R.id.tagCode)
        tagCodeTV.setOnClickListener {
            TextTool.showPop(context, tagCodeTV)
        }
        holder.setText(R.id.specNum, "${item.specNum}${item.specUnit}/${item.packUnit}")
        holder.setText(R.id.surplus, "${item.surplus}${item.specUnit}")
        holder.setText(R.id.belongName, "${item.belongName}")
        holder.setText(R.id.storage, "${item.cabinetName}-${item.doorName}-${item.layers}层")
        val storageTV = holder.getView<TextView>(R.id.storage)
        storageTV.setOnClickListener {
            TextTool.showPop(context, storageTV)
        }
        if (item.statusStr != null) {
            holder.setText(R.id.statusStr, "${item.statusStr}")
        }

    }
}