From 8f83197c02ffee109aa44b63777a072f041c046d Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Wed, 15 May 2024 15:22:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BAxlsx?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=89=8B=E6=9C=BA=E7=AB=AF=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/electricQuery/index.js | 2 +- pages/home/index.js | 10 ++++------ service/accounting.js | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pages/electricQuery/index.js b/pages/electricQuery/index.js index 8db63e1..7c4571b 100644 --- a/pages/electricQuery/index.js +++ b/pages/electricQuery/index.js @@ -177,7 +177,7 @@ Page({ // } wx.openDocument({ filePath: data.tempFilePath, - fileType: 'xlsx', + fileType: ['xlsx'], success() { }, fail(err) { diff --git a/pages/home/index.js b/pages/home/index.js index fd95ce8..9e71ff6 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -79,7 +79,7 @@ Page({ park: value, tenement: value.tenements?.[0] }) - wx.setStorageSync('park', park) + wx.setStorageSync('park', value) wx.setStorageSync('tenement', value.tenements?.[0]) break; case "tenement": @@ -189,7 +189,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - this.setUser(); + this.getAllList(); this.watchTenement(); this.watchPark(); @@ -209,10 +209,8 @@ Page({ set: function (newVal) { // const oldValue = value; wx.setStorageSync('tenement', newVal) - if (value !== newVal) { - that.getMeters(newVal); - that.setUser(); - } + that.getMeters(newVal); + that.setUser(); value = newVal; } }); diff --git a/service/accounting.js b/service/accounting.js index 02da240..cd44010 100644 --- a/service/accounting.js +++ b/service/accounting.js @@ -33,6 +33,7 @@ export const exportElectricityList = async function({ meter, type, time }) { wx.downloadFile({ url: `${api}/wx/getElectricityList/export?tenement=${tenement}&meter=${meter}&type=${type}&time=${time}`, success(res) { + console.log('请求成功结果', res) resolve(res) }, fail(err) {