|
|
@@ -2,7 +2,7 @@
|
|
|
// errorAlertTool.m
|
|
|
//
|
|
|
//
|
|
|
-// Created by David on 2024/7/20.
|
|
|
+// Created David on 2024/7/20.
|
|
|
//
|
|
|
|
|
|
#import "errorAlertTool.h"
|
|
|
@@ -69,7 +69,6 @@ static errorAlertTool *shareInstance = nil;
|
|
|
-(void)showNetErrorAlertFunInMain:(NSInteger)type
|
|
|
{
|
|
|
|
|
|
- [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"showNetErrorAlertFun %ld",type]];
|
|
|
|
|
|
if(linkFailAlretVC
|
|
|
||(ksharedAppDelegate.isWebSockLinkOKAginType && type == 2) //重连上了但是延时消息来了
|
|
|
@@ -116,49 +115,13 @@ static errorAlertTool *shareInstance = nil;
|
|
|
// }
|
|
|
|
|
|
BOOL isPhoneNetWorkWrongType = NO;
|
|
|
- NSString *linkErrTip = NSLocalizedString(@"player_link_fail_tip_type11",nil);
|
|
|
+ NSString *linkErrTip = @"";
|
|
|
if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
|
|
|
linkErrTip = NSLocalizedString(@"netWork_error_tip_content",nil);
|
|
|
isPhoneNetWorkWrongType = YES;
|
|
|
}
|
|
|
|
|
|
- if(type == 11 && !isPhoneNetWorkWrongType){
|
|
|
- NSString* linkErrTitle = NSLocalizedString(@"player_link_fail_title_type11",nil);
|
|
|
- linkErrTitle = [[NSString alloc] initWithFormat:@"[%ld]%@",type,linkErrTitle];
|
|
|
-
|
|
|
- KWeakSelf
|
|
|
- linkFailAlretType2VC = [[ComontAlretType2ViewController alloc] initWithTitle:linkErrTitle msg:linkErrTip imageStr:@"" cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil) okTitle:NSLocalizedString(@"player_link_fail_tryAgain",nil) otherTitle:NSLocalizedString(@"my_set_no_restart_phone",nil) isOkBtnHighlight:YES didClickOk:^{
|
|
|
- [weakSelf tryAgainInLinkFailFun];
|
|
|
- [cachesFileManager writeLogsWithMsg:@"click tryAgain"];
|
|
|
-
|
|
|
- if(self->curDidClickButFun){
|
|
|
- self->curDidClickButFun(1);
|
|
|
- }
|
|
|
- } didClickCancel:^{
|
|
|
- if(type == 5){
|
|
|
- self->curDidClickButFun(5);
|
|
|
- }
|
|
|
- else{
|
|
|
- exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- } didClickOther:^{//重启云机
|
|
|
- [weakSelf needToRebootFun];
|
|
|
-
|
|
|
- if(self->curDidClickButFun){
|
|
|
- self->curDidClickButFun(3);
|
|
|
- }
|
|
|
- }];
|
|
|
-
|
|
|
-
|
|
|
- linkFailAlretType2VC.modalPresentationStyle = UIModalPresentationCustom;
|
|
|
-
|
|
|
- [ksharedAppDelegate.window.rootViewController presentViewController:linkFailAlretType2VC animated:YES completion:^{
|
|
|
- self->linkFailAlretType2VC.view.superview.backgroundColor = [UIColor clearColor];
|
|
|
- }];
|
|
|
-
|
|
|
- }
|
|
|
- else{
|
|
|
+
|
|
|
NSString* linkErrTitle = @"";
|
|
|
if(type == 2
|
|
|
||type==5
|
|
|
@@ -186,7 +149,7 @@ static errorAlertTool *shareInstance = nil;
|
|
|
okTitle:NSLocalizedString(@"player_link_fail_tryAgain",nil) isOkBtnHighlight:YES
|
|
|
didClickOk:^{
|
|
|
[weakSelf tryAgainInLinkFailFun];
|
|
|
- [cachesFileManager writeLogsWithMsg:@"click tryAgain"];
|
|
|
+
|
|
|
|
|
|
if(self->curDidClickButFun){
|
|
|
self->curDidClickButFun(1);
|
|
|
@@ -200,7 +163,7 @@ static errorAlertTool *shareInstance = nil;
|
|
|
[ksharedAppDelegate.window.rootViewController presentViewController:linkFailAlretVC animated:YES completion:^{
|
|
|
self->linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
|
|
|
}];
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
linkFailAlretVC.view.tag = type;
|
|
|
}
|