牌位管理网关控制牌位

This commit is contained in:
WindowBird 2025-10-15 16:49:36 +08:00
parent a02ff28e75
commit dd1597606a
2 changed files with 58 additions and 3 deletions

View File

@ -292,6 +292,7 @@ export default {
};
uni.setStorageSync("abbotId", response.data.abbotId);
uni.setStorageSync("templeId", response.data.id);
//
this.stopMarquee();

View File

@ -35,6 +35,7 @@
<view class="grid-btn" @click="handleForceClose">强制关闭</view>
<view class="grid-btn" @click="handleResetDuration">时长归零</view>
<view class="grid-btn" @click="handleIncreaseDuration">增加时长</view>
<view class="grid-btn" @click="handleSearchMemorial">寻找牌位</view>
</view>
</view>
</view>
@ -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%;