| | |
| | | import androidx.lifecycle.lifecycleScope |
| | | import com.dayu.baselibrary.net.subscribers.SubscriberListener |
| | | import com.dayu.baselibrary.tools.nfc.NFCCallBack |
| | | import com.dayu.baselibrary.utils.MornyUtil |
| | | import com.dayu.baselibrary.utils.ToastUtil |
| | | import com.dayu.general.bean.card.ClearCard |
| | | import com.dayu.general.bean.card.UserCard |
| | |
| | | textData.append("工本费:" + cardFee + "元\n") |
| | | } |
| | | if (userCard.balance != 0) { |
| | | textData.append("充值金额:" + userCard.balance + "元") |
| | | textData.append("充值金额:" + MornyUtil.changeF2Y(userCard.balance) + "元") |
| | | } |
| | | |
| | | binding?.cardData?.text = textData.toString() |
| | |
| | | |
| | | // 显示充值金额 |
| | | if (rechargeAmount > 0) { |
| | | textData.append("充值金额:" + String.format("%.2f", rechargeAmount) + "元\n") |
| | | textData.append( |
| | | "充值金额:" + String.format( |
| | | "%.2f", |
| | | rechargeAmount |
| | | ) + "元\n" |
| | | ) |
| | | } |
| | | |
| | | // 显示赠送金额 |
| | |
| | | // 显示总金额(写入卡内的总余额) |
| | | if (userCard.balance != 0) { |
| | | val totalBalanceInYuan = userCard.balance / 100.0 // 转换为元 |
| | | textData.append("卡内总余额:" + String.format("%.2f", totalBalanceInYuan) + "元") |
| | | textData.append( |
| | | "卡内总余额:" + String.format( |
| | | "%.2f", |
| | | totalBalanceInYuan |
| | | ) + "元" |
| | | ) |
| | | } |
| | | |
| | | binding?.cardData?.text = textData.toString() |