Bladeren bron

功能优化

Steven 5 jaren geleden
bovenliggende
commit
642b181577
47 gewijzigde bestanden met toevoegingen van 565 en 225 verwijderingen
  1. 10 0
      MusicGradeExam/MusicGradeExam.xcodeproj/project.pbxproj
  2. 3 2
      MusicGradeExam/MusicGradeExam/AppDelegate.m
  3. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/Login/login_unable.imageset/login_unable@2x.png
  4. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/Login/login_unable.imageset/login_unable@3x.png
  5. 2 2
      MusicGradeExam/MusicGradeExam/Assets.xcassets/stamp_image.imageset/Contents.json
  6. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/stamp_image.imageset/stamp_image@2x.png
  7. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/stamp_image.imageset/stamp_image@3x.png
  8. 22 0
      MusicGradeExam/MusicGradeExam/Assets.xcassets/ticket_image.imageset/Contents.json
  9. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/ticket_image.imageset/ticket_image@2x.png
  10. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/ticket_image.imageset/ticket_image@3x.png
  11. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/wd_img_zwsj.imageset/wd_img_zwsj@2x.png
  12. BIN
      MusicGradeExam/MusicGradeExam/Assets.xcassets/wd_img_zwsj.imageset/wd_img_zwsj@3x.png
  13. 5 1
      MusicGradeExam/MusicGradeExam/Base/KSBaseWKWebViewController.m
  14. 1 1
      MusicGradeExam/MusicGradeExam/KSRequestManager.h
  15. 8 4
      MusicGradeExam/MusicGradeExam/KSRequestManager.m
  16. 3 0
      MusicGradeExam/MusicGradeExam/Tools/Custom/KSGuideMaskView.h
  17. 11 0
      MusicGradeExam/MusicGradeExam/Tools/Custom/KSGuideMaskView.m
  18. 39 22
      MusicGradeExam/MusicGradeExam/UI/Classroom/Controller/ClassroomViewController.m
  19. 50 10
      MusicGradeExam/MusicGradeExam/UI/Exam/Controller/WaitExamViewController.m
  20. 1 0
      MusicGradeExam/MusicGradeExam/UI/Exam/Model/TicketListModel.h
  21. 17 13
      MusicGradeExam/MusicGradeExam/UI/Exam/Model/TicketListModel.m
  22. 3 3
      MusicGradeExam/MusicGradeExam/UI/Exam/View/ExamDeviceCheckView.xib
  23. 4 1
      MusicGradeExam/MusicGradeExam/UI/Exam/View/TicketBodyView.m
  24. 59 19
      MusicGradeExam/MusicGradeExam/UI/Exam/View/TicketBodyView.xib
  25. 0 2
      MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.h
  26. 1 58
      MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.m
  27. 2 34
      MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.xib
  28. 29 0
      MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.h
  29. 156 0
      MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.m
  30. 60 0
      MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.xib
  31. 2 2
      MusicGradeExam/MusicGradeExam/UI/ExamLibrary/Controller/ExamLibraryController.m
  32. 4 5
      MusicGradeExam/MusicGradeExam/UI/Home/Controller/HomeViewController.m
  33. 3 3
      MusicGradeExam/MusicGradeExam/UI/Home/View/HomeBodyView.m
  34. 1 1
      MusicGradeExam/MusicGradeExam/UI/Login/Controller/LoginViewController.m
  35. 5 1
      MusicGradeExam/MusicGradeExam/UI/Login/Controller/ModifyViewController.m
  36. 1 1
      MusicGradeExam/MusicGradeExam/UI/Login/Controller/RegisterViewController.m
  37. 1 1
      MusicGradeExam/MusicGradeExam/UI/Login/Controller/VefiLoginViewController.m
  38. 3 1
      MusicGradeExam/MusicGradeExam/UI/Login/Model/UserInfoManager.h
  39. 6 11
      MusicGradeExam/MusicGradeExam/UI/Login/Model/UserInfoManager.m
  40. 1 1
      MusicGradeExam/MusicGradeExam/UI/NotiferMessage/Controller/NotifyMessageViewController.m
  41. 20 3
      MusicGradeExam/MusicGradeExam/UI/NotiferMessage/View/NotifyMessageCell.m
  42. 13 9
      MusicGradeExam/MusicGradeExam/UI/NotiferMessage/View/NotifyMessageCell.xib
  43. 3 3
      MusicGradeExam/MusicGradeExam/UI/UserCenter/DeviceCheck/DeviceCheckView.xib
  44. 5 1
      MusicGradeExam/MusicGradeExam/UI/UserCenter/Setting/Controller/ModifyPhoneChangeController.m
  45. 5 1
      MusicGradeExam/MusicGradeExam/UI/UserCenter/Setting/Controller/SettingViewController.m
  46. 6 6
      MusicGradeExam/MusicGradeExam/UI/UserCenter/View/UserCenterBodyView.m
  47. 0 3
      MusicGradeExam/MusicGradeExam/UI/UserCenter/View/UserCenterBodyView.xib

+ 10 - 0
MusicGradeExam/MusicGradeExam.xcodeproj/project.pbxproj

@@ -349,6 +349,8 @@
 		27D4149824CA741D000DBC0C /* RecordExamModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D4149724CA741D000DBC0C /* RecordExamModel.m */; };
 		27D4149B24CA757A000DBC0C /* SongModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D4149A24CA757A000DBC0C /* SongModel.m */; };
 		27DBF9D324D8F67B00202145 /* KSStatusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27DBF9D224D8F67B00202145 /* KSStatusView.m */; };
+		27DBF9D624DAAE6200202145 /* WaitExamBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27DBF9D524DAAE6100202145 /* WaitExamBottomView.m */; };
+		27DBF9D824DAAE7500202145 /* WaitExamBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 27DBF9D724DAAE7500202145 /* WaitExamBottomView.xib */; };
 		27EF3EEE24BEE35E002068A2 /* MessageListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 27EF3EED24BEE35E002068A2 /* MessageListModel.m */; };
 		27EF3EF224BEE885002068A2 /* NotifyMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 27EF3EF024BEE885002068A2 /* NotifyMessageCell.m */; };
 		27EF3EF324BEE885002068A2 /* NotifyMessageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 27EF3EF124BEE885002068A2 /* NotifyMessageCell.xib */; };
@@ -1027,6 +1029,9 @@
 		27D4149A24CA757A000DBC0C /* SongModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SongModel.m; sourceTree = "<group>"; };
 		27DBF9D124D8F67B00202145 /* KSStatusView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSStatusView.h; sourceTree = "<group>"; };
 		27DBF9D224D8F67B00202145 /* KSStatusView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSStatusView.m; sourceTree = "<group>"; };
+		27DBF9D424DAAE6100202145 /* WaitExamBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WaitExamBottomView.h; sourceTree = "<group>"; };
+		27DBF9D524DAAE6100202145 /* WaitExamBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WaitExamBottomView.m; sourceTree = "<group>"; };
+		27DBF9D724DAAE7500202145 /* WaitExamBottomView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WaitExamBottomView.xib; sourceTree = "<group>"; };
 		27EF3EEC24BEE35E002068A2 /* MessageListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageListModel.h; sourceTree = "<group>"; };
 		27EF3EED24BEE35E002068A2 /* MessageListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageListModel.m; sourceTree = "<group>"; };
 		27EF3EEF24BEE885002068A2 /* NotifyMessageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotifyMessageCell.h; sourceTree = "<group>"; };
@@ -1772,6 +1777,9 @@
 				27EF3EFC24BF015A002068A2 /* WaitExamBodyView.h */,
 				27EF3EFD24BF015A002068A2 /* WaitExamBodyView.m */,
 				27EF3EFF24BF016B002068A2 /* WaitExamBodyView.xib */,
+				27DBF9D424DAAE6100202145 /* WaitExamBottomView.h */,
+				27DBF9D524DAAE6100202145 /* WaitExamBottomView.m */,
+				27DBF9D724DAAE7500202145 /* WaitExamBottomView.xib */,
 				278D113A24CFC6A100599421 /* ExamDeviceCheckView.h */,
 				278D113B24CFC6A200599421 /* ExamDeviceCheckView.m */,
 				278D113D24CFC6B600599421 /* ExamDeviceCheckView.xib */,
@@ -2818,6 +2826,7 @@
 				2729F7F624C8398B00E1F3C4 /* RecordBottomView.xib in Resources */,
 				2729F7F124C8379D00E1F3C4 /* RecordListCell.xib in Resources */,
 				2794D1BA24BC69A400BAF6F3 /* RegisterBodyView.xib in Resources */,
+				27DBF9D824DAAE7500202145 /* WaitExamBottomView.xib in Resources */,
 				2747719624BC0C0500181362 /* TZImagePickerController.bundle in Resources */,
 				27A008DE24BDA6950002452B /* PhoneCheckBodyView.xib in Resources */,
 				2747727E24BC0C7C00181362 /* RCConfig.plist in Resources */,
@@ -3106,6 +3115,7 @@
 				274771D324BC0C0500181362 /* ControlDeviceNotifyMessage.m in Sources */,
 				2747719324BC0C0500181362 /* NSBundle+TZImagePicker.m in Sources */,
 				27A008B524BD97FE0002452B /* AudioRecordManager.m in Sources */,
+				27DBF9D624DAAE6200202145 /* WaitExamBottomView.m in Sources */,
 				2747721924BC0C0500181362 /* UIImage+Color.m in Sources */,
 				27EF3F2E24C0384E002068A2 /* HomeExamTicketCell.m in Sources */,
 				278D114624D0009000599421 /* KSGuideMaskView.m in Sources */,

+ 3 - 2
MusicGradeExam/MusicGradeExam/AppDelegate.m

@@ -105,7 +105,7 @@
     }
     else {
         [KSRequestManager configRequestHeader];
-        [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+        [USER_MANAGER queryUserInfoConnectRongCloud:NO connectionJPush:YES];
         [self initTableBar];
         self.window.rootViewController=_tabBarController;
     }
@@ -460,7 +460,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
         [self versionCheck];
     }
     RCConnectionStatus status = [[RCIMClient sharedRCIMClient] getConnectionStatus];
