manifest.json 权限:
"",
"",
"",
nfc.vue代码如下,完全可运行:
NFC
UID:{ {UID}}
{ {tip}}
var NfcAdapter;
export default {
data() {
return {
title: 'redNFC',
UID: '',
msg: '',
tip: '',
}
},
onLoad() {
console.log("onLoad");
},
onShow() {
console.log("onShow");
this.NFCInit();
},
onHide() {
console.log("onHide");
this.NFCReadUID();
},
methods: {
NFCInit() {
try {
var main = plus.android.runtimeMainActivity();
//console.log(main);
var Intent = plus.android.importClass('and