Commit 01ad20fd by pangchong

fix: 请求修复

parent f1270ea4
...@@ -3,19 +3,12 @@ import useUserStore from 'mocp/store/user' ...@@ -3,19 +3,12 @@ import useUserStore from 'mocp/store/user'
const baseURL = 'https://hna-platform.anyremote.cn' const baseURL = 'https://hna-platform.anyremote.cn'
class ServiceLoading { class ServiceLoading {
constructor() {
this.count = 0
}
open(loading) { open(loading) {
if (this.count < 0) {
this.count = 0
}
if (loading || loading === '') { if (loading || loading === '') {
let loadingText = '加载中' let loadingText = '加载中'
if (typeof loading === 'string' && loading !== '') { if (typeof loading === 'string' && loading !== '') {
loadingText = loading loadingText = loading
} }
this.count++
uni.showLoading({ uni.showLoading({
title: loadingText, title: loadingText,
mask: true mask: true
...@@ -23,10 +16,7 @@ class ServiceLoading { ...@@ -23,10 +16,7 @@ class ServiceLoading {
} }
} }
close() { close() {
this.count-- uni.hideLoading()
if (this.count <= 0) {
uni.hideLoading()
}
} }
} }
const serviceLoading = new ServiceLoading() const serviceLoading = new ServiceLoading()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment