Browse Source

录播引导

Steven 5 years ago
parent
commit
4638d2fc89

+ 1 - 1
MusicGradeExam/MusicGradeExam/Tools/Custom/KSGuideMaskView.m

@@ -104,7 +104,7 @@ NSInteger countNum = 0;
     UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
     label.text = tipsMessage;
     label.textAlignment = NSTextAlignmentCenter;
-    label.font = [UIFont systemFontOfSize:15.0f];
+    label.font = [UIFont systemFontOfSize:18.0f];
     label.textColor = HexRGB(0xffffff);
     [self addSubview:label];
     [label mas_makeConstraints:^(MASConstraintMaker *make) {

+ 10 - 4
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.m

@@ -25,6 +25,8 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
 
 @property (nonatomic, assign) BOOL hasAnimation;
 
+@property (weak, nonatomic) IBOutlet UIView *animationView;
+
 @end
 
 @implementation WaitExamBottomView
@@ -67,6 +69,9 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
             self.canJoinRoom = self.sourceModel.classroomSwitch;
             if (self.sourceModel.classroomSwitch == 0) {
                 NSString *title = [NSString stringWithFormat:@"当前需要等待%.0f位考生",self.sourceModel.waitNum];
+                if (self.sourceModel.waitNum == 0) {
+                    title = @"即将开始考试,请准备";
+                }
                [self.joinButton setTitle:title forState:UIControlStateNormal];
             }
             else {
@@ -86,7 +91,8 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
         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.animationView.layer addAnimation:[self alphaLight:1.5f] forKey:@"aAlpha"];
         
         self.hasAnimation = YES;
     }
@@ -95,7 +101,7 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
         [self.joinButton setBackgroundImage:[UIImage imageNamed:@"button_unable"] forState:UIControlStateNormal];
         if (self.hasAnimation) {
             self.hasAnimation = NO;
-            [self.joinButton.layer removeAnimationForKey:@"aAlpha"];
+            [self.animationView.layer removeAnimationForKey:@"aAlpha"];
         }
     }
 }
@@ -125,12 +131,12 @@ typedef NS_ENUM(NSInteger,EXAMSTATUS) {
     CABasicAnimation * scaleAnim = [CABasicAnimation animation];
     scaleAnim.keyPath = @"transform.scale";
     scaleAnim.fromValue = @1.0;
-    scaleAnim.toValue = @1.1;
+    scaleAnim.toValue = @1.2;
     scaleAnim.duration = time;
     
     CABasicAnimation *opacityAnim =[CABasicAnimation animationWithKeyPath:@"opacity"];
     opacityAnim.fromValue = [NSNumber numberWithFloat:1.0f];
-    opacityAnim.toValue = [NSNumber numberWithFloat:0.7f];//这是透明度。
+    opacityAnim.toValue = [NSNumber numberWithFloat:0.01f];//这是透明度。
     opacityAnim.autoreverses = YES;
     opacityAnim.duration = time;
     

+ 18 - 4
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBottomView.xib

@@ -13,8 +13,17 @@
             <rect key="frame" x="0.0" y="0.0" width="414" height="130"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8Gh-j0-ioZ">
+                    <rect key="frame" x="50" y="70" width="314" height="50"/>
+                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="25"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
                 <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"/>
+                    <rect key="frame" x="50" y="10" width="314" height="50"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="50" id="3iA-gj-poL"/>
                     </constraints>
@@ -26,7 +35,7 @@
                     </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"/>
+                    <rect key="frame" x="50" y="70" width="314" height="50"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="50" id="kvJ-uA-PNs"/>
                     </constraints>
@@ -39,14 +48,19 @@
             <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="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="50" 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="8Gh-j0-ioZ" firstAttribute="trailing" secondItem="olr-Af-45x" secondAttribute="trailing" id="T19-g4-mpe"/>
+                <constraint firstItem="8Gh-j0-ioZ" firstAttribute="leading" secondItem="olr-Af-45x" secondAttribute="leading" id="Trb-EH-zkh"/>
                 <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="8Gh-j0-ioZ" firstAttribute="bottom" secondItem="olr-Af-45x" secondAttribute="bottom" id="d4q-Pu-Vwa"/>
+                <constraint firstAttribute="trailing" secondItem="vNA-va-jtb" secondAttribute="trailing" constant="50" id="dgj-Ux-jWu"/>
+                <constraint firstItem="8Gh-j0-ioZ" firstAttribute="top" secondItem="olr-Af-45x" secondAttribute="top" id="mbq-Gb-alj"/>
                 <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="animationView" destination="8Gh-j0-ioZ" id="eSe-ew-3gN"/>
                 <outlet property="guideButton" destination="vNA-va-jtb" id="glR-xF-fkQ"/>
                 <outlet property="joinButton" destination="olr-Af-45x" id="OUE-E5-KvO"/>
             </connections>

+ 45 - 6
MusicGradeExam/MusicGradeExam/UI/RecordExam/Controller/RecordExamViewController.m

@@ -15,6 +15,7 @@
 #import "KSMediaManager.h"
 #import "WMPlayer.h"
 #import "SongModel.h"
+#import "KSGuideMaskView.h"
 
 @interface RecordExamViewController ()<UITableViewDelegate, UITableViewDataSource,WMPlayerDelegate>
 {
@@ -43,6 +44,8 @@
 
 @property (nonatomic, strong) NSMutableArray *fileUrlArray;
 
+@property (nonatomic, assign) BOOL hasShowTips;
+
 @end
 
 @implementation RecordExamViewController
@@ -105,7 +108,7 @@
             [self.fileUrlArray addObject:remoteUrl];
         }
     }
