牌位管理网关控制牌位
This commit is contained in:
parent
a02ff28e75
commit
dd1597606a
|
|
@ -292,6 +292,7 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
uni.setStorageSync("abbotId", response.data.abbotId);
|
uni.setStorageSync("abbotId", response.data.abbotId);
|
||||||
|
uni.setStorageSync("templeId", response.data.id);
|
||||||
|
|
||||||
// 重新启动跑马灯
|
// 重新启动跑马灯
|
||||||
this.stopMarquee();
|
this.stopMarquee();
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
<view class="grid-btn" @click="handleForceClose">强制关闭</view>
|
<view class="grid-btn" @click="handleForceClose">强制关闭</view>
|
||||||
<view class="grid-btn" @click="handleResetDuration">时长归零</view>
|
<view class="grid-btn" @click="handleResetDuration">时长归零</view>
|
||||||
<view class="grid-btn" @click="handleIncreaseDuration">增加时长</view>
|
<view class="grid-btn" @click="handleIncreaseDuration">增加时长</view>
|
||||||
|
<view class="grid-btn" @click="handleSearchMemorial">寻找牌位</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -144,11 +145,12 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log("floodr", floorId);
|
console.log("floodr", floorId);
|
||||||
|
let templeId = uni.getStorageSync("templeId");
|
||||||
return {
|
return {
|
||||||
// 兼容字段:同时传 floorId 与后端现用的 regionId
|
// 兼容字段:同时传 floorId 与后端现用的 regionId
|
||||||
|
|
||||||
// regionId: String(floorId),
|
// regionId: String(floorId),
|
||||||
regionId: 1,
|
templeId: templeId,
|
||||||
command, // open | close
|
command, // open | close
|
||||||
mac: "FFFFFFFFFFFF",
|
mac: "FFFFFFFFFFFF",
|
||||||
timeout: "11",
|
timeout: "11",
|
||||||
|
|
@ -200,6 +202,31 @@ export default {
|
||||||
return { amount: value, unit: chosen.value };
|
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() {
|
async handleAllOpen() {
|
||||||
const payload = this.buildGatewayPayload("open", "全开");
|
const payload = this.buildGatewayPayload("open", "全开");
|
||||||
await this.performPut(
|
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() {
|
async handleIncreaseDuration() {
|
||||||
if (!this.ensureUnitSelected()) return;
|
if (!this.ensureUnitSelected()) return;
|
||||||
|
|
@ -411,13 +465,13 @@ export default {
|
||||||
bottom: 10rpx;
|
bottom: 10rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #fffbf5;
|
background: #fffbf5;
|
||||||
height: 200rpx;
|
height: 300rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-grid {
|
.btn-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
grid-template-rows: 1fr 1fr;
|
grid-template-rows: 1fr 1fr 1fr;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
padding: 20rpx 32rpx;
|
padding: 20rpx 32rpx;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user