ErrorToastUtils.ets
2.97 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { ToastUtils } from './ToastUtils'
export namespace ErrorToastUtils {
export enum ErrorType {
NET_CORE_NO_NETWORK, //当前无网络,请重试
NET_CORE_WEAK_NETWORK, //当前无网络,请重试
NET_CORE_PAGE_ERROR_NETWORK, //网络出小差了,请检查网络后重试
NET_CORE_LOAD_ERROR_NETWORK, //加载失败,请重试
NET_CORE_ENTER_ERROR_NETWORK, //很抱歉,当前内容无法加载,请点击重试
//直播异常
LIVE_CORE_NO_NETWORK, //直播 无网络 网络出小差了,请检查下网络
LIVE_CORE_WEAK_NETWORK, //直播 弱网 网络出小差了,请检查下网络
LIVE_CORE_IO_NETWORK, //直播 直播流异常 直播加载异常
LIVE_CORE_SERVICE_NETWORK, //直播 服务端接口异常 直播加载异常
LIVE_CORE_SWITCH_FLOW_NETWORK, //直播 网络切换到流量 正在使用流量,请注意流量使用
//审核后异常报错
AUDITING_CORE_CONTENT_DISTRIBUTE, //审核 内容分发下线规则 内容已下线
AUDITING_CORE_ACCOUNT_ERROR, //审核 账号有问题下线规则 内容已下线
}
export class ErrorToast {
static showToast(type: ErrorType) {
switch (type) {
case ErrorType.NET_CORE_NO_NETWORK:
ToastUtils.shortToast($r('app.string.net_core_no_network'))
break
case ErrorType.NET_CORE_WEAK_NETWORK:
ToastUtils.shortToast($r('app.string.net_core_no_network'))
break
case ErrorType.NET_CORE_PAGE_ERROR_NETWORK:
ToastUtils.shortToast($r('app.string.net_core_page_error_network'))
break
case ErrorType.NET_CORE_LOAD_ERROR_NETWORK:
ToastUtils.shortToast($r('app.string.net_core_load_fail_network'))
break
case ErrorType.NET_CORE_ENTER_ERROR_NETWORK:
ToastUtils.shortToast($r('app.string.net_core_enter_fail_network'))
break
case ErrorType.LIVE_CORE_NO_NETWORK:
ToastUtils.shortToast($r('app.string.live_core_no_network'))
break
case ErrorType.LIVE_CORE_WEAK_NETWORK:
ToastUtils.shortToast($r('app.string.live_core_weak_network'))
break
case ErrorType.LIVE_CORE_IO_NETWORK:
ToastUtils.shortToast($r('app.string.live_core_io_network'))
break
case ErrorType.LIVE_CORE_SERVICE_NETWORK:
ToastUtils.shortToast($r('app.string.live_core_service_network'))
break
case ErrorType.LIVE_CORE_SWITCH_FLOW_NETWORK:
ToastUtils.shortToast($r('app.string.live_core_switch_flow_network'))
break
case ErrorType.LIVE_CORE_SWITCH_FLOW_NETWORK:
ToastUtils.shortToast($r('app.string.live_core_switch_flow_network'))
break
case ErrorType.AUDITING_CORE_CONTENT_DISTRIBUTE:
ToastUtils.shortToast($r('app.string.auditing_core_error'))
break
case ErrorType.AUDITING_CORE_ACCOUNT_ERROR:
ToastUtils.shortToast($r('app.string.auditing_core_error'))
break
}
}
}
}