-    
+    [self checkSubmitButtonEnable];
     [self.tableView reloadData];
 }
 
@@ -132,6 +135,33 @@
 }
 
 
+- (void)viewDidAppear:(BOOL)animated {
+    [super viewDidAppear:animated];
+    
+    if (_hasShowTips == NO) {
+        [self addIntroduceView];
+    }
+}
+
+- (void)addIntroduceView {
+    _hasShowTips = YES;
+    CGRect rect1 = [self.tableView convertRect:self.tableView.tableHeaderView.frame toView:[UIApplication sharedApplication].keyWindow];
+    rect1.origin.y -= 50;
+    rect1.size.height += 50;
+    UIBezierPath *pathOne = [UIBezierPath bezierPathWithRect:rect1];
+    
+    CGRect rect2 = rect1;
+    rect2.size = CGSizeMake(kScreenWidth, 130);
+    rect2.origin.y = CGRectGetMaxY(rect1);
+    UIBezierPath *pathSecond = [UIBezierPath bezierPathWithRect:rect2];
+    NSArray *tipsArray = @[@"请在录播时间内完成视频上传", @"点击上传曲目录播视频"];
+    NSArray *bezierArray = @[pathOne,pathSecond];
+    
+    KSGuideMaskView *guideView = [[KSGuideMaskView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
+    [guideView addTips:tipsArray transparentRect:bezierArray shaperLayerIndex:-1];
+    [guideView showMaskViewInView:nil];
+}
+
 #pragma mark ----- table data source
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.songArray.count;
@@ -174,6 +204,7 @@
     UserDefaultRemoveObjectForKey(fileKey);
     NSString *remoteUrl = [parm stringValueForKey:@"remoteUrl"];
     [self.fileUrlArray removeObject:remoteUrl];
+    [self checkSubmitButtonEnable];
     [self.tableView reloadData];
 }
 
@@ -193,6 +224,18 @@
 }
 
 
