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.TradingBean;
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<TradingBean.RecordsBean, BaseViewHolder> {

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


    @Override
    protected void convert(BaseViewHolder helper, TradingBean.RecordsBean item) {


        helper.setText(R.id.tv_card, item.getProductName());
        helper.setText(R.id.tv_use_num, MathUtils.converData(item.getChooseNum(),3));

        helper.setText(R.id.tv_name, item.getChangePro().getName());
        helper.setText(R.id.tv_num, MathUtils.converData(item.getChangePro().getCarNum(),3));
        helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getChangePro().getCarNum() ,
                MathUtils.converData(item.getChangePro().getInternalPrice(),3), 3));
        helper.addOnClickListener(R.id.rl_upload);
        if (!TextUtils.isEmpty(item.getChangePro().getUrl())){
            helper.setText(R.id.tv_upload, item.getChangePro().getUrl().substring(1));
        }
    }
}

