From 0dc18eb8eb877a1773209071bf9364b7748e133e Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Wed, 19 Nov 2025 17:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5nfc=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E4=B8=ADing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/memorial/index.js | 14 + pages.json | 7 + pages/memorial/adminMemorial.vue | 20 ++ pages/memorial/nfcPairing.vue | 464 +++++++++++++++++++++++++++++++ utils/request.js | 4 +- 5 files changed, 507 insertions(+), 2 deletions(-) create mode 100644 pages/memorial/nfcPairing.vue diff --git a/api/memorial/index.js b/api/memorial/index.js index 6c120dd..f9b2cba 100644 --- a/api/memorial/index.js +++ b/api/memorial/index.js @@ -110,3 +110,17 @@ export function getDeceasedList(params) { showLoading: false, }); } + +/** + * 提交 NFC 绑定信息 + * @param {Object} data + * @param {string} data.memorialMac - 往生殿设备 MAC + * @param {string} data.nfcMac - NFC 卡片 MAC + * @param {string} [data.unitId] - 单元 ID + * @returns {Promise} + */ +export function bindNfcCard(data) { + return post("/bst/nfc", data, { + showLoading: false, + }); +} diff --git a/pages.json b/pages.json index ae77dcb..efeaa23 100644 --- a/pages.json +++ b/pages.json @@ -257,6 +257,13 @@ "navigationStyle": "custom" } } + , + { + "path": "pages/memorial/nfcPairing", + "style": { + "navigationStyle": "custom" + } + } ], "subPackages": [ { diff --git a/pages/memorial/adminMemorial.vue b/pages/memorial/adminMemorial.vue index 7c9e601..2bcdf97 100644 --- a/pages/memorial/adminMemorial.vue +++ b/pages/memorial/adminMemorial.vue @@ -36,6 +36,7 @@ 时长归零 增加时长 寻找牌位 + NFC 配对 添加牌位 @@ -473,6 +474,25 @@ export default { }, }); }, + + // 跳转到NFC配对页面 + handleNfcPairing() { + if (!this.ensureUnitSelected()) return; + const unitId = this.selectedUnitId; + uni.navigateTo({ + url: `/pages/memorial/nfcPairing?unitId=${unitId}`, + success: () => { + console.log("跳转到NFC配对页面成功"); + }, + fail: (error) => { + console.error("跳转失败:", error); + uni.showToast({ + title: "页面跳转失败", + icon: "none", + }); + }, + }); + }, }, }; diff --git a/pages/memorial/nfcPairing.vue b/pages/memorial/nfcPairing.vue new file mode 100644 index 0000000..7bedc88 --- /dev/null +++ b/pages/memorial/nfcPairing.vue @@ -0,0 +1,464 @@ + + + + + + diff --git a/utils/request.js b/utils/request.js index 4842461..0310461 100644 --- a/utils/request.js +++ b/utils/request.js @@ -6,8 +6,8 @@ import debounce from "uview-ui/libs/function/debounce"; const ENV_CONFIG = { release: { // 正式版 - // baseUrl: "http://192.168.1.3:4501", - baseUrl: "https://tech-ape.top/prod-api", + baseUrl: "http://192.168.1.4:4501", + // baseUrl: "https://tech-ape.top/prod-api", // baseUrl: "https://tech-ape.top/prod-api", appId: 1, },