Browse Source

替换全局loading

Steven 3 weeks ago
parent
commit
5e1b2004ae
39 changed files with 188 additions and 328 deletions
  1. 4 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/BaseViewController/KSBaseViewController.m
  2. 3 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.m
  3. 15 39
      KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m
  4. 9 14
      KulexiuForStudent/KulexiuForStudent/Common/Tools/Custom/KSMediaManager.m
  5. 3 3
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/INSSettingViewController.m
  6. 0 3
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/TenantNotiferCenterController.m
  7. 2 4
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/KSChatUserDetailViewController.m
  8. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Group/Controller/GroupSettingViewController.m
  9. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Group/Controller/KSChatComplainController.m
  10. 0 3
      KulexiuForStudent/KulexiuForStudent/Module/Chat/GroupNotice/Controller/GroupNoticeViewController.m
  11. 11 36
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m
  12. 0 3
      KulexiuForStudent/KulexiuForStudent/Module/Course/Controller/CourseViewController.m
  13. 9 35
      KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/Controller/MusicRoomDetailViewController.m
  14. 11 36
      KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/Controller/VipCouseDetailViewController.m
  15. 5 5
      KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m
  16. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Home/NoticeCenter/Controller/NotiferMessageViewController.m
  17. 2 2
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomePageView/HomePageBodyView.m
  18. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/FirstSettingViewController.m
  19. 6 5
      KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/InstrumentChooseViewController.m
  20. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/PasswordLoginController.m
  21. 6 6
      KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/VefiCodeLoginController.m
  22. 6 9
      KulexiuForStudent/KulexiuForStudent/Module/Mine/AddressList/Controller/AddressDetailViewController.m
  23. 3 5
      KulexiuForStudent/KulexiuForStudent/Module/Mine/AddressList/Controller/AddressListViewController.m
  24. 2 2
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Controller/MineViewController.m
  25. 10 39
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/Controller/HomeworkDetailViewController.m
  26. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyNameViewController.m
  27. 6 6
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyPhoneChangeController.m
  28. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyPhoneCheckController.m
  29. 6 6
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyViewController.m
  30. 6 6
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/PasswordModify/ForgetPasswordViewController.m
  31. 6 6
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/PasswordModify/NewPwdModifyViewController.m
  32. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/PasswordModify/PasswordCheckViewController.m
  33. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/UserAuthViewController.m
  34. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/UserSettingViewController.m
  35. 6 6
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/Controller/AccountDeleteViewController.m
  36. 3 3
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Works/View/MineWorksBodyView.m
  37. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/Controller/TXClassroomViewController.m
  38. 5 5
      KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/Model/OnlineClassManager.m
  39. 8 6
      KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/View/NewWhiteboard/KSNewWhiteBoard.m

+ 4 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/BaseViewController/KSBaseViewController.m

@@ -486,6 +486,10 @@
     }
 }
 
