package com.wd.workoffice.ui.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;

import java.util.List;

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

public class ProfitProductAdapter extends BaseQuickAdapter<OrderDetail.OrderItemsBean, BaseViewHolder> {

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

    @Override
    protected void convert(BaseViewHolder helper, OrderDetail.OrderItemsBean item) {
        helper.setText(R.id.tv_name, item.getProductName());
        helper.setText(R.id.tv_card, item.getProductSoleCode());
        helper.setText(R.id.tv_card_name, item.getProductSimpleCode());
        helper.setText(R.id.tv_spec, item.getProductSpec());
        helper.setText(R.id.tv_sale_price, "￥".concat(MathUtils.converData(item.getOuterPrice(),3)));
        helper.setText(R.id.tv_price, "￥".concat(MathUtils.converData(item.getInnerPrice(),3)));
        helper.setText(R.id.tv_all_price, "￥".concat(MathUtils.multiply(MathUtils.converData(item.getProductCount(),3),
                MathUtils.converData(item.getInnerPrice(),3),3)));
        helper.setText(R.id.tv_unit, item.getProductUnit());
        helper.setText(R.id.tv_num, MathUtils.converData(item.getProductCount(),3));
    }

}

