package com.zj365.health.adapter

import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.common.setImage
import com.zj365.health.R
import com.xty.network.model.DietaryRecuperate
import com.xty.network.model.DkBean
import com.xty.network.model.ItemDrugHealthCare

class EatAdapter : BaseAdapter<DietaryRecuperate>(R.layout.view_type_eat) {
    override fun convert(holder: BaseViewHolder, item: DietaryRecuperate) {
        holder.getView<ImageView>(R.id.image).setImage(context,item.img)
        holder.setText(R.id.tvTitle,item.name)
        var content = ""
        var meth = "【烹饪方法】"
        item.cookMethods.forEachIndexed { index, s ->
                meth += s +"\n"
        }
        content += "【药材】${item.herbs}\n" +
                "【食材】${item.food}\n" +
                meth +
                "【功效】${item.efficacy}\n" +
                "【引自】${item.reference}"
        holder.setText(R.id.tvContent,content)
    }

}