+- (void)checkSubmitButtonEnable {
+    if (self.fileUrlArray.count == 0) {
+        self.bottomView.finishButton.userInteractionEnabled = NO;
+        [self.bottomView.finishButton setBackgroundImage:[UIImage imageNamed:@"button_unable"] forState:UIControlStateNormal];
+    }
+    else {
+        self.bottomView.finishButton.userInteractionEnabled = YES;
+        [self.bottomView.finishButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
+        [self.bottomView.finishButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
+    }
+}
+
 
 #pragma mark --- lazying
 - (RecordBodyView *)topView {
@@ -258,11 +301,6 @@
 
 - (void)submitAction {
     // 提交 完成考试
-    
-    if (self.fileUrlArray.count == 0) {
-        [self MBPShow:@"请提交录播视频"];
-        return;
-    }
     [self showhud];
     NSString *videoUrl = [self.fileUrlArray componentsJoinedByString:@","];
     [KSRequestManager stuEndRecordFinishRequest:KS_POST examRegistrationId:self.examRegistrationId videoUrl:videoUrl success:^(NSDictionary * _Nonnull dic) {
@@ -320,6 +358,7 @@
             [self.tableView reloadData];
             
             [self.fileUrlArray addObject:fileUrl];
+            [self checkSubmitButtonEnable];
         }
         else {
             [self MBPShow:MESSAGEKEY];

+ 4 - 4
MusicGradeExam/MusicGradeExam/UI/RecordExam/View/RecordBodyView.xib

@@ -57,10 +57,10 @@
                             <color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="20分45秒" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q8k-CG-YKq">
-                            <rect key="frame" x="132" y="13" width="235" height="20"/>
-                            <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                            <color key="textColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.50196078431372548" alpha="1" colorSpace="calibratedRGB"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q8k-CG-YKq">
+                            <rect key="frame" x="132" y="23" width="235" height="0.0"/>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+                            <color key="textColor" red="1" green="0.36078431372549019" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                     </subviews>

+ 1 - 0
MusicGradeExam/MusicGradeExam/UI/RecordExam/View/RecordBottomView.m

@@ -26,6 +26,7 @@
         self.callback = callback;
     }
 }
+
 - (IBAction)submitAction:(id)sender {
     if (self.callback) {
         self.callback();

+ 4 - 7
MusicGradeExam/MusicGradeExam/UI/RecordExam/View/RecordBottomView.xib

@@ -15,16 +15,10 @@
             <subviews>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OVk-6l-fwy">
                     <rect key="frame" x="17" y="20" width="380" height="50"/>
-                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="50" id="7kz-FV-ii6"/>
                     </constraints>
-                    <state key="normal" title="完成考试"/>
-                    <userDefinedRuntimeAttributes>
-                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                            <real key="value" value="25"/>
-                        </userDefinedRuntimeAttribute>
-                    </userDefinedRuntimeAttributes>
+                    <state key="normal" title="完成考试" backgroundImage="button_nomal"/>
                     <connections>
                         <action selector="submitAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="J6j-ED-Zt9"/>
                     </connections>
@@ -45,4 +39,7 @@
             <point key="canvasLocation" x="252" y="148"/>
         </view>
     </objects>
+    <resources>
+        <image name="button_nomal" width="49.5" height="49"/>
+    </resources>
 </document>

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/RecordExam/View/RecordTipsView.m

@@ -29,7 +29,7 @@
         NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
         [paragraphStyle setLineSpacing:4];//调整行间距
         NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:messageStr attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:14.0f weight:UIFontWeightMedium],NSForegroundColorAttributeName:HexRGB(0x808080)}];
-        [attrStr addAttributes:@{NSForegroundColorAttributeName:HexRGB(0xff5c00)} range:NSMakeRange(2, endTime.length)];
+        [attrStr addAttributes:@{NSForegroundColorAttributeName:HexRGB(0xff5c00), NSFontAttributeName:[UIFont systemFontOfSize:14.0f weight:UIFontWeightSemibold]} range:NSMakeRange(2, endTime.length)];
         self.tipsLabel.attributedText = attrStr;
     }
     else {

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/RecordExam/View/RecordTipsView.xib

@@ -22,7 +22,7 @@
                     <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
                 </label>
-                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请于2020-05-20 9:30:59前依次完成考级曲目的提交,规定时间后,未提交完成,则视为缺考。" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0KC-iu-RW4">
+                <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="0KC-iu-RW4">
                     <rect key="frame" x="20" y="49" width="374" height="60"/>
                     <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"/>

+ 8 - 8
MusicGradeExam/MusicGradeExam/UI/UserCenter/View/UserCenterBodyView.xib

@@ -30,8 +30,8 @@
                                 </userDefinedRuntimeAttribute>
                             </userDefinedRuntimeAttributes>
                         </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"/>
+                        <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="0.0" height="29"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="29" id="Hve-KA-eN2"/>
                             </constraints>
@@ -39,8 +39,8 @@
                             <nil key="textColor"/>
                             <nil key="highlightedColor"/>
                         </label>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2010-06-27" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="85j-TL-W3B">
-                            <rect key="frame" x="87" y="38" width="78.5" height="20"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="85j-TL-W3B">
+                            <rect key="frame" x="87" y="38" width="0.0" height="20"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="20" id="h1Z-Wn-NcE"/>
                             </constraints>
@@ -48,8 +48,8 @@
                             <color key="textColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.50196078431372548" alpha="1" colorSpace="calibratedRGB"/>
                             <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="1Jk-n0-UV8">
-                            <rect key="frame" x="180.5" y="38" width="20" height="20"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Jk-n0-UV8">
+                            <rect key="frame" x="102" y="38" width="20" height="20"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="20" id="MzM-0V-sK8"/>
                             </constraints>
@@ -57,8 +57,8 @@
                             <color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="calibratedRGB"/>
                             <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="DTT-Zs-WXV">
-                            <rect key="frame" x="210.5" y="38" width="29" height="20"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DTT-Zs-WXV">
+                            <rect key="frame" x="132" y="38" width="0.0" height="20"/>
                             <fontDescription key="fontDescription" type="system" pointSize="14"/>
                             <color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>