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 @@
+
+
+
+
+
+
+
+
+
+ 请保持手机在线,等待刷卡设备将NFC卡号传递到本页面。
+
+
+ NFC卡号
+ {{ cardNo || "等待刷卡..." }}
+
+ {{ connectionError }}
+ {{ lastMessage }}
+
+ 重新连接
+ 清空卡号
+
+
+
+
+
+ 设备 MAC 地址
+
+
+
+ NFC 卡号
+
+
+
+
+ 绑定单元 ID
+ {{ unitId }}
+
+
+
+ {{ binding ? "提交中..." : "提交绑定" }}
+
+
+
+
+
+
+
+
+
+
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,
},