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,
| }
|
|