Explorar o código

【ipad】关闭4G和wifi,启动app黑屏

huangxiaodong hai 1 ano
pai
achega
e0cb8a9119

+ 51 - 3
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -42,6 +42,9 @@
 @property(nonatomic, assign)   bool isNeedToShowSecretKey;//扫码进来的SN 没有密码 则需要显示秘钥
 
 @property (nonatomic, assign)  BOOL isLoginAgainType;// 单点登录 点重新登录进来的
+
+@property (nonatomic, assign)  BOOL isNeedToStopWork;// 无网络报错
+@property (nonatomic, assign)  BOOL isDidShowPwdType;// 是否显示密码界面了
 @end
 
 @implementation SceneDelegate
@@ -96,6 +99,10 @@
     //    self.window.rootViewController = qrCodeVCNav;
     //    return;/*临时测试*/
     
+    if(_isNeedToStopWork){
+        return;
+    }
+    
     /*先判断本地有无设备 无设备时需要先扫码添加设备*/
     NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
     if (!deviceDict || ![[deviceDict allKeys] containsObject:Const_Have_Add_Device_SN]){
@@ -137,6 +144,7 @@
     }
     
     [self getDeviceMsgInMainVCWith:deviceDict];
+    //[self showNetErrorAlertType2Fun];
 }
 
 - (void)getDeviceMsgInMainVCWith:(NSDictionary*)deviceDict
@@ -152,10 +160,14 @@
                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                     mainBlock(^{
                         [weakSelf showNetErrorAlertFun];
+                        [weakSelf enterMainVCFromSceneSecondStepFun];
                     });
                 });
             }
-            [weakSelf enterMainVCFromSceneSecondStepFun];
+            else{
+                [weakSelf enterMainVCFromSceneSecondStepFun];
+            }
+            
         }];
     }
     else{
@@ -526,7 +538,7 @@
         [self closeCalculatorVC];
         _inputVC = [[inputPWDViewController alloc] init];
         [self.window addSubview:_inputVC.view];
-        
+        _isDidShowPwdType = YES;
     }
     else if (maskModel == 2){
         /*浏览器*/
@@ -535,12 +547,14 @@
         _webVC.pwd = PwdStr;
         _webVC.webUrl = @"https://baidu.com";
         [self.window addSubview:_webVC.view];
+        _isDidShowPwdType = YES;
     }else{
         /*计算器*/
         [self closeCalculatorVC];
         _calculatorVC = [[CalculatorViewController alloc] init];
         _calculatorVC.pwd = PwdStr;
         [self.window addSubview:_calculatorVC.view];
+        _isDidShowPwdType = YES;
     }
     
     [[NSNotificationCenter defaultCenter] postNotificationName:ShowPwdVCNotification object:nil];
@@ -559,6 +573,7 @@
     if(_inputVC){
         [_inputVC.view removeFromSuperview];
     }
+    _isDidShowPwdType = NO;
 }
 
 - (NSString *)documentPathForAccount:(NSString *)account fileFolder:(NSString *)fileFolder {
@@ -744,13 +759,16 @@
 {
     NSInteger maskModel = [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
     
-    if(maskModel !=0){
+    if(maskModel !=0 && _isDidShowPwdType){
         return;
     }
     
     NSString *linkErrTip = NSLocalizedString(@"player_link_fail_couldPhone_Tips",nil);
     if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
         linkErrTip = NSLocalizedString(@"player_link_fail_phone_Tips",nil);
+        _isNeedToStopWork = YES;
+        [self showNetErrorAlertType2Fun];
+        return;
     }
     
     linkErrTip = [[NSString alloc] initWithFormat:@"[9]%@",linkErrTip];
@@ -774,4 +792,34 @@
      }];
 }
 
+#pragma mark 网络异常弹框
+-(void)showNetErrorAlertType2Fun
+{
+
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
+        
+        NSString * linkErrTip = NSLocalizedString(@"netWork_error_tip_content",nil);
+        
+        ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"netWork_error_tip_title",nil)
+                                                                                          msg:linkErrTip
+                                                                                     imageStr:nil
+                                                                                  cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil)
+                                                                                      okTitle:nil isOkBtnHighlight:NO
+                                                                                   didClickOk:^{
+            
+            //[self enterMainVCFromScene];
+         } didClickCancel:^{
+             exit(0);
+         }];
+        
+         linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
+         
+        self.window.rootViewController = [UIViewController new];
+         [self.window.rootViewController presentViewController:linkFailAlretVC animated:YES completion:^{
+             linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
+         }];
+    }
+    
+}
+
 @end

+ 2 - 0
创维盒子/双子星云手机/en.lproj/Localizable.strings

@@ -395,3 +395,5 @@
 "download_task_not_done_tip" = "There is currently a download task in progress, please try again later";
 "disk_insertion_pop_tip2"   = "Reminder: Use brand-new 1TB+ drives, minimize unplugging to prevent damage.";
 "File_creat_def_path_error_tip"   = "Unable to create system default path";
+"netWork_error_tip_title" = "No network";
+"netWork_error_tip_content" = "iphone network abnormality, please check the current network permissions, or drag to the bottom of the settings to find Private-x and enter to view wireless data permissions";

+ 2 - 0
创维盒子/双子星云手机/ja.lproj/Localizable.strings

@@ -394,3 +394,5 @@
 "download_task_not_done_tip" = "現在ダウンロードタスクが進行中ですので、後で操作してください";
 "disk_insertion_pop_tip2"   = "注意:1TB以上の新ディスクを使用し、不要な挿入/拔出を減らしてください。";
 "File_creat_def_path_error_tip"   = "システムのデフォルトパスを作成できません";
+"netWork_error_tip_title" = "ネットワークなし";
+"netWork_error_tip_content" = "携帯電話のネットワークに異常がある場合は、現在のネットワーク権限を確認するか、設定の下にPrivate-xを見つけてワイヤレスデータを表示する権限を確認してください";

+ 2 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -394,3 +394,5 @@
 "download_task_not_done_tip" = "目前有下载任务正在进行中,请稍后再操作";
 "disk_insertion_pop_tip2"   = "温馨提示:1T及以上规格建议使用全新磁盘。使用过程中尽量减少不必要的拔插操作,以防磁盘受损!!!";
 "File_creat_def_path_error_tip"   = "不可创建操作系统默认路径";
+"netWork_error_tip_title" = "无网络";
+"netWork_error_tip_content" = "手机网络异常,请检查当前网络权限,或者在设置里拉到底部找到Private-x进入查看无线数据权限";

+ 2 - 0
创维盒子/双子星云手机/zh-Hant.lproj/Localizable.strings

@@ -394,3 +394,5 @@
 "download_task_not_done_tip" = "目前有下載任務正在進行中,請稍後再操作";
 "disk_insertion_pop_tip2"   = "溫馨提示:建議使用全新1T或以上規格的磁盤。使用過程中請盡量減少不必要的插拔操作,以防磁盤受損!!!";
 "File_creat_def_path_error_tip"   = "不可建立作業系統預設路徑";
+"netWork_error_tip_title" = "無網絡";
+"netWork_error_tip_content" = "手機網絡异常,請檢查當前網絡許可權,或者在設定里拉到底部找到Private-x進入查看無線數據許可權";