From e491cdb48129752324c4e3764f99bd9203c56dec Mon Sep 17 00:00:00 2001
From: lgq <1015864684@qq.com>
Date: 星期二, 31 三月 2026 09:48:44 +0800
Subject: [PATCH] 1.新增VF205门禁机代码
---
vf205_access/src/service/nfcService.js | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/vf205_access/src/service/nfcService.js b/vf205_access/src/service/nfcService.js
new file mode 100644
index 0000000..bfb90a4
--- /dev/null
+++ b/vf205_access/src/service/nfcService.js
@@ -0,0 +1,44 @@
+/**
+ * NFC鏈嶅姟妯″潡
+ * 澶勭悊NFC鍗$墖鐩稿叧鐨勪笟鍔¢�昏緫锛屽寘鎷韩浠借瘉鍗″拰浜戣瘉鐨勫鐞�
+ */
+import log from '../../dxmodules/dxLogger.js'
+import dxMap from '../../dxmodules/dxMap.js'
+import accessService from '../service/accessService.js'
+import config from '../../dxmodules/dxConfig.js'
+import driver from '../driver.js';
+
+const nfcService = {}
+
+/**
+ * 鎺ユ敹NFC鍗$墖娑堟伅骞跺鐞�
+ * @param {object} data - NFC鍗$墖鏁版嵁
+ * @param {string} [data.card_type] - 鍗$墖绫诲瀷
+ * @param {string} [data.id] - 韬唤璇佺墿鐞嗗崱鍙�
+ * @param {string} [data.name] - 濮撳悕锛堜簯璇侊級
+ * @param {string} [data.sex] - 鎬у埆锛堜簯璇侊級
+ * @param {string} [data.idCardNo] - 韬唤璇佸彿鐮侊紙浜戣瘉锛�
+ */
+nfcService.receiveMsg = function (data) {
+ // log.info('[nfcService] receiveMsg :' + JSON.stringify(data))
+
+ // 棣栧厛鍒ゆ柇鏄惁鏄韩浠借瘉鍗�
+ if (data.card_type && data.id) {
+ if (dxMap.get("UI").get("getCardStart")) {
+ driver.screen.getCard(data.id)
+ return
+ }
+ // 韬唤璇佺墿鐞嗗崱鍙�/鏅�氬崱
+ accessService.access({ type: "200", code: data.id })
+ } else if (data.name && data.sex && data.idCardNo) {
+ if (dxMap.get("UI").get("getCardStart")) {
+ driver.screen.getCard(data.idCardNo)
+ return
+ }
+ // 浜戣瘉
+ accessService.access({ type: "200", code: data.idCardNo });
+ }
+
+}
+
+export default nfcService
--
Gitblit v1.9.3