This commit is contained in:
张成
2026-03-09 16:15:06 +08:00
parent 47c19f0fa5
commit 636e218a63
2 changed files with 20 additions and 10 deletions

View File

@@ -140,9 +140,13 @@ class HttpService {
this.hideLoadingTimer = null
}
// 延时300ms后隐藏loading避免频繁切换
// 延时 800ms 后隐藏 loading避免频繁切换;捕获 hideLoading 失败(如 toast 已被关闭)避免报错打断流程
this.hideLoadingTimer = setTimeout(() => {
Taro.hideLoading()
try {
Taro.hideLoading()
} catch (e) {
// 忽略 "toast can't be found" 等,避免发布后分享等流程报错
}
this.currentLoadingText = ''
this.hideLoadingTimer = null
}, 800)