package com.zj365.health.adapter

import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R
import com.xty.network.model.BloodBean

class BloodInfoAdapter(var unit: String = "", var type: Int = 0) :
    BaseAdapter<BloodBean>(R.layout.item_blood_info) {
    override fun convert(holder: BaseViewHolder, item: BloodBean) {
        holder.setText(R.id.mTime, item.measuringTime)
        when (type) {
            1 ->
                holder.setText(R.id.m1, "${item.dbp}/${item.sbp}$unit")
            2 ->
                holder.setText(R.id.m1, "${item.measuringNum}$unit")
        }

        holder.setText(R.id.m2, item.type)

    }
}