Skip to content

Commit

Permalink
Merge pull request #168 from xixiIBN5100/fix/electricity
Browse files Browse the repository at this point in the history
fix(electricity): error campus input handle
  • Loading branch information
xixiIBN5100 authored Dec 14, 2024
2 parents a0873f8 + a3713b8 commit 8cbf138
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/electricity/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</view>
<view class="text-wrapper">
<text>{{ roomInfo.roomName }}</text>
<text class="week">
房间号 {{ roomInfo.roomCode }}
</text>
</view>
</view>
</card>
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 8cbf138

Please sign in to comment.