code 统一
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
proxyBackgroundService,
|
||||
PhonePePersonalBindResult,
|
||||
PaytmPersonalBindResult,
|
||||
BindErrorCode,
|
||||
} from 'rnwalletman';
|
||||
|
||||
import {
|
||||
@@ -446,25 +447,25 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
}}
|
||||
onError={(code: string, message: string) => {
|
||||
switch (code) {
|
||||
case 'NATIVE_MODULE_UNAVAILABLE': // 没有模块
|
||||
case BindErrorCode.NATIVE_MODULE_UNAVAILABLE: // 没有模块
|
||||
Alert.alert('Bind Failed', 'Native module not available');
|
||||
break;
|
||||
case 'NOT_LOGGED_IN': // 未登录,提示用户登录
|
||||
case BindErrorCode.NOT_LOGGED_IN: // 未登录,提示用户登录
|
||||
Alert.alert('Bind Failed', 'Please login in paytm app first');
|
||||
break;
|
||||
case 'ERROR': // catch 错误,提示错误即可
|
||||
case BindErrorCode.ERROR: // catch 错误,提示错误即可
|
||||
Alert.alert('Bind Failed', message);
|
||||
break;
|
||||
case 'NO_DATA': // 拿到了错误的信息,提示错误就可以 (aidl 给了错误的 resp,几率低),提示错误就可以
|
||||
case BindErrorCode.NO_DATA: // 拿到了错误的信息,提示错误就可以 (aidl 给了错误的 resp,几率低),提示错误就可以
|
||||
Alert.alert('Bind Failed', 'No data received from Paytm');
|
||||
break;
|
||||
case 'SERVICE_DISCONNECTED': // 服务不可用 (可能aidl 通信失败,几率低)提示错误就可以
|
||||
case BindErrorCode.SERVICE_DISCONNECTED: // 服务不可用 (可能aidl 通信失败,几率低)提示错误就可以
|
||||
Alert.alert('Bind Failed', 'Paytm service disconnected');
|
||||
break;
|
||||
case 'NOT_INSTALLED': // 未安装,提示用户安装
|
||||
case BindErrorCode.NOT_INSTALLED: // 未安装,提示用户安装
|
||||
Alert.alert('Bind Failed', '未安装Paytm 魔改包,需要重新安装');
|
||||
break;
|
||||
case 'BIND_ERROR': // 绑定错误,aidl 通信失败,可能存在 paytm 未打开的情况,出现这个,手动拉起一下
|
||||
case BindErrorCode.BIND_ERROR: // 绑定错误,aidl 通信失败,可能存在 paytm 未打开的情况,出现这个,手动拉起一下
|
||||
Alert.alert('Bind Failed', 'Paytm bind error');
|
||||
break;
|
||||
default:
|
||||
@@ -530,23 +531,23 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
onError={(code: string, message: string) => {
|
||||
|
||||
switch (code) {
|
||||
case 'NOT_INSTALLED':
|
||||
case BindErrorCode.NOT_INSTALLED:
|
||||
// 未安装
|
||||
Alert.alert('Bind Failed', '未安装Phonepe 魔改包,需要重新安装');
|
||||
break;
|
||||
case 'SERVICE_DISCONNECTED':
|
||||
case BindErrorCode.SERVICE_DISCONNECTED:
|
||||
// 服务不可用 (可能aidl 通信失败,几率低)提示错误就可以
|
||||
Alert.alert('Bind Failed', '服务不可用');
|
||||
break;
|
||||
case 'NO_DATA':
|
||||
case BindErrorCode.NO_DATA:
|
||||
// 拿到了错误的信息,提示错误就可以 (aidl 给了错误的 resp,几率低),提示错误就可以
|
||||
Alert.alert('Bind Failed', '未知错误信息');
|
||||
break;
|
||||
case 'BIND_ERROR':
|
||||
case BindErrorCode.BIND_ERROR:
|
||||
// 绑定错误,aidl 通信失败,可能存在 paytm / phonepe 未打开的情况,出现这个,手动拉起一下
|
||||
Alert.alert('Bind Failed', '绑定失败,请手动打开PhonePe后重试');
|
||||
break;
|
||||
case 'ERROR':
|
||||
case BindErrorCode.ERROR:
|
||||
// catch 错误,通用错误,提示错误即可
|
||||
Alert.alert('Bind Failed', message);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user