开始做工作台,调整用电查询分页

This commit is contained in:
2024-11-08 18:24:05 +08:00
parent 08ef87ce33
commit b9d1ee34a7
32 changed files with 384 additions and 16 deletions

View File

@@ -48,13 +48,20 @@ Page({
this.setData({ queryType: type },() => {
switch(type) {
case 0:
this.init()
loadingFunc(async () => {
await this.init()
})
break;
case 1:
this.getReadingList();
loadingFunc(async () => {
await this.getReadingList();
})
break;
case 2:
this.getAccountingBalanceList();
loadingFunc(async () => {
await this.getAccountingBalanceList();
})
break;
}
@@ -69,8 +76,11 @@ Page({
},
changeTimeType(e) {
const { type } = e.currentTarget.dataset
const that = this;
this.setData({ timeType: type }, () => {
this.init()
loadingFunc(async () => {
await that.init()
})
})
},
@@ -78,7 +88,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.init()
loadingFunc(async () => {
await this.init()
})
},
async init() {
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page } = this.data;
@@ -251,13 +263,20 @@ Page({
const { queryType, } = this.data;
switch(queryType) {
case 1:
this.getReadingList();
loadingFunc(async () => {
await this.getReadingList();
})
break;
case 2:
this.getAccountingBalanceList();
loadingFunc(async () => {
await this.getAccountingBalanceList();
})
break;
default:
this.init();
loadingFunc(async () => {
await this.init();
})
break;
}
})
@@ -273,13 +292,17 @@ Page({
switch(type) {
case "year":
this.setData({ year: time, visible: false, }, () => {
this.init();
loadingFunc(async () => {
await this.init();
})
});
break;
case "month":
const [year, month] = time.split("-")
this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => {
this.init();
loadingFunc(async () => {
await this.init();
})
});
break;
case "day":
@@ -289,7 +312,9 @@ Page({
visible: false,
page: 1,
}, () => {
this.init();
loadingFunc(async () => {
await this.init();
})
})
break;
}