/** * @param holder * @param youbi */ private void setDetailData(ViewHolder holder, UserYoubiDetail youbi) { String text = null; ImageViewUtil.showImage(holder.image, youbi.getUserIcon(), R.drawable.postbar_thumbimg_default); if (youbi.getBusinessType() == 1) { if (youbi.getChannel() == 1) { text = "支付宝充值" + DoubleUtil.getDoubleFormat(youbi.getAmountRmb()) + "元"; } else if (youbi.getChannel() == 2) { text = "微信充值" + DoubleUtil.getDoubleFormat(youbi.getAmountRmb()) + "元"; } } else if (youbi.getBusinessType() == 2) { text = "陪玩收入"; } else if (youbi.getBusinessType() == 3) { text = "支付陪玩"; } else if (youbi.getBusinessType() == 4) { text = "提现" + DoubleUtil.getDoubleFormat(youbi.getAmountRmb()) + "元"; } else if (youbi.getBusinessType() == 5) { if (youbi.getAmountYoubi() > 0) { text = "系统赠送"; } else { text = "系统扣除"; } } else if (youbi.getBusinessType() == 6) { text = "支付陪玩技术服务费"; } holder.paytitle.setText(text); LogUtil.d("pay", youbi.getCreateTime() + ""); holder.paytime.setText( new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(youbi.getCreateTime()))); holder.paymoney.setText(DoubleUtil.getDoubleFormat(youbi.getAmountYoubi()) + "U币"); getTradeText(youbi, holder.paystatus); }
private void getTradeText(UserYoubiDetail youbi, TextView text) { switch (youbi.getBusinessType()) { case TRADE_RECHARGE: getStatusText("充值", youbi, text); break; case TRADE_PLAY_INCOME: case TRADE_PLAY_PAY: getStatusText("交易", youbi, text); break; case TRADE_PLAY_WITHDRAW: getStatusText("提现", youbi, text); break; case TRADE_OOFICIAL: getStatusText("交易", youbi, text); break; case OFFICIA_SERVER: getStatusText("交易", youbi, text); } }
public void getStatusText(String s, UserYoubiDetail youbi, TextView tv) { String text = null; switch (youbi.getTradeStatus()) { case TRADE_DOING: tv.setTextColor(context.getResources().getColor(R.color.pay_main_top_bg)); text = "进行中"; break; case TRADE_CANCLE: text = "取消"; tv.setTextColor(context.getResources().getColor(R.color.pay_detail_status_color)); break; case TRADE_COMEPLTE: if (youbi.getBusinessType() != 6) { text = "成功"; } else { s = ""; text = "自动扣取"; } tv.setTextColor(context.getResources().getColor(R.color.pay_detail_status_color)); break; case TRADE_FAIL: if (s.equals("提现")) { text = "失败(有退款)"; } else if (s.equals("交易")) { text = "交易关闭(有退款)"; } else { text = "失败"; } tv.setTextColor(context.getResources().getColor(R.color.pay_detail_status_color)); break; default: tv.setTextColor(context.getResources().getColor(R.color.pay_main_top_bg)); text = "进行中"; break; } tv.setText(s + text); }