Steven 10 months ago
parent
commit
6823a42515

+ 0 - 2
KulexiuForStudent/KulexiuForStudent/Common/Base/AccompanyWebView/KSAccompanyWebViewController.m

@@ -1593,8 +1593,6 @@
     [self.loadingView stopLoading];
 }
 
-
-
 #pragma mark ----- 跟音模块
 - (void)startTuner {
     @try {

+ 1 - 12
KulexiuForStudent/KulexiuForStudent/Common/Base/BaseViewController/KSBaseViewController.m

@@ -19,9 +19,6 @@
 #define PROMPT_TIME  1.5f
 
 @interface KSBaseViewController ()
-{
-    MBProgressHUD *t_MBProgressHUD;
-}
 
 @property (nonatomic, strong) UIView *promptPlaceView;
 
@@ -275,15 +272,7 @@
     }
     
     if (!isExistenceNetwork) {
-        MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-        hud.removeFromSuperViewOnHide =YES;
-        hud.mode = MBProgressHUDModeText;
-        hud.label.text = NSLocalizedString(@"当前没有网络,请先连接网络", nil);
-        hud.minSize = CGSizeMake(132.f, 108.0f);
-        hud.label.textColor = [UIColor whiteColor];
-        hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-        hud.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-        [hud hideAnimated:YES afterDelay:5];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"当前没有网络,请先连接网络"];
         return NO;
     }
     

+ 9 - 22
KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.m

@@ -130,10 +130,10 @@
             NSLog(@"%@",error.description);
             faliure(error);
             if (error.code == -1001) {
-                [self showMessage:@"网络请求超时"];
+                [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络请求超时"];
             }
             else if (error.code != -999) {
-                [self showMessage:@"网络错误,请检查您的网络"];
+                [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络错误,请检查您的网络"];
             }
             
         }];
@@ -167,10 +167,10 @@
             NSLog(@"%@",error.description);
             faliure(error);
             if (error.code == -1001) {
-                [self showMessage:@"网络请求超时"];
+                [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络请求超时"];
             }
             else if (error.code != -999) {
-                [self showMessage:@"网络错误,请检查您的网络"];
+                [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络错误,请检查您的网络"];
             }
             
         }];
@@ -183,10 +183,10 @@
     [LOADING_MANAGER removeCustomLoading];
     [LOADING_MANAGER removeHUD];
     if (isDisable) {
-        [self showMessage:@"登录过期,请重新登录"];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"登录过期,请重新登录"];
     }
     else {
-        [self showMessage:@"未认证"];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"未认证"];
     }
     [self logoutAction];
 }
@@ -201,19 +201,6 @@
 }
 
 
-// 提示信息
-+ (void)showMessage:(NSString *)message {
-    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[[UIApplication sharedApplication].windows lastObject] animated:YES];
-    hud.removeFromSuperViewOnHide =YES;
-    hud.mode = MBProgressHUDModeText;
-    hud.label.text = message;
-    hud.minSize = CGSizeMake(132.f, 60.0f);
-    hud.label.textColor = [UIColor whiteColor];
-    hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-    hud.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-    [hud hideAnimated:YES afterDelay:2];
-}
-
 // 多文件上传
 + (void)uploadMultiFileWithFileArray:(NSArray *)datas
                           andWithUrl:(NSString *)myUrl
@@ -235,7 +222,7 @@
         }
         success(dics);
     } failBlock:^(NSArray *errors) {
-        [self showMessage:@"网络错误,请检查您的网络"];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络错误,请检查您的网络"];
         faliure([errors lastObject]);
     }];
     
@@ -265,7 +252,7 @@
         return ;
     } failBlock:^(NSError *error) {
         faliure(error);
-        [self showMessage:@"网络错误,请检查您的网络"];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络错误,请检查您的网络"];
     }];
 }
 
@@ -301,7 +288,7 @@
         NSMutableArray *result = [NSMutableArray arrayWithArray:responses];
         success(result);
     } failBlock:^(NSArray * _Nonnull errors) {
-        [self showMessage:@"网络错误,请检查您的网络"];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"网络错误,请检查您的网络"];
         faliure([errors lastObject]);
     }];
 }

+ 1 - 14
KulexiuForStudent/KulexiuForStudent/Module/Login/Model/UserInfoManager.m

@@ -67,8 +67,7 @@
                     return;
                 }
             }
-            
-            [self showMessage:@"登录过期,请重新登录"];
+            [LOADING_MANAGER MBShowAUTOHidingInWindow:@"登录过期,请重新登录"];
             [APPLOGIN_MANAGER logoutAction];
         }
     });
@@ -81,18 +80,6 @@
         }
     }];
 }
-// 提示信息
-- (void)showMessage:(NSString *)message {
-    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[[UIApplication sharedApplication].windows lastObject] animated:YES];
-    hud.removeFromSuperViewOnHide =YES;
-    hud.mode = MBProgressHUDModeText;
-    hud.label.text = message;
-    hud.minSize = CGSizeMake(132.f, 60.0f);
-    hud.label.textColor = [UIColor whiteColor];
-    hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-    hud.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-    [hud hideAnimated:YES afterDelay:2];
-}
 
 // 获取信息回调
 - (void)queryUserInfoCallback:(UserInfoCallback)callback {

+ 1 - 16
KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/Controller/TXClassroomViewController.m

@@ -17,7 +17,6 @@
 #import "TXRTCService.h"
 #import "Classroom.h"
 #import "ClassroomService.h"
-#import <MBProgressHUD/MBProgressHUD.h>
 #import "AppDelegate.h"
 #import "KSWhiteboardControl.h"
 #import <KSToolLibrary/UIDevice+TFDevice.h>
@@ -267,7 +266,7 @@
 
 #pragma mark ----- 账号异地登陆
 - (void)leaveRoomAction {
-    [self showMessage:@"该账号在其他设备上登录"];
+    [LOADING_MANAGER MBShowAUTOHidingInWindow:@"该账号在其他设备上登录"];
     self.isQuitRoom = YES;
     [[LoginHelper sharedInstance] logout];
     self.cancleAlert = YES;
@@ -290,20 +289,6 @@
     });
 }
 
-// 提示信息
-- (void)showMessage:(NSString *)message {
-    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    [self.view bringSubviewToFront:hud];
-    hud.removeFromSuperViewOnHide =YES;
-    hud.mode = MBProgressHUDModeText;
-    hud.label.text = message;
-    hud.minSize = CGSizeMake(132.f, 60.0f);
-    hud.label.textColor = [UIColor whiteColor];
-    hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-    hud.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-    [hud hideAnimated:YES afterDelay:2];
-}
-
 
 - (void)tapGesture: (UITapGestureRecognizer *)tapGesture {
     if (self.titleView.isDisplay) {