feat(all): 新增工具

This commit is contained in:
2026-05-28 11:30:35 +08:00
parent 5dbedcaf0f
commit 3a55edfafc
85 changed files with 2902 additions and 2591 deletions
+11 -6
View File
@@ -1,3 +1,4 @@
/* eslint-disable no-useless-assignment, @typescript-eslint/no-unused-vars */
const systemInfo = uni.getSystemInfoSync();
const isAndroid =
systemInfo.uniPlatform === "app" && systemInfo.osName === "android";
@@ -195,12 +196,16 @@ export class AndroidNfcUtil {
static async scan() {
const androidNfcUtil = new AndroidNfcUtil();
return await new Promise(async (resolve, reject) => {
await androidNfcUtil.startNfcScan();
androidNfcUtil.addDiscoveredListener((res) => {
androidNfcUtil.stopNfcScan();
resolve(res);
});
return await new Promise((resolve, reject) => {
androidNfcUtil
.startNfcScan()
.then(() => {
androidNfcUtil.addDiscoveredListener((res) => {
androidNfcUtil.stopNfcScan();
resolve(res);
});
})
.catch(reject);
});
}
}