From dd1597606a5c27c253c68e4338a5d3bc9fd16766 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Wed, 15 Oct 2025 16:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=8C=E4=BD=8D=E7=AE=A1=E7=90=86=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E6=8E=A7=E5=88=B6=E7=89=8C=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 1 + pages/memorial/adminMemorial.vue | 60 ++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 4c2039c..1ad06e8 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -292,6 +292,7 @@ export default { }; uni.setStorageSync("abbotId", response.data.abbotId); + uni.setStorageSync("templeId", response.data.id); // 重新启动跑马灯 this.stopMarquee(); diff --git a/pages/memorial/adminMemorial.vue b/pages/memorial/adminMemorial.vue index ce01eb6..e5c4245 100644 --- a/pages/memorial/adminMemorial.vue +++ b/pages/memorial/adminMemorial.vue @@ -35,6 +35,7 @@ 强制关闭 时长归零 增加时长 + 寻找牌位 @@ -144,11 +145,12 @@ export default { return false; } console.log("floodr", floorId); + let templeId = uni.getStorageSync("templeId"); return { // 兼容字段:同时传 floorId 与后端现用的 regionId // regionId: String(floorId), - regionId: 1, + templeId: templeId, command, // open | close mac: "FFFFFFFFFFFF", timeout: "11", @@ -200,6 +202,31 @@ export default { return { amount: value, unit: chosen.value }; }, + // 输入寻找牌位所需参数:闪烁类型 与 超时时间 + async promptSearchParams() { + // 输入闪烁类型(后端自定义字符串/代码) + const typeRes = await new Promise((resolve) => { + uni.showModal({ + title: "输入闪烁类型", + editable: true, + placeholderText: "请输入类型代码或名称", + success: (res) => resolve(res), + }); + }); + + if (!typeRes || !typeRes.confirm) { + throw new Error("UserCancelled"); + } + + const type = String((typeRes.content || "").trim()); + if (!type) { + uni.showToast({ title: "闪烁类型不能为空", icon: "none" }); + throw new Error("InvalidType"); + } + + return { type }; + }, + async handleAllOpen() { const payload = this.buildGatewayPayload("open", "全开"); await this.performPut( @@ -248,6 +275,33 @@ export default { ); }, + // 底部按钮:寻找牌位(闪烁) + async handleSearchMemorial() { + if (!this.ensureUnitSelected()) return; + try { + const { type } = await this.promptSearchParams(); + const payload = { + memorialId: String(this.selectedUnitId), + type, + timeout: "11", + }; + await this.performPut( + `/app/memorial/searchMemorail`, + payload, + "handleSearchMemorial", + ); + } catch (e) { + if ( + e && + e.message !== "UserCancelled" && + e.message !== "InvalidNumber" && + e.message !== "InvalidType" + ) { + console.error("handleSearchMemorial prompt error", e); + } + } + }, + // 底部按钮:增加时长 async handleIncreaseDuration() { if (!this.ensureUnitSelected()) return; @@ -411,13 +465,13 @@ export default { bottom: 10rpx; width: 100%; background: #fffbf5; - height: 200rpx; + height: 300rpx; } .btn-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; - grid-template-rows: 1fr 1fr; + grid-template-rows: 1fr 1fr 1fr; gap: 20rpx; padding: 20rpx 32rpx; height: 100%;