我有一个嵌套列表,其中每个项目的列表都有一个pricereguler和一个priceafterdiscount。
如何计算总价调节器(如果priceafterdiscount==0)?所以结果是363000+158000=521000。
或如何计算总价(如果priceafterdiscount!=0)? 所以结果是这样的363000+119000=482000
@Override
public void onBindViewHolder(@NonNull AdapterHeaderCart.ViewHolder holder, int position) {
ProductCountry productCountry = productCountryList.get(position);
List<Product> productList = productCountry.getProductList();
Log.e("TAG", "onBindViewHolder: " + productList.toString());
}
E/TAG: onBindViewHolder: [{totalAllProduct=0, finalPrice=0, totalPrice=0, image='https://google.com/171212847/file.jpg', images=null, kindId=0, kind=null, description='null', weight=0, source=Source{image = 'null',name = 'Shopciety',link = 'null',id = '0',slug = 'shopciety'}, usdPriceRegular=0.0, sourceLink='null', colors=null, priceRegular=363000, sizes=null, usdPriceAfterDiscount=0, name='4D CITYSCAPE Puzzle - Game of Thrones Winterfell 3D Puzzle', attributes=null, id=141922, sourceId=0, priceAfterDiscount=0, slug='null', isFeatured=false, country='USA'}]
E/TAG: onBindViewHolder: [{totalAllProduct=0, finalPrice=0, totalPrice=0, image='https://google.com/system/media_libraries/268171710/file.jpg', images=null, kindId=0, kind=null, description='null', weight=0, source=Source{image = 'null',name = 'Shopciety',link = 'null',id = '0',slug = 'shopciety'}, usdPriceRegular=0.0, sourceLink='null', colors=null, priceRegular=158000, sizes=null, usdPriceAfterDiscount=0, name='BIOGLAN Supplement - Gummies Probiotic 50 Chocolate Balls', attributes=null, id=142095, sourceId=0, priceAfterDiscount=119000, slug='null', isFeatured=false, country='Australia'}]
1条答案
按热度按时间eagi6jfj1#
这个怎么样?