闫增涛
2025-03-31 04c7b0163caeae4ab1c5da62e301fa993101cfad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* 加载动画相关 */
const showLoading = (tips = '加载中...') => {
  wx.showNavigationBarLoading()
  wx.showLoading({
    title: tips,
  })
}
 
const hideLoading = () => {
  wx.hideLoading()
  wx.hideNavigationBarLoading()
}
 
const hideLoadingWithErrorTips = (err = '资源不可用,请联系管理员') => {
  hideLoading()
  wx.showToast({
    title: err,
    icon: 'error',
    duration: 2000
  })
}
 
module.exports = {
  showLoading: showLoading,
  hideLoading: hideLoading,
  hideLoadingWithErrorTips: hideLoadingWithErrorTips,
}