闫增涛
2024-09-25 7974f3266c323e4cd4fdff7d457fe75f39b8c199
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,
}