From 6c4f542bfeef1e462b6f5c45ff978e973df0a7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Mon, 25 Dec 2023 19:48:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AD=90=E7=B3=BB=E7=BB=9F=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=A2=9E=E5=8A=A0loading=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/subSystem/subSystem.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/weapp/package/subSystem/subSystem.js b/weapp/package/subSystem/subSystem.js index 4487bbf..028ee37 100644 --- a/weapp/package/subSystem/subSystem.js +++ b/weapp/package/subSystem/subSystem.js @@ -116,6 +116,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + wx.showLoading({ + title: '加载中...', + }) this.subType = options.key const { windowHeight } = wx.getSystemInfoSync() const pageHeight = windowHeight - 48 @@ -151,11 +154,14 @@ Page({ }); - wx.hideLoading() + // wx.hideLoading() }, getSubSystemPatrolAbout: function (options) { + wx.showLoading({ + title: '加载中...', + }) // const userInfo=wx.getStorageSync('userInfo'); let that = this; const STime = moment('1970-01-01').format('YYYY-MM-DD') @@ -167,6 +173,7 @@ Page({ const query = { STime, ETime, keywords } Request.get(getSubSystemPatrolAbout(query)).then(res => { if (res) { + //求出最小时间 const minTimeObject = res.reduce((min, current) => { // 比较时间,选择最小的时间 @@ -284,10 +291,10 @@ Page({ }] }; that.initECharts(option); + wx.hideLoading(); - wx.hideLoading() } else { - wx.hideLoading(); + // wx.hideLoading(); } }) }, @@ -304,6 +311,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { + // wx.hideLoading() },