package com.wd.workoffice.ui.adapter;


import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.mesBean.TicketBean;
import com.wd.workoffice.bean.mesBean.UserDataBean;

import org.greenrobot.greendao.annotation.Id;

import java.util.List;

import flexible.xd.android_base.utils.TimeUtils;

/**
 * Created by flexible on 2018/8/13.
 */

public class MesUserDataAdapter extends BaseQuickAdapter<UserDataBean.ListBean, BaseViewHolder> {

    public MesUserDataAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, UserDataBean.ListBean item) {
        helper.setText(R.id.tv_time, item.getFeedbackDateTime());
        helper.setText(R.id.tv_client, item.getCustomerUserName());
        helper.setText(R.id.tv_factory, item.getSteelmakingWorksName());
        helper.setText(R.id.tv_machine, item.getContinuousCasterName());
        if (item.getApprovalStatus() != null) {
            switch (item.getApprovalStatus()) {
                case 0:
                    helper.setTextColor(R.id.tv_status, Color.parseColor("#FF6AA3D4"));
                    helper.setText(R.id.tv_status, "未审核");
                    break;
                case 1:
                    helper.setTextColor(R.id.tv_status, Color.parseColor("#FF349A85"));
                    helper.setText(R.id.tv_status, "已通过");
                    break;
                case 2:
                    helper.setTextColor(R.id.tv_status, Color.parseColor("#FFB84D4D"));
                    helper.setText(R.id.tv_status, "已驳回");
                    break;
                default:
                    helper.setTextColor(R.id.tv_status, Color.parseColor("#FF6AA3D4"));
                    helper.setText(R.id.tv_status, "未审核");
                    break;
            }
        }else {
            helper.setTextColor(R.id.tv_status, Color.parseColor("#FF6AA3D4"));
            helper.setText(R.id.tv_status, "未审核");
        }
    }
}

