Steven před 5 roky
rodič
revize
541dd2d9a0

+ 3 - 1
MusicGradeExam/MusicGradeExam/KSRequestManager.h

@@ -327,9 +327,11 @@ NS_ASSUME_NONNULL_BEGIN
 /// @param get get
 /// @param subjectList 专业
 /// @param level 级别
+/// /// @param page 分页
+/// @param rows 条数
 /// @param success 成功
 /// @param faliure 失败
-+ (void)musicSongListRequest:(NSString *)get subjectList:(NSString *)subjectList level:(NSString *)level success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
++ (void)musicSongListRequest:(NSString *)get subjectList:(NSString *)subjectList level:(NSString *)level page:(NSString *)page rows:(NSString *)rows success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
 @end
 
 NS_ASSUME_NONNULL_END

+ 5 - 1
MusicGradeExam/MusicGradeExam/KSRequestManager.m

@@ -713,13 +713,17 @@
 /// @param get get
 /// @param subjectList 专业
 /// @param level 级别
+/// /// @param page 分页
+/// @param rows 条数
 /// @param success 成功
 /// @param faliure 失败
-+ (void)musicSongListRequest:(NSString *)get subjectList:(NSString *)subjectList level:(NSString *)level success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure {
++ (void)musicSongListRequest:(NSString *)get subjectList:(NSString *)subjectList level:(NSString *)level page:(NSString *)page rows:(NSString *)rows success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure {
     NSString *url = [NSString stringWithFormat:@"%@%@", hostURL, @"/api-user/examSong/queryPage"];
     NSMutableDictionary *parm = [NSMutableDictionary dictionary];
     [parm setValue:subjectList forKey:@"subjectList"];
     [parm setValue:level forKey:@"level"];
+    [parm setValue:page forKey:@"page"];
+    [parm setValue:rows forKey:@"rows"];
     [self request:get url:url parm:nil success:success faliure:faliure];
 }
 

+ 1 - 1
MusicGradeExam/MusicGradeExam/Tools/NetworkManager/KSNetworking.m

@@ -22,7 +22,7 @@ static NSDictionary     *headers;
 
 static KSNetworkStatus  networkStatus;
 
-static NSTimeInterval   requestTimeout = 10.0f;  // 超时时间
+static NSTimeInterval   requestTimeout = 220.0f;  // 超时时间
 
 @interface KSNetworking ()
 

+ 14 - 2
MusicGradeExam/MusicGradeExam/UI/Classroom/Controller/ClassroomViewController.m

@@ -374,9 +374,21 @@
     if ([curMember.userId isEqualToString:member.userId]) {
         // 弹窗提示去录播
         [KSNormalAlertView ks_showAlertWithTitle:@"当前在线直播考试无法正常完成\n主考官建议您使用录播进行考试" leftTitle:@"取消" rightTitle:@"去录播" cancel:^{
-            
+            // 离开教室
+            self.isQuitRoom = YES;
+            self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+            [[RoomLoginHelper sharedInstance] logout:^{
+            } error:^(RongRTCCode code) {
+                [self.hud hideAnimated:YES];
+            }];
         } confirm:^{
-            
+            // 去录播
+            self.isQuitRoom = YES;
+            self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+            [[RoomLoginHelper sharedInstance] logout:^{
+            } error:^(RongRTCCode code) {
+                [self.hud hideAnimated:YES];
+            }];
         }];
     }
 }

+ 3 - 1
MusicGradeExam/MusicGradeExam/UI/ExamLibrary/Controller/ExamLibraryController.m

@@ -129,7 +129,7 @@
 }
 
 - (void)requestData {
-    [KSRequestManager musicSongListRequest:KS_GET subjectList:self.subjectId level:self.levelString success:^(NSDictionary * _Nonnull dic) {
+    [KSRequestManager musicSongListRequest:KS_GET subjectList:self.subjectId level:self.levelString page:[NSString stringWithFormat:@"%zd", self.pages] rows:[NSString stringWithFormat:@"%zd", self.rows] success:^(NSDictionary * _Nonnull dic) {
         [self.tableView.mj_header endRefreshing];
         [self.tableView.mj_footer endRefreshing];
         if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
@@ -190,7 +190,9 @@
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    SongListModel *model = self.dataArray[indexPath.row];
     OpenFileViewController *fileUrl = [[OpenFileViewController alloc] init];
+//    model.fileUrlList 
     fileUrl.urlString = @"https://www.tutorialspoint.com/ios/ios_tutorial.pdf";
     [self.navigationController pushViewController:fileUrl animated:YES];
 }

+ 6 - 2
MusicGradeExam/MusicGradeExam/UI/ExamLibrary/Controller/OpenFileViewController.m

@@ -15,6 +15,7 @@
 
 @property (nonatomic, strong) NSURL *fileURL;
 
+@property (nonatomic, strong) MBProgressHUD *hud;
 
 @end
 
@@ -25,7 +26,7 @@
     // Do any additional setup after loading the view.
     [self allocTitle:@"曲目详情"];
     [self addChildViewController:self.previewCtrl];
-    [self.view addSubview:self.previewCtrl.view];
+    
 }
 
 
@@ -41,13 +42,16 @@
         [self.previewCtrl refreshCurrentPreviewItem];
     }
     else { // 网络下载
+        self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
         [KSRequestManager downloadFileRequestWithFileUrl:self.urlString progress:^(int64_t bytesRead, int64_t totalBytes) {
             
         } success:^(NSURL * _Nonnull fileUrl) {
+             [self.hud hideAnimated:YES];
             self.fileURL = fileUrl;
+            [self.view addSubview:self.previewCtrl.view];
             [self.previewCtrl refreshCurrentPreviewItem];
         } faliure:^(NSError * _Nonnull error) {
-            
+             [self.hud hideAnimated:YES];
         }];
     }
 }

+ 3 - 3
MusicGradeExam/MusicGradeExam/UI/Home/View/HomeBodyView.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
@@ -50,7 +50,7 @@
                         <constraint firstAttribute="height" constant="40" id="C4X-wk-y2Q"/>
                         <constraint firstAttribute="width" constant="40" id="S9o-kq-zZV"/>
                     </constraints>
-                    <state key="normal" image="notice_unread"/>
+                    <state key="normal" image="notice_read"/>
                     <connections>
                         <action selector="buttonClickAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="WhJ-yF-Z16"/>
                     </connections>
@@ -224,7 +224,7 @@
         <image name="book_record" width="351" height="120"/>
         <image name="exam_record" width="351" height="120"/>
         <image name="home_top" width="375" height="158"/>
-        <image name="notice_unread" width="21" height="22"/>
+        <image name="notice_read" width="19" height="22"/>
         <image name="record_detail" width="14" height="18"/>
     </resources>
 </document>