From 35d4b2c663c1aaef169dc896f3b2728152b1d0cb Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 21 Apr 2025 15:15:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E4=BF=AE=E5=BC=80=E9=97=A8=E5=92=8C?= =?UTF-8?q?=E6=A3=80=E4=BF=AE=E5=85=B3=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cabinet/cabinetDetail.vue | 48 +++++++++++++++++++++++++++-- src/pages/tabbar/cabinet.vue | 2 +- src/sheep/api/door.ts | 1 - 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/pages/cabinet/cabinetDetail.vue b/src/pages/cabinet/cabinetDetail.vue index 71655d1..c30c13a 100644 --- a/src/pages/cabinet/cabinetDetail.vue +++ b/src/pages/cabinet/cabinetDetail.vue @@ -81,7 +81,15 @@ - {{ "柜门" + state.detail.deviceCode + "-" + item.cabinetNo }} + + {{ "柜门" + state.detail.deviceCode + "-" + item.cabinetNo }} + + 检修开门 +    + 检修关门 + + + 货柜号: {{ item.cabinetNo }} @@ -134,13 +142,47 @@ onShow(async () => { const res = await doorApi.hardDoorDetail({ hardDoorId: state.id }) if (res.code == 0) { state.detail = res.data - return + } else { + uni.showToast({ title: res.msg, icon: "none" }) } - uni.showToast({ title: res.msg, icon: "none" }) } catch (error: any) { uni.showToast({ title: error.msg, icon: "none" }) } finally { uni.hideLoading() } }) + +// 检修开门 +const checkOpenAccess = async (cabinetNo: string) => { + try { + uni.showLoading({ title: "开门中...", mask: true }) + const res: any = await doorApi.openAccess({ hardDoorId: state.id, cabinetNo }) + if (res.code == 0) { + uni.showToast({ title: "开门成功", icon: "none" }) + } else { + uni.showToast({ title: res.msg, icon: "none" }) + } + } catch (error: any) { + uni.showToast({ title: error.msg, icon: "none" }) + } finally { + uni.hideLoading() + } +} + +// 检修关门 +const checkCloseAccess = async (cabinetNo: string) => { + try { + uni.showLoading({ title: "关门中...", mask: true }) + const res = await doorApi.closeAccess({ hardDoorId: state.id, cabinetNo }) + if (res.code == 0) { + uni.showToast({ title: "关门成功", icon: "none" }) + } else { + uni.showToast({ title: res.msg, icon: "none" }) + } + } catch (error: any) { + uni.showToast({ title: error.msg, icon: "none" }) + } finally { + uni.hideLoading() + } +} diff --git a/src/pages/tabbar/cabinet.vue b/src/pages/tabbar/cabinet.vue index 81e1c17..a3253e8 100644 --- a/src/pages/tabbar/cabinet.vue +++ b/src/pages/tabbar/cabinet.vue @@ -17,7 +17,7 @@ {{ item.hardName }} {{ item.deviceCode }} - + 货柜详情 diff --git a/src/sheep/api/door.ts b/src/sheep/api/door.ts index c700347..608992a 100644 --- a/src/sheep/api/door.ts +++ b/src/sheep/api/door.ts @@ -173,7 +173,6 @@ export default { showLoading: false, }, }), - /** * app检修关门 * @param hardDoorId 智能柜id