修改用电查询切换电表数据不更新的问题

This commit is contained in:
qiaomu 2024-05-07 14:34:00 +08:00
parent 1e92bb8bcf
commit 6ad47c47ac
3 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,6 @@
.d-table { .d-table {
display: table !important; display: table !important;
width: 100% !important;
} }
.d-table-row { .d-table-row {
display: table-row !important; display: table-row !important;

View File

@ -160,7 +160,18 @@ Page({
show: false, show: false,
title: "" title: ""
}, () => { }, () => {
this.init(); const { queryType, } = this.data;
switch(queryType) {
case 1:
this.getReadingList();
break;
case 2:
this.getAccountingBalanceList();
break;
default:
this.init();
break;
}
}) })
}, },
onTimeClose() { onTimeClose() {

View File

@ -262,13 +262,12 @@ Page({
wx.setStorageSync('meter', {}) wx.setStorageSync('meter', {})
return; return;
} }
const storageMeter = wx.getStorageSync('meter');
this.setData({ this.setData({
meterList: data || [], meterList: data || [],
meter: storageMeter || (data?.[0] || {}) meter: (data?.[0] || {})
}) })
// if (!storageMeter) { // if (!storageMeter) {
wx.setStorageSync('meter', data?.[0]) wx.setStorageSync('meter', data?.[0] || {} )
// } // }
}, },
jumpToElectric() { jumpToElectric() {