+- (void)dealloc {
+    NSLog(@"native view dealloc----");
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
 /*
 #pragma mark - Navigation
 

+ 3 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.m

@@ -43,6 +43,9 @@
 
 - (void)showLoadingView {
     UIWindow *windows = [NSObject getKeyWindow];
+    if ([windows.subviews containsObject:self]) {
+        return;
+    }
     [windows addSubview:self];
     [self mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.top.bottom.mas_equalTo(windows);

+ 15 - 39
KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m

@@ -65,8 +65,6 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 @property (nonatomic, strong) KSMediaManager *mediaManager;
 
-@property (strong, nonatomic) MBProgressHUD *HUD;
-
 @property (nonatomic, assign) CHOOSETYPE fileChooseType;
 
 @property (nonatomic, strong) NSString *bucketName;
@@ -652,9 +650,9 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"joinLiveRoom"]) { // 进入直播间
         NSDictionary *valueDic = [parm ks_dictionaryValueForKey:@"content"];
         NSString *roomId = [valueDic ks_stringValueForKey:@"roomId"];
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"加载中..."];
         [KSEnterLiveroomManager joinLiveWithRoomId:roomId inController:(CustomNavViewController *)self.navigationController callback:^{
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
         }];
     }
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"setEventTracking"]) {
@@ -1597,28 +1595,6 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 #pragma mark -- 上传图片
 
-- (void)hudTipWillShow:(BOOL)willShow{
-    if (willShow) {
-        [self resignFirstResponder];
-        UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
-        if (!_HUD) {
-            _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
-            _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
-            _HUD.contentColor = [UIColor whiteColor];
-            _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-            _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-            _HUD.removeFromSuperViewOnHide = YES;
-            
-        }else{
-            _HUD.progress = 0;
-            [keyWindow addSubview:_HUD];
-            [_HUD showAnimated:YES];
-        }
-    }else{
-        [_HUD hideAnimated:YES];
-    }
-}
 - (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
     if (![NSString isEmptyString:text]) {
         NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
@@ -1631,7 +1607,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     }
 }
 - (void)uploadImageArray:(NSMutableArray *)imageArray bucket:(NSString *)bucket {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"上传中..."];
     NSMutableArray *imageDataArray = [NSMutableArray array];
     for (UIImage *image in imageArray) {
         NSData *imgData = [UIImage turnsImaegDataByImage:image];
@@ -1639,7 +1615,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     }
     [UPLOAD_MANAGER configWithfilePath:@"/user/"];
     [UPLOAD_MANAGER mutilUploadImage:imageDataArray fileName:@"complainImg" successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         NSMutableArray *urlArray = [NSMutableArray array];
         for (NSString *url in fileUrlArray) {
             [urlArray addObject:url];
@@ -1651,7 +1627,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
             self.chooseFileParm = nil;
         }
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
         [self fileChooseErrorCallback];
     }];
@@ -1684,23 +1660,22 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 - (void)submitUrlWith:(NSString *)imgUrl videoUrl:(NSString *)videoUrl {
     // 上传视频
-    [self hudTipWillShow:YES];
     NSURL *uploadFileUrl = [NSURL fileURLWithPath:videoUrl];
     NSData *fileData = [NSData dataWithContentsOfURL:uploadFileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
     [UPLOAD_MANAGER videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
+        // 显示进度
+        int progress = (int)(bytesWritten / totalBytes * 100);
+        __block NSString *tipsMessage = [NSString stringWithFormat:@"上传中 %d%%",progress];
         dispatch_main_async_safe(^{
-            // 显示进度
-            if (self.HUD) {
-                self.HUD.progress = bytesWritten / totalBytes;// progress是回调进度
-            }
+            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
         });
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         NSString *fileUrl = [fileUrlArray lastObject];
         [self videoUploadCallback:fileUrl firstFrameImg:imgUrl];
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         if (![NSString isEmptyString:descMessaeg]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
         }
@@ -1925,7 +1900,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 - (void)uploadFile:(NSString *)fileName fileUrl:(NSString *)fileUrl {
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"上传中..."];
         NSString *suffix = [NSString stringWithFormat:@".%@",[[fileName componentsSeparatedByString:@"."] lastObject]];
         NSData *fileData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:fileUrl]];
         [UPLOAD_MANAGER configWithfilePath:@"/user/"];
@@ -1936,7 +1911,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
                 [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
             });
         } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
             NSString *fileUrl = [fileUrlArray lastObject];
             if (self.chooseFileParm) { // 回调
                 [self.chooseFileParm setValue:fileUrl forKey:@"fileUrl"];
@@ -1944,7 +1919,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
                 self.chooseFileParm = nil;
             }
         } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
             [self fileChooseErrorCallback];
         }];
@@ -2064,6 +2039,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 - (void)removeCustomLoadingView {
     [self.customLoading stopLoading];
 }
+
 /*
 #pragma mark - Navigation
 

+ 9 - 14
KulexiuForStudent/KulexiuForStudent/Common/Tools/Custom/KSMediaManager.m

@@ -191,19 +191,17 @@
             return;
         }
         
-//        PHAssetResource *resource = [[PHAssetResource assetResourcesForAsset:asset] firstObject];
-//        long long size = [[resource valueForKey:@"fileSize"] longLongValue];
-//
-//        NSLog(@"原视频大小:%@",[NSString stringWithFormat:@"%.2fM",(CGFloat)size/(1024*1024)]);
+        PHAssetResource *resource = [[PHAssetResource assetResourcesForAsset:asset] firstObject];
+        long long size = [[resource valueForKey:@"fileSize"] longLongValue];
+
+        NSLog(@"原视频大小:%@",[NSString stringWithFormat:@"%.2fM",(CGFloat)size/(1024*1024)]);
         dispatch_main_sync_safe(^{
-            [LOADING_MANAGER MBShowInWindow:@"视频导出中..."];
+            [LOADING_MANAGER showCustomLoading:@"上传中..."];
         });
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
             
             [[TZImageManager manager] getVideoOutputPathWithAsset:asset presetName:self.presentName success:^(NSString *outputPath) {
-                dispatch_main_sync_safe(^{
-                    [LOADING_MANAGER removeHUDNoDelay];
-                });
+                
                 NSLog(@"视频导出到本地完成,沙盒路径为:%@",outputPath);
                 NSData *outputData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:outputPath]]; //压缩后的视频
                 NSLog(@"导出后的视频:%@",[NSString stringWithFormat:@"%.2fM",(CGFloat)outputData.length/(1024*1024)]);
@@ -217,7 +215,7 @@
                 
             } failure:^(NSString *errorMessage, NSError *error) {
                 dispatch_main_sync_safe(^{
-                    [LOADING_MANAGER removeHUDNoDelay];
+                    [LOADING_MANAGER removeCustomLoading];
                     [LOADING_MANAGER MBShowAUTOHidingInWindow:@"视频导出失败"];
                 });
                 NSLog(@"视频导出失败:%@,error:%@",errorMessage, error);
@@ -363,13 +361,10 @@
                 [tzImagePickerVc hideProgressHUD];
                 if (!error) {
                     dispatch_main_async_safe(^{
-                        [LOADING_MANAGER MBShowInWindow:@"视频处理中..."];
+                        [LOADING_MANAGER showCustomLoading:@"上传中..."];
                     });
                     [[TZImageManager manager] getVideoOutputPathWithAsset:asset presetName:self.presentName success:^(NSString *outputPath) {
                         // NSData *data = [NSData dataWithContentsOfFile:outputPath];
-                        dispatch_main_async_safe(^{
-                            [LOADING_MANAGER removeHUD];
-                        });
                         NSLog(@"视频导出到本地完成,沙盒路径为:%@",outputPath);
                         // Export completed, send video here, send by outputPath or NSData
                         // 导出完成,在这里写上传代码,通过路径或者通过NSData上传
@@ -383,7 +378,7 @@
                         
                     } failure:^(NSString *errorMessage, NSError *error) {
                         dispatch_main_async_safe(^{
-                            [LOADING_MANAGER removeHUD];
+                            [LOADING_MANAGER removeCustomLoading];
                             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"视频导出失败"];
                         });
                         

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/INSSettingViewController.m

@@ -279,9 +279,9 @@
 
 - (void)modifyUserMessage:(NSString *)imgUrl gender:(NSString *)gender birthday:(NSString *)birthday {
     NSString *userName = nil;
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager modifyUserMessage:KS_POST avatal:imgUrl gender:gender username:userName birthdate:birthday success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"修改成功"];
             [self requestUserMessage];
@@ -290,7 +290,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 0 - 3
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/TenantNotiferCenterController.m

@@ -100,9 +100,7 @@
 }
 - (void)requestData {
     NSString *groupType = nil;
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager sysMessageListRequest:KS_POST group:groupType page:self.pages rows:self.rows success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         [self endRefresh];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             // rows
@@ -122,7 +120,6 @@
         [self changePromptLabelState];
 
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
         [self endRefresh];
         if (self.networkAvaiable == NO) {
             [self setPromptString:@"暂无网络" imageName:@"no_networking" inView:self.tableView];

+ 2 - 4
KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/KSChatUserDetailViewController.m

@@ -92,7 +92,6 @@
 }
 
 - (void)requestUserMessage {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager queryUserById:KS_GET rongCloudUserId:self.rongCloudId success:^(NSDictionary * _Nonnull dic) {
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             self.userInfo = [[ChatUserInfo alloc] initWithDictionary:[dic ks_dictionaryValueForKey:@"data"]];
@@ -103,14 +102,13 @@
         }
         
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
     }];
 }
 
 - (void)requestRecentPractice {
     
     [KSNetworkingManager queryUserRecentRequest:KS_GET userId:[NSString stringWithFormat:@"%.0f",self.userInfo.userId] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         NSLog(@"%@", [dic mj_JSONString]);
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             NSArray *sourceArray = [[dic ks_dictionaryValueForKey:@"data"] ks_arrayValueForKey:@"rows"];
@@ -120,7 +118,7 @@
             
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Chat/Group/Controller/GroupSettingViewController.m

@@ -232,9 +232,9 @@
 }
 
 - (void)quitGroup {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager quitImGroupRequest:KS_POST groupId:self.groupId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"你已退出该群聊" promptCompletion:^{
                 [self quitIMGroup];
@@ -244,7 +244,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Chat/Group/Controller/KSChatComplainController.m

@@ -86,7 +86,7 @@
         return;
     }
     NSString *content = self.bodyView.inputText.text;
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     NSMutableArray *imageDataArray = [NSMutableArray array];
     for (UIImage *image in self.imageArray) {
         NSData *imgData = [UIImage turnsImaegDataByImage:image];
@@ -101,7 +101,7 @@
         NSString *attachments = [urlArray componentsJoinedByString:@","];
         [self uplodMessage:attachments content:content];
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
     }];
 }
@@ -110,7 +110,7 @@
     NSString *type = self.fromGroup ? @"GROUP" : @"PERSON";
     
     [KSNetworkingManager sysImComplaintRequest:KS_POST type:type fileUrl:attachments memo:content targetId:self.targetId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             
             [LOADING_MANAGER KSShowMsg:@"已收到您的投诉,我们会认真审核并处理" promptCompletion:^{
@@ -121,7 +121,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
     
 }

+ 0 - 3
KulexiuForStudent/KulexiuForStudent/Module/Chat/GroupNotice/Controller/GroupNoticeViewController.m

@@ -85,9 +85,7 @@
 }
 
 - (void)requestData {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager queryNoticeListRequest:KS_POST groupId:self.groupId page:[NSString stringWithFormat:@"%zd", self.pages] rows:[NSString stringWithFormat:@"%zd", self.rows] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         [self endRefresh];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             // 赋值
@@ -106,7 +104,6 @@
         [self.tableView reloadData];
         [self changePromptLabelState];
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
         [self endRefresh];
         if (self.networkAvaiable == NO) {
             [self setPromptString:@"暂无网络" imageName:CLIENT_NONETWORKING_IMG inView:self.tableView];

+ 11 - 36
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -48,8 +48,6 @@
 
 @property (nonatomic, strong) EvaluateDetailModel *evaluateModel;
 
-@property (strong, nonatomic) MBProgressHUD *HUD;
-
 @property (nonatomic, strong) AccompanyDetailBottomView *bottomView;
 
 @property (nonatomic, strong) OnlineClassManager *classManager;
@@ -302,9 +300,9 @@
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请输入评价内容"];
         return;
     }
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager accompanyCourseRepliedRequest:KS_POST courseScheduleId:self.courseId courseGroupId:self.courseGroupId studentReplied:content score:starNum success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"评价成功"];
             [self requestCourseInfoMessage];
@@ -313,7 +311,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -342,21 +340,19 @@
 
 #pragma mark --- 上传视频文件
 - (void)uploadVideoWithUrl:(NSString *)videoUrl {
-    [self hudTipWillShow:YES];
     
     NSURL *uploadFileUrl = [NSURL fileURLWithPath:videoUrl];
     NSData *fileData = [NSData dataWithContentsOfURL:uploadFileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
     [UPLOAD_MANAGER configWithfilePath:@"homework"];
     [UPLOAD_MANAGER videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
+        int progress = (int)(bytesWritten / totalBytes * 100);
+        __block NSString *tipsMessage = [NSString stringWithFormat:@"上传中 %d%%",progress];
         dispatch_main_async_safe(^{
-            // 显示进度
-            if (self.HUD) {
-                self.HUD.progress = bytesWritten / totalBytes;// progress是回调进度
-            }
+            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
         });
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         NSString *fileUrl = [fileUrlArray lastObject];
         self.isModify = YES;
         // 删除文件
@@ -365,7 +361,7 @@
         [self evaluateSubmitViewWithSource:fileUrl];
         
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         if (![NSString isEmptyString:descMessaeg]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
         }
@@ -472,9 +468,9 @@
         return;
     }
     NSString *attachment = [self.fileArray componentsJoinedByString:@","];
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager homeSubmitAction:KS_POST courseScheduleId:self.courseId attachment:attachment success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
             [self removeSubmitAlert];
@@ -485,7 +481,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -597,27 +593,6 @@
     }
 }
 
-- (void)hudTipWillShow:(BOOL)willShow{
-    if (willShow) {
-        [self resignFirstResponder];
-        UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
-        if (!_HUD) {
-            _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
-            _HUD.removeFromSuperViewOnHide = YES;
-            _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
-            _HUD.contentColor = [UIColor whiteColor];
-            _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-            _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-        }else{
-            _HUD.progress = 0;
-            [keyWindow addSubview:_HUD];
-            [_HUD showAnimated:YES];
-        }
-    }else{
-        [_HUD hideAnimated:YES];
-    }
-}
 
 - (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
     if (![NSString isEmptyString:text]) {

+ 0 - 3
KulexiuForStudent/KulexiuForStudent/Module/Course/Controller/CourseViewController.m

@@ -339,9 +339,7 @@
 
 #pragma mark --- 获取当日课程
 - (void)getCourseByDate:(NSString *)date {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager queryCourseForDay:KS_POST classDate:date success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             // 配置信息
             NSDictionary *config = [[dic ks_dictionaryValueForKey:@"data"] ks_dictionaryValueForKey:@"sysConfig"];
@@ -368,7 +366,6 @@
         [self.tableView reloadData];
         [self changePromptLabelState];
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
     }];
 }
 

+ 9 - 35
KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/Controller/MusicRoomDetailViewController.m

@@ -42,7 +42,6 @@
 @property (nonatomic, strong) KSMediaManager *mediaManager;
 
 @property (nonatomic, strong) HomeworkDetailModel *homeworkModel;
-@property (strong, nonatomic) MBProgressHUD *HUD;
 
 @property (nonatomic, strong) AccompanyDetailBottomView *bottomView;
 
@@ -92,9 +91,7 @@
 }
 
 - (void)requestHomeworkMessage {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager homeworkDetailRequest:KS_GET courseId:self.courseId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             self.homeworkModel = [[HomeworkDetailModel alloc] initWithDictionary:[dic ks_dictionaryValueForKey:@"data"]];
             if (self.homeworkModel.submitHomework == 1) {
@@ -115,7 +112,6 @@
         [self evaluateViewDisplay];
         [self.tableView reloadData];
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
     }];
 }
 
@@ -258,21 +254,19 @@
 
 #pragma mark --- 上传视频文件
 - (void)uploadVideoWithUrl:(NSString *)videoUrl {
-    [self hudTipWillShow:YES];
     
     NSURL *uploadFileUrl = [NSURL fileURLWithPath:videoUrl];
     NSData *fileData = [NSData dataWithContentsOfURL:uploadFileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
     [UPLOAD_MANAGER configWithfilePath:@"/homework/"];
     [UPLOAD_MANAGER videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
+        int progress = (int)(bytesWritten / totalBytes * 100);
+        __block NSString *tipsMessage = [NSString stringWithFormat:@"上传中 %d%%",progress];
         dispatch_main_async_safe(^{
-            // 显示进度
-            if (self.HUD) {
-                self.HUD.progress = bytesWritten / totalBytes;// progress是回调进度
-            }
+            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
         });
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         NSString *fileUrl = [fileUrlArray lastObject];
         self.isModify = YES;
         // 删除文件
@@ -280,7 +274,7 @@
         // 刷新弹窗
         [self evaluateSubmitViewWithSource:fileUrl];
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         if (![NSString isEmptyString:descMessaeg]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
         }
@@ -383,9 +377,9 @@
         return;
     }
     NSString *attachment = [self.fileArray componentsJoinedByString:@","];
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager homeSubmitAction:KS_POST courseScheduleId:self.courseId attachment:attachment success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
             [self removeSubmitAlert];
@@ -396,7 +390,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -442,27 +436,7 @@
     }
     return _tableView;
 }
-- (void)hudTipWillShow:(BOOL)willShow{
-    if (willShow) {
-        [self resignFirstResponder];
-        UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
-        if (!_HUD) {
-            _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
-            _HUD.removeFromSuperViewOnHide = YES;
-            _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
-            _HUD.contentColor = [UIColor whiteColor];
-            _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-            _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-        }else{
-            _HUD.progress = 0;
-            [keyWindow addSubview:_HUD];
-            [_HUD showAnimated:YES];
-        }
-    }else{
-        [_HUD hideAnimated:YES];
-    }
-}
+
 
 - (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
     if (![NSString isEmptyString:text]) {

+ 11 - 36
KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/Controller/VipCouseDetailViewController.m

@@ -50,8 +50,6 @@
 
 @property (nonatomic, strong) EvaluateDetailModel *evaluateModel;
 
-@property (strong, nonatomic) MBProgressHUD *HUD;
-
 @property (nonatomic, strong) AccompanyDetailBottomView *bottomView;
 
 @property (nonatomic, strong) OnlineClassManager *classManager;
@@ -307,9 +305,9 @@
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请输入评价内容"];
         return;
     }
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager accompanyCourseRepliedRequest:KS_POST courseScheduleId:self.courseId courseGroupId:self.courseGroupId studentReplied:content score:starNum success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"评价成功"];
             [self requestCourseInfoMessage];
@@ -318,7 +316,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -347,21 +345,19 @@
 
 #pragma mark --- 上传视频文件
 - (void)uploadVideoWithUrl:(NSString *)videoUrl {
-    [self hudTipWillShow:YES];
     
     NSURL *uploadFileUrl = [NSURL fileURLWithPath:videoUrl];
     NSData *fileData = [NSData dataWithContentsOfURL:uploadFileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
     [UPLOAD_MANAGER configWithfilePath:@"homework"];
     [UPLOAD_MANAGER videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
+        int progress = (int)(bytesWritten / totalBytes * 100);
+        __block NSString *tipsMessage = [NSString stringWithFormat:@"上传中 %d%%",progress];
         dispatch_main_async_safe(^{
-            // 显示进度
-            if (self.HUD) {
-                self.HUD.progress = bytesWritten / totalBytes;// progress是回调进度
-            }
+            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
         });
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         NSString *fileUrl = [fileUrlArray lastObject];
         self.isModify = YES;
         // 删除文件
@@ -370,7 +366,7 @@
         [self evaluateSubmitViewWithSource:fileUrl];
         
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         if (![NSString isEmptyString:descMessaeg]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
         }
@@ -476,9 +472,9 @@
         return;
     }
     NSString *attachment = [self.fileArray componentsJoinedByString:@","];
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager homeSubmitAction:KS_POST courseScheduleId:self.courseId attachment:attachment success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
             [self removeSubmitAlert];
@@ -489,7 +485,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -603,27 +599,6 @@
             break;
     }
 }
-- (void)hudTipWillShow:(BOOL)willShow{
-    if (willShow) {
-        [self resignFirstResponder];
-        UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
-        if (!_HUD) {
-            _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
-            _HUD.removeFromSuperViewOnHide = YES;
-            _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.text = @"正在上传视频文件...";
-            _HUD.contentColor = [UIColor whiteColor];
-            _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-            _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-        }else{
-            _HUD.progress = 0;
-            [keyWindow addSubview:_HUD];
-            [_HUD showAnimated:YES];
-        }
-    }else{
-        [_HUD hideAnimated:YES];
-    }
-}
 
 - (void)tryJoinRoom {
     

+ 5 - 5
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -685,7 +685,7 @@
 }
 
 - (void)requestData {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [self requestNewsList];
     [self requestStatistics];
     [self requestNotice];
@@ -698,7 +698,7 @@
         [self requestAwardMessage];
     }
     dispatch_group_notify(self.requestGroup, dispatch_get_main_queue(), ^{
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         [self.pagerView.mainTableView.mj_header endRefreshing];
         [self refreshView];
     });
@@ -1126,9 +1126,9 @@
 }
 
 - (void)followTalentTeacher:(NSString *)teacherId {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager starOrUnStarRequest:KS_GET userId:teacherId starStatus:@"1" success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             
             [LOADING_MANAGER KSShowMsg:@"关注成功" promptCompletion:^{
@@ -1139,7 +1139,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Home/NoticeCenter/Controller/NotiferMessageViewController.m

@@ -166,9 +166,9 @@
 }
 
 - (void)requestData {
-    [LOADING_MANAGER showHUD];
+    
     [KSNetworkingManager sysMessageListRequest:KS_POST group:self.groupType page:self.pages rows:self.rows success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+       
         [self endRefresh];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             // rows
@@ -188,7 +188,7 @@
         [self changePromptLabelState];
 
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        
         [self endRefresh];
         if (self.networkAvaiable == NO) {
             [self setPromptString:@"暂无网络" imageName:@"no_networking" inView:self.tableView];

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomePageView/HomePageBodyView.m

@@ -180,9 +180,9 @@
     if ([NSString isEmptyString:liveRoomId]) {
         return;
     }
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSEnterLiveroomManager joinLiveWithRoomId:liveRoomId inController:(CustomNavViewController *)self.naviController callback:^{
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/FirstSettingViewController.m

@@ -74,9 +74,9 @@
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请设置性别"];
         return;
     }
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager setPasswordRequest:KS_POST username:nickName password:pwdCode userSex:self.userSex token:self.access_token success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             MJWeakSelf;
             UserDefaultSet(self.phone, PHONEKEY);
@@ -91,7 +91,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 6 - 5
KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/InstrumentChooseViewController.m

@@ -99,9 +99,9 @@
 }
 
 - (void)requestInstrumentMessage {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager studentQuerySubject:KS_GET success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [self evaluateSource:[dic ks_arrayValueForKey:@"data"]];
         }
@@ -109,7 +109,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         
     }];
 }
@@ -259,8 +259,9 @@
 - (void)sureChooseSubject {
     InstrumentMessageModel *model = self.chooseModel;
     NSString *subjectId = model.internalBaseClassIdentifier;
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager studentSetSubject:KS_GET subjectIds:subjectId success:^(NSDictionary * _Nonnull dic) {
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"设置成功" promptCompletion:^{
                 if (self.callback) {
@@ -273,7 +274,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/PasswordLoginController.m

@@ -59,9 +59,9 @@
         [self backAction];
     }
     else if (action == PWDLOGIN_LOGIN) {
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"加载中..."];
         [KSNetworkingManager LoginRequest:KS_POST phone:[parm ks_stringValueForKey:@"phone"] password:[parm ks_stringValueForKey:@"password"] success:^(NSDictionary * _Nonnull dic) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
             if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
                 NSDictionary *result = [dic ks_dictionaryValueForKey:@"data"];
                 // 保存用户类型
@@ -82,7 +82,7 @@
                 [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
             }
         } faliure:^(NSError * _Nonnull error) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
         }];
     }
 }

+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/VefiCodeLoginController.m

@@ -99,9 +99,9 @@
 
 // 发送短信 校验图形验证码
 - (void)veriImageCodeWithParm:(NSDictionary *)parm checkView:(VeriCheckView *)checkView {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager sendSmsRequest:KS_POST mobile:[parm ks_stringValueForKey:@"phone"] type:@"LOGIN" code:[parm ks_stringValueForKey:@"code"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [checkView hiddView];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"验证码已发送"];
@@ -111,7 +111,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -152,9 +152,9 @@
 
 - (void)loginAction:(NSString *)code {
     
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager smsLoginRequest:KS_POST phone:self.phoneNo smsCode:code success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             NSDictionary *result = [dic ks_dictionaryValueForKey:@"data"];
 
@@ -181,7 +181,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 6 - 9
KulexiuForStudent/KulexiuForStudent/Module/Mine/AddressList/Controller/AddressDetailViewController.m

@@ -39,9 +39,7 @@
 }
 
 - (void)queryAddressDetail {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager queryAddressDetailRequst:KS_GET addressId:self.addressId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200) {
             [self evaluateUI:[dic ks_dictionaryValueForKey:@"data"]];
         }
@@ -49,7 +47,6 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:[dic ks_stringValueForKey:@"message"]];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
     }];
 }
 
@@ -135,9 +132,9 @@
         return;
     }
     if (self.modifyAddress) {
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"加载中..."];
         [KSNetworkingManager updateAddressRequest:KS_POST addressId:self.addressId name:self.bodyView.nameField.text phoneNumber:phoneNo defaultStatus:self.bodyView.isOn detailAddress:self.bodyView.detailAddress.text province:self.province city:self.city region:self.region postCode:self.cityCode success:^(NSDictionary * _Nonnull dic) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
             if ([dic ks_integerValueForKey:@"code"] == 200) {
                 [LOADING_MANAGER KSShowMsg:@"修改成功" promptCompletion:^{
                     [self backAction];
@@ -147,13 +144,13 @@
                 [LOADING_MANAGER MBShowAUTOHidingInWindow:[dic ks_stringValueForKey:@"message"]];
             }
         } faliure:^(NSError * _Nonnull error) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
         }];
     }
     else {
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"加载中..."];
         [KSNetworkingManager addAddressRequest:KS_POST name:self.bodyView.nameField.text phoneNumber:phoneNo defaultStatus:self.bodyView.isOn detailAddress:self.bodyView.detailAddress.text province:self.province city:self.city region:self.region postCode:self.cityCode success:^(NSDictionary * _Nonnull dic) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
             if ([dic ks_integerValueForKey:@"code"] == 200) {
                 [LOADING_MANAGER KSShowMsg:@"新增成功" promptCompletion:^{
                     [self backAction];
@@ -163,7 +160,7 @@
                 [LOADING_MANAGER MBShowAUTOHidingInWindow:[dic ks_stringValueForKey:@"message"]];
             }
         } faliure:^(NSError * _Nonnull error) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
         }];
     }
 }

+ 3 - 5
KulexiuForStudent/KulexiuForStudent/Module/Mine/AddressList/Controller/AddressListViewController.m

@@ -79,9 +79,7 @@
 }
 
 - (void)requestData {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager companyAddressListRequest:KS_GET success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         [self endRefresh];
         if ([dic ks_integerValueForKey:@"code"] == 200) {
             NSArray *listArray = [dic ks_arrayValueForKey:@"data"];
@@ -96,7 +94,6 @@
         [self.tableView reloadData];
         [self changePromptLabelState];
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
         [self endRefresh];
         if (self.networkAvaiable == NO) {
             [self setPromptString:@"暂无网络" imageName:@"no_networking" inView:self.tableView];
@@ -165,8 +162,9 @@
 }
 
 - (void)deleteAddress:(NSString *)addressId {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager deleteAddressRequest:KS_POST addressId:addressId success:^(NSDictionary * _Nonnull dic) {
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"删除成功"];
             [self refreshAndRequestData];
@@ -175,7 +173,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:[dic ks_stringValueForKey:@"message"]];
         }
     } faliure:^(NSError * _Nonnull error) {
-        
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Module/Mine/Controller/MineViewController.m

@@ -114,13 +114,13 @@
 }
 
 - (void)requestData {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [self requsetUserMessage];
     [self requestUserMemo];
     [self requestConfig];
     
     dispatch_group_notify(self.requestGroup, dispatch_get_main_queue(), ^{
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         [self refreshView];
     });
 }

+ 10 - 39
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/Controller/HomeworkDetailViewController.m

@@ -40,8 +40,6 @@
 
 @property (nonatomic, strong) KSMediaManager *mediaManager;
 
-@property (strong, nonatomic) MBProgressHUD *HUD;
-
 @property (nonatomic, assign) BOOL canModify;
 
 @property (nonatomic, assign) BOOL isModify; // 是否修改作业
@@ -217,20 +215,19 @@
 
 #pragma mark --- 上传视频文件
 - (void)uploadVideoWithUrl:(NSString *)videoUrl {
-    [self hudTipWillShow:YES];
+    
     NSURL *uploadFileUrl = [NSURL fileURLWithPath:videoUrl];
     NSData *fileData = [NSData dataWithContentsOfURL:uploadFileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
     [UPLOAD_MANAGER configWithfilePath:@"/homework/"];
     [UPLOAD_MANAGER videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
+        int progress = (int)(bytesWritten / totalBytes * 100);
+        __block NSString *tipsMessage = [NSString stringWithFormat:@"上传中 %d%%",progress];
         dispatch_main_async_safe(^{
-            // 显示进度
-            if (self.HUD) {
-                self.HUD.progress = bytesWritten / totalBytes;// progress是回调进度
-            }
+            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
         });
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [self hudTipWillShow:NO];
+        [LOADING_MANAGER removeCustomLoading];
         NSString *fileUrl = [fileUrlArray lastObject];
         self.isModify = YES;
         // 删除文件
@@ -238,10 +235,8 @@
         [self.fileArray addObject:fileUrl];
         [self.alertView configWithFileArray:self.fileArray];
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [self hudTipWillShow:NO];
-        if (![NSString isEmptyString:descMessaeg]) {
-            [LOADING_MANAGER MBShowAUTOHidingInWindow:descMessaeg];
-        }
+        [LOADING_MANAGER removeCustomLoading];
+        [LOADING_MANAGER MBShowAUTOHidingInWindow:@"上传失败,请重试"];
     }];
 }
 
@@ -335,9 +330,9 @@
         return;
     }
     NSString *attachment = [self.fileArray componentsJoinedByString:@","];
-    [LOADING_MANAGER showHUD];
+    
     [KSNetworkingManager homeSubmitAction:KS_POST courseScheduleId:self.courseId attachment:attachment success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
             [self removeSubmitAlert];
@@ -348,7 +343,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -433,30 +428,6 @@
     }
 }
 
-
-
-- (void)hudTipWillShow:(BOOL)willShow{
-    if (willShow) {
-        [self resignFirstResponder];
-        UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
-        if (!_HUD) {
-            _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
-            _HUD.removeFromSuperViewOnHide = YES;
-            _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
-            _HUD.contentColor = [UIColor whiteColor];
-            _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
-            _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
-        }else{
-            _HUD.progress = 0;
-            [keyWindow addSubview:_HUD];
-            [_HUD showAnimated:YES];
-        }
-    }else{
-        [_HUD hideAnimated:YES];
-    }
-}
-
 - (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
     if (![NSString isEmptyString:text]) {
         NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyNameViewController.m

@@ -60,9 +60,9 @@
     NSString *avatal = nil;
     NSString *gendar = nil;
     NSString *birthday = nil;
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager modifyUserMessage:KS_POST avatal:avatal gender:gendar username:self.bodyView.nameField.text birthdate:birthday success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"修改成功" promptCompletion:^{
                 if (self.callback) {
@@ -75,7 +75,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
     
     

+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyPhoneChangeController.m

@@ -70,9 +70,9 @@
 
 #pragma mark --- 修改手机号
 - (void)modifyPhoneWithParm:(NSDictionary *)parm {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager updatePhoneRequest:KS_POST oldPhone:self.prePhone authCode:[parm ks_stringValueForKey:@"code"] newPhone:[parm ks_stringValueForKey:@"phone"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"修改成功" promptCompletion:^{
                 UserDefaultSet([parm ks_stringValueForKey:@"phone"], PHONEKEY);
@@ -85,7 +85,7 @@
         }
         
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
     
 }
@@ -109,9 +109,9 @@
 
 // 发送短信 校验图形验证码
 - (void)veriImageCodeWithParm:(NSDictionary *)parm checkView:(VeriCheckView *)checkView {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager sendSmsRequest:KS_POST mobile:[parm ks_stringValueForKey:@"phone"] type:@"PHONE" code:[parm ks_stringValueForKey:@"code"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [checkView hiddView];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"验证码已发送"];
@@ -121,7 +121,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyPhoneCheckController.m

@@ -50,9 +50,9 @@
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"手机号码输入有误"];
         return;
     }
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager checkUserRequest:KS_GET phone:phoneNo password:password success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [self nextChangeViewWithWithPhone:phoneNo];
         }
@@ -60,7 +60,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/ModifyViewController.m

@@ -64,9 +64,9 @@
 
 #pragma mark -- 修改密码
 - (void)modifyPassword:(NSDictionary *)parm {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager updatePasswordRequest:KS_POST authCode:[parm ks_stringValueForKey:@"code"] mobile:[parm ks_stringValueForKey:@"phone"] newPassword:[parm ks_stringValueForKey:@"password"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"修改成功" promptCompletion:^{
                 [self toLoginView];
@@ -76,7 +76,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -99,9 +99,9 @@
 
 // 发送短信 校验图形验证码
 - (void)veriImageCodeWithParm:(NSDictionary *)parm checkView:(VeriCheckView *)checkView {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager sendSmsRequest:KS_POST mobile:[parm ks_stringValueForKey:@"phone"] type:@"PASSWD" code:[parm ks_stringValueForKey:@"code"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [checkView hiddView];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"验证码已发送"];
@@ -111,7 +111,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/PasswordModify/ForgetPasswordViewController.m

@@ -61,9 +61,9 @@
 
 
 - (void)checkCode:(NSString *)code {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager checkVerityCodeRequest:KS_POST code:code success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [self modifyPasswordAction];
         }
@@ -71,7 +71,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         
     }];
 }
@@ -96,9 +96,9 @@
 
 // 发送短信 校验图形验证码
 - (void)veriImageCodeWithParm:(NSDictionary *)parm checkView:(VeriCheckView *)checkView {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager sendSmsRequest:KS_POST mobile:[parm ks_stringValueForKey:@"phone"] type:@"PASSWD" code:[parm ks_stringValueForKey:@"code"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [checkView hiddView];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"验证码已发送"];
@@ -108,7 +108,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
 
     }];
 }

+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/PasswordModify/NewPwdModifyViewController.m

@@ -60,9 +60,9 @@
 }
 
 - (void)updatePassword:(NSString *)password code:(NSString *)code {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager setPasswordRequest:KS_POST password:password code:code success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"修改成功" promptCompletion:^{
                 [self toLoginView];
@@ -72,7 +72,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         
     }];
 }
@@ -95,9 +95,9 @@
 
 // 发送短信 校验图形验证码
 - (void)veriImageCodeWithParm:(NSDictionary *)parm checkView:(VeriCheckView *)checkView {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager sendSmsRequest:KS_POST mobile:[parm ks_stringValueForKey:@"phone"] type:@"PASSWD" code:[parm ks_stringValueForKey:@"code"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [checkView hiddView];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"验证码已发送"];
@@ -107,7 +107,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
 
     }];
 }

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/PasswordModify/PasswordCheckViewController.m

@@ -56,10 +56,10 @@
 }
 
 - (void)passwordCheck:(NSString *)password {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     
     [KSNetworkingManager checkPasswordRequest:KS_POST password:password success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [self modifyPasswordAction];
         }
@@ -67,7 +67,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/UserAuthViewController.m

@@ -68,9 +68,9 @@
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请阅读并同意用户注册协议"];
         return;
     }
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager realNameAuthRequest:KS_POST idCardNo:self.bodyView.cardField.text realName:self.bodyView.nameField.text success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"认证成功" promptCompletion:^{
                 [self backAction];
@@ -83,7 +83,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/UserSettingViewController.m

@@ -285,9 +285,9 @@
 
 - (void)modifyUserMessage:(NSString *)imgUrl gender:(NSString *)gender birthday:(NSString *)birthday {
     NSString *userName = nil;
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager modifyUserMessage:KS_POST avatal:imgUrl gender:gender username:userName birthdate:birthday success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"修改成功"];
             [self requestUserMessage];
@@ -296,7 +296,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/Controller/AccountDeleteViewController.m

@@ -101,9 +101,9 @@
 
 #pragma mark ----- 删除账号
 - (void)deleteAccount:(NSString *)code {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager logoffRequest:KS_GET smsCode:code success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER KSShowMsg:@"注销成功,感谢您的使用" promptCompletion:^{
                 [self successDeleteBack];
@@ -118,7 +118,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 
@@ -147,9 +147,9 @@
 
 // 发送短信 校验图形验证码
 - (void)veriImageCodeWithParm:(NSDictionary *)parm checkView:(VeriCheckView *)checkView {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager sendSmsRequest:KS_POST mobile:[parm ks_stringValueForKey:@"phone"] type:@"LOGOFF" code:[parm ks_stringValueForKey:@"code"] success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [checkView hiddView];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"验证码已发送"];
@@ -159,7 +159,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Works/View/MineWorksBodyView.m

@@ -459,9 +459,9 @@
         }
     }
     NSString *musicId = [draftArray componentsJoinedByString:@","];
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [KSNetworkingManager userMusicRemoveRequest:KS_POST musicId:musicId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200) {
             [LOADING_MANAGER KSShowMsg:@"删除成功" promptCompletion:^{
                 [self refreshAndRequestData];
@@ -471,7 +471,7 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
     }];
 }
 

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/Controller/TXClassroomViewController.m

@@ -382,7 +382,7 @@
                 
             } confirm:^{
                 weakSelf.isQuitRoom = YES;
-                [LOADING_MANAGER showHUD];
+                [LOADING_MANAGER showCustomLoading:@"加载中..."];
                 [[LoginHelper sharedInstance] logout];
             }];
 
@@ -418,7 +418,7 @@
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
             // 课程结束退出房间
             SealClassLog(@"ClassEnd!");
-            [LOADING_MANAGER showHUD];
+            [LOADING_MANAGER showCustomLoading:@"加载中..."];
             [[LoginHelper sharedInstance] logout];
         });
     }
@@ -440,7 +440,7 @@
 }
 
 - (void)dismissClassroom {
-    [LOADING_MANAGER removeHUD];
+    [LOADING_MANAGER removeCustomLoading];
     [ClassroomService sharedService].currentRoom = nil;
     [self changeOrientation:NO];
     [self.timeManager stopDurationTimer];
@@ -516,7 +516,7 @@
 
 - (void)errorDidOccur:(ErrorCode)code {
     NSLog(@"errorDidOccur %@",@(code));
-    [LOADING_MANAGER removeHUD];
+    [LOADING_MANAGER removeCustomLoading];
     if (code != ErrorCodeSuccess) {
         if (code == ErrorCodeOverMaxUserCount) {
             [self.tipsView showTipsMessage:@"超过人数限制" inView:self.view];

+ 5 - 5
KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/Model/OnlineClassManager.m

@@ -46,7 +46,7 @@
 - (void)joinRoom {
     // 进入房间重置默认值
     [LocalRenderManager shareInstance].hadRenderMainView = NO;
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [self login:NO];
 }
 
@@ -54,7 +54,7 @@
 - (void)classroomDidJoin:(Classroom *)classroom {
     
     if ([self.baseCtrl.navigationController.topViewController isKindOfClass:[self.baseCtrl class]]) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         
         // 加入RTC成功反馈给后端
         [self notiferIsSuccess:YES];
@@ -65,7 +65,7 @@
 
 
 - (void)classroomDidJoinFailCode:(NSNumber *)code errorMessage:(nonnull NSString *)message {
-    [LOADING_MANAGER removeHUD];
+    [LOADING_MANAGER removeCustomLoading];
     NSString *tipsMessage = [NSString isEmptyString:message] ? [NSString stringWithFormat:@"加入房间失败,请重试.错误码:%@",code] : message;
     [self notiferIsSuccess:NO];
     [KSNormalAlertView ks_showAlertWithTitle:tipsMessage confirmTitle:@"确定" confirm:^{
@@ -75,7 +75,7 @@
 
 // 加入RTC房间失败回调
 - (void)classroomDidJoinFailRTC:(NSNumber *)code {
-    [LOADING_MANAGER removeHUD];
+    [LOADING_MANAGER removeCustomLoading];
     [self notiferIsSuccess:NO];
 //
 //    NSString *tipsMessage = [NSString stringWithFormat:@"加入房间失败RTC:%@",code];
@@ -91,7 +91,7 @@
 
 - (void)classroomDidOverMaxUserCount {
     [self notiferIsSuccess:NO];
-    [LOADING_MANAGER removeHUD];
+    [LOADING_MANAGER removeCustomLoading];
     [KSNormalAlertView ks_showAlertWithTitle:@"教室人数已满!" confirmTitle:@"确认" confirm:^{
     }];
 }

+ 8 - 6
KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/View/NewWhiteboard/KSNewWhiteBoard.m

@@ -647,7 +647,7 @@
     }
     else {
         self.isJoinRoom = YES;
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"加载中..."];
     }
 }
 // 离开房间
@@ -673,7 +673,7 @@
 - (void)removeLoadig {
     self.isLoadingSource = NO;
     if (self.isJoinRoom) {
-        [LOADING_MANAGER removeHUD];
+        [LOADING_MANAGER removeCustomLoading];
         [self loadRequest];
     }
 }
@@ -702,9 +702,9 @@
 - (void)refreshWebViewAction {
     // 如果链接为空
     if ([NSString isEmptyString:self.url]) {
-        [LOADING_MANAGER showHUD];
+        [LOADING_MANAGER showCustomLoading:@"加载中..."];
         [WhiteUtils getRoomTokenWithRoomId:self.roomId completionHandler:^(NSString * _Nullable uuid, NSString * _Nullable roomToken, NSString * _Nonnull randomRoom, NSString * _Nullable randomNumeric, NSError * _Nullable error) {
-            [LOADING_MANAGER removeHUD];
+            [LOADING_MANAGER removeCustomLoading];
             if (!error) {
                 NSString *url = [NSString stringWithFormat:@"%@%@?roomId=%@&userId=%@&clientType=STUDENT&role=viewer#room=%@,%@", hostURL, @"/whiteboard/",self.roomId,UserDefault(UIDKey),randomRoom,randomNumeric];
                 self.url = url;
@@ -719,9 +719,11 @@
 }
 
 - (void)refreshRequest {
-    [LOADING_MANAGER showHUD];
+    [LOADING_MANAGER showCustomLoading:@"加载中..."];
     [self loadRequest];
-    [LOADING_MANAGER removeHUD];
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [LOADING_MANAGER removeCustomLoading];
+    });
 }
 
 - (UIViewController *)getViewController {