| package com.dayu.qihealonelibrary.activity; | 
|   | 
| import android.content.Intent; | 
| import android.nfc.NfcAdapter; | 
| import android.os.Bundle; | 
| import android.text.TextUtils; | 
| import android.view.LayoutInflater; | 
|   | 
| import com.dayu.baselibrary.utils.TipUtil; | 
| import com.dayu.qihealonelibrary.databinding.ActivityManagerReadQhaBinding; | 
| import com.dayu.qihealonelibrary.tools.NfcReadHelper; | 
| import com.dayu.qihealonelibrary.view.ProgressDialog; | 
|   | 
| /** | 
|  * author: zuo | 
|  * Date: 2024-05-09 | 
|  * Time: 11:05 | 
|  * 备注: | 
|  */ | 
| public class ManagerReadActivityQHAlone extends QHAloneBaseNfcActivity { | 
|   | 
|     ActivityManagerReadQhaBinding binding; | 
|     Intent intent; | 
|   | 
|     @Override | 
|     protected void onCreate(Bundle savedInstanceState) { | 
|         super.onCreate(savedInstanceState); | 
|         binding = ActivityManagerReadQhaBinding.inflate(LayoutInflater.from(this)); | 
|         setContentView(binding.getRoot()); | 
|   | 
|     } | 
|   | 
|   | 
|     @Override | 
|     public void onNfcBack(Intent intent) { | 
|         this.intent = intent; | 
|         ProgressDialog.show(this); | 
|         if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { | 
|             getCardNumber(); | 
|         } | 
|     } | 
|   | 
|   | 
|     private void getCardNumber() { | 
|         String cardNumber = NfcReadHelper.getInstence(intent, this).getCardNumber(); | 
|         if (!TextUtils.isEmpty(cardNumber)) { | 
|             TipUtil.show(this, "读卡成功,接下来会跳转到用户列表选择补卡的用户。", new TipUtil.TipListener() { | 
|                 @Override | 
|                 public void onCancle() { | 
|                     Intent intent = new Intent(ManagerReadActivityQHAlone.this, ManagerListActivityQHAlone.class); | 
|                     intent.putExtra("cardNumber", cardNumber); | 
|                     startActivity(intent); | 
|                     ManagerReadActivityQHAlone.this.finish(); | 
|                 } | 
|             }); | 
|   | 
|   | 
|         } else { | 
|             TipUtil.show(this, "未读取到新卡卡号,请重新贴卡"); | 
|         } | 
|     } | 
| } |