-    if (status == ConnectionStatus_Unconnected) {  // 连接失败或未连接 需要重新连接
+    if (status == ConnectionStatus_Unconnected && USER_MANAGER.needConnect == YES) {  // 连接失败或未连接 需要重新连接
         NSString *token = UserDefault(TokenKey);
         if (![NSString isEmptyString:token]) {
             [USER_MANAGER connectRongCloud];
@@ -471,6 +471,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 
 - (void)applicationDidBecomeActive:(UIApplication *)application {
     // app启动或者app从后台进入前台都会调用这个方法
+    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
 }
 
 

BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/Login/login_unable.imageset/login_unable@2x.png


BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/Login/login_unable.imageset/login_unable@3x.png


+ 2 - 2
MusicGradeExam/MusicGradeExam/Assets.xcassets/wd_img_zwsj.imageset/Contents.json → MusicGradeExam/MusicGradeExam/Assets.xcassets/stamp_image.imageset/Contents.json

@@ -5,12 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "wd_img_zwsj@2x.png",
+      "filename" : "stamp_image@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "wd_img_zwsj@3x.png",
+      "filename" : "stamp_image@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/stamp_image.imageset/stamp_image@2x.png


BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/stamp_image.imageset/stamp_image@3x.png


+ 22 - 0
MusicGradeExam/MusicGradeExam/Assets.xcassets/ticket_image.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "ticket_image@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "ticket_image@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/ticket_image.imageset/ticket_image@2x.png


BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/ticket_image.imageset/ticket_image@3x.png


BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/wd_img_zwsj.imageset/wd_img_zwsj@2x.png


BIN
MusicGradeExam/MusicGradeExam/Assets.xcassets/wd_img_zwsj.imageset/wd_img_zwsj@3x.png


+ 5 - 1
MusicGradeExam/MusicGradeExam/Base/KSBaseWKWebViewController.m

@@ -13,6 +13,7 @@
 #import "CustomNavViewController.h"
 #import <RongIMKit/RongIMKit.h>
 #import "RCConnectionManager.h"
+#import "UserInfoManager.h"
 
 @interface KSBaseWKWebViewController ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler>
 @property (nonatomic, strong) WKUserContentController *userContentController;
@@ -188,7 +189,10 @@
     [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
     [RCConnectionManager shareManager].isNeedJoin = NO;
     [RCConnectionManager shareManager].isNeedShowMessage = NO;
-    [[RCIM sharedRCIM] logout];
+    if (USER_MANAGER.needConnect) {
+        USER_MANAGER.needConnect = NO;
+        [[RCIM sharedRCIM] logout];
+    }
     UserDefaultSetObjectForKey(self.url, WEB_URL);
     // 取消推送别名
     [JPUSHService deleteAlias:nil seq:0];

+ 1 - 1
MusicGradeExam/MusicGradeExam/KSRequestManager.h

@@ -245,7 +245,7 @@ NS_ASSUME_NONNULL_BEGIN
 /// @param faliure 失败
 + (void)updateInfoRequest:(NSString *)post idCardNo:(NSString *)idCardNo realName:(NSString *)realName gender:(NSString *)gender birthdate:(NSString *)birthdate nation:(NSString *)nation avatar:(NSString *)avatar success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
 
-// /api-student/suggestion/add
+// /api-student/sysSuggestion/add
 
 /**
  新增建议

+ 8 - 4
MusicGradeExam/MusicGradeExam/KSRequestManager.m

@@ -14,6 +14,7 @@
 #import "JPUSHService.h"
 #import "RCConnectionManager.h"
 #import "LoginViewController.h"
+#import "UserInfoManager.h"
 
 @implementation KSRequestManager
 
@@ -147,9 +148,12 @@
     [[NSUserDefaults standardUserDefaults] synchronize];
     [RCConnectionManager shareManager].isNeedJoin = NO;
     [RCConnectionManager shareManager].isNeedShowMessage = NO;
-    [[RCIM sharedRCIM] logout];
+    if (USER_MANAGER.needConnect) {
+        USER_MANAGER.needConnect = NO;
+        [[RCIM sharedRCIM] logout];
+    }
+    
     
-    // 回到登录界面
     // 回到登录界面
     UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
     if ([vc isKindOfClass:[UITabBarController class]]) {
@@ -603,7 +607,7 @@
     [self request:post url:url parm:parm success:success faliure:faliure];
 }
 
-// /api-student/suggestion/add
+// /api-student/sysSuggestion/add
 
 /**
  新增建议
@@ -619,7 +623,7 @@
     NSMutableDictionary *parm = [NSMutableDictionary dictionary];
     [parm setValue:content forKey:@"content"];
     [parm setValue:mobileNo forKey:@"mobileNo"];
-    NSString *url = [NSString stringWithFormat:@"%@%@",hostURL, @"/api-student/suggestion/add"];
+    NSString *url = [NSString stringWithFormat:@"%@%@",hostURL, @"/api-student/sysSuggestion/add"];
     [self request:post url:url parm:parm success:success faliure:faliure];
 }
 

+ 3 - 0
MusicGradeExam/MusicGradeExam/Tools/Custom/KSGuideMaskView.h

@@ -8,6 +8,7 @@
 
 #import <UIKit/UIKit.h>
 
+typedef void(^CompleteBlock)(void);
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -29,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (void)dismissMaskView;
 
+- (void)completeCallback:(CompleteBlock)callback;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 11 - 0
MusicGradeExam/MusicGradeExam/Tools/Custom/KSGuideMaskView.m

@@ -29,6 +29,8 @@ NSInteger countNum = 0;
 
 @property (nonatomic, strong) CAShapeLayer *shapeLayer;
 
+@property (nonatomic, copy) CompleteBlock callback;
+
 @end
 
 @implementation KSGuideMaskView
@@ -56,6 +58,12 @@ NSInteger countNum = 0;
     [self addGestureRecognizer:tapGesture];
 }
 
+- (void)completeCallback:(CompleteBlock)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
 - (void)layoutSubviews {
     [super layoutSubviews];
 }
@@ -169,6 +177,9 @@ NSInteger countNum = 0;
     [UIView animateWithDuration:0.3 animations:^{
         self.alpha = 0;
     } completion:^(BOOL finished) {
+        if (self.callback) {
+            self.callback();
+        }
         [self removeFromSuperview];
     }];
 }

+ 39 - 22
MusicGradeExam/MusicGradeExam/UI/Classroom/Controller/ClassroomViewController.m

@@ -28,6 +28,13 @@
 
 #define TitleViewHeight  (64)
 
+typedef NS_ENUM(NSInteger, KICKTYPE) {
+    KICKTYPE_NONE,
+    KICKTYPE_FINISH = 1,
+    KICKTYPE_RECORD = 2,
+    KICKTYPE_RESIGN = 3,
+};
+
 @interface ClassroomViewController ()<ClassTitleViewDelegate, RongRTCRoomDelegate, ClassroomDelegate, UIGestureRecognizerDelegate, RongRTCActivityMonitorDelegate, RTCServiceDelegate, ClassVideoListViewDelegate>
 
 @property (nonatomic, strong) ClassTitleView *titleView;
@@ -46,7 +53,7 @@
 
 @property (nonatomic, strong) KSTipsView *tipsView;
 
-@property (nonatomic, assign) BOOL isKick;  // 老师踢出学生
+@property (nonatomic, assign) KICKTYPE kickType; // 退出状态
 
 @end
 
@@ -95,7 +102,7 @@
     [self.view addGestureRecognizer:tapGes];
     tapGes.delegate = self;
     [self showRoleHud];
-    self.isKick = NO;
+    self.kickType = KICKTYPE_NONE;
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(backgroundQuitRoomAction) name:@"backgroundQuit" object:nil];
 }
 
@@ -314,13 +321,14 @@
             }];
         }
     }
-    else if (_isKick) { // 退出房间,但是不dismiss
+    else if (_kickType != KICKTYPE_NONE) { // 退出房间,但是不dismiss
         [[KSRemoteUserManager shareInstance] removeAllUser];
         if ([RTCService sharedInstance].rtcRoom) {
             [[RTCService sharedInstance] leaveRongRTCRoom:[ClassroomService sharedService].currentRoom.roomId success:^{
             } error:^(RongRTCCode code) {
             }];
         }
+        [self showKickAlert];
     }
     else {
         [[KSRemoteUserManager shareInstance] removeAllUser];
@@ -333,6 +341,31 @@
     }
 }
 
+- (void)showKickAlert {
+    if (_kickType == KICKTYPE_FINISH) {
+        [KSNormalAlertView ks_showAlertWithTitle:@"您已完成考试,请耐心等待考试结果。" confirmTitle:@"退出考场" confirm:^{
+            [self dismissClassroom];
+        }];
+    }
+    else if (_kickType == KICKTYPE_RECORD) {
+        // 弹窗提示去录播
+        [KSNormalAlertView ks_showAlertWithTitle:@"当前状态无法正常完成在线直播考试\n主考官建议您录播上传考试视频。" leftTitle:@"取消" rightTitle:@"去录播" cancel:^{
+            // 离开教室
+            [self dismissClassroom];
+        } confirm:^{
+            // 去录播
+            [self dismissClassroom];
+            [[NSNotificationCenter defaultCenter] postNotificationName:RecordExamNotification object:nil];
+        }];
+    }
+    else if (_kickType == KICKTYPE_RESIGN) {
+        [KSNormalAlertView ks_showAlertWithTitle:@"当前状态无法正常完成考试,请检查设备及网络状态正常后再次签到考试。" confirmTitle:@"确定" confirm:^{
+            // 离开教室
+            [self dismissClassroom];
+        }];
+    }
+}
+
 - (void)dismissClassroom {
     [self.hud hideAnimated:YES];
     [ClassroomService sharedService].currentRoom = nil;
@@ -366,13 +399,10 @@
     RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
     [[ClassroomService sharedService].currentRoom removeMemeber:member];
     if ([curMember.userId isEqualToString:member.userId]) {
-        self.isKick = YES;
+        self.kickType = KICKTYPE_FINISH;
         [[RoomLoginHelper sharedInstance] logout:^{
         } error:^(RongRTCCode code) {
         }];
-        [KSNormalAlertView ks_showAlertWithTitle:@"恭喜您,考试已结束,请耐心等待考试结果。" confirmTitle:@"退出考场" confirm:^{
-            [self dismissClassroom];
-        }];
         return;
     }
     
@@ -392,19 +422,10 @@
     NSLog(@"memberRecordAction %@", member);
     RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
     if ([curMember.userId isEqualToString:member.userId]) {
-        self.isKick = YES;
+        self.kickType = KICKTYPE_RECORD;
         [[RoomLoginHelper sharedInstance] logout:^{
         } error:^(RongRTCCode code) {
         }];
-        // 弹窗提示去录播
-        [KSNormalAlertView ks_showAlertWithTitle:@"当前在线直播考试无法正常完成\n主考官建议您使用录播进行考试" leftTitle:@"取消" rightTitle:@"去录播" cancel:^{
-            // 离开教室
-            [self dismissClassroom];
-        } confirm:^{
-            // 去录播
-            [self dismissClassroom];
-            [[NSNotificationCenter defaultCenter] postNotificationName:RecordExamNotification object:nil];
-        }];
     }
 }
 
@@ -420,14 +441,10 @@
     NSLog(@"memberRecordAction %@", member);
     RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
     if ([curMember.userId isEqualToString:member.userId]) {
-        self.isKick = YES;
+        self.kickType = KICKTYPE_RESIGN;
         [[RoomLoginHelper sharedInstance] logout:^{
         } error:^(RongRTCCode code) {
         }];
-        [KSNormalAlertView ks_showAlertWithTitle:@"考官已将你移出教室,请检查设备及网络状态正常后再次签到考试" confirmTitle:@"确定" confirm:^{
-            // 离开教室
-            [self dismissClassroom];
-        }];
     }
 }
 

+ 50 - 10
MusicGradeExam/MusicGradeExam/UI/Exam/Controller/WaitExamViewController.m

@@ -13,6 +13,9 @@
 #import "RecordExamViewController.h"
 #import "ExamGuideViewController.h"
 #import "KSGuideMaskView.h"
+#import "UserInfoManager.h"
+#import "WaitExamBottomView.h"
+#define  BOTTOMVIEW_HEIGHT (150)
 
 @interface WaitExamViewController ()<UIScrollViewDelegate>
 
@@ -24,6 +27,8 @@
 
 @property (nonatomic, assign) BOOL cancleRequest;
 
+@property (nonatomic, strong) WaitExamBottomView *bottomView;
+
 @end
 
 @implementation WaitExamViewController
@@ -68,6 +73,12 @@
         return;
     }
     [self requestDataWithHub:YES];
+    
+    // 进入页面建立连接
+    if (USER_MANAGER.needConnect == NO) {
+        [USER_MANAGER connectRongCloud];
+        USER_MANAGER.needConnect = YES;
+    }
 }
 
 - (void)viewDidAppear:(BOOL)animated {
@@ -95,7 +106,7 @@
     CGFloat height = CGRectGetHeight(self.bodyView.frame);
     NSArray *tipsArray = @[@"考场开启后,才可已进行签到,签到后排考", @"展示为当前考场的排考信息"];
     NSArray *bezierArray = @[pathOne,pathSecond];
-    if (height == kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin) {
+    if (height == kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin - BOTTOMVIEW_HEIGHT) {
         CGRect rect3 = [self.bodyView convertRect:self.bodyView.tipsView.frame toView:[UIApplication sharedApplication].keyWindow];
         UIBezierPath *pathThree = [UIBezierPath bezierPathWithRect:rect3];
         tipsArray = @[@"考场开启后,才可已进行签到,签到后排考", @"展示为当前考场的排考信息",@"展示为线上考试的注意事项"];
@@ -104,7 +115,13 @@
     
     KSGuideMaskView *guideView = [[KSGuideMaskView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
     [guideView addTips:tipsArray transparentRect:bezierArray shaperLayerIndex:0];
+    if (tipsArray.count == 2) {
+        [guideView completeCallback:^{
+            [self scrollToBottom];
+        }];
+    }
     [guideView showMaskViewInView:nil];
+    
 }
 
 
@@ -134,6 +151,7 @@
             
             self.sourceModel.desc = [self.sourceModel.desc replaceAll:@"\\n" WithString:@"\n"];
             [self.bodyView configMessageSource:self.sourceModel];
+            [self.bottomView configMessageSource:self.sourceModel];
             [self configViewHeight];
         }
         else {
@@ -148,7 +166,7 @@
 
 - (void)configViewHeight {
     CGFloat tipsHeight = [self.bodyView configTipsHeight:self.sourceModel.desc];
-    CGFloat viewHeight = 206 + 160 + 19 + tipsHeight + 50 + 21 + 9 + 50 + 27;
+    CGFloat viewHeight = 206 + 160 + 19 + tipsHeight + 15;
     viewHeight = viewHeight > kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin ? viewHeight : kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin;
     self.bodyView.frame = CGRectMake(0, 0, kScreenWidth, viewHeight);
     [self.scrollView setContentSize:CGSizeMake(kScreenWidth, viewHeight)];
@@ -156,12 +174,12 @@
 
 - (void)configUI {
     self.scrollView.backgroundColor = HexRGB(0xf3f4f8);
-    self.scrollView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin);
+    self.scrollView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin - BOTTOMVIEW_HEIGHT);
     self.scrollView.delegate = self;
     self.scrollView.bounces = NO;
     _bodyView = [WaitExamBodyView shareInstance];
-    CGFloat viewHeight = 206 + 160 + 19 + 204 + 50 + 21 + 9 + 50 + 27;
-    viewHeight = viewHeight > kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin ? viewHeight : kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin;
+    CGFloat viewHeight = 206 + 160 + 19 + 204 + 15;
+    viewHeight = viewHeight > kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin - BOTTOMVIEW_HEIGHT ? viewHeight : kScreenHeight - kTabBarHeight - iPhoneXSafeBottomMargin - BOTTOMVIEW_HEIGHT;
     _bodyView.frame = CGRectMake(0, 0, kScreenWidth, viewHeight);
     MJWeakSelf;
     [_bodyView operationCallback:^(JOINROOMACTION action, TicketDetailModel * _Nullable source) {
@@ -170,6 +188,12 @@
     [self.scrollView addSubview:_bodyView];
     [self.scrollView setContentSize:CGSizeMake(kScreenWidth, viewHeight)];
     
+    _bottomView = [WaitExamBottomView shareInstance];
+    _bottomView.frame = CGRectMake(0, CGRectGetMaxY(self.scrollView.frame), kScreenWidth, BOTTOMVIEW_HEIGHT);
+    [_bottomView operationCallback:^(JOINROOMACTION action, TicketDetailModel * _Nullable source) {
+        [weakSelf opreationAction:action source:source];
+    }];
+    [self.view addSubview:_bottomView];
 }
 
 - (void)opreationAction:(JOINROOMACTION)action source:(TicketDetailModel *)source {
@@ -206,16 +230,14 @@
 
 #pragma mark ----- 签到
 - (void)signAction {
-    if (self.sourceModel.openFlag == 0) {
-        [self MBPShow:@"当前考场未开启,无法签到,请等待考场开启。"];
-        return;
-    }
     
     [self showhud];
     [KSRequestManager signInRequest:KS_POST examRegistrationId:self.examRegistrationId success:^(NSDictionary * _Nonnull dic) {
         [self removehub];
         if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
             [self MBPShow:@"签到成功"];
+            // 滑动到底部
+            [self scrollToBottom];
             // 判断是否能进入教室
             [self requestDataWithHub:NO];
         }
@@ -227,6 +249,11 @@
     }];
 }
 
+- (void)scrollToBottom {
+    CGPoint bottomOffset = CGPointMake(0, self.scrollView.contentSize.height - self.scrollView.bounds.size.height);
+    [self.scrollView setContentOffset:bottomOffset animated:YES];
+}
+
 #pragma mark ----- 加入房间
 - (void)joinRoomAction:(NSString *)roomId {
     [self.classManager joinRoomWithId:roomId inViewController:self];
@@ -242,7 +269,20 @@
     [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 
-
+- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
+    CGPoint offset = scrollView.contentOffset;
+    CGRect bounds = scrollView.bounds;
+    CGSize size = scrollView.contentSize;
+    UIEdgeInsets inset = scrollView.contentInset;
+    CGFloat currentOffset = offset.y + bounds.size.height - inset.bottom;
+    CGFloat maximumOffset = size.height;
+    if((maximumOffset - currentOffset) < 40.0) {
+        BOOL hasAppear = UserDefaultBoolForKey(@"examTipsBottom");
+        if (hasAppear == NO) {
+            [self showBottomTips];
+        }
+    }
+}
 
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
     CGPoint offset = scrollView.contentOffset;

+ 1 - 0
MusicGradeExam/MusicGradeExam/UI/Exam/Model/TicketListModel.h

@@ -21,6 +21,7 @@
 @property (nonatomic, assign) double subjectId;
 @property (nonatomic, strong) NSString *subjectName;
 @property (nonatomic, strong) NSString *realName;
+@property (nonatomic, strong) NSString *baseExamName;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
 - (instancetype)initWithDictionary:(NSDictionary *)dict;

+ 17 - 13
MusicGradeExam/MusicGradeExam/UI/Exam/Model/TicketListModel.m

@@ -18,7 +18,7 @@ NSString *const kTicketListModelExamAddress = @"examAddress";
 NSString *const kTicketListModelSubjectId = @"subjectId";
 NSString *const kTicketListModelSubjectName = @"subjectName";
 NSString *const kTicketListModelRealName = @"realName";
-
+NSString *const kTicketListModelBaseExamName = @"baseExamName";
 
 @interface TicketListModel ()
 
@@ -38,7 +38,7 @@ NSString *const kTicketListModelRealName = @"realName";
 @synthesize subjectId = _subjectId;
 @synthesize subjectName = _subjectName;
 @synthesize realName = _realName;
-
+@synthesize baseExamName = _baseExamName;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
 {
@@ -52,17 +52,17 @@ NSString *const kTicketListModelRealName = @"realName";
     // This check serves to make sure that a non-NSDictionary object
     // passed into the model class doesn't break the parsing.
     if(self && [dict isKindOfClass:[NSDictionary class]]) {
-            self.gender = [[self objectOrNilForKey:kTicketListModelGender fromDictionary:dict] doubleValue];
-            self.cardNo = [self objectOrNilForKey:kTicketListModelCardNo fromDictionary:dict];
-            self.certificatePhoto = [self objectOrNilForKey:kTicketListModelCertificatePhoto fromDictionary:dict];
-            self.examTime = [self objectOrNilForKey:kTicketListModelExamTime fromDictionary:dict];
-            self.examRegistrationId = [[self objectOrNilForKey:kTicketListModelExamRegistrationId fromDictionary:dict] doubleValue];
-            self.level = [[self objectOrNilForKey:kTicketListModelLevel fromDictionary:dict] doubleValue];
-            self.examAddress = [self objectOrNilForKey:kTicketListModelExamAddress fromDictionary:dict];
-            self.subjectId = [[self objectOrNilForKey:kTicketListModelSubjectId fromDictionary:dict] doubleValue];
-            self.subjectName = [self objectOrNilForKey:kTicketListModelSubjectName fromDictionary:dict];
-            self.realName = [self objectOrNilForKey:kTicketListModelRealName fromDictionary:dict];
-
+        self.gender = [[self objectOrNilForKey:kTicketListModelGender fromDictionary:dict] doubleValue];
+        self.cardNo = [self objectOrNilForKey:kTicketListModelCardNo fromDictionary:dict];
+        self.certificatePhoto = [self objectOrNilForKey:kTicketListModelCertificatePhoto fromDictionary:dict];
+        self.examTime = [self objectOrNilForKey:kTicketListModelExamTime fromDictionary:dict];
+        self.examRegistrationId = [[self objectOrNilForKey:kTicketListModelExamRegistrationId fromDictionary:dict] doubleValue];
+        self.level = [[self objectOrNilForKey:kTicketListModelLevel fromDictionary:dict] doubleValue];
+        self.examAddress = [self objectOrNilForKey:kTicketListModelExamAddress fromDictionary:dict];
+        self.subjectId = [[self objectOrNilForKey:kTicketListModelSubjectId fromDictionary:dict] doubleValue];
+        self.subjectName = [self objectOrNilForKey:kTicketListModelSubjectName fromDictionary:dict];
+        self.realName = [self objectOrNilForKey:kTicketListModelRealName fromDictionary:dict];
+        self.baseExamName = [self objectOrNilForKey:kTicketListModelBaseExamName fromDictionary:dict];
     }
     
     return self;
@@ -82,6 +82,7 @@ NSString *const kTicketListModelRealName = @"realName";
     [mutableDict setValue:[NSNumber numberWithDouble:self.subjectId] forKey:kTicketListModelSubjectId];
     [mutableDict setValue:self.subjectName forKey:kTicketListModelSubjectName];
     [mutableDict setValue:self.realName forKey:kTicketListModelRealName];
+    [mutableDict setValue:self.baseExamName forKey:kTicketListModelBaseExamName];
 
     return [NSDictionary dictionaryWithDictionary:mutableDict];
 }
@@ -115,6 +116,7 @@ NSString *const kTicketListModelRealName = @"realName";
     self.subjectId = [aDecoder decodeDoubleForKey:kTicketListModelSubjectId];
     self.subjectName = [aDecoder decodeObjectForKey:kTicketListModelSubjectName];
     self.realName = [aDecoder decodeObjectForKey:kTicketListModelRealName];
+    self.baseExamName = [aDecoder decodeObjectForKey:kTicketListModelBaseExamName];
     return self;
 }
 
@@ -131,6 +133,7 @@ NSString *const kTicketListModelRealName = @"realName";
     [aCoder encodeDouble:_subjectId forKey:kTicketListModelSubjectId];
     [aCoder encodeObject:_subjectName forKey:kTicketListModelSubjectName];
     [aCoder encodeObject:_realName forKey:kTicketListModelRealName];
+    [aCoder encodeObject:_baseExamName forKey:kTicketListModelBaseExamName];
 }
 
 - (id)copyWithZone:(NSZone *)zone
@@ -149,6 +152,7 @@ NSString *const kTicketListModelRealName = @"realName";
         copy.subjectId = self.subjectId;
         copy.subjectName = [self.subjectName copyWithZone:zone];
         copy.realName = [self.realName copyWithZone:zone];
+        copy.baseExamName = [self.baseExamName copyWithZone:zone];
     }
     
     return copy;

+ 3 - 3
MusicGradeExam/MusicGradeExam/UI/Exam/View/ExamDeviceCheckView.xib

@@ -195,7 +195,7 @@
                             <rect key="frame" x="0.0" y="277" width="414" height="50"/>
                             <subviews>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="193-DS-VAC">
-                                    <rect key="frame" x="219" y="0.0" width="167" height="50"/>
+                                    <rect key="frame" x="210" y="0.0" width="176" height="50"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                     <state key="normal" title="有声音" backgroundImage="button_nomal"/>
                                     <connections>
@@ -203,7 +203,7 @@
                                     </connections>
                                 </button>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5RC-yu-zq4">
-                                    <rect key="frame" x="28" y="0.0" width="167" height="50"/>
+                                    <rect key="frame" x="28" y="0.0" width="176" height="50"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                     <state key="normal" title="无声音" backgroundImage="layer_buttonNomal">
                                         <color key="titleColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -215,7 +215,7 @@
                             </subviews>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
-                                <constraint firstItem="193-DS-VAC" firstAttribute="leading" secondItem="5RC-yu-zq4" secondAttribute="trailing" constant="24" id="6Rb-cW-jaM"/>
+                                <constraint firstItem="193-DS-VAC" firstAttribute="leading" secondItem="5RC-yu-zq4" secondAttribute="trailing" constant="6" id="6Rb-cW-jaM"/>
                                 <constraint firstAttribute="bottom" secondItem="193-DS-VAC" secondAttribute="bottom" id="9LV-am-TAJ"/>
                                 <constraint firstItem="5RC-yu-zq4" firstAttribute="leading" secondItem="Qn1-ek-Ma0" secondAttribute="leading" constant="28" id="OdM-91-L6e"/>
                                 <constraint firstAttribute="trailing" secondItem="193-DS-VAC" secondAttribute="trailing" constant="28" id="PSX-fV-TRi"/>

+ 4 - 1
MusicGradeExam/MusicGradeExam/UI/Exam/View/TicketBodyView.m

@@ -41,6 +41,7 @@
 @property (weak, nonatomic) IBOutlet UIButton *backButton;
 
 @property (weak, nonatomic) IBOutlet UIButton *enterButton;
+@property (weak, nonatomic) IBOutlet UILabel *examName;
 
 @end
 
@@ -93,13 +94,15 @@
 - (void)configMessage:(TicketListModel *)message {
     // 赋值
     self.sourceModel = message;
+    self.examName.text = [NSString returnNoNullStringWithString:self.sourceModel.baseExamName];
     [self.certificateImage sd_setImageWithURL:[NSURL URLWithString:self.sourceModel.certificatePhoto] placeholderImage:[UIImage imageNamed:@"icon_placeholder"]];
     self.cardNo.text = [NSString stringWithFormat:@"准考证号:%@",[NSString returnNoNullStringWithString:self.sourceModel.cardNo]];
     self.userName.text = [NSString stringWithFormat:@"考试名字:%@",[NSString returnNoNullStringWithString:self.sourceModel.realName]];
     self.userSex.text = self.sourceModel.gender == 1 ? @"考生性别:男" : @"考生性别:女";
     self.subjectLabel.text = [NSString stringWithFormat:@"报考专业:%@",[NSString returnNoNullStringWithString:self.sourceModel.subjectName]];
     self.examLevel.text = [NSString stringWithFormat:@"报考级别:%@",[self getLevelName:self.sourceModel.level]];
-    self.examTime.text = [NSString stringWithFormat:@"考试时间:%@",[NSString returnNoNullStringWithString:self.sourceModel.examTime]];
+    
+    self.examTime.text = [NSString stringWithFormat:@"考试时间:%@",[[self.sourceModel.examTime componentsSeparatedByString:@" "] firstObject]];
     self.classLocation.text = [NSString isEmptyString:self.sourceModel.examAddress] ? @"考试地点:网络教室" : [NSString stringWithFormat:@"考试地点%@",self.sourceModel.examAddress];
 }
 

+ 59 - 19
MusicGradeExam/MusicGradeExam/UI/Exam/View/TicketBodyView.xib

@@ -53,15 +53,8 @@
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Cj7-w9-VFo">
                             <rect key="frame" x="11" y="11" width="360" height="390"/>
                             <subviews>
-                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_placeholder" translatesAutoresizingMaskIntoConstraints="NO" id="A1y-sO-QGA">
-                                    <rect key="frame" x="130" y="26" width="100" height="131"/>
-                                    <constraints>
-                                        <constraint firstAttribute="width" constant="100" id="BVy-Mc-nfH"/>
-                                        <constraint firstAttribute="height" constant="131" id="ScM-W4-Jg7"/>
-                                    </constraints>
-                                </imageView>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="准考证号:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KFg-DG-VJj">
-                                    <rect key="frame" x="75" y="181" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="135" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="4jJ-Hb-l6c"/>
                                     </constraints>
@@ -70,7 +63,7 @@
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考生名字:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hj2-Sz-yoI">
-                                    <rect key="frame" x="75" y="209" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="163" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="Qse-p4-2qW"/>
                                     </constraints>
@@ -79,7 +72,7 @@
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考生性别:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="59a-SL-h8z">
-                                    <rect key="frame" x="75" y="237" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="191" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="fLE-r4-pJ8"/>
                                     </constraints>
@@ -88,7 +81,7 @@
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="报考专业:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yik-4s-H4Q">
-                                    <rect key="frame" x="75" y="265" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="219" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="goO-9e-RAZ"/>
                                     </constraints>
@@ -97,7 +90,7 @@
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="报考级别:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="baH-bx-beF">
-                                    <rect key="frame" x="75" y="293" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="247" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="bVh-7M-K79"/>
                                     </constraints>
@@ -106,7 +99,7 @@
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考试时间:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pgz-3o-9OJ">
-                                    <rect key="frame" x="75" y="321" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="275" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="55S-oJ-IwL"/>
                                     </constraints>
@@ -115,7 +108,7 @@
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考试地点:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sl8-xL-Pp2">
-                                    <rect key="frame" x="75" y="349" width="275" height="20"/>
+                                    <rect key="frame" x="20" y="303" width="213" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="1fz-eA-rgH"/>
                                     </constraints>
@@ -123,33 +116,77 @@
                                     <color key="textColor" red="0.1019607843" green="0.1019607843" blue="0.1019607843" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
+                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dfb-jr-3dr">
+                                    <rect key="frame" x="238" y="140" width="102" height="137"/>
+                                    <subviews>
+                                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_placeholder" translatesAutoresizingMaskIntoConstraints="NO" id="A1y-sO-QGA">
+                                            <rect key="frame" x="5" y="5" width="92" height="127"/>
+                                        </imageView>
+                                    </subviews>
+                                    <color key="backgroundColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.92156862745098034" alpha="1" colorSpace="calibratedRGB"/>
+                                    <constraints>
+                                        <constraint firstItem="A1y-sO-QGA" firstAttribute="leading" secondItem="Dfb-jr-3dr" secondAttribute="leading" constant="5" id="1Rc-4C-ppA"/>
+                                        <constraint firstAttribute="height" constant="137" id="2m2-ho-08f"/>
+                                        <constraint firstAttribute="width" constant="102" id="b9K-cj-2Zn"/>
+                                        <constraint firstAttribute="trailing" secondItem="A1y-sO-QGA" secondAttribute="trailing" constant="5" id="c6P-I8-Eq8"/>
+                                        <constraint firstItem="A1y-sO-QGA" firstAttribute="top" secondItem="Dfb-jr-3dr" secondAttribute="top" constant="5" id="cxs-QK-uSM"/>
+                                        <constraint firstAttribute="bottom" secondItem="A1y-sO-QGA" secondAttribute="bottom" constant="5" id="nHp-pD-2sp"/>
+                                    </constraints>
+                                </view>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2020年中央音乐学院考级" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FUD-mv-Z7W">
+                                    <rect key="frame" x="10" y="23" width="340" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="28" id="Slf-ww-Bdz"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="20"/>
+                                    <color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ticket_image" translatesAutoresizingMaskIntoConstraints="NO" id="Q6o-Wj-idS">
+                                    <rect key="frame" x="136" y="66" width="88" height="29"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="29" id="PcS-m6-TZu"/>
+                                        <constraint firstAttribute="width" constant="88" id="QnZ-u3-Noo"/>
+                                    </constraints>
+                                </imageView>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="stamp_image" translatesAutoresizingMaskIntoConstraints="NO" id="w9O-Yu-QsO">
+                                    <rect key="frame" x="217" y="232" width="78" height="70"/>
+                                </imageView>
                             </subviews>
                             <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
                             <constraints>
-                                <constraint firstItem="KFg-DG-VJj" firstAttribute="leading" secondItem="A1y-sO-QGA" secondAttribute="leading" constant="-55" id="0Eg-4m-RtX"/>
+                                <constraint firstItem="KFg-DG-VJj" firstAttribute="top" secondItem="Q6o-Wj-idS" secondAttribute="bottom" constant="40" id="2aI-8X-IxP"/>
+                                <constraint firstItem="FUD-mv-Z7W" firstAttribute="leading" secondItem="Cj7-w9-VFo" secondAttribute="leading" constant="10" id="2y8-S3-fin"/>
                                 <constraint firstItem="sl8-xL-Pp2" firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" id="6jc-aA-ndd"/>
                                 <constraint firstItem="59a-SL-h8z" firstAttribute="top" secondItem="hj2-Sz-yoI" secondAttribute="bottom" constant="8" id="7zt-hk-NWo"/>
+                                <constraint firstItem="w9O-Yu-QsO" firstAttribute="trailing" secondItem="Dfb-jr-3dr" secondAttribute="trailing" constant="-45" id="8OB-F8-LnN"/>
                                 <constraint firstItem="sl8-xL-Pp2" firstAttribute="leading" secondItem="pgz-3o-9OJ" secondAttribute="leading" id="8OJ-g9-EwT"/>
                                 <constraint firstItem="pgz-3o-9OJ" firstAttribute="top" secondItem="baH-bx-beF" secondAttribute="bottom" constant="8" id="BB5-zQ-HxF"/>
                                 <constraint firstItem="hj2-Sz-yoI" firstAttribute="leading" secondItem="KFg-DG-VJj" secondAttribute="leading" id="C6E-5Y-Q9X"/>
                                 <constraint firstItem="Yik-4s-H4Q" firstAttribute="leading" secondItem="KFg-DG-VJj" secondAttribute="leading" id="Cq3-te-Mrn"/>
-                                <constraint firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" constant="10" id="EhT-ZF-chp"/>
                                 <constraint firstItem="baH-bx-beF" firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" id="EqX-RZ-Xjr"/>
                                 <constraint firstItem="Yik-4s-H4Q" firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" id="HAg-jY-J0q"/>
                                 <constraint firstItem="pgz-3o-9OJ" firstAttribute="top" secondItem="baH-bx-beF" secondAttribute="bottom" constant="8" id="Hr2-4f-Q9I"/>
                                 <constraint firstItem="hj2-Sz-yoI" firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" id="ImE-en-N7I"/>
+                                <constraint firstItem="Q6o-Wj-idS" firstAttribute="centerX" secondItem="Cj7-w9-VFo" secondAttribute="centerX" id="J59-HO-db6"/>
                                 <constraint firstItem="59a-SL-h8z" firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" id="L5b-mH-b6z"/>
+                                <constraint firstItem="KFg-DG-VJj" firstAttribute="leading" secondItem="Cj7-w9-VFo" secondAttribute="leading" constant="20" id="MzQ-PY-csB"/>
                                 <constraint firstItem="baH-bx-beF" firstAttribute="top" secondItem="Yik-4s-H4Q" secondAttribute="bottom" constant="8" id="N4O-io-7xo"/>
+                                <constraint firstAttribute="trailing" secondItem="Dfb-jr-3dr" secondAttribute="trailing" constant="20" id="N4x-PH-nlO"/>
                                 <constraint firstItem="pgz-3o-9OJ" firstAttribute="leading" secondItem="KFg-DG-VJj" secondAttribute="leading" id="U0A-6l-VQq"/>
-                                <constraint firstItem="A1y-sO-QGA" firstAttribute="top" secondItem="Cj7-w9-VFo" secondAttribute="top" constant="26" id="WHa-wq-Mya"/>
-                                <constraint firstItem="A1y-sO-QGA" firstAttribute="centerX" secondItem="Cj7-w9-VFo" secondAttribute="centerX" id="aJ2-dI-Zni"/>
+                                <constraint firstItem="Dfb-jr-3dr" firstAttribute="top" secondItem="KFg-DG-VJj" secondAttribute="top" constant="5" id="Vus-fg-bsv"/>
+                                <constraint firstItem="FUD-mv-Z7W" firstAttribute="centerX" secondItem="Cj7-w9-VFo" secondAttribute="centerX" id="ffS-Od-dPA"/>
                                 <constraint firstItem="hj2-Sz-yoI" firstAttribute="top" secondItem="KFg-DG-VJj" secondAttribute="bottom" constant="8" id="hf3-4I-v6O"/>
+                                <constraint firstItem="Q6o-Wj-idS" firstAttribute="top" secondItem="FUD-mv-Z7W" secondAttribute="bottom" constant="15" id="jXF-9D-Pc8"/>
                                 <constraint firstItem="pgz-3o-9OJ" firstAttribute="trailing" secondItem="KFg-DG-VJj" secondAttribute="trailing" id="ncn-Up-FOP"/>
-                                <constraint firstItem="KFg-DG-VJj" firstAttribute="top" secondItem="A1y-sO-QGA" secondAttribute="bottom" constant="24" id="oCW-M2-rLg"/>
+                                <constraint firstItem="Dfb-jr-3dr" firstAttribute="leading" secondItem="KFg-DG-VJj" secondAttribute="trailing" constant="5" id="noz-05-eWL"/>
                                 <constraint firstItem="sl8-xL-Pp2" firstAttribute="top" secondItem="pgz-3o-9OJ" secondAttribute="bottom" constant="8" id="rs5-ve-iPZ"/>
                                 <constraint firstItem="59a-SL-h8z" firstAttribute="leading" secondItem="KFg-DG-VJj" secondAttribute="leading" id="tKn-og-oY6"/>
+                                <constraint firstAttribute="trailing" secondItem="FUD-mv-Z7W" secondAttribute="trailing" constant="10" id="yDA-Ek-tR1"/>
                                 <constraint firstItem="baH-bx-beF" firstAttribute="leading" secondItem="KFg-DG-VJj" secondAttribute="leading" id="ySH-z0-YeH"/>
                                 <constraint firstItem="Yik-4s-H4Q" firstAttribute="top" secondItem="59a-SL-h8z" secondAttribute="bottom" constant="8" id="yfS-CE-CT2"/>
+                                <constraint firstItem="w9O-Yu-QsO" firstAttribute="centerY" secondItem="Dfb-jr-3dr" secondAttribute="bottom" constant="-10" id="z3k-W2-Q7s"/>
+                                <constraint firstItem="FUD-mv-Z7W" firstAttribute="top" secondItem="Cj7-w9-VFo" secondAttribute="top" constant="23" id="ztP-mJ-cDO"/>
                             </constraints>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
@@ -246,6 +283,7 @@
                 <outlet property="emptyView" destination="SEt-dI-9WR" id="36y-OS-5PH"/>
                 <outlet property="enterButton" destination="Zcb-sN-Ifk" id="loX-Vr-Ait"/>
                 <outlet property="examLevel" destination="baH-bx-beF" id="9MK-50-ube"/>
+                <outlet property="examName" destination="FUD-mv-Z7W" id="4Rc-G0-VrC"/>
                 <outlet property="examTime" destination="pgz-3o-9OJ" id="S2z-he-SzZ"/>
                 <outlet property="subjectLabel" destination="Yik-4s-H4Q" id="FGR-yT-aw3"/>
                 <outlet property="topView" destination="yUJ-P8-V4z" id="diP-7H-kVh"/>
@@ -259,5 +297,7 @@
         <image name="empty_exam" width="179" height="188"/>
         <image name="icon_placeholder" width="87" height="110"/>
         <image name="login_back" width="12" height="21"/>
+        <image name="stamp_image" width="78" height="70"/>
+        <image name="ticket_image" width="88" height="29"/>
     </resources>
 </document>

+ 0 - 2
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.h

@@ -23,8 +23,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) BOOL canJoinRoom;
 
-@property (weak, nonatomic) IBOutlet UIButton *joinButton;
-
 @property (weak, nonatomic) IBOutlet UIView *examMessageView;
 
 @property (weak, nonatomic) IBOutlet UIView *tipsView;

+ 1 - 58
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.m

@@ -25,7 +25,6 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
 @property (weak, nonatomic) IBOutlet UILabel *classTime;
 
 @property (weak, nonatomic) IBOutlet UILabel *tipsLabel;
-@property (weak, nonatomic) IBOutlet UIButton *guideButton;
 
 @property (nonatomic, copy) JoinRoomAction callback;
 
@@ -38,8 +37,6 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
 @implementation WaitExamBodyView
 - (void)awakeFromNib {
     [super awakeFromNib];
-    [self.guideButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonNomal"] forState:UIControlStateNormal];
-    [self.guideButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonHighlight"] forState:UIControlStateHighlighted];
 }
 
 
@@ -63,35 +60,6 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
         self.status = EXAMSTATUS_SINGED;
     }
     
-    
-    if (self.status == EXAMSTATUS_SINGED) { // 已签到显示
-        if (self.sourceModel.recordFlag == 1 && self.sourceModel.finishedExam == 4) { // 录播考试开启中
-            self.canJoinRoom = YES;
-            [self.joinButton setTitle:@"录播考试" forState:UIControlStateNormal];
-        }
-        else if (self.sourceModel.finishedExam == 5) { // 考试已完成
-            self.canJoinRoom = NO;
-            [self.joinButton setTitle:@"考试已完成" forState:UIControlStateNormal];
-        }
-        else {
-            self.canJoinRoom = self.sourceModel.classroomSwitch;
-            if (self.sourceModel.classroomSwitch == 0) {
-                NSString *title = [NSString stringWithFormat:@"当前需要等待%.0f位考生",self.sourceModel.waitNum];
-               [self.joinButton setTitle:title forState:UIControlStateNormal];
-            }
-            else {
-                [self.joinButton setTitle:@"到你了,进入教室" forState:UIControlStateNormal];
-            }
-        }
-    }
-    else { // 未签到显示
-        self.canJoinRoom = NO;
-        [self.joinButton setTitle:@"进入教室" forState:UIControlStateNormal];
-    }
-    
-    
-    
-    
     self.classDate.text = [[self.sourceModel.examStartTime componentsSeparatedByString:@" "] firstObject];
     self.subjectLabel.text = [NSString returnNoNullStringWithString:self.sourceModel.baseExamName];
     
@@ -112,7 +80,7 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
 
         NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
         [paragraphStyle setLineSpacing:4];//调整行间距
-        NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:tipsMessge attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:14.0f],NSForegroundColorAttributeName:HexRGB(0x333333)}];
+        NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:tipsMessge attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:14.0f],NSForegroundColorAttributeName:HexRGB(0x808080)}];
         self.tipsLabel.attributedText = attrStr;
     }
     else {
@@ -165,19 +133,6 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
 }
 
 
-- (void)setCanJoinRoom:(BOOL)canJoinRoom {
-    _canJoinRoom = canJoinRoom;
-    if (canJoinRoom) {
-        self.joinButton.userInteractionEnabled = YES;
-        [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
-        [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
-    }
-    else {
-        self.joinButton.userInteractionEnabled = NO;
-        [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_unable"] forState:UIControlStateNormal];
-    }
-}
-
 
 - (void)operationCallback:(JoinRoomAction)callback {
     if (callback) {
@@ -194,18 +149,6 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
 }
 
 
-- (IBAction)guideAction:(id)sender {
-    if (self.callback) {
-        self.callback(JOINROOMACTION_GUIDE, nil);
-    }
-}
-
-- (IBAction)joinAction:(id)sender {
-    if (self.callback) {
-        self.callback(JOINROOMACTION_JOIN, self.sourceModel);
-    }
-}
-
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.

+ 2 - 34
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.xib

@@ -143,11 +143,11 @@
                     <rect key="frame" x="0.0" y="385" width="414" height="60"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考试注意事项" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Eny-Xj-7OZ">
-                            <rect key="frame" x="15" y="15" width="92" height="20"/>
+                            <rect key="frame" x="15" y="15" width="98" height="20"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="20" id="xBU-kq-cin"/>
                             </constraints>
-                            <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                             <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
@@ -173,46 +173,18 @@
                         </userDefinedRuntimeAttribute>
                     </userDefinedRuntimeAttributes>
                 </view>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8bl-8o-KNJ">
-                    <rect key="frame" x="17" y="466" width="380" height="50"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="50" id="gcf-YI-Gnf"/>
-                    </constraints>
-                    <state key="normal" title="设备检查及考试引导" backgroundImage="layer_buttonNomal">
-                        <color key="titleColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
-                    </state>
-                    <connections>
-                        <action selector="guideAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="szD-ot-0hU"/>
-                    </connections>
-                </button>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I8H-IY-JIX">
-                    <rect key="frame" x="16" y="526" width="382" height="50"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="50" id="fRv-bF-dQZ"/>
-                    </constraints>
-                    <state key="normal" title="进入教室" backgroundImage="button_unable"/>
-                    <connections>
-                        <action selector="joinAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="Zoc-Q5-JHh"/>
-                    </connections>
-                </button>
             </subviews>
             <color key="backgroundColor" red="0.95294117647058818" green="0.95686274509803915" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
-                <constraint firstItem="8bl-8o-KNJ" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="17" id="0WS-Iz-tK7"/>
                 <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="UYp-Af-6p1" secondAttribute="trailing" id="8pk-5f-VC7"/>
-                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="I8H-IY-JIX" secondAttribute="trailing" constant="16" id="8yH-6Q-Qdg"/>
                 <constraint firstItem="Pa9-Km-YvF" firstAttribute="top" secondItem="UYp-Af-6p1" secondAttribute="bottom" id="CWe-JG-6hK"/>
                 <constraint firstItem="Pa9-Km-YvF" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="HHn-iH-eae"/>
-                <constraint firstItem="I8H-IY-JIX" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="16" id="Jdm-1A-QVo"/>
-                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="8bl-8o-KNJ" secondAttribute="trailing" constant="17" id="MoY-DY-LWf"/>
                 <constraint firstItem="UYp-Af-6p1" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Q88-JQ-nCz"/>
                 <constraint firstItem="UYp-Af-6p1" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="RVB-yk-KHo"/>
                 <constraint firstItem="rEr-rK-lTU" firstAttribute="top" secondItem="Pa9-Km-YvF" secondAttribute="bottom" constant="19" id="Ryv-aW-hgO"/>
                 <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="rEr-rK-lTU" secondAttribute="trailing" id="UBZ-Qd-R5C"/>
-                <constraint firstItem="I8H-IY-JIX" firstAttribute="top" secondItem="8bl-8o-KNJ" secondAttribute="bottom" constant="10" id="alG-yH-Dan"/>
                 <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Pa9-Km-YvF" secondAttribute="trailing" id="jzt-B0-L8V"/>
                 <constraint firstItem="rEr-rK-lTU" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="ktB-06-Zxi"/>
-                <constraint firstItem="8bl-8o-KNJ" firstAttribute="top" secondItem="rEr-rK-lTU" secondAttribute="bottom" constant="21" id="t2z-bu-S2A"/>
             </constraints>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
@@ -220,8 +192,6 @@
                 <outlet property="classDate" destination="qLV-gz-q1k" id="deW-pB-idj"/>
                 <outlet property="classTime" destination="Czx-Hb-wZ8" id="irw-eT-XKg"/>
                 <outlet property="examMessageView" destination="Pa9-Km-YvF" id="xvc-mw-5ne"/>
-                <outlet property="guideButton" destination="8bl-8o-KNJ" id="1MP-3g-ljh"/>
-                <outlet property="joinButton" destination="I8H-IY-JIX" id="cAC-Ad-PuS"/>
                 <outlet property="signButton" destination="WEa-ER-E4J" id="Ft8-JM-Rw6"/>
                 <outlet property="signDescLabel" destination="O3Y-5U-nUH" id="tBU-Y1-qvd"/>
                 <outlet property="subjectLabel" destination="cOI-UA-7JY" id="95e-BG-AVB"/>
@@ -232,8 +202,6 @@
         </view>
     </objects>
     <resources>
-        <image name="button_unable" width="49.5" height="49"/>
-        <image name="layer_buttonNomal" width="49.5" height="49"/>
         <image name="sign_noOpen" width="164" height="164"/>
     </resources>
 </document>

+ 29 - 0
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.h

@@ -0,0 +1,29 @@
+//
+//  WaitExamBottomView.h
+//  MusicGradeExam
+//
+//  Created by Kyle on 2020/8/5.
+//  Copyright © 2020 DayaMusic. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "WaitExamBodyView.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface WaitExamBottomView : UIView
+
+@property (nonatomic, assign) BOOL canJoinRoom;
+
+@property (weak, nonatomic) IBOutlet UIButton *joinButton;
+
+
++ (instancetype)shareInstance;
+
+- (void)configMessageSource:(TicketDetailModel *)source;
+
+- (void)operationCallback:(JoinRoomAction)callback;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 156 - 0
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.m

@@ -0,0 +1,156 @@
+//
+//  WaitExamBottomView.m
+//  MusicGradeExam
+//
+//  Created by Kyle on 2020/8/5.
+//  Copyright © 2020 DayaMusic. All rights reserved.
+//
+
+#import "WaitExamBottomView.h"
+typedef NS_ENUM(NSInteger,EXAMSTATUS) {
+    EXAMSTATUS_NOSTART, // 考场未开启
+    EXAMSTATUS_WAITSIGN, // 等待签到
+    EXAMSTATUS_SINGED,   // 已签到
+};
+
+@interface WaitExamBottomView ()
+
+@property (nonatomic, copy) JoinRoomAction callback;
+
+@property (weak, nonatomic) IBOutlet UIButton *guideButton;
+
+@property (nonatomic, strong) TicketDetailModel *sourceModel;
+
+@property (nonatomic, assign) EXAMSTATUS status;
+
+@property (nonatomic, assign) BOOL hasAnimation;
+
+@end
+
+@implementation WaitExamBottomView
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    [self.guideButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonNomal"] forState:UIControlStateNormal];
+    [self.guideButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonHighlight"] forState:UIControlStateHighlighted];
+    self.hasAnimation = NO;
+}
+
++ (instancetype)shareInstance {
+    WaitExamBottomView *view = [[[NSBundle mainBundle] loadNibNamed:@"WaitExamBottomView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)configMessageSource:(TicketDetailModel *)source {
+    self.sourceModel = source;
+    if ([NSString isEmptyString:source.signInTime]) {
+        if (source.openFlag == 0) { // 考场未开启
+            self.status = EXAMSTATUS_NOSTART;
+        }
+        else {
+            self.status = EXAMSTATUS_WAITSIGN;
+        }
+    }
+    else {
+        self.status = EXAMSTATUS_SINGED;
+    }
+    if (self.status == EXAMSTATUS_SINGED) { // 已签到显示
+        if (self.sourceModel.recordFlag == 1 && self.sourceModel.finishedExam == 4) { // 录播考试开启中
+            self.canJoinRoom = YES;
+            [self.joinButton setTitle:@"录播考试" forState:UIControlStateNormal];
+        }
+        else if (self.sourceModel.finishedExam == 5) { // 考试已完成
+            self.canJoinRoom = NO;
+            [self.joinButton setTitle:@"考试已完成" forState:UIControlStateNormal];
+        }
+        else {
+            self.canJoinRoom = self.sourceModel.classroomSwitch;
+            if (self.sourceModel.classroomSwitch == 0) {
+                NSString *title = [NSString stringWithFormat:@"当前需要等待%.0f位考生",self.sourceModel.waitNum];
+               [self.joinButton setTitle:title forState:UIControlStateNormal];
+            }
+            else {
+                [self.joinButton setTitle:@"到你了,进入教室" forState:UIControlStateNormal];
+            }
+        }
+    }
+    else { // 未签到显示
+        self.canJoinRoom = NO;
+        [self.joinButton setTitle:@"进入教室" forState:UIControlStateNormal];
+    }
+}
+
+- (void)setCanJoinRoom:(BOOL)canJoinRoom {
+    _canJoinRoom = canJoinRoom;
+    if (canJoinRoom) {
+        self.joinButton.userInteractionEnabled = YES;
+        [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
+        [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
+        [self.joinButton.layer addAnimation:[self alphaLight:1.0f] forKey:@"aAlpha"];
+        
+        self.hasAnimation = YES;
+    }
+    else {
+        self.joinButton.userInteractionEnabled = NO;
+        [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_unable"] forState:UIControlStateNormal];
+        if (self.hasAnimation) {
+            self.hasAnimation = NO;
+            [self.joinButton.layer removeAnimationForKey:@"aAlpha"];
+        }
+    }
+}
+
+- (void)operationCallback:(JoinRoomAction)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (IBAction)guideAction:(id)sender {
+    if (self.callback) {
+        self.callback(JOINROOMACTION_GUIDE, nil);
+    }
+}
+
+- (IBAction)joinAction:(id)sender {
+    if (self.callback) {
+        self.callback(JOINROOMACTION_JOIN, self.sourceModel);
+    }
+}
+
+#pragma mark - 呼吸灯动画
+
+-(CAAnimationGroup *)alphaLight:(float)time {
+    // 缩放动画
+    CABasicAnimation * scaleAnim = [CABasicAnimation animation];
+    scaleAnim.keyPath = @"transform.scale";
+    scaleAnim.fromValue = @1.0;
+    scaleAnim.toValue = @1.1;
+    scaleAnim.duration = time;
+    
+    CABasicAnimation *opacityAnim =[CABasicAnimation animationWithKeyPath:@"opacity"];
+    opacityAnim.fromValue = [NSNumber numberWithFloat:1.0f];
+    opacityAnim.toValue = [NSNumber numberWithFloat:0.7f];//这是透明度。
+    opacityAnim.autoreverses = YES;
+    opacityAnim.duration = time;
+    
+    // 创建动画组
+    CAAnimationGroup *groups =[CAAnimationGroup animation];
+    groups.animations = @[scaleAnim,opacityAnim];
+    groups.removedOnCompletion = YES;
+    groups.fillMode = kCAFillModeForwards;
+    groups.duration = time;
+    groups.repeatCount = FLT_MAX;
+    groups.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
+    return groups;
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 60 - 0
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.xib

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="WaitExamBottomView">
+            <rect key="frame" x="0.0" y="0.0" width="414" height="130"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vNA-va-jtb">
+                    <rect key="frame" x="17" y="10" width="380" height="50"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="50" id="3iA-gj-poL"/>
+                    </constraints>
+                    <state key="normal" title="设备检查及考试引导" backgroundImage="layer_buttonNomal">
+                        <color key="titleColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="guideAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="PY4-WC-sQU"/>
+                    </connections>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="olr-Af-45x">
+                    <rect key="frame" x="17" y="70" width="380" height="50"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="50" id="kvJ-uA-PNs"/>
+                    </constraints>
+                    <state key="normal" title="进入教室" backgroundImage="button_unable"/>
+                    <connections>
+                        <action selector="joinAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="yRc-U4-W3U"/>
+                    </connections>
+                </button>
+            </subviews>
+            <color key="backgroundColor" red="0.95294117649999999" green="0.95686274510000002" blue="0.97254901959999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="olr-Af-45x" firstAttribute="trailing" secondItem="vNA-va-jtb" secondAttribute="trailing" id="Amr-0k-YOy"/>
+                <constraint firstItem="vNA-va-jtb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="17" id="AnE-ci-nZb"/>
+                <constraint firstItem="vNA-va-jtb" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="GDF-1L-JY1"/>
+                <constraint firstItem="olr-Af-45x" firstAttribute="leading" secondItem="vNA-va-jtb" secondAttribute="leading" id="aFg-fR-GLo"/>
+                <constraint firstAttribute="trailing" secondItem="vNA-va-jtb" secondAttribute="trailing" constant="17" id="dgj-Ux-jWu"/>
+                <constraint firstItem="olr-Af-45x" firstAttribute="top" secondItem="vNA-va-jtb" secondAttribute="bottom" constant="10" id="uMT-7G-rE1"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="guideButton" destination="vNA-va-jtb" id="glR-xF-fkQ"/>
+                <outlet property="joinButton" destination="olr-Af-45x" id="OUE-E5-KvO"/>
+            </connections>
+            <point key="canvasLocation" x="137.68115942028987" y="-123.88392857142857"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="button_unable" width="49.5" height="49"/>
+        <image name="layer_buttonNomal" width="49.5" height="49"/>
+    </resources>
+</document>

+ 2 - 2
MusicGradeExam/MusicGradeExam/UI/ExamLibrary/Controller/ExamLibraryController.m

@@ -121,7 +121,7 @@
 - (void)resetParamenter {
     self.isLoadMore = YES;
     self.pages = 1;
-    self.rows = 10;
+    self.rows = 20;
     self.dataArray = [NSMutableArray array];
     [self.tableView.mj_footer resetNoMoreData];
     MJWeakSelf;
@@ -210,7 +210,7 @@
 
 - (UITableView *)tableView {
     if (!_tableView) {
-        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 124, kScreenWidth, kScreenHeight) style:UITableViewStylePlain];
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 124, kScreenWidth, kScreenHeight - kNaviBarHeight - iPhoneXSafeBottomMargin - 124) style:UITableViewStylePlain];
         _tableView.delegate = self;
         _tableView.dataSource = self;
         _tableView.rowHeight = 53;

+ 4 - 5
MusicGradeExam/MusicGradeExam/UI/Home/Controller/HomeViewController.m

@@ -70,9 +70,6 @@
                 [ticketArray addObject:model];
             }
             self.dataArray = [NSMutableArray arrayWithArray:ticketArray];
-            if (self.dataArray.count) {
-                // 建立IM连接
-            }
         }
         else {
             [self MBPShow:MESSAGEKEY];
@@ -106,11 +103,12 @@
         [self.scrollView.mj_header endRefreshing];
         if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
             NSDictionary *dataDic = [dic dictionaryValueForKey:@"data"];
-            if (dataDic == 0) {
+            if (dataDic == nil) {
                 self.bodyView.hasNoReadCount = NO;
             }
             else {
-                self.bodyView.hasNoReadCount = YES;
+                NSInteger num = [dataDic integerValueForKey:@"num"];
+                self.bodyView.hasNoReadCount = num == 0 ? NO : YES;
             }
         }
         
@@ -121,6 +119,7 @@
 
 - (void)configUI {
     self.scrollView.backgroundColor = HexRGB(0xf3f4f8);
+    
     self.scrollView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTabBarHeight);
     _bodyView = [HomeBodyView shareInstance];
     CGFloat recordHeight = (kScreenWidth - 24) / 351 * 120;

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

@@ -28,11 +28,11 @@
 
 - (void)setHasNoReadCount:(BOOL)hasNoReadCount {
     _hasNoReadCount = hasNoReadCount;
-    if (hasNoReadCount) {
-        [self.noticeButton setImage:[UIImage imageNamed:@"notice_read"] forState:UIControlStateNormal];
+    if (hasNoReadCount) { // 有未读消息
+        [self.noticeButton setImage:[UIImage imageNamed:@"notice_unread"] forState:UIControlStateNormal];
     }
     else {
-        [self.noticeButton setImage:[UIImage imageNamed:@"notice_unread"] forState:UIControlStateNormal];
+        [self.noticeButton setImage:[UIImage imageNamed:@"notice_read"] forState:UIControlStateNormal];
     }
 }
 

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/Login/Controller/LoginViewController.m

@@ -89,7 +89,7 @@
                 [[NSUserDefaults standardUserDefaults] synchronize];
                 // 获取用户信息并登录融云
                 [KSRequestManager configRequestHeader];
-                [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+                [USER_MANAGER queryUserInfoConnectRongCloud:NO connectionJPush:YES];
                 MJWeakSelf;
                 [self KSShowMsg:@"登录成功" promptCompletion:^{
                     [weakSelf toHomeView];

+ 5 - 1
MusicGradeExam/MusicGradeExam/UI/Login/Controller/ModifyViewController.m

@@ -14,6 +14,7 @@
 #import "CustomNavViewController.h"
 #import "JPUSHService.h"
 #import "RCConnectionManager.h"
+#import "UserInfoManager.h"
 
 @interface ModifyViewController ()
 {
@@ -97,7 +98,10 @@
 - (void)toLoginView {
     [RCConnectionManager shareManager].isNeedJoin = NO;
     [RCConnectionManager shareManager].isNeedShowMessage = NO;
-    [[RCIM sharedRCIM] logout];
+    if (USER_MANAGER.needConnect) {
+        USER_MANAGER.needConnect = NO;
+        [[RCIM sharedRCIM] logout];
+    }
     [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
     // 取消推送别名
     [JPUSHService deleteAlias:nil seq:0];

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/Login/Controller/RegisterViewController.m

@@ -106,7 +106,7 @@
             [KSRequestManager configRequestHeader];
             
             // 获取用户信息并登录融云
-            [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+            [USER_MANAGER queryUserInfoConnectRongCloud:NO connectionJPush:YES];
             MJWeakSelf;
             [self KSShowMsg:@"注册成功" promptCompletion:^{
                 [weakSelf settingPasswordWithPhone:phoneNo code:code];

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/Login/Controller/VefiLoginViewController.m

@@ -105,7 +105,7 @@
             [KSRequestManager configRequestHeader];
             
             // 获取用户信息并登录融云
-            [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+            [USER_MANAGER queryUserInfoConnectRongCloud:NO connectionJPush:YES];
             MJWeakSelf;
             [self KSShowMsg:@"登录成功" promptCompletion:^{
                 if ([result boolValueForKey:@"password"] == YES) {

+ 3 - 1
MusicGradeExam/MusicGradeExam/UI/Login/Model/UserInfoManager.h

@@ -18,12 +18,14 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) UserInfo *userInfo;
 
+@property (nonatomic, assign) BOOL needConnect; // 是否需要连接IM
+
 + (instancetype)shareInstance;
 
 // 获取信息回调
 - (void)queryUserInfoCallback:(UserInfoCallback)callback;
 
-- (void)queryUserInfoConnectRongCloud:(BOOL)connectRM;
+- (void)queryUserInfoConnectRongCloud:(BOOL)connectRM connectionJPush:(BOOL)connectJPush;
 
 - (void)connectRongCloud;
 

+ 6 - 11
MusicGradeExam/MusicGradeExam/UI/Login/Model/UserInfoManager.m

@@ -67,11 +67,11 @@
     if (callback) {
         self.callback = callback;
     }
-    [self queryUserInfoConnectRongCloud:NO];
+    [self queryUserInfoConnectRongCloud:NO connectionJPush:NO];
 }
 
 
-- (void)queryUserInfoConnectRongCloud:(BOOL)connectRM {
+- (void)queryUserInfoConnectRongCloud:(BOOL)connectRM connectionJPush:(BOOL)connectJPush {
     
     [KSRequestManager queryUserInfo:KS_GET success:^(NSDictionary * _Nonnull dic) {
         if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
@@ -79,26 +79,20 @@
             self.userInfo = [[UserInfo alloc] initWithDictionary:[dic dictionaryValueForKey:@"data"]];
             NSString *uid = [NSString stringWithFormat:@"%.0f",self.userInfo.userId];
             UserDefaultSet(uid, UIDKey);
-            NSString *rongToken = UserDefault(RongTokenKey);
-            BOOL needConnect = NO;
-            if ([NSString isEmptyString:rongToken]) {
-                needConnect = YES;
-            }
             UserDefaultSet(self.userInfo.imToken, RongTokenKey);
             UserDefaultSet(self.userInfo.realName, NicknameKey);
             UserDefaultSet(self.userInfo.avatar, AvatarUrlKey);
             [[NSUserDefaults standardUserDefaults] synchronize];
             
+            if (connectJPush) {
+                [JPUSHService setAlias:UserDefault(UIDKey) completion:nil seq:0];
+            }
             if (connectRM) {
                 // 设置推送别名
-                [JPUSHService setAlias:UserDefault(UIDKey) completion:nil seq:0];
                 [Bugly setUserIdentifier:UserDefault(UIDKey)];
                 [self connectRongCloud];
             }
             else if (self.callback) {
-                if (needConnect) {
-                    [self connectRongCloud];
-                }
                 self.callback(self.userInfo);
             }
         }
@@ -137,6 +131,7 @@
     } tokenIncorrect:^{
         NSLog(@"token错误");
         dispatch_async(dispatch_get_main_queue(), ^{
+            USER_MANAGER.needConnect = NO;
             // 再次获取token
             AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
             [appDelegate requestRongCloudToken];

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/NotiferMessage/Controller/NotifyMessageViewController.m

@@ -100,7 +100,7 @@
 - (void)resetParamenter {
     self.isLoadMore = YES;
     self.pages = 1;
-    self.rows = 10;
+    self.rows = 20;
     self.dataArray = [NSMutableArray array];
     [self.tableView.mj_footer resetNoMoreData];
     MJWeakSelf;

+ 20 - 3
MusicGradeExam/MusicGradeExam/UI/NotiferMessage/View/NotifyMessageCell.m

@@ -33,12 +33,29 @@
     NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
     dateFormatter.timeZone = [NSTimeZone systemTimeZone];
     [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
-    NSDate *messageDate = [dateFormatter dateFromString:sourceModel.createOn];
-    [dateFormatter setDateFormat:@"MM-dd"];
-    NSString *dateStr = [dateFormatter stringFromDate:messageDate];
+    NSDate *messageDate = [dateFormatter dateFromString:sourceModel.modifyOn];
+    
+    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
+    NSDate *currentDate = [NSDate date];
+    NSString *today = [dateFormatter stringFromDate:currentDate];
+    NSString *messageDateStr = [dateFormatter stringFromDate:messageDate];
+    NSString *dateStr = @"";
+    if ([messageDateStr isEqualToString:today]) {
+        [dateFormatter setDateFormat:@"HH:mm"];
+        dateStr = [dateFormatter stringFromDate:messageDate];
+    }
+    else {
+        [dateFormatter setDateFormat:@"MM-dd"];
+        dateStr = [dateFormatter stringFromDate:messageDate];
+    }
 
     self.timeLabel.text = [NSString returnNoNullStringWithString:dateStr];
     self.topMessage.text = [NSString returnNoNullStringWithString:sourceModel.title];
+    NSString *messgage = [NSString returnNoNullStringWithString:sourceModel.content];
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+           [paragraphStyle setLineSpacing:4];//调整行间距
+    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:messgage attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:14.0f],NSForegroundColorAttributeName:HexRGB(0x808080)}];
+           self.descMessage.attributedText = attrStr;
 }
 
 - (void)setIsRead:(BOOL)isRead {

+ 13 - 9
MusicGradeExam/MusicGradeExam/UI/NotiferMessage/View/NotifyMessageCell.xib

@@ -25,7 +25,7 @@
                         </constraints>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="报名通知" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c4k-4Y-3yQ">
-                        <rect key="frame" x="76" y="23" width="66" height="22"/>
+                        <rect key="frame" x="76" y="18" width="65.5" height="22"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="22" id="7V8-Sq-Ogb"/>
                         </constraints>
@@ -33,23 +33,26 @@
                         <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="05-20" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iMh-Np-lvc">
-                        <rect key="frame" x="318" y="21" width="41" height="17"/>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="05-20" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iMh-Np-lvc">
+                        <rect key="frame" x="309" y="21" width="50" height="17"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="50" id="BbO-0g-38M"/>
+                        </constraints>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <color key="textColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.50196078431372548" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考生须带报考费及考生同一底版的…" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yL7-lv-Cfl">
-                        <rect key="frame" x="76" y="48" width="265" height="21"/>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="考生须带报考费及考生同一底版的…" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yL7-lv-Cfl">
+                        <rect key="frame" x="76" y="43" width="265" height="26"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="21" id="81j-K6-dfj"/>
+                            <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="81j-K6-dfj"/>
                         </constraints>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pfN-a6-1ot">
-                        <rect key="frame" x="351" y="54.5" width="8" height="8"/>
+                        <rect key="frame" x="351" y="52" width="8" height="8"/>
                         <color key="backgroundColor" red="1" green="0.20784313730000001" blue="0.20784313730000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="8" id="HDd-dc-azA"/>
@@ -71,15 +74,16 @@
                 </subviews>
                 <constraints>
                     <constraint firstAttribute="trailing" secondItem="pfN-a6-1ot" secondAttribute="trailing" constant="16" id="383-7r-Vvj"/>
-                    <constraint firstItem="c4k-4Y-3yQ" firstAttribute="top" secondItem="3zY-4P-qh6" secondAttribute="top" id="38k-5F-MCl"/>
                     <constraint firstItem="pfN-a6-1ot" firstAttribute="centerY" secondItem="yL7-lv-Cfl" secondAttribute="centerY" id="4jt-LR-LQI"/>
                     <constraint firstItem="yL7-lv-Cfl" firstAttribute="top" secondItem="c4k-4Y-3yQ" secondAttribute="bottom" constant="3" id="Epb-qG-x8d"/>
                     <constraint firstAttribute="trailing" secondItem="iMh-Np-lvc" secondAttribute="trailing" constant="16" id="GxV-jP-K9H"/>
                     <constraint firstItem="c4k-4Y-3yQ" firstAttribute="leading" secondItem="3zY-4P-qh6" secondAttribute="trailing" constant="18" id="H2V-mf-agu"/>
                     <constraint firstItem="3zY-4P-qh6" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="HvA-bz-WaR"/>
-                    <constraint firstItem="iMh-Np-lvc" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="21" id="P6e-WX-ZSp"/>
+                    <constraint firstItem="iMh-Np-lvc" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="c4k-4Y-3yQ" secondAttribute="trailing" constant="10" id="LzL-fQ-veV"/>
                     <constraint firstItem="pfN-a6-1ot" firstAttribute="leading" secondItem="yL7-lv-Cfl" secondAttribute="trailing" constant="10" id="Prc-Dc-q8q"/>
+                    <constraint firstItem="iMh-Np-lvc" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="21" id="Tgr-cm-9Le"/>
                     <constraint firstItem="3zY-4P-qh6" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="U2L-6a-Tf0"/>
+                    <constraint firstItem="c4k-4Y-3yQ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="18" id="Uzg-SN-tAK"/>
                     <constraint firstAttribute="trailing" secondItem="yc7-s6-gbf" secondAttribute="trailing" id="VbP-3S-iZ8"/>
                     <constraint firstItem="yL7-lv-Cfl" firstAttribute="leading" secondItem="c4k-4Y-3yQ" secondAttribute="leading" id="iIJ-BA-JPW"/>
                     <constraint firstItem="yc7-s6-gbf" firstAttribute="top" secondItem="yL7-lv-Cfl" secondAttribute="bottom" constant="18" id="rIF-DC-fQU"/>

+ 3 - 3
MusicGradeExam/MusicGradeExam/UI/UserCenter/DeviceCheck/DeviceCheckView.xib

@@ -186,7 +186,7 @@
                             <rect key="frame" x="0.0" y="277" width="320" height="45"/>
                             <subviews>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SPT-Hd-ERF">
-                                    <rect key="frame" x="172" y="0.0" width="120" height="45"/>
+                                    <rect key="frame" x="163" y="0.0" width="129" height="45"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                     <state key="normal" title="有声音" backgroundImage="button_nomal"/>
                                     <connections>
@@ -194,7 +194,7 @@
                                     </connections>
                                 </button>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Vr-mf-Mbz">
-                                    <rect key="frame" x="28" y="0.0" width="120" height="45"/>
+                                    <rect key="frame" x="28" y="0.0" width="129" height="45"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                     <state key="normal" title="无声音" backgroundImage="layer_buttonNomal">
                                         <color key="titleColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -208,7 +208,7 @@
                             <constraints>
                                 <constraint firstItem="3Vr-mf-Mbz" firstAttribute="leading" secondItem="5Iv-wq-O2H" secondAttribute="leading" constant="28" id="2vT-3R-3cK"/>
                                 <constraint firstAttribute="trailing" secondItem="SPT-Hd-ERF" secondAttribute="trailing" constant="28" id="GZ8-BC-qfh"/>
-                                <constraint firstItem="SPT-Hd-ERF" firstAttribute="leading" secondItem="3Vr-mf-Mbz" secondAttribute="trailing" constant="24" id="NyZ-C1-5DL"/>
+                                <constraint firstItem="SPT-Hd-ERF" firstAttribute="leading" secondItem="3Vr-mf-Mbz" secondAttribute="trailing" constant="6" id="NyZ-C1-5DL"/>
                                 <constraint firstAttribute="height" constant="45" id="VCF-PW-fak"/>
                                 <constraint firstItem="3Vr-mf-Mbz" firstAttribute="top" secondItem="5Iv-wq-O2H" secondAttribute="top" id="YrR-ft-Fgc"/>
                                 <constraint firstItem="SPT-Hd-ERF" firstAttribute="top" secondItem="5Iv-wq-O2H" secondAttribute="top" id="cbm-mt-f3h"/>

+ 5 - 1
MusicGradeExam/MusicGradeExam/UI/UserCenter/Setting/Controller/ModifyPhoneChangeController.m

@@ -14,6 +14,7 @@
 #import "CustomNavViewController.h"
 #import "JPUSHService.h"
 #import "RCConnectionManager.h"
+#import "UserInfoManager.h"
 
 @interface ModifyPhoneChangeController ()
 {
@@ -79,7 +80,10 @@
 - (void)successChangeBack {
     [RCConnectionManager shareManager].isNeedJoin = NO;
     [RCConnectionManager shareManager].isNeedShowMessage = NO;
-    [[RCIM sharedRCIM] logout];
+    if (USER_MANAGER.needConnect) {
+        USER_MANAGER.needConnect = NO;
+        [[RCIM sharedRCIM] logout];
+    }
     [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
     // 取消推送别名
     [JPUSHService deleteAlias:nil seq:0];

+ 5 - 1
MusicGradeExam/MusicGradeExam/UI/UserCenter/Setting/Controller/SettingViewController.m

@@ -18,6 +18,7 @@
 #import "KSBaseWKWebViewController.h"
 #import "RCConnectionManager.h"
 #import "ModifyPhoneCheckController.h"
+#import "UserInfoManager.h"
 
 @interface SettingViewController ()
 
@@ -107,7 +108,10 @@
 - (void)clearSource {
     [RCConnectionManager shareManager].isNeedJoin = NO;
     [RCConnectionManager shareManager].isNeedShowMessage = NO;
-    [[RCIM sharedRCIM] logout];
+    if (USER_MANAGER.needConnect) {
+        USER_MANAGER.needConnect = NO;
+        [[RCIM sharedRCIM] logout];
+    }
     // 取消推送别名
     [JPUSHService deleteAlias:nil seq:0];
     [UIApplication sharedApplication].applicationIconBadgeNumber = 0;

+ 6 - 6
MusicGradeExam/MusicGradeExam/UI/UserCenter/View/UserCenterBodyView.m

@@ -25,12 +25,12 @@
 - (void)configMessage {
     UserInfo *info = USER_MANAGER.userInfo;
     self.userName.text = [NSString returnNoNullStringWithString:info.realName];
-    if ([NSString isEmptyString:info.certificatePhoto]) {
-        [self.userAvatar setImage:[UIImage imageNamed:USER_LOGO]];
-    }
-    else {
-        [self.userAvatar sd_setImageWithURL:[NSURL URLWithString:info.certificatePhoto] placeholderImage:[UIImage imageNamed:USER_LOGO]];
-    }
+//    if ([NSString isEmptyString:info.certificatePhoto]) {
+//        [self.userAvatar setImage:[UIImage imageNamed:USER_LOGO]];
+//    }
+//    else {
+//        [self.userAvatar sd_setImageWithURL:[NSURL URLWithString:info.certificatePhoto] placeholderImage:[UIImage imageNamed:USER_LOGO]];
+//    }
     if ([NSString isEmptyString:info.birthdate]) {
         self.birthday.text = @"";
         self.userNation.text = @"";

+ 0 - 3
MusicGradeExam/MusicGradeExam/UI/UserCenter/View/UserCenterBodyView.xib

@@ -29,9 +29,6 @@
                                     <real key="value" value="29"/>
                                 </userDefinedRuntimeAttribute>
                             </userDefinedRuntimeAttributes>
-                            <connections>
-                                <outletCollection property="gestureRecognizers" destination="uPF-sq-oRr" appends="YES" id="caT-2r-Y3a"/>
-                            </connections>
                         </imageView>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="白鸽" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="br8-HA-xec">
                             <rect key="frame" x="87" y="0.0" width="43" height="29"/>