| | |
| | | // } |
| | | } |
| | | |
| | | ImageUtil.showImageFace(mContext, info.getTitle(), info.getShopType(), viewHolder.tv_name); |
| | | viewHolder.tv_price.setText("¥" + info.getZkPrice()); |
| | | viewHolder.tv_price.setPaintFlags(viewHolder.tv_price.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); |
| | | if (viewHolder.tv_name != null) |
| | | ImageUtil.showImageFace(mContext, info.getTitle(), info.getShopType(), viewHolder.tv_name); |
| | | if (viewHolder.tv_price != null) { |
| | | viewHolder.tv_price.setText("¥" + info.getZkPrice()); |
| | | viewHolder.tv_price.setPaintFlags(viewHolder.tv_price.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); |
| | | } |
| | | |
| | | if (info.getGoodsType() != Constant.GOODS_TYPE_VIP) { |
| | | viewHolder.tv_sale_num.setText(info.getSalesType() == 1 ? "月销 " + info.getSalesCount() : |
| | | info.getSalesType() == 2 ? "2小时销量 " + info.getSalesCount() : info.getSalesType() == 3 ? |
| | | "今日销量 " + info.getSalesCount() : "总销量 " + info.getSalesCount()); |
| | | } else { |
| | | viewHolder.tv_sale_num.setText(""); |
| | | if (viewHolder.tv_sale_num != null) { |
| | | if (info.getGoodsType() != Constant.GOODS_TYPE_VIP) { |
| | | viewHolder.tv_sale_num.setText(info.getSalesType() == 1 ? "月销 " + info.getSalesCount() : |
| | | info.getSalesType() == 2 ? "2小时销量 " + info.getSalesCount() : info.getSalesType() == 3 ? |
| | | "今日销量 " + info.getSalesCount() : "总销量 " + info.getSalesCount()); |
| | | } else { |
| | | viewHolder.tv_sale_num.setText(""); |
| | | } |
| | | } |
| | | |
| | | // info.setShopInfo(null); |
| | |
| | | } |
| | | |
| | | //返利 |
| | | if (info.getMoneyInfo().getFanliMoney() != null) { |
| | | viewHolder.tv_fanli_amount.setText("-" + info.getMoneyInfo().getFanliMoney()); |
| | | viewHolder.tv_fanli_amount.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.tv_fanli_amount.setVisibility(View.GONE); |
| | | if (viewHolder.tv_fanli_amount != null) { |
| | | if (info.getMoneyInfo().getFanliMoney() != null) { |
| | | viewHolder.tv_fanli_amount.setText("-" + info.getMoneyInfo().getFanliMoney()); |
| | | viewHolder.tv_fanli_amount.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.tv_fanli_amount.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | if (info.getMoneyInfo().getHongBaoMoney() != null) { |
| | | viewHolder.tv_hongbao_amount.setText("-" + info.getMoneyInfo().getHongBaoMoney()); |
| | | viewHolder.tv_hongbao_amount.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.tv_hongbao_amount.setVisibility(View.GONE); |
| | | if (viewHolder.tv_hongbao_amount != null) { |
| | | if (info.getMoneyInfo().getHongBaoMoney() != null) { |
| | | viewHolder.tv_hongbao_amount.setText("-" + info.getMoneyInfo().getHongBaoMoney()); |
| | | viewHolder.tv_hongbao_amount.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.tv_hongbao_amount.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | String disCount = info.getMoneyInfo().getFinalMoney(); |
| | | if (info.isHasCoupon()) { |
| | | if (StringUtils.isNullOrEmpty(disCount)) |
| | | disCount = "¥" + info.getCouponPrice(); |
| | | viewHolder.tv_coupon_amount.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_coupon_amount.setText("-¥" + info.getCouponInfo().getAmount()); |
| | | } else { |
| | | if (StringUtils.isNullOrEmpty(disCount)) |
| | | if (info.getGoodsType() == Constant.GOODS_TYPE_VIP) { |
| | | if (viewHolder.tv_coupon_amount != null) { |
| | | if (info.isHasCoupon()) { |
| | | if (StringUtils.isNullOrEmpty(disCount)) |
| | | disCount = "¥" + info.getCouponPrice(); |
| | | } else |
| | | disCount = "¥" + info.getZkPrice(); |
| | | viewHolder.tv_coupon_amount.setVisibility(View.GONE); |
| | | viewHolder.tv_coupon_amount.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_coupon_amount.setText("-¥" + info.getCouponInfo().getAmount()); |
| | | } else { |
| | | if (StringUtils.isNullOrEmpty(disCount)) |
| | | if (info.getGoodsType() == Constant.GOODS_TYPE_VIP) { |
| | | disCount = "¥" + info.getCouponPrice(); |
| | | } else |
| | | disCount = "¥" + info.getZkPrice(); |
| | | viewHolder.tv_coupon_amount.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | int startIndex = disCount.indexOf("."); |
| | | if (startIndex > -1) { |
| | | viewHolder.tv_actual_price1.setText(disCount.substring(0, startIndex + 1)); |
| | | |
| | | |
| | | viewHolder.tv_actual_price2.setText(disCount.substring(startIndex + 1)); |
| | | if (viewHolder.tv_actual_price1 != null) |
| | | viewHolder.tv_actual_price1.setText(disCount.substring(0, startIndex + 1)); |
| | | if (viewHolder.tv_actual_price2 != null) |
| | | viewHolder.tv_actual_price2.setText(disCount.substring(startIndex + 1)); |
| | | } else { |
| | | viewHolder.tv_actual_price2.setText(""); |
| | | viewHolder.tv_actual_price1.setText(disCount); |
| | | if (viewHolder.tv_actual_price2 != null) |
| | | viewHolder.tv_actual_price2.setText(""); |
| | | if (viewHolder.tv_actual_price1 != null) |
| | | viewHolder.tv_actual_price1.setText(disCount); |
| | | } |
| | | |
| | | SpannableString spannableString = new SpannableString(viewHolder.tv_actual_price1.getText()); |
| | | spannableString.setSpan(new RelativeSizeSpan(0.5f), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | viewHolder.tv_actual_price1.setText(spannableString); |
| | | if (viewHolder.tv_actual_price1 != null) { |
| | | SpannableString spannableString = new SpannableString(viewHolder.tv_actual_price1.getText()); |
| | | spannableString.setSpan(new RelativeSizeSpan(0.5f), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | viewHolder.tv_actual_price1.setText(spannableString); |
| | | } |
| | | |
| | | |
| | | viewHolder.tv_sale_num.setTextColor((info.getSalesType() == 1 || info.getSalesType() == 4) ? |
| | | mContext.getResources().getColor(R.color.gray5) : info.getSalesType() == 2 ? |
| | | mContext.getResources().getColor(R.color.goods_sale_num_text_color_orange) : |
| | | mContext.getResources().getColor(R.color.goods_sale_num_text_color_blue)); |
| | | if (viewHolder.tv_sale_num != null) |
| | | viewHolder.tv_sale_num.setTextColor((info.getSalesType() == 1 || info.getSalesType() == 4) ? |
| | | mContext.getResources().getColor(R.color.gray5) : info.getSalesType() == 2 ? |
| | | mContext.getResources().getColor(R.color.goods_sale_num_text_color_orange) : |
| | | mContext.getResources().getColor(R.color.goods_sale_num_text_color_blue)); |
| | | } |
| | | |
| | | } |