| | |
| | | package com.dayu.recharge.activity; |
| | | |
| | | import android.content.Intent; |
| | | import android.nfc.Tag; |
| | | import android.os.Bundle; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | |
| | | */ |
| | | public class RechargeActivity extends BaseNfcActivity { |
| | | |
| | | Intent intent; |
| | | // Intent intent; |
| | | |
| | | boolean userFlag; |
| | | ActivityRechargeBinding binding; |
| | |
| | | AdminDataBean adminData; |
| | | String userName; |
| | | |
| | | Tag mTag; |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void physicalCardDoing(Tag tag) { |
| | | super.physicalCardDoing(tag); |
| | | try { |
| | | mTag=tag; |
| | | userCard = NfcReadHelper.getInstence(tag).getUserCardData(); |
| | | if (userCard != null) { |
| | | ProgressDialog.show(this); |
| | | selectBalance(userCard.getInitPeasantCode()); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "卡片读取失败"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | | } |
| | | } |
| | | |
| | | public void onNewIntent(Intent intent) { |
| | | |
| | | try { |
| | | this.intent = intent; |
| | | // this.intent = intent; |
| | | userCard = NfcReadHelper.getInstence(intent).getUserCardData(); |
| | | if (userCard != null) { |
| | | ProgressDialog.show(this); |
| | |
| | | stateText.append("该卡已被禁用"); |
| | | userCard.setState("01"); |
| | | userCard.setBalance(balance); |
| | | userFlag = WriteCardUtils.setUser(intent, userCard); |
| | | userFlag = WriteCardUtils.setUser(mTag, userCard); |
| | | } else if ("02".equals(state)) { |
| | | stateText.append("隶属信息不符"); |
| | | } else if ("03".equals(state)) { |