| | |
| | | setContentView(binding.getRoot()); |
| | | nfcWreatActivity = this; |
| | | setData(); |
| | | titleBack(); |
| | | getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | cleanUserCard = (CleanUserCard) this.getIntent().getSerializableExtra("cleanUserCard"); |
| | | binding.cardData.setText("制作删除全部用户卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("domainCard")) { |
| | | domainCard = (DomainCard) this.getIntent().getSerializableExtra("domainCard"); |
| | | binding.cardData.setText("制作设置域名卡"); |
| | | if (this.getIntent().hasExtra("domainCard_xinxiang")) { |
| | | domainCard = (DomainCard) this.getIntent().getSerializableExtra("domainCard_xinxiang"); |
| | | binding.cardData.setText("制作设置新乡域名卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("domainCard_luyi")) { |
| | | domainCard = (DomainCard) this.getIntent().getSerializableExtra("domainCard_luyi"); |
| | | binding.cardData.setText("制作设置新乡域名卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("testCard")) { |
| | | testCard = (TestCard) this.getIntent().getSerializableExtra("testCard"); |
| | |
| | | TipUtil.show(NFCWreatActivity.this, "请勿移动卡片,读卡失败请重试!!"); |
| | | } else if (cardType.equals(BaseCommon.CARD_TYPE_ERROR2)) { |
| | | TipUtil.show(NFCWreatActivity.this, ",卡片未能识别,请检查卡片是否是本公司卡片"); |
| | | } else { |
| | | } else { |
| | | Log.i("NFCWreatActivity", "olduserCard!=null saveData"); |
| | | saveData(); |
| | | } |
| | |
| | | * 设置域名卡 |
| | | * |
| | | * @param intent |
| | | * @param domainCard |
| | | * @param domainXinXiangCard |
| | | */ |
| | | private void setDomainCard(Intent intent, DomainCard domainCard) { |
| | | private void setDomainCard(Intent intent, DomainCard domainXinXiangCard) { |
| | | try { |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainCard.getZeroByte(), 1, 0); |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainXinXiangCard.getZeroByte(), 1, 0); |
| | | if (!domainCrdFlag) { |
| | | return; |
| | | } |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainCard.getOneByte(), 1, 1); |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainXinXiangCard.getOneByte(), 1, 1); |
| | | if (!domainCrdFlag) { |
| | | return; |
| | | } |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainCard.getTwoByte(), 1, 2); |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainXinXiangCard.getTwoByte(), 1, 2); |
| | | } catch (Exception e) { |
| | | domainCrdFlag = false; |
| | | throw new RuntimeException(e); |
| | |
| | | //默认是1元 |
| | | userCard.setElectricityPrice(1.000f); |
| | | } |
| | | userCard.setSwipeNumber( 0); |
| | | userCard.setSwipeNumber(0); |
| | | userCard.setState("00"); |
| | | userCard.setBalance(0); |
| | | userCard.setAddressCode(adminData.getAddressCode()); |
| | |
| | | ProgressDialog.dismiss(); |
| | | nfcWreatActivity = null; |
| | | } |
| | | |
| | | private void titleBack() { |
| | | titleBar.setOnItemclickListner(TitleBar.ClickType_LEFT_IMAGE, new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | back(); |
| | | } |
| | | }); |
| | | } |
| | | } |