左晓为主开发手持机充值管理机
zuoxiao
2024-05-09 b8f8323cc39091d3119101923251a0455da87f55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 ManagerReadActivity extends BaseNfcActivity {
 
    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 onNewIntent(Intent intent) {
        this.intent = intent;
        ProgressDialog.show(this);
        if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) {
            getCardNumber();
        }
        super.onNewIntent(intent);
    }
 
 
    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(ManagerReadActivity.this, ManagerListActivity.class);
                    intent.putExtra("cardNumber", cardNumber);
                    startActivity(intent);
                    ManagerReadActivity.this.finish();
                }
            });
 
 
        } else {
            TipUtil.show(this, "未读取到新卡卡号,请重新贴卡");
        }
    }
}