From 217d7255fa05b450c2f8e3a13a250e3f27f4eead Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 31 Jan 2024 09:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/instrument/instrument.tsx | 5 ++--- src/pages/integral_list/integral_list.tsx | 17 ++++++++++++++++- src/pages/user/user.tsx | 8 +++++++- src/utils/request.js | 16 ++++++++++++++-- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/pages/instrument/instrument.tsx b/src/pages/instrument/instrument.tsx index f780fe5..9c63827 100644 --- a/src/pages/instrument/instrument.tsx +++ b/src/pages/instrument/instrument.tsx @@ -345,7 +345,6 @@ export default class Instrument extends Component { serial: channelInfo.serial, instrumentId: channelInfo.id, }); - console.log("bindingInstrument", res); Taro.hideLoading(); if (res.data.code === 200) { // this.setState({ isVisibleBinding: false }); @@ -402,7 +401,7 @@ export default class Instrument extends Component { } = this.state; return ( - {/* { textAlgin="center" close={this.closeDev} confirm={this.closeDev} - /> */} + /> { // 用户是否已关闭提醒 GetOfficialAccount = async () => { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); let res = await GetOfficialAccount(); if (res.data.code === 200) { if (!res.data.data) { @@ -153,8 +157,11 @@ class IntegralList extends Component { }; // 用户是否关注公众号 GetIsAttentionOfficialAccount = async () => { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); let res = await GetIsAttentionOfficialAccount(); - console.log("GetIsAttentionOfficialAccount", res); if (res.data.code === 200) { if (!res.data.data) { // 如果false则是没关注 @@ -174,6 +181,10 @@ class IntegralList extends Component { }; GetObtainUserIntegral = async () => { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); let { list, pageNum, pageSize } = this.state; let res = await GetObtainUserIntegral({ pageNum, @@ -195,6 +206,10 @@ class IntegralList extends Component { }; GetIntegralRule = async () => { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); let res = await GetIntegralRule(); console.log("GetIntegralRule", res); if (res.data.code === 200) { diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 2cd6a52..a472557 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -116,6 +116,11 @@ class User extends Component { }); }; + // 开发中弹窗 + devOpen = (e) => { + this.setState({ isDev: true }); + }; + // 不检查登录跳转 goUrlNoRegister = (e) => { let url = e.currentTarget.dataset.url; @@ -265,7 +270,8 @@ class User extends Component { { // mask: true, // }); + const whiteListLoading = [""]; // loading + // 防止多次点击 const requestUrlList = global_requestUrlList; const whiteList = []; // 白名单:不自动重新请求 @@ -88,7 +97,10 @@ export const Ajax = (params) => { // }); }, complete() { - Taro.hideLoading(); + if (requestUrlList.length === 0) { + Taro.hideLoading(); + } + // const requestUrlList = global_requestUrlList; // const newRequestUrlList = requestUrlList.splice( // requestUrlList.indexOf(params.url),