package com.wd.workoffice.ui.adapter;


import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.widget.EditText;

import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceView;

import org.greenrobot.eventbus.EventBus;

import java.util.List;

import flexible.xd.android_base.utils.ToastUtil;

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

public class TradingConfimProAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {

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


    @Override
    protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getName());
        helper.setText(R.id.tv_num, String.valueOf(item.getCarNum()));
        helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() , MathUtils.converData(item.getInternalPrice(),3), 3));
        helper.addOnClickListener(R.id.rl_upload);
        if (!TextUtils.isEmpty(item.getUrl())){
            helper.setText(R.id.tv_upload, "已上传，点击替换");
        }
    }
}

