| File was renamed from qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/activity/RechargeActivity.java |
| | |
| | | import com.dayu.qihealonelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qihealonelibrary.tools.NfcReadHelper; |
| | | import com.dayu.qihealonelibrary.utils.CardCommon; |
| | | import com.dayu.qihealonelibrary.utils.DeviceNumberUtils; |
| | | import com.dayu.qihealonelibrary.view.ProgressDialog; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | | |
| | | import java.util.Calendar; |
| | |
| | | * Date: 2023-11-5 09:52 |
| | | * Description: 充值界面 |
| | | */ |
| | | public class RechargeActivity extends BaseNfcActivity { |
| | | public class RechargeActivityQHAlone extends QHAloneBaseNfcActivity { |
| | | |
| | | Intent intent; |
| | | |
| | | ActivityRechargeQhaBinding binding; |
| | | public static RechargeActivity rechargeActivity; |
| | | public static RechargeActivityQHAlone rechargeActivity; |
| | | |
| | | AdminDataBean adminData; |
| | | String userName; |
| | |
| | | } |
| | | } |
| | | |
| | | public void onNewIntent(Intent intent) { |
| | | @Override |
| | | public void onNfcBack(Intent intent) { |
| | | this.intent = intent; |
| | | try { |
| | | readAllData(); |
| | |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | | } |
| | | super.onNewIntent(intent); |
| | | } |
| | | |
| | | |
| | |
| | | if (!data.isEmpty()) { |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | setUserData(cardType, cardNumber, data); |
| | | if(priceBean!=null){ |
| | | binding.redRechargeElectric.setText("电量单价:"+priceBean.getPrice()+"元/度"); |
| | | if (priceBean != null) { |
| | | binding.redRechargeElectric.setText("电量单价:" + priceBean.getPrice() + "元/度"); |
| | | } |
| | | } else { |
| | | TipUtil.show(this, "读取卡片失败,请重新贴卡"); |
| | |
| | | } |
| | | |
| | | |
| | | userCard = UserCard.getBean(data); |
| | | userCard = new UserCard().getBean(data); |
| | | List<UserCardBean> userCardBeans = baseDao.userCardDao().findUserName(cardNumber); |
| | | AdminDataBean adminDataBean = baseDao.adminDao().findFirst(); |
| | | |
| | |
| | | binding.rechargeRegistBtn.setOnClickListener(v -> { |
| | | String morny = binding.rechargeWater.getText().toString(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | Intent intent = new Intent(RechargeActivity.this, NFCWreatActivity.class); |
| | | Intent intent = new Intent(RechargeActivityQHAlone.this, NFCWreatActivityQHAlone.class); |
| | | //当前金额单位为元 |
| | | intent.putExtra("morny", morny); |
| | | intent.putExtra("userName", userName); |
| | |
| | | // intent.putExtra("rechageWater", rechageWater); |
| | | startActivity(intent); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "请输入充值金额(元)"); |
| | | TipUtil.show(RechargeActivityQHAlone.this, "请输入充值金额(元)"); |
| | | } |
| | | }); |
| | | } |