From 745dff3b15415a47939957be2264d4e6402338eb Mon Sep 17 00:00:00 2001 From: xixiibn5100 <1584914306@qq.com> Date: Sat, 14 Dec 2024 13:03:16 +0800 Subject: [PATCH] fix(electricity): error campus info handle --- src/pages/electricity/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/electricity/index.vue b/src/pages/electricity/index.vue index b6bccd9..9c1e7a1 100644 --- a/src/pages/electricity/index.vue +++ b/src/pages/electricity/index.vue @@ -13,9 +13,6 @@ {{ roomInfo.roomName }} - - 房间号 {{ roomInfo.roomCode }} - @@ -104,7 +101,7 @@ import store, { serviceStore } from "@/store"; import Taro from "@tarojs/taro"; const options = ref(["朝晖/屏峰", "莫干山"]); -const selectedIndex = ref(serviceStore.electricity.selectedIndex); +const selectedIndex = ref(serviceStore.electricity.selectIndex); const valueMap = { "朝晖/屏峰": "zhpf", "莫干山": "mgs" @@ -160,6 +157,10 @@ const { onSuccess: (response) => { if (response.data.code === 1) { store.commit("setConsumption", response.data.data[0].used); + } else if (response.data.code === 200525) { + selectedIndex.value = 0; + serviceStore.electricity.selectedIndex = 0; + serviceStore.electricity.electricityCampus = "zhpf"; } else { throw new Error(response.data.msg); }