Browse Source

作业提交交互

Steven 1 month ago
parent
commit
d14535f98e
24 changed files with 1218 additions and 205 deletions
  1. 20 0
      KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj
  2. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Course/homework_upload_bg.imageset/Contents.json
  3. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Course/homework_upload_bg.imageset/homework_upload_bg@2x.png
  4. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Course/homework_upload_bg.imageset/homework_upload_bg@3x.png
  5. 80 47
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m
  6. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyArrangeCell.xib
  7. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyEvaluateCell.xib
  8. 13 7
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyHomeworkCell.m
  9. 6 5
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyHomeworkCell.xib
  10. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyRemarkCell.xib
  11. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyStudentEvaCell.xib
  12. 73 39
      KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/Controller/MusicRoomDetailViewController.m
  13. 4 0
      KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/View/MusicRoomCourseInfoCell.xib
  14. 81 48
      KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/Controller/VipCouseDetailViewController.m
  15. 71 20
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/Controller/HomeworkDetailViewController.m
  16. 1 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/AccompanyAlertView.m
  17. 24 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/CourseEvaluateAlertView.h
  18. 201 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/CourseEvaluateAlertView.m
  19. 197 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/CourseEvaluateAlertView.xib
  20. 9 9
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkAddView.m
  21. 37 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkSubmitAlertView.h
  22. 173 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkSubmitAlertView.m
  23. 176 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkSubmitAlertView.xib
  24. 14 14
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkVideoView.xib

+ 20 - 0
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -989,6 +989,10 @@
 		BCF425F72AB991E600BCD942 /* TenantAlbumModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF425F62AB991E600BCD942 /* TenantAlbumModel.m */; };
 		BCF472E72AB019CD0032BE16 /* TenantDarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF472E62AB019CD0032BE16 /* TenantDarkViewController.m */; };
 		BCF472EA2AB01AEB0032BE16 /* TenantMoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF472E92AB01AEB0032BE16 /* TenantMoreViewController.m */; };
+		BCF748512D15010D00CD7EB4 /* HomeworkSubmitAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF748502D15010D00CD7EB4 /* HomeworkSubmitAlertView.m */; };
+		BCF748532D15011500CD7EB4 /* HomeworkSubmitAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF748522D15011500CD7EB4 /* HomeworkSubmitAlertView.xib */; };
+		BCF748562D15026D00CD7EB4 /* CourseEvaluateAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF748552D15026D00CD7EB4 /* CourseEvaluateAlertView.m */; };
+		BCF748582D15027500CD7EB4 /* CourseEvaluateAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF748572D15027500CD7EB4 /* CourseEvaluateAlertView.xib */; };
 		BCFA12682CF424D8005229AC /* ProgramCourseListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCFA12672CF424D8005229AC /* ProgramCourseListCell.xib */; };
 		BCFA12692CF424D8005229AC /* ProgramCourseListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA12662CF424D8005229AC /* ProgramCourseListCell.m */; };
 		BCFA126C2CF425A7005229AC /* StudentCourseGroupDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA126B2CF425A7005229AC /* StudentCourseGroupDetailModel.m */; };
@@ -2669,6 +2673,12 @@
 		BCF472E62AB019CD0032BE16 /* TenantDarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TenantDarkViewController.m; sourceTree = "<group>"; };
 		BCF472E82AB01AEB0032BE16 /* TenantMoreViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TenantMoreViewController.h; sourceTree = "<group>"; };
 		BCF472E92AB01AEB0032BE16 /* TenantMoreViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TenantMoreViewController.m; sourceTree = "<group>"; };
+		BCF7484F2D15010D00CD7EB4 /* HomeworkSubmitAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeworkSubmitAlertView.h; sourceTree = "<group>"; };
+		BCF748502D15010D00CD7EB4 /* HomeworkSubmitAlertView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeworkSubmitAlertView.m; sourceTree = "<group>"; };
+		BCF748522D15011500CD7EB4 /* HomeworkSubmitAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HomeworkSubmitAlertView.xib; sourceTree = "<group>"; };
+		BCF748542D15026D00CD7EB4 /* CourseEvaluateAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CourseEvaluateAlertView.h; sourceTree = "<group>"; };
+		BCF748552D15026D00CD7EB4 /* CourseEvaluateAlertView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CourseEvaluateAlertView.m; sourceTree = "<group>"; };
+		BCF748572D15027500CD7EB4 /* CourseEvaluateAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseEvaluateAlertView.xib; sourceTree = "<group>"; };
 		BCF880DA2B91C4DF0007B8F0 /* Config-dev.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-dev.xcconfig"; sourceTree = "<group>"; };
 		BCF880DD2B91C4FA0007B8F0 /* Config-debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-debug.xcconfig"; sourceTree = "<group>"; };
 		BCF880DF2B91C5090007B8F0 /* Config-test.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-test.xcconfig"; sourceTree = "<group>"; };
@@ -4220,6 +4230,9 @@
 				BC119268280FAF5800A716F7 /* AccompanyAlertView.h */,
 				BC119269280FAF5800A716F7 /* AccompanyAlertView.m */,
 				BC11926A280FAF5900A716F7 /* AccompanyAlertView.xib */,
+				BCF748542D15026D00CD7EB4 /* CourseEvaluateAlertView.h */,
+				BCF748552D15026D00CD7EB4 /* CourseEvaluateAlertView.m */,
+				BCF748572D15027500CD7EB4 /* CourseEvaluateAlertView.xib */,
 				BC11925C280FA89A00A716F7 /* HomeworkBodyView.h */,
 				BC11925D280FA89A00A716F7 /* HomeworkBodyView.m */,
 				BC119254280FA85200A716F7 /* HomeworkListCell.h */,
@@ -4236,6 +4249,9 @@
 				BC119299280FD2E800A716F7 /* HomeworkBottomView.h */,
 				BC11929A280FD2E800A716F7 /* HomeworkBottomView.m */,
 				BC11929C280FD2EF00A716F7 /* HomeworkBottomView.xib */,
+				BCF7484F2D15010D00CD7EB4 /* HomeworkSubmitAlertView.h */,
+				BCF748502D15010D00CD7EB4 /* HomeworkSubmitAlertView.m */,
+				BCF748522D15011500CD7EB4 /* HomeworkSubmitAlertView.xib */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -6897,6 +6913,7 @@
 				BC7663162827E49900C91A1D /* NotiferHeadView.xib in Resources */,
 				BC802D9928BC4FE90079E350 /* HomeHotMusicView.xib in Resources */,
 				BC38C4542AFA095D00ABFCC2 /* MineWorksDraftsCell.xib in Resources */,
+				BCF748582D15027500CD7EB4 /* CourseEvaluateAlertView.xib in Resources */,
 				BC106C4C2A933E75000759A9 /* LiveRoomHeadView.xib in Resources */,
 				BCC583CF28A9EC6400BAB4CF /* cloud_animation_1.png in Resources */,
 				2723B5C427F157B100E0B90B /* KSChatListSearchView.xib in Resources */,
@@ -7025,6 +7042,7 @@
 				BC8B641728F3B5B300A08D16 /* KSAwardAlertView.xib in Resources */,
 				BC71D265288804CD0010F14B /* img_55.png in Resources */,
 				BC2C1BAE2CEB505B00EDEB97 /* HomeArrangeNavView.xib in Resources */,
+				BCF748532D15011500CD7EB4 /* HomeworkSubmitAlertView.xib in Resources */,
 				BC89AC1F2AB08FF500B077AF /* TenantMusicCellView.xib in Resources */,
 				BC71D0FA2881A2420010F14B /* UMSocialSDKResources.bundle in Resources */,
 				BC38C4992AFA4B9C00ABFCC2 /* KSProgressLoadingView.xib in Resources */,
@@ -7636,6 +7654,7 @@
 				BC2C1BB12CEB555500EDEB97 /* HomeArrangeVIPCourseView.m in Sources */,
 				BC76630E2827E48800C91A1D /* NotiferMessageModel.m in Sources */,
 				BCFE5406281545C600AD6786 /* HomeAlbumModel.m in Sources */,
+				BCF748512D15010D00CD7EB4 /* HomeworkSubmitAlertView.m in Sources */,
 				BC4AA2E72D13FD6800BD764B /* AccompanyNavView.m in Sources */,
 				BCFA126C2CF425A7005229AC /* StudentCourseGroupDetailModel.m in Sources */,
 				BC106C352A9338A7000759A9 /* TXUISeatMember.m in Sources */,
@@ -7790,6 +7809,7 @@
 				BC60E3D3287D592800B05441 /* KSPublicAlertView.m in Sources */,
 				BC8DA2632CD4C17400D8EA32 /* KSAudioSaveAlert.m in Sources */,
 				2779353527E324A60010E277 /* NSObject+ReadDocument.m in Sources */,
+				BCF748562D15026D00CD7EB4 /* CourseEvaluateAlertView.m in Sources */,
 				BC9AA0DD2ABC434900CD954D /* KSHudLoagingManager.m in Sources */,
 				2723B63427F157D500E0B90B /* GroupApplyMemberCell.m in Sources */,
 				BC106C0F2A933829000759A9 /* TXLiveMessageSeatApply.m in Sources */,

+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Course/homework_upload_bg.imageset/Contents.json

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

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Course/homework_upload_bg.imageset/homework_upload_bg@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Course/homework_upload_bg.imageset/homework_upload_bg@3x.png


+ 80 - 47
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -15,15 +15,15 @@
 #import "AccompanyDetailBottomView.h"
 #import "HomeworkDetailModel.h"
 #import "EvaluateDetailModel.h"
-#import "AccompanyAlertView.h"
+#import "CourseEvaluateAlertView.h"
 #import <WMPlayer.h>
 #import <RecordCheckManager.h>
 #import "KSPremissionAlert.h"
 #import "KSMediaManager.h"
 #import "OnlineClassManager.h"
-#import "HomeworkDetailViewController.h"
 #import "KSChatConversationViewController.h"
 #import "AccompanyNavView.h"
+#import "HomeworkSubmitAlertView.h"
 
 @interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate>
 {
@@ -38,7 +38,7 @@
 
 @property (nonatomic, strong) UITableView *tableView;
 
-@property (nonatomic, strong) AccompanyAlertView *alertView;
+@property (nonatomic, strong) CourseEvaluateAlertView *alertView;
 
 @property (nonatomic, strong) NSMutableArray *fileArray;
 
@@ -58,6 +58,8 @@
 
 @property (nonatomic, assign) BOOL isModify; // 是否修改作业
 
+@property (nonatomic, strong) HomeworkSubmitAlertView *submitAlertView;
+
 @end
 
 @implementation AccompanyDetailViewController
@@ -286,15 +288,13 @@
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"课程结束之后才可以评价哦~"];
         return;
     }
-    self.alertView = [AccompanyAlertView shareInstance];
-    self.alertView.alertTitle.text = @"课程评价";
-    self.alertView.tipsLabel.text = @"请输入您对本次课程的评价~";
-    self.alertView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
-    [self.alertView showInView:[UIApplication sharedApplication].keyWindow showStarView:YES];
+
+    self.alertView = [CourseEvaluateAlertView sharedInstance];
     MJWeakSelf;
-    [self.alertView sureCallback:^(NSString * _Nonnull content, NSInteger starNum) {
-        [weakSelf evaluateAction:content starNum:starNum];
+    [self.alertView courseEvaluateAction:^(NSString * _Nullable evaluateString, NSInteger starNum) {
+        [weakSelf evaluateAction:evaluateString starNum:starNum];
     }];
+    [self.alertView showInView:self.view];
 }
 
 - (void)evaluateAction:(NSString *)content starNum:(NSInteger)starNum {
@@ -329,31 +329,11 @@
             [self deleteVideoIndex:viewIndex];
         }
             break;
-        case HOMEWORKACTION_ADD: // 选择视频作业
-        {
-            // 调用相册
-            self.mediaManager = [[KSMediaManager alloc] init];
-            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
-            self.mediaManager.maxPhotoNumber = 1;
-            self.mediaManager.baseCtrl = self;
-            self.mediaManager.needCropImage = NO;
-            MJWeakSelf;
-            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
-                NSLog(@"%@", videoUrl);
-                // 上传视频
-                [weakSelf uploadVideoWithUrl:videoUrl];
-            }];
-            [self.mediaManager pushImagePickerController];
-        }
         case HOMEWORKACTION_HOMEWOEKPAGE:
         {
-            HomeworkDetailViewController *detalVC = [[HomeworkDetailViewController alloc] init];
-            detalVC.courseId = self.courseId;
-            MJWeakSelf;
-            [detalVC backRefreshAction:^{
-                [weakSelf requestCourseInfoMessage];
-            }];
-            [self.navigationController pushViewController:detalVC animated:YES];
+            
+            [self.submitAlertView configWithFileArray:self.fileArray];
+            [self.submitAlertView showInView:self.view];
         }
         default:
             break;
@@ -381,8 +361,9 @@
         self.isModify = YES;
         // 删除文件
         [self removeVideoWithPath:videoUrl];
-        [self.fileArray addObject:fileUrl];
-        [self.tableView reloadData];
+        // 刷新弹窗
+        [self evaluateSubmitViewWithSource:fileUrl];
+        
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
         [self hudTipWillShow:NO];
         if (![NSString isEmptyString:descMessaeg]) {
@@ -391,6 +372,11 @@
     }];
 }
 
+- (void)evaluateSubmitViewWithSource:(NSString *)fileUrl {
+    [self.submitAlertView.sourceArray addObject:fileUrl];
+    [self.submitAlertView configWithFileArray:self.submitAlertView.sourceArray];
+}
+
 - (void)removeVideoWithPath:(NSString *)videoUrl {
     NSFileManager *fileMamager = [NSFileManager defaultManager];
     if ([fileMamager fileExistsAtPath:videoUrl]) {
@@ -468,18 +454,8 @@
 }
 
 - (void)bottomButtonAction {
-    // 判断
-    if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) { // 判断是否能提交作业
-        if (self.fileArray.count == 0 || self.homeworkModel.reviewHomework == 1 || self.homeworkModel.decorateHomework == 0) {
-            return;
-        }
-        else { // 提交作业
-            [self submitHomeworkAction];
-        }
-    }
-    else {
-        [self tryJoinRoom];
-    }
+    
+    [self tryJoinRoom];
 }
 
 - (void)submitHomeworkAction {
@@ -501,6 +477,7 @@
         [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
+            [self removeSubmitAlert];
             [self requestCourseInfoMessage];
             self.isModify = NO;
         }
@@ -512,6 +489,9 @@
     }];
 }
 
+- (void)removeSubmitAlert {
+    [self.submitAlertView removeView];
+}
 #pragma mark --- lazying
 
 - (OnlineClassManager *)classManager {
@@ -564,6 +544,59 @@
     return _navView;
 }
 
+- (HomeworkSubmitAlertView *)submitAlertView {
+    if (!_submitAlertView) {
+        _submitAlertView = [HomeworkSubmitAlertView sharedInstance];
+        MJWeakSelf;
+        [_submitAlertView alertActionCallback:^(HOMEWORK_TYPE type, NSMutableArray * _Nonnull fileArray, NSInteger videoIndex) {
+            [weakSelf alertAction:type fileArray:fileArray videoIndex:videoIndex];
+        }];
+    }
+    return _submitAlertView;
+}
+
+- (void)alertAction:(HOMEWORK_TYPE)type fileArray:(NSMutableArray *)fileArray videoIndex:(NSInteger)videoIndex {
+    switch (type) {
+        case HOMEWORK_TYPE_ADD:
+        {
+            // 调用相册
+            self.mediaManager = [[KSMediaManager alloc] init];
+            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
+            self.mediaManager.maxPhotoNumber = 1;
+            self.mediaManager.baseCtrl = self;
+            self.mediaManager.needCropImage = NO;
+            MJWeakSelf;
+            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
+                NSLog(@"%@", videoUrl);
+                // 上传视频
+                [weakSelf uploadVideoWithUrl:videoUrl];
+            }];
+            [self.mediaManager pushImagePickerController];
+        }
+            break;
+        case HOMEWORK_TYPE_SUBMIT:
+        {
+            [self submitHomeworkAction];
+        }
+            break;
+        case HOMEWORK_TYPE_PLAY:
+        {
+            if (fileArray.count > videoIndex) {
+                NSString *fileUrl = fileArray[videoIndex];
+                [self playVideoWithUrl:fileUrl];
+            }
+        }
+            break;
+        case HOMEWORK_TYPE_DELETE:
+        {
+            self.isModify = YES;
+        }
+            break;
+        default:
+            break;
+    }
+}
+
 - (void)hudTipWillShow:(BOOL)willShow{
     if (willShow) {
         [self resignFirstResponder];

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyArrangeCell.xib

@@ -12,14 +12,14 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="150" id="KGk-i7-Jjw" customClass="AccompanyArrangeCell">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+            <rect key="frame" x="0.0" y="0.0" width="375" height="152"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+                <rect key="frame" x="0.0" y="0.0" width="375" height="152"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gA1-Yl-rTq">
-                        <rect key="frame" x="14" y="0.0" width="347" height="138"/>
+                        <rect key="frame" x="14" y="0.0" width="347" height="140"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accell_left" translatesAutoresizingMaskIntoConstraints="NO" id="zvH-rj-MgD">
                                 <rect key="frame" x="12" y="14" width="3" height="12"/>
@@ -99,7 +99,7 @@
                         <constraints>
                             <constraint firstAttribute="trailing" secondItem="vf1-Yo-J7O" secondAttribute="trailing" constant="12" id="C9V-eH-geC"/>
                             <constraint firstItem="vf1-Yo-J7O" firstAttribute="leading" secondItem="gA1-Yl-rTq" secondAttribute="leading" constant="12" id="NWC-5K-8kt"/>
-                            <constraint firstAttribute="bottom" secondItem="vf1-Yo-J7O" secondAttribute="bottom" constant="10" id="T6p-ud-tLL"/>
+                            <constraint firstAttribute="bottom" secondItem="vf1-Yo-J7O" secondAttribute="bottom" constant="12" id="T6p-ud-tLL"/>
                             <constraint firstItem="qyk-Yf-gN8" firstAttribute="top" secondItem="gA1-Yl-rTq" secondAttribute="top" constant="10" id="XRB-b8-tfK"/>
                             <constraint firstItem="zvH-rj-MgD" firstAttribute="leading" secondItem="gA1-Yl-rTq" secondAttribute="leading" constant="12" id="ad3-xv-Xlz"/>
                             <constraint firstItem="qyk-Yf-gN8" firstAttribute="centerY" secondItem="zvH-rj-MgD" secondAttribute="centerY" id="dYy-51-vic"/>

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyEvaluateCell.xib

@@ -12,14 +12,14 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="150" id="KGk-i7-Jjw" customClass="AccompanyEvaluateCell">
-            <rect key="frame" x="0.0" y="0.0" width="354" height="150"/>
+            <rect key="frame" x="0.0" y="0.0" width="354" height="152"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="354" height="150"/>
+                <rect key="frame" x="0.0" y="0.0" width="354" height="152"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3vN-Vj-itp">
-                        <rect key="frame" x="14" y="0.0" width="326" height="138"/>
+                        <rect key="frame" x="14" y="0.0" width="326" height="140"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accell_left" translatesAutoresizingMaskIntoConstraints="NO" id="lLF-ft-OTS">
                                 <rect key="frame" x="11" y="14" width="3" height="12"/>
@@ -100,7 +100,7 @@
                             <constraint firstItem="ksa-Jo-b55" firstAttribute="centerY" secondItem="lLF-ft-OTS" secondAttribute="centerY" id="4cQ-qj-M1R"/>
                             <constraint firstItem="UuA-Bs-h8B" firstAttribute="leading" secondItem="3vN-Vj-itp" secondAttribute="leading" constant="11" id="4kZ-bC-zD8"/>
                             <constraint firstItem="lLF-ft-OTS" firstAttribute="leading" secondItem="3vN-Vj-itp" secondAttribute="leading" constant="11" id="B3T-Uw-Liq"/>
-                            <constraint firstAttribute="bottom" secondItem="UuA-Bs-h8B" secondAttribute="bottom" constant="10" id="PEn-6P-tRY"/>
+                            <constraint firstAttribute="bottom" secondItem="UuA-Bs-h8B" secondAttribute="bottom" constant="12" id="PEn-6P-tRY"/>
                             <constraint firstItem="UuA-Bs-h8B" firstAttribute="top" secondItem="ksa-Jo-b55" secondAttribute="bottom" constant="10" id="dfO-BO-Wpw"/>
                             <constraint firstAttribute="trailing" secondItem="UuA-Bs-h8B" secondAttribute="trailing" constant="9" id="jWf-Oo-FS8"/>
                             <constraint firstItem="ksa-Jo-b55" firstAttribute="leading" secondItem="lLF-ft-OTS" secondAttribute="trailing" constant="5" id="lg5-g7-Y09"/>

+ 13 - 7
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyHomeworkCell.m

@@ -9,6 +9,7 @@
 #import "HomeworkAddView.h"
 
 @interface AccompanyHomeworkCell ()
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *containerHeight;
 
 @property (weak, nonatomic) IBOutlet UIView *emptyView;
 @property (weak, nonatomic) IBOutlet UILabel *emptyDescLabel;
@@ -42,6 +43,7 @@
             self.submitView.hidden = NO;
             if (fileArray.count == 0) {
                 self.emptyView.hidden = NO;
+                self.containerHeight.constant = 88.0f;
                 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
                 [paragraphStyle setLineSpacing:4];//调整行间距
                 NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:@"您暂未上传作业视频" attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x999999)}];
@@ -49,16 +51,19 @@
             }
             else {
                 self.emptyView.hidden = YES;
+                self.containerHeight.constant = 76.0f;
             }
         }
         else {
             self.emptyView.hidden = YES;
             self.submitView.hidden = YES;
+            self.containerHeight.constant = 76.0f;
         }
     }
     else { // 未布置 或已过期
         self.submitView.hidden = YES;
         self.emptyView.hidden = NO;
+        self.containerHeight.constant = 88.0f;
         NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
         [paragraphStyle setLineSpacing:4];//调整行间距
         NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] init];
@@ -74,18 +79,19 @@
 }
 
 - (void)configVideoViewWithSource:(NSMutableArray *)fileArray {
-    CGFloat maxWidth = kScreenWidth - 24 - 24;
-    CGFloat space = 0;
-    CGFloat width = (maxWidth - space * 2) / 3.0f;
-    CGFloat height = 92.0f;
+    CGFloat maxWidth = KPortraitWidth - 14 * 2 - 12 * 2;
+    CGFloat leftSpace = 0.0f;
+    CGFloat space = 10;
+    CGFloat width = (maxWidth - space * 2 - leftSpace * 2) / 3.0f;
+    CGFloat height = 72.0f;
     for (NSInteger i = 0; i < fileArray.count; i++) {
         if (i > 2) {
             return;
         }
-        CGFloat positionX = i * (width + space);
+        CGFloat positionX = leftSpace + i * (width + space);
         NSString *videoUrl = fileArray[i];
         HomeworkVideoView *videoView = [HomeworkVideoView shareInstance];
-        videoView.frame = CGRectMake(positionX, 0, width, height);
+        videoView.frame = CGRectMake(positionX, 2, width, height);
         if (self.canSubmit == NO) {
             videoView.hideDeleteButton = YES;
         }
@@ -104,7 +110,7 @@
     }
     if (fileArray.count < 3 && self.canSubmit) { // 添加上传按钮
         CGFloat positionX = fileArray.count * (width + space);
-        HomeworkAddView *addView = [[HomeworkAddView alloc] initWithFrame:CGRectMake(positionX, 0, width, height)];
+        HomeworkAddView *addView = [[HomeworkAddView alloc] initWithFrame:CGRectMake(positionX, 2, width, height)];
         [self.videoContainer addSubview:addView];
         MJWeakSelf;
         [addView chooseCallback:^{

+ 6 - 5
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyHomeworkCell.xib

@@ -12,14 +12,14 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="150" id="KGk-i7-Jjw" customClass="AccompanyHomeworkCell">
-            <rect key="frame" x="0.0" y="0.0" width="364" height="150"/>
+            <rect key="frame" x="0.0" y="0.0" width="364" height="152"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="364" height="150"/>
+                <rect key="frame" x="0.0" y="0.0" width="364" height="152"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dtq-Yd-b5t">
-                        <rect key="frame" x="14" y="0.0" width="336" height="138"/>
+                        <rect key="frame" x="14" y="0.0" width="336" height="140"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accell_left" translatesAutoresizingMaskIntoConstraints="NO" id="1fO-1K-g2U">
                                 <rect key="frame" x="12" y="14" width="3" height="12"/>
@@ -78,7 +78,7 @@
                                 <constraints>
                                     <constraint firstAttribute="trailing" secondItem="O89-iL-xU2" secondAttribute="trailing" id="HQp-bb-AtX"/>
                                     <constraint firstItem="O89-iL-xU2" firstAttribute="leading" secondItem="0zy-PX-mCI" secondAttribute="leading" id="S2b-yI-RdW"/>
-                                    <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="88" id="ZyR-89-1K1"/>
+                                    <constraint firstAttribute="height" constant="88" id="ZyR-89-1K1"/>
                                     <constraint firstItem="O89-iL-xU2" firstAttribute="top" secondItem="0zy-PX-mCI" secondAttribute="top" id="bRR-gO-HrZ"/>
                                     <constraint firstAttribute="bottom" secondItem="O89-iL-xU2" secondAttribute="bottom" id="lUa-1z-WaZ"/>
                                 </constraints>
@@ -132,7 +132,7 @@
                             <constraint firstItem="nhC-wd-ZZb" firstAttribute="centerY" secondItem="sJu-iK-25U" secondAttribute="centerY" id="1mm-5t-S0T"/>
                             <constraint firstItem="0zy-PX-mCI" firstAttribute="trailing" secondItem="EwC-zg-aiZ" secondAttribute="trailing" id="70p-E3-NeF"/>
                             <constraint firstItem="sJu-iK-25U" firstAttribute="top" secondItem="dtq-Yd-b5t" secondAttribute="top" constant="10" id="8xF-zd-teD"/>
-                            <constraint firstAttribute="bottom" secondItem="0zy-PX-mCI" secondAttribute="bottom" constant="10" id="F6N-7x-aaL"/>
+                            <constraint firstAttribute="bottom" secondItem="0zy-PX-mCI" secondAttribute="bottom" constant="12" id="F6N-7x-aaL"/>
                             <constraint firstItem="sJu-iK-25U" firstAttribute="leading" secondItem="1fO-1K-g2U" secondAttribute="trailing" constant="5" id="eUo-qr-eCq"/>
                             <constraint firstItem="0zy-PX-mCI" firstAttribute="leading" secondItem="dtq-Yd-b5t" secondAttribute="leading" constant="12" id="hOV-oC-FPR"/>
                             <constraint firstItem="1fO-1K-g2U" firstAttribute="leading" secondItem="dtq-Yd-b5t" secondAttribute="leading" constant="12" id="hrI-hU-381"/>
@@ -160,6 +160,7 @@
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <connections>
+                <outlet property="containerHeight" destination="ZyR-89-1K1" id="gq8-QO-pIk"/>
                 <outlet property="emptyDescLabel" destination="xV1-w2-nqO" id="ZNY-JG-qzw"/>
                 <outlet property="emptyView" destination="0zy-PX-mCI" id="3KA-n7-M42"/>
                 <outlet property="submitView" destination="nhC-wd-ZZb" id="QhF-aF-m6m"/>

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyRemarkCell.xib

@@ -12,14 +12,14 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="221" id="KGk-i7-Jjw" customClass="AccompanyRemarkCell">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+            <rect key="frame" x="0.0" y="0.0" width="375" height="152"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+                <rect key="frame" x="0.0" y="0.0" width="375" height="152"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qyw-41-OgZ">
-                        <rect key="frame" x="14" y="0.0" width="347" height="138"/>
+                        <rect key="frame" x="14" y="0.0" width="347" height="140"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accell_left" translatesAutoresizingMaskIntoConstraints="NO" id="Nmt-3B-GQh">
                                 <rect key="frame" x="12" y="14" width="3" height="12"/>
@@ -103,7 +103,7 @@
                             <constraint firstAttribute="trailing" secondItem="ehC-4r-0Vt" secondAttribute="trailing" constant="12" id="UGg-Vv-yct"/>
                             <constraint firstItem="Lof-Tc-krl" firstAttribute="top" secondItem="qyw-41-OgZ" secondAttribute="top" constant="10" id="Vke-kL-doW"/>
                             <constraint firstItem="ehC-4r-0Vt" firstAttribute="top" secondItem="Lof-Tc-krl" secondAttribute="bottom" constant="10" id="c4A-7V-3jf"/>
-                            <constraint firstAttribute="bottom" secondItem="ehC-4r-0Vt" secondAttribute="bottom" constant="10" id="ghc-VL-2mE"/>
+                            <constraint firstAttribute="bottom" secondItem="ehC-4r-0Vt" secondAttribute="bottom" constant="12" id="ghc-VL-2mE"/>
                             <constraint firstItem="ehC-4r-0Vt" firstAttribute="leading" secondItem="qyw-41-OgZ" secondAttribute="leading" constant="12" id="lg4-q3-Py7"/>
                         </constraints>
                         <userDefinedRuntimeAttributes>

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/View/AccompanyStudentEvaCell.xib

@@ -12,14 +12,14 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="150" id="KGk-i7-Jjw" customClass="AccompanyStudentEvaCell">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+            <rect key="frame" x="0.0" y="0.0" width="375" height="152"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+                <rect key="frame" x="0.0" y="0.0" width="375" height="152"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yyc-jU-e8w">
-                        <rect key="frame" x="14" y="0.0" width="347" height="138"/>
+                        <rect key="frame" x="14" y="0.0" width="347" height="140"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accell_left" translatesAutoresizingMaskIntoConstraints="NO" id="ltT-kf-P7C">
                                 <rect key="frame" x="12" y="14" width="3" height="12"/>
@@ -150,7 +150,7 @@
                             <constraint firstItem="9CO-NU-fBc" firstAttribute="centerY" secondItem="dMT-VK-l9k" secondAttribute="centerY" id="MIb-jS-DNJ"/>
                             <constraint firstAttribute="trailing" secondItem="CS9-1I-B48" secondAttribute="trailing" constant="12" id="Nlt-hE-n6i"/>
                             <constraint firstItem="jcn-OZ-9Lu" firstAttribute="centerY" secondItem="dMT-VK-l9k" secondAttribute="centerY" id="Q9l-tH-UOk"/>
-                            <constraint firstAttribute="bottom" secondItem="CS9-1I-B48" secondAttribute="bottom" constant="10" id="Qcs-io-hc9"/>
+                            <constraint firstAttribute="bottom" secondItem="CS9-1I-B48" secondAttribute="bottom" constant="12" id="Qcs-io-hc9"/>
                             <constraint firstItem="CS9-1I-B48" firstAttribute="top" secondItem="9CO-NU-fBc" secondAttribute="bottom" id="Yue-o1-bKx"/>
                             <constraint firstItem="ltT-kf-P7C" firstAttribute="leading" secondItem="Yyc-jU-e8w" secondAttribute="leading" constant="12" id="gf9-Gz-x7R"/>
                             <constraint firstItem="dMT-VK-l9k" firstAttribute="leading" secondItem="ltT-kf-P7C" secondAttribute="trailing" constant="6" id="nVb-RO-bhR"/>

+ 73 - 39
KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/Controller/MusicRoomDetailViewController.m

@@ -20,9 +20,8 @@
 #import "KSMediaManager.h"
 #import "OnlineClassManager.h"
 #import "MusicRoomCourseInfoCell.h"
-#import "HomeworkDetailViewController.h"
 #import "CourseGroupNavView.h"
-
+#import "HomeworkSubmitAlertView.h"
 
 @interface MusicRoomDetailViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate>
 {
@@ -52,6 +51,9 @@
 @property (nonatomic, assign) BOOL canModify;
 
 @property (nonatomic, assign) BOOL isModify; // 是否修改作业
+
+@property (nonatomic, strong) HomeworkSubmitAlertView *submitAlertView;
+
 @end
 
 @implementation MusicRoomDetailViewController
@@ -244,31 +246,10 @@
             [self deleteVideoIndex:viewIndex];
         }
             break;
-        case HOMEWORKACTION_ADD: // 选择视频作业
-        {
-            // 调用相册
-            self.mediaManager = [[KSMediaManager alloc] init];
-            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
-            self.mediaManager.maxPhotoNumber = 1;
-            self.mediaManager.baseCtrl = self;
-            self.mediaManager.needCropImage = NO;
-            MJWeakSelf;
-            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
-                NSLog(@"%@", videoUrl);
-                // 上传视频
-                [weakSelf uploadVideoWithUrl:videoUrl];
-            }];
-            [self.mediaManager pushImagePickerController];
-        }
         case HOMEWORKACTION_HOMEWOEKPAGE:
         {
-            HomeworkDetailViewController *detalVC = [[HomeworkDetailViewController alloc] init];
-            detalVC.courseId = self.courseId;
-            MJWeakSelf;
-            [detalVC backRefreshAction:^{
-                [weakSelf requestCourseInfoMessage];
-            }];
-            [self.navigationController pushViewController:detalVC animated:YES];
+            [self.submitAlertView configWithFileArray:self.fileArray];
+            [self.submitAlertView showInView:self.view];
         }
         default:
             break;
@@ -296,8 +277,8 @@
         self.isModify = YES;
         // 删除文件
         [self removeVideoWithPath:videoUrl];
-        [self.fileArray addObject:fileUrl];
-        [self.tableView reloadData];
+        // 刷新弹窗
+        [self evaluateSubmitViewWithSource:fileUrl];
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
         [self hudTipWillShow:NO];
         if (![NSString isEmptyString:descMessaeg]) {
@@ -306,6 +287,11 @@
     }];
 }
 
+- (void)evaluateSubmitViewWithSource:(NSString *)fileUrl {
+    [self.submitAlertView.sourceArray addObject:fileUrl];
+    [self.submitAlertView configWithFileArray:self.submitAlertView.sourceArray];
+}
+
 - (void)removeVideoWithPath:(NSString *)videoUrl {
     NSFileManager *fileMamager = [NSFileManager defaultManager];
     if ([fileMamager fileExistsAtPath:videoUrl]) {
@@ -383,18 +369,8 @@
 }
 
 - (void)bottomButtonAction {
-    // 判断
-    if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) { // 判断是否能提交作业
-        if (self.fileArray.count == 0 || self.homeworkModel.reviewHomework == 1 || self.homeworkModel.decorateHomework == 0) {
-            return;
-        }
-        else { // 提交作业
-            [self submitHomeworkAction];
-        }
-    }
-    else {
-        [self tryJoinRoom];
-    }
+    
+    [self tryJoinRoom];
 }
 
 - (void)submitHomeworkAction {
@@ -412,6 +388,7 @@
         [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
+            [self removeSubmitAlert];
             [self requestCourseInfoMessage];
             self.isModify = NO;
         }
@@ -423,6 +400,10 @@
     }];
 }
 
+- (void)removeSubmitAlert {
+    [self.submitAlertView removeView];
+}
+
 #pragma mark --- lazying
 
 - (OnlineClassManager *)classManager {
@@ -573,6 +554,59 @@
     }
     return _navView;
 }
+
+- (HomeworkSubmitAlertView *)submitAlertView {
+    if (!_submitAlertView) {
+        _submitAlertView = [HomeworkSubmitAlertView sharedInstance];
+        MJWeakSelf;
+        [_submitAlertView alertActionCallback:^(HOMEWORK_TYPE type, NSMutableArray * _Nonnull fileArray, NSInteger videoIndex) {
+            [weakSelf alertAction:type fileArray:fileArray videoIndex:videoIndex];
+        }];
+    }
+    return _submitAlertView;
+}
+
+- (void)alertAction:(HOMEWORK_TYPE)type fileArray:(NSMutableArray *)fileArray videoIndex:(NSInteger)videoIndex {
+    switch (type) {
+        case HOMEWORK_TYPE_ADD:
+        {
+            // 调用相册
+            self.mediaManager = [[KSMediaManager alloc] init];
+            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
+            self.mediaManager.maxPhotoNumber = 1;
+            self.mediaManager.baseCtrl = self;
+            self.mediaManager.needCropImage = NO;
+            MJWeakSelf;
+            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
+                NSLog(@"%@", videoUrl);
+                // 上传视频
+                [weakSelf uploadVideoWithUrl:videoUrl];
+            }];
+            [self.mediaManager pushImagePickerController];
+        }
+            break;
+        case HOMEWORK_TYPE_SUBMIT:
+        {
+            [self submitHomeworkAction];
+        }
+            break;
+        case HOMEWORK_TYPE_PLAY:
+        {
+            if (fileArray.count > videoIndex) {
+                NSString *fileUrl = fileArray[videoIndex];
+                [self playVideoWithUrl:fileUrl];
+            }
+        }
+            break;
+        case HOMEWORK_TYPE_DELETE:
+        {
+            self.isModify = YES;
+        }
+            break;
+        default:
+            break;
+    }
+}
 /*
 #pragma mark - Navigation
 

+ 4 - 0
KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/View/MusicRoomCourseInfoCell.xib

@@ -155,10 +155,14 @@
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <connections>
+                <outlet property="attendenceImgLeft" destination="7og-r8-Be3" id="Iad-Tg-YaG"/>
+                <outlet property="attendenceImgWidth" destination="0ly-ym-r0i" id="9dB-Gr-Fjw"/>
+                <outlet property="attendentStatusImage" destination="cPi-Jc-34J" id="eBk-ji-6Ar"/>
                 <outlet property="courseName" destination="09N-Zc-juN" id="X1d-qP-Lz2"/>
                 <outlet property="courseSubject" destination="kbx-pS-TGd" id="bmc-zg-wR2"/>
                 <outlet property="courseTime" destination="DZc-wF-kiD" id="T4x-I1-8LT"/>
                 <outlet property="statusLabel" destination="5TG-5t-3Vw" id="kIA-0J-Nom"/>
+                <outlet property="studentName" destination="l3e-3i-FN2" id="Gob-lv-f9C"/>
                 <outlet property="subjectView" destination="oPF-d8-FLk" id="Zz3-Ne-2ix"/>
             </connections>
             <point key="canvasLocation" x="131.8840579710145" y="117.85714285714285"/>

+ 81 - 48
KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/Controller/VipCouseDetailViewController.m

@@ -14,17 +14,17 @@
 #import "AccompanyStudentEvaCell.h"
 #import "HomeworkDetailModel.h"
 #import "EvaluateDetailModel.h"
-#import "AccompanyAlertView.h"
+#import "CourseEvaluateAlertView.h"
 #import <WMPlayer.h>
 #import <RecordCheckManager.h>
 #import "KSPremissionAlert.h"
 #import "KSMediaManager.h"
 #import "OnlineClassManager.h"
-#import "HomeworkDetailViewController.h"
 #import "KSChatConversationViewController.h"
 #import "OnlineClassManager.h"
 #import "AccompanyDetailBottomView.h"
 #import "AccompanyNavView.h"
+#import "HomeworkSubmitAlertView.h"
 
 
 @interface VipCouseDetailViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate>
@@ -40,7 +40,7 @@
 
 @property (nonatomic, strong) UITableView *tableView;
 
-@property (nonatomic, strong) AccompanyAlertView *alertView;
+@property (nonatomic, strong) CourseEvaluateAlertView *alertView;
 
 @property (nonatomic, strong) NSMutableArray *fileArray;
 
@@ -60,6 +60,10 @@
 
 @property (nonatomic, assign) BOOL isModify; // 是否修改作业
 
+@property (nonatomic, strong) HomeworkSubmitAlertView *submitAlertView;
+
+@property (nonatomic, strong) NSMutableArray *tempFileArray;
+
 @end
 
 @implementation VipCouseDetailViewController
@@ -286,20 +290,16 @@
 
 // 课程评价
 - (void)evaluateCourse {
-    
     if (![self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"课程结束之后才可以评价哦~"];
         return;
     }
-    self.alertView = [AccompanyAlertView shareInstance];
-    self.alertView.alertTitle.text = @"课程评价";
-    self.alertView.tipsLabel.text = @"请输入您对本次课程的评价~";
-    self.alertView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
-    [self.alertView showInView:[UIApplication sharedApplication].keyWindow showStarView:YES];
+    self.alertView = [CourseEvaluateAlertView sharedInstance];
     MJWeakSelf;
-    [self.alertView sureCallback:^(NSString * _Nonnull content, NSInteger starNum) {
-        [weakSelf evaluateAction:content starNum:starNum];
+    [self.alertView courseEvaluateAction:^(NSString * _Nullable evaluateString, NSInteger starNum) {
+        [weakSelf evaluateAction:evaluateString starNum:starNum];
     }];
+    [self.alertView showInView:self.view];
 }
 
 - (void)evaluateAction:(NSString *)content starNum:(NSInteger)starNum {
@@ -334,32 +334,12 @@
             [self deleteVideoIndex:viewIndex];
         }
             break;
-        case HOMEWORKACTION_ADD: // 选择视频作业
-        {
-            // 调用相册
-            self.mediaManager = [[KSMediaManager alloc] init];
-            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
-            self.mediaManager.maxPhotoNumber = 1;
-            self.mediaManager.baseCtrl = self;
-            self.mediaManager.needCropImage = NO;
-            MJWeakSelf;
-            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
-                NSLog(@"%@", videoUrl);
-                // 上传视频
-                [weakSelf uploadVideoWithUrl:videoUrl];
-            }];
-            [self.mediaManager pushImagePickerController];
-        }
         case HOMEWORKACTION_HOMEWOEKPAGE:
         {
-            HomeworkDetailViewController *detalVC = [[HomeworkDetailViewController alloc] init];
-            detalVC.courseId = self.courseId;
-            MJWeakSelf;
-            [detalVC backRefreshAction:^{
-                [weakSelf requestCourseInfoMessage];
-            }];
-            [self.navigationController pushViewController:detalVC animated:YES];
+            [self.submitAlertView configWithFileArray:self.fileArray];
+            [self.submitAlertView showInView:self.view];
         }
+            break;
         default:
             break;
     }
@@ -386,8 +366,9 @@
         self.isModify = YES;
         // 删除文件
         [self removeVideoWithPath:videoUrl];
-        [self.fileArray addObject:fileUrl];
-        [self.tableView reloadData];
+        // 刷新弹窗
+        [self evaluateSubmitViewWithSource:fileUrl];
+        
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
         [self hudTipWillShow:NO];
         if (![NSString isEmptyString:descMessaeg]) {
@@ -396,6 +377,11 @@
     }];
 }
 
+- (void)evaluateSubmitViewWithSource:(NSString *)fileUrl {
+    [self.submitAlertView.sourceArray addObject:fileUrl];
+    [self.submitAlertView configWithFileArray:self.submitAlertView.sourceArray];
+}
+
 - (void)removeVideoWithPath:(NSString *)videoUrl {
     NSFileManager *fileMamager = [NSFileManager defaultManager];
     if ([fileMamager fileExistsAtPath:videoUrl]) {
@@ -473,18 +459,7 @@
 }
 
 - (void)bottomButtonAction {
-    // 判断
-    if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) { // 判断是否能提交作业
-        if (self.fileArray.count == 0 || self.homeworkModel.reviewHomework == 1 || self.homeworkModel.decorateHomework == 0) {
-            return;
-        }
-        else { // 提交作业
-            [self submitHomeworkAction];
-        }
-    }
-    else {
-        [self tryJoinRoom];
-    }
+    [self tryJoinRoom];
 }
 
 - (void)submitHomeworkAction {
@@ -506,6 +481,7 @@
         [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
+            [self removeSubmitAlert];
             [self requestCourseInfoMessage];
             self.isModify = NO;
         }
@@ -517,6 +493,10 @@
     }];
 }
 
+- (void)removeSubmitAlert {
+    [self.submitAlertView removeView];
+}
+
 #pragma mark --- lazying
 
 - (OnlineClassManager *)classManager {
@@ -570,6 +550,59 @@
     return _navView;
 }
 
+- (HomeworkSubmitAlertView *)submitAlertView {
+    if (!_submitAlertView) {
+        _submitAlertView = [HomeworkSubmitAlertView sharedInstance];
+        MJWeakSelf;
+        [_submitAlertView alertActionCallback:^(HOMEWORK_TYPE type, NSMutableArray * _Nonnull fileArray, NSInteger videoIndex) {
+            [weakSelf alertAction:type fileArray:fileArray videoIndex:videoIndex];
+        }];
+    }
+    return _submitAlertView;
+}
+
+- (void)alertAction:(HOMEWORK_TYPE)type fileArray:(NSMutableArray *)fileArray videoIndex:(NSInteger)videoIndex {
+    self.fileArray = [NSMutableArray arrayWithArray:fileArray];
+    switch (type) {
+        case HOMEWORK_TYPE_ADD:
+        {
+            // 调用相册
+            self.mediaManager = [[KSMediaManager alloc] init];
+            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
+            self.mediaManager.maxPhotoNumber = 1;
+            self.mediaManager.baseCtrl = self;
+            self.mediaManager.needCropImage = NO;
+            MJWeakSelf;
+            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
+                NSLog(@"%@", videoUrl);
+                // 上传视频
+                [weakSelf uploadVideoWithUrl:videoUrl];
+            }];
+            [self.mediaManager pushImagePickerController];
+        }
+            break;
+        case HOMEWORK_TYPE_SUBMIT:
+        {
+            [self submitHomeworkAction];
+        }
+            break;
+        case HOMEWORK_TYPE_PLAY:
+        {
+            if (fileArray.count > videoIndex) {
+                NSString *fileUrl = fileArray[videoIndex];
+                [self playVideoWithUrl:fileUrl];
+            }
+        }
+            break;
+        case HOMEWORK_TYPE_DELETE:
+        {
+            self.isModify = YES;
+        }
+            break;
+        default:
+            break;
+    }
+}
 - (void)hudTipWillShow:(BOOL)willShow{
     if (willShow) {
         [self resignFirstResponder];

+ 71 - 20
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/Controller/HomeworkDetailViewController.m

@@ -16,6 +16,7 @@
 #import "HomeworkBottomView.h"
 #import "KSChatConversationViewController.h"
 #import "HomeworkDetailNavView.h"
+#import "HomeworkSubmitAlertView.h"
 
 @interface HomeworkDetailViewController ()<UITableViewDelegate, UITableViewDataSource,WMPlayerDelegate>
 {
@@ -47,6 +48,8 @@
 
 @property (nonatomic, copy) BackRefreshBlock callback;
 
+@property (nonatomic, strong) HomeworkSubmitAlertView *alertView;
+
 @end
 
 @implementation HomeworkDetailViewController
@@ -97,9 +100,7 @@
 }
 
 - (void)requestCourseMessage {
-    [LOADING_MANAGER showHUD];
     [KSNetworkingManager homeworkDetailRequest:KS_GET courseId:self.courseId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             self.detailModel = [[HomeworkDetailModel alloc] initWithDictionary:[dic ks_dictionaryValueForKey:@"data"]];
             [self evaluateViewDisplay];
@@ -108,7 +109,6 @@
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeHUD];
     }];
 }
 
@@ -166,8 +166,8 @@
         BOOL isExpired = self.detailModel.homeworkExpire == 1 ? YES : NO;
         
         AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
-        cell.canSubmit = self.canModify;
-        
+        cell.canSubmit = NO;
+        cell.showSubmitButton = self.canModify;
         MJWeakSelf;
         [cell configWithAttachmentArray:self.fileArray canDisplaySubmitView:hasArrangeHomework isExpired:isExpired callback:^(HOMEWORKACTION action, NSInteger viewIndex) {
             [weakSelf operationActionWithType:action index:viewIndex];
@@ -204,22 +204,12 @@
             [self deleteVideoIndex:viewIndex];
         }
             break;
-        case HOMEWORKACTION_ADD: // 选择视频作业
+        case HOMEWORKACTION_HOMEWOEKPAGE:
         {
-            // 调用相册
-            self.mediaManager = [[KSMediaManager alloc] init];
-            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
-            self.mediaManager.maxPhotoNumber = 1;
-            self.mediaManager.baseCtrl = self;
-            self.mediaManager.needCropImage = NO;
-            MJWeakSelf;
-            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
-                NSLog(@"%@", videoUrl);
-                // 上传视频
-                [weakSelf uploadVideoWithUrl:videoUrl];
-            }];
-            [self.mediaManager pushImagePickerController];
+            [self.alertView configWithFileArray:self.fileArray];
+            [self.alertView showInView:self.view];
         }
+            break;
         default:
             break;
     }
@@ -246,7 +236,7 @@
         // 删除文件
         [self removeVideoWithPath:videoUrl];
         [self.fileArray addObject:fileUrl];
-        [self.tableView reloadData];
+        [self.alertView configWithFileArray:self.fileArray];
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
         [self hudTipWillShow:NO];
         if (![NSString isEmptyString:descMessaeg]) {
@@ -331,6 +321,10 @@
     }
 }
 
+- (void)removeSubmitAlert {
+    [self.alertView removeView];
+}
+
 - (void)submitHomeworkAction {
     if (self.isModify == NO) {
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请先选择视频文件"];
@@ -346,6 +340,7 @@
         [LOADING_MANAGER removeHUD];
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:@"作业提交成功"];
+            [self removeSubmitAlert];
             [self requestCourseMessage];
             self.isModify = NO;
         }
@@ -384,6 +379,62 @@
     return _tableView;
 }
 
+- (HomeworkSubmitAlertView *)alertView {
+    if (!_alertView) {
+        _alertView = [HomeworkSubmitAlertView sharedInstance];
+        MJWeakSelf;
+        [_alertView alertActionCallback:^(HOMEWORK_TYPE type, NSMutableArray * _Nonnull fileArray, NSInteger videoIndex) {
+            [weakSelf alertAction:type fileArray:fileArray videoIndex:videoIndex];
+        }];
+    }
+    return _alertView;
+}
+
+- (void)alertAction:(HOMEWORK_TYPE)type fileArray:(NSMutableArray *)fileArray videoIndex:(NSInteger)videoIndex {
+    self.fileArray = [NSMutableArray arrayWithArray:fileArray];
+    switch (type) {
+        case HOMEWORK_TYPE_ADD:
+        {
+            // 调用相册
+            self.mediaManager = [[KSMediaManager alloc] init];
+            self.mediaManager.mediaType = MEDIATYPE_VIDEO;
+            self.mediaManager.maxPhotoNumber = 1;
+            self.mediaManager.baseCtrl = self;
+            self.mediaManager.needCropImage = NO;
+            MJWeakSelf;
+            [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
+                NSLog(@"%@", videoUrl);
+                // 上传视频
+                [weakSelf uploadVideoWithUrl:videoUrl];
+            }];
+            [self.mediaManager pushImagePickerController];
+        }
+            break;
+        case HOMEWORK_TYPE_SUBMIT:
+        {
+            [self submitHomeworkAction];
+        }
+            break;
+        case HOMEWORK_TYPE_PLAY:
+        {
+            if (fileArray.count > videoIndex) {
+                NSString *fileUrl = fileArray[videoIndex];
+                [self playVideoWithUrl:fileUrl];
+            }
+        }
+            break;
+        case HOMEWORK_TYPE_DELETE:
+        {
+            self.isModify = YES;
+        }
+            break;
+        default:
+            break;
+    }
+}
+
+
+
 - (void)hudTipWillShow:(BOOL)willShow{
     if (willShow) {
         [self resignFirstResponder];

+ 1 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/AccompanyAlertView.m

@@ -39,6 +39,7 @@
 - (void)configDefaltStar {
     self.starView.rate = 5;
 }
+
 - (void)showInView:(UIView *)displayView showStarView:(BOOL)showStarView {
     if (showStarView) {
         [self configDefaltStar];

+ 24 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/CourseEvaluateAlertView.h

@@ -0,0 +1,24 @@
+//
+//  CourseEvaluateAlertView.h
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/12/20.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef void(^CourseEvaluateAlertCallback)(NSString * _Nullable evaluateString, NSInteger starNum);
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CourseEvaluateAlertView : UIView
+
++ (instancetype)sharedInstance;
+
+- (void)courseEvaluateAction:(CourseEvaluateAlertCallback)callback;
+
+- (void)showInView:(UIView *)displayView;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 201 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/CourseEvaluateAlertView.m

@@ -0,0 +1,201 @@
+//
+//  CourseEvaluateAlertView.m
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/12/20.
+//
+
+#import "CourseEvaluateAlertView.h"
+#import "KSStarView.h"
+
+@interface CourseEvaluateAlertView ()<UITextViewDelegate,UIGestureRecognizerDelegate>
+
+@property (weak, nonatomic) IBOutlet UIView *bgView;
+
+@property (weak, nonatomic) IBOutlet KSStarView *starView;
+
+@property (weak, nonatomic) IBOutlet UITextView *textView;
+
+@property (weak, nonatomic) IBOutlet UILabel *tipsLabel;
+
+@property (weak, nonatomic) IBOutlet UILabel *countLabel;
+
+@property (nonatomic, assign) NSInteger maxInputCount;
+
+@property (nonatomic, copy) CourseEvaluateAlertCallback callback;
+
+@property (nonatomic, assign) NSInteger starNum;
+
+@end
+
+@implementation CourseEvaluateAlertView
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    self.textView.delegate = self;
+    self.textView.textContainer.lineFragmentPadding = 0;
+    self.textView.textContainerInset = UIEdgeInsetsZero;
+    self.bgView.layer.cornerRadius = 12.0f;
+    self.bgView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
+    [self addTagGreture];
+    [self configDefault];
+    self.starView.allowMark = YES;
+    [self configDefaltStar];
+}
+- (void)configDefaltStar {
+    self.starView.rate = 5;
+}
+- (void)configDefault {
+    self.maxInputCount = 200;
+}
+
+- (void)addTagGreture {
+    UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
+    gesture.delegate = self;
+    [self addGestureRecognizer:gesture];
+    
+}
+
+- (NSDictionary *)getTypeAttributes {
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
+    paragraphStyle.lineSpacing = 4.0f;
+    UIFont *font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
+    
+    NSDictionary *attributes = @{NSFontAttributeName:font,NSParagraphStyleAttributeName:paragraphStyle,NSForegroundColorAttributeName:HexRGBAlpha(0x000000, 0.9)};
+    return attributes;
+}
+
+
+- (void)tapAction {
+    [self endEditing:YES];
+    [self removeFromSuperview];
+}
+
+
++ (instancetype)sharedInstance {
+    CourseEvaluateAlertView *view = [[[NSBundle mainBundle] loadNibNamed:@"CourseEvaluateAlertView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)courseEvaluateAction:(CourseEvaluateAlertCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (void)showInView:(UIView *)displayView {
+    if (!displayView) {
+        displayView = [NSObject getKeyWindow];
+    }
+    if (![displayView.subviews containsObject:self]) {
+        [displayView addSubview:self];
+        [self mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.top.bottom.mas_equalTo(displayView);
+        }];
+    }
+}
+
+- (IBAction)cancelAction:(id)sender {
+    [self endEditing:YES];
+    [self removeFromSuperview];
+}
+
+- (IBAction)sureAction:(id)sender {
+    [self endEditing:YES];
+    [self removeFromSuperview];
+    self.starNum = self.starView.rate * 5;
+    if (self.callback) {
+        self.callback(self.textView.text, self.starNum);
+    }
+}
+
+#pragma mark   ---- delegate
+
+- (void)textViewDidBeginEditing:(UITextView *)textView {
+    self.tipsLabel.hidden = YES;
+}
+
+
+- (void)textViewDidEndEditing:(UITextView *)textView {
+    if ([NSString isEmptyString:textView.text]) {
+        self.tipsLabel.hidden = NO;
+    }
+}
+
+- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
+    UITextRange *markedTextRange = textView.markedTextRange;
+    if (markedTextRange) {
+        // 当前处于拼音输入状态,暂不更新 attributedText
+        return YES;
+    }
+    NSInteger limitCount = self.maxInputCount;
+
+    NSString *newText = [[textView text] stringByReplacingCharactersInRange:range withString:text];
+    if (newText.length > limitCount) {
+        newText = [newText substringWithRange:NSMakeRange(0, limitCount)];
+        textView.text = newText;
+    }
+    return YES;
+}
+
+- (void)updateTextViewLineHeight:(UITextView *)textView {
+    UITextRange *markedTextRange = textView.markedTextRange;
+    if (markedTextRange) {
+        // 当前处于拼音输入状态,暂不更新 attributedText
+        return;
+    }
+    [UIView setAnimationsEnabled:NO];
+    NSRange selectedRange = textView.selectedRange;
+    NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:textView.text attributes:[self getTypeAttributes]];
+    textView.attributedText = attrs;
+    textView.selectedRange = selectedRange;
+    [UIView setAnimationsEnabled:YES];
+}
+
+- (void)textViewDidChange:(UITextView *)textView {
+    // 获取当前高亮的部分(如果正在拼音输入状态)
+    UITextRange *selectedRange = [textView markedTextRange];
+    UITextPosition *position = [textView positionFromPosition:selectedRange.start offset:0];
+    
+    // 如果没有高亮选择的文本,说明不是拼音输入状态
+    if (!position) {
+        // 获取当前textView的内容
+        NSInteger limitCount = self.maxInputCount;
+        NSString *currentText = textView.text;
+        
+        // 如果文本超出最大长度,进行截取
+        if (currentText.length > limitCount) {
+            NSString *limitedText = [currentText substringToIndex:limitCount];
+            textView.text = limitedText;
+        }
+        
+        self.countLabel.text = [NSString stringWithFormat:@"%zd/%zd",textView.text.length,self.maxInputCount];
+    }
+    [self updateTextViewLineHeight:textView];
+}
+
+- (BOOL)textViewShouldEndEditing:(UITextView *)textView {
+    [self endEditing:YES];
+    return YES;
+}
+
+- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
+    [self endEditing:YES];
+}
+
+#pragma mark --- gesture delegate
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
+    if ([touch.view isDescendantOfView:self.bgView]) {
+        return NO;
+    }
+    return YES;
+}
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 197 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/CourseEvaluateAlertView.xib

@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <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="CourseEvaluateAlertView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3T1-Qr-Vhf">
+                    <rect key="frame" x="0.0" y="428" width="393" height="424"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="评价老师" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9t4-kR-Cnp">
+                            <rect key="frame" x="160.66666666666666" y="18" width="71.666666666666657" height="22"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="22" id="uAx-Tx-QiV"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
+                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cancle_button" translatesAutoresizingMaskIntoConstraints="NO" id="pAM-cp-TAE">
+                            <rect key="frame" x="365" y="22" width="16" height="16"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="16" id="882-Ez-HT2"/>
+                                <constraint firstAttribute="height" constant="16" id="bdv-T7-Tvv"/>
+                            </constraints>
+                        </imageView>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HkK-LI-ve3">
+                            <rect key="frame" x="349" y="5" width="44" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="iMy-vA-2YG"/>
+                                <constraint firstAttribute="width" constant="44" id="slR-LR-OMJ"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <connections>
+                                <action selector="cancelAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="5Vf-3o-4ds"/>
+                            </connections>
+                        </button>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qVY-d9-6JA">
+                            <rect key="frame" x="14" y="165" width="365" height="164"/>
+                            <subviews>
+                                <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="c2c-iL-fcH">
+                                    <rect key="frame" x="12" y="13" width="341" height="117"/>
+                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                    <color key="textColor" systemColor="labelColor"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                    <textInputTraits key="textInputTraits" autocapitalizationType="sentences" smartInsertDeleteType="no"/>
+                                </textView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0/200" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HtA-n3-ifw">
+                                    <rect key="frame" x="314" y="130" width="39" height="22"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="22" id="cWa-7s-tLN"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.29999999999999999" 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="nXM-kn-gLz">
+                                    <rect key="frame" x="12.000000000000014" y="12" width="238.33333333333337" height="22"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="22" id="5w4-mX-7Zv"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="nXM-kn-gLz" firstAttribute="top" secondItem="qVY-d9-6JA" secondAttribute="top" constant="12" id="3bB-yl-05M"/>
+                                <constraint firstItem="c2c-iL-fcH" firstAttribute="leading" secondItem="qVY-d9-6JA" secondAttribute="leading" constant="12" id="CU0-fu-gUq"/>
+                                <constraint firstAttribute="trailing" secondItem="c2c-iL-fcH" secondAttribute="trailing" constant="12" id="GSM-lm-w9h"/>
+                                <constraint firstAttribute="height" constant="164" id="IJs-oA-62T"/>
+                                <constraint firstItem="HtA-n3-ifw" firstAttribute="top" secondItem="c2c-iL-fcH" secondAttribute="bottom" id="Wc2-Iy-LUH"/>
+                                <constraint firstItem="nXM-kn-gLz" firstAttribute="leading" secondItem="qVY-d9-6JA" secondAttribute="leading" constant="12" id="Zci-f3-OYH"/>
+                                <constraint firstAttribute="trailing" secondItem="HtA-n3-ifw" secondAttribute="trailing" constant="12" id="cwy-0L-cxr"/>
+                                <constraint firstItem="c2c-iL-fcH" firstAttribute="top" secondItem="qVY-d9-6JA" secondAttribute="top" constant="13" id="lDb-bS-AzG"/>
+                                <constraint firstAttribute="bottom" secondItem="HtA-n3-ifw" secondAttribute="bottom" constant="12" id="yWk-YK-A8d"/>
+                            </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="10"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FIf-bt-Kby">
+                            <rect key="frame" x="28" y="359" width="337" height="44"/>
+                            <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="ij0-rm-7l0"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="提交"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="22"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="sureAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="dqd-eV-Yne"/>
+                            </connections>
+                        </button>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2zU-Zn-BFb">
+                            <rect key="frame" x="14" y="67" width="365" height="86"/>
+                            <subviews>
+                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4lZ-yB-kbK" customClass="KSStarView">
+                                    <rect key="frame" x="84.666666666666686" y="12" width="196" height="28"/>
+                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="196" id="5SH-bw-eN7"/>
+                                        <constraint firstAttribute="height" constant="28" id="CGo-bx-0Q1"/>
+                                    </constraints>
+                                </view>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="如果满意请给五星好评喔~" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IlQ-xr-Mup">
+                                    <rect key="frame" x="111.00000000000001" y="57" width="143.33333333333337" height="17"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="17" id="zio-4x-aGE"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                    <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                            <constraints>
+                                <constraint firstAttribute="bottom" secondItem="IlQ-xr-Mup" secondAttribute="bottom" constant="12" id="Vf9-DF-Lnr"/>
+                                <constraint firstItem="4lZ-yB-kbK" firstAttribute="top" secondItem="2zU-Zn-BFb" secondAttribute="top" constant="12" id="ivT-jk-FQI"/>
+                                <constraint firstItem="IlQ-xr-Mup" firstAttribute="centerX" secondItem="2zU-Zn-BFb" secondAttribute="centerX" id="rO4-CI-hQM"/>
+                                <constraint firstItem="4lZ-yB-kbK" firstAttribute="centerX" secondItem="2zU-Zn-BFb" secondAttribute="centerX" id="snE-vj-hTH"/>
+                                <constraint firstAttribute="height" constant="86" id="tdc-Oi-lAd"/>
+                            </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="10"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                    </subviews>
+                    <color key="backgroundColor" red="0.97254901959999995" green="0.97647058819999999" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstItem="HkK-LI-ve3" firstAttribute="top" secondItem="3T1-Qr-Vhf" secondAttribute="top" constant="5" id="20I-wZ-1Lz"/>
+                        <constraint firstItem="9t4-kR-Cnp" firstAttribute="top" secondItem="3T1-Qr-Vhf" secondAttribute="top" constant="18" id="3lx-wK-d6Z"/>
+                        <constraint firstAttribute="height" constant="424" id="7k3-tP-GB1"/>
+                        <constraint firstItem="pAM-cp-TAE" firstAttribute="top" secondItem="3T1-Qr-Vhf" secondAttribute="top" constant="22" id="9LE-DS-YnW"/>
+                        <constraint firstItem="FIf-bt-Kby" firstAttribute="top" secondItem="qVY-d9-6JA" secondAttribute="bottom" constant="30" id="LZa-QS-POF"/>
+                        <constraint firstItem="FIf-bt-Kby" firstAttribute="leading" secondItem="3T1-Qr-Vhf" secondAttribute="leading" constant="28" id="Vtm-88-KX0"/>
+                        <constraint firstItem="9t4-kR-Cnp" firstAttribute="centerX" secondItem="3T1-Qr-Vhf" secondAttribute="centerX" id="Xcy-Bq-2TN"/>
+                        <constraint firstAttribute="trailing" secondItem="2zU-Zn-BFb" secondAttribute="trailing" constant="14" id="bcU-Ao-f1j"/>
+                        <constraint firstItem="2zU-Zn-BFb" firstAttribute="top" secondItem="HkK-LI-ve3" secondAttribute="bottom" constant="18" id="ccR-sG-bf6"/>
+                        <constraint firstAttribute="trailing" secondItem="HkK-LI-ve3" secondAttribute="trailing" id="hib-yV-4nk"/>
+                        <constraint firstItem="qVY-d9-6JA" firstAttribute="top" secondItem="2zU-Zn-BFb" secondAttribute="bottom" constant="12" id="n1i-MX-VYv"/>
+                        <constraint firstItem="2zU-Zn-BFb" firstAttribute="leading" secondItem="3T1-Qr-Vhf" secondAttribute="leading" constant="14" id="osP-Cc-SMm"/>
+                        <constraint firstAttribute="trailing" secondItem="qVY-d9-6JA" secondAttribute="trailing" constant="14" id="r6N-1O-N21"/>
+                        <constraint firstAttribute="trailing" secondItem="FIf-bt-Kby" secondAttribute="trailing" constant="28" id="t8g-Ll-P3y"/>
+                        <constraint firstAttribute="trailing" secondItem="pAM-cp-TAE" secondAttribute="trailing" constant="12" id="tla-tu-QCo"/>
+                        <constraint firstItem="qVY-d9-6JA" firstAttribute="leading" secondItem="3T1-Qr-Vhf" secondAttribute="leading" constant="14" id="yb7-m5-ql5"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="3T1-Qr-Vhf" secondAttribute="bottom" id="JnZ-Io-y9m"/>
+                <constraint firstAttribute="trailing" secondItem="3T1-Qr-Vhf" secondAttribute="trailing" id="aQV-Ul-1Ji"/>
+                <constraint firstItem="3T1-Qr-Vhf" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="i07-pC-FdT"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="bgView" destination="3T1-Qr-Vhf" id="Lte-Yo-s73"/>
+                <outlet property="countLabel" destination="HtA-n3-ifw" id="EnB-8o-nqb"/>
+                <outlet property="starView" destination="4lZ-yB-kbK" id="j1j-Ea-A01"/>
+                <outlet property="textView" destination="c2c-iL-fcH" id="hRO-2R-mdS"/>
+                <outlet property="tipsLabel" destination="nXM-kn-gLz" id="tn9-I8-oFV"/>
+            </connections>
+            <point key="canvasLocation" x="38.931297709923662" y="19.718309859154932"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="cancle_button" width="20" height="20"/>
+        <systemColor name="labelColor">
+            <color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 9 - 9
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkAddView.m

@@ -25,29 +25,29 @@
 
 - (void)configUI {
     
-    UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 11, self.bounds.size.width - 11, self.bounds.size.height -22)];
+    UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)];
     [self addSubview:bgView];
-    [bgView drawBoardDottedLine:1.0f length:4 space:4 cornerRadius:8.0f lineColor:THEMECOLOR];
+    [bgView drawBoardDottedLine:1.0f length:4 space:4 cornerRadius:4.0f lineColor:HexRGB(0xD9D9D9)];
     
-    UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image_upload"]];
+    UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"homework_upload_bg"]];
     [bgView addSubview:imgView];
     
     [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerX.mas_equalTo(bgView.mas_centerX);
-        make.width.mas_equalTo(32);
-        make.height.mas_equalTo(32);
-        make.top.mas_equalTo(bgView.mas_top).offset(13);
+        make.width.mas_equalTo(28);
+        make.height.mas_equalTo(28);
+        make.top.mas_equalTo(bgView.mas_top).offset(9);
     }];
     
     UILabel *label = [[UILabel alloc] init];
     label.textAlignment = NSTextAlignmentCenter;
     label.text = @"上传视频";
-    label.font = [UIFont systemFontOfSize:10.0f];
-    label.textColor = THEMECOLOR;
+    label.font = [UIFont systemFontOfSize:12.0f];
+    label.textColor = HexRGB(0x333333);
     [bgView addSubview:label];
     [label mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.mas_equalTo(bgView);
-        make.top.mas_equalTo(imgView.mas_bottom).offset(1);
+        make.top.mas_equalTo(imgView.mas_bottom).offset(6);
         make.height.mas_equalTo(17);
     }];
     UIButton *actionButton = [UIButton buttonWithType:UIButtonTypeCustom];

+ 37 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkSubmitAlertView.h

@@ -0,0 +1,37 @@
+//
+//  HomeworkSubmitAlertView.h
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/12/20.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSInteger, HOMEWORK_TYPE) {
+    HOMEWORK_TYPE_ADD, // 添加
+    HOMEWORK_TYPE_SUBMIT, // 提交
+    HOMEWORK_TYPE_PLAY,   // 播放
+    HOMEWORK_TYPE_DELETE, // 删除
+};
+
+typedef void(^HomeSubmitAlertCallback)(HOMEWORK_TYPE type, NSMutableArray * _Nonnull fileArray, NSInteger videoIndex);
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface HomeworkSubmitAlertView : UIView
+
+@property (nonatomic, strong) NSMutableArray *sourceArray;
+
++ (instancetype)sharedInstance;
+
+- (void)configWithFileArray:(NSMutableArray *)fileUrlArray;
+
+- (void)alertActionCallback:(HomeSubmitAlertCallback)callback;
+
+- (void)showInView:(UIView *)displayView;
+
+- (void)removeView;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 173 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkSubmitAlertView.m

@@ -0,0 +1,173 @@
+//
+//  HomeworkSubmitAlertView.m
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/12/20.
+//
+
+#import "HomeworkSubmitAlertView.h"
+#import "HomeworkVideoView.h"
+#import "HomeworkAddView.h"
+#import <UIView+ExtensionForDotLine.h>
+
+@interface HomeworkSubmitAlertView ()
+
+@property (weak, nonatomic) IBOutlet UIView *bgView;
+
+@property (weak, nonatomic) IBOutlet UIView *emptyView;
+
+@property (weak, nonatomic) IBOutlet UIView *buttonContainer;
+
+
+@property (nonatomic, copy) HomeSubmitAlertCallback callback;
+
+@end
+
+@implementation HomeworkSubmitAlertView
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+     self.bgView.layer.cornerRadius = 12.0f;
+    self.bgView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
+    [self.emptyView drawBoardDottedLine:1.0f length:4 space:4 cornerRadius:8.0f lineColor:HexRGB(0xD9D9D9)];
+}
+
++ (instancetype)sharedInstance {
+    HomeworkSubmitAlertView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeworkSubmitAlertView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)configWithFileArray:(NSMutableArray *)fileUrlArray {
+    self.sourceArray = [NSMutableArray arrayWithArray:fileUrlArray];
+    [self refreshViewStatus];
+}
+
+- (void)refreshViewStatus {
+    [self.buttonContainer removeAllSubViews];
+    if (self.sourceArray.count) {
+        self.emptyView.hidden = YES;
+        self.buttonContainer.hidden = NO;
+        [self configVideoView];
+        
+    }
+    else {
+        self.emptyView.hidden = NO;
+        self.buttonContainer.hidden = YES;
+    }
+}
+
+- (void)configVideoView {
+    CGFloat maxWidth = KPortraitWidth - 14 * 2;
+    CGFloat leftSpace = 12.0f;
+    CGFloat space = 10.0f;
+    CGFloat width = (maxWidth - space * 2 - leftSpace * 2) / 3.0f;
+    CGFloat height = 72.0f;
+    for (NSInteger i = 0; i < self.sourceArray.count; i++) {
+        if (i > 2) {
+            return;
+        }
+        CGFloat positionX = leftSpace + i * (width + space);
+        NSString *videoUrl = self.sourceArray[i];
+        HomeworkVideoView *videoView = [HomeworkVideoView shareInstance];
+        videoView.frame = CGRectMake(positionX, leftSpace, width, height);
+        
+        videoView.tag = i+1000;
+        MJWeakSelf
+        [videoView displayVideoUrl:videoUrl callback:^(VIDEOVIEWACTION action, NSInteger viewIndex) {
+            if (action == VIDEOVIEWACTION_PLAY) {
+                [weakSelf playVideoIndex:viewIndex];
+            }
+            else {
+                [weakSelf deleteVideoIndex:viewIndex];
+            }
+        }];
+
+        [self.buttonContainer addSubview:videoView];
+    }
+    
+    if (self.sourceArray.count < 3) { // 添加上传按钮
+        CGFloat positionX = self.sourceArray.count * (width + space) + leftSpace;
+        HomeworkAddView *addView = [[HomeworkAddView alloc] initWithFrame:CGRectMake(positionX, leftSpace, width, height)];
+        [self.buttonContainer addSubview:addView];
+        MJWeakSelf;
+        [addView chooseCallback:^{
+            [weakSelf chooseVideo];
+        }];
+    }
+}
+
+- (void)chooseVideo {
+    if (self.callback) {
+        self.callback(HOMEWORK_TYPE_ADD,self.sourceArray, 0);
+    }
+}
+
+// 播放
+- (void)playVideoIndex:(NSInteger)index {
+    if (self.callback) {
+        self.callback(HOMEWORK_TYPE_PLAY, self.sourceArray, index);
+    }
+}
+
+// 删除
+- (void)deleteVideoIndex:(NSInteger)index {
+    [self.sourceArray removeObjectAtIndex:index];
+    [self refreshViewStatus];
+    if (self.callback) {
+        self.callback(HOMEWORK_TYPE_DELETE, self.sourceArray, index);
+    }
+}
+
+- (void)alertActionCallback:(HomeSubmitAlertCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (IBAction)addFile:(id)sender {
+    if (self.callback) {
+        self.callback(HOMEWORK_TYPE_ADD, self.sourceArray, 0);
+    }
+}
+
+- (IBAction)submitAction:(id)sender {
+    if (self.callback) {
+        self.callback(HOMEWORK_TYPE_SUBMIT, self.sourceArray, 0);
+    }
+}
+
+- (IBAction)cancelAction:(id)sender {
+    [self removeView];
+}
+
+- (void)showInView:(UIView *)displayView {
+    if (!displayView) {
+        displayView = [NSObject getKeyWindow];
+    }
+    if (![displayView.subviews containsObject:self]) {
+        [displayView addSubview:self];
+        [self mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.top.bottom.mas_equalTo(displayView);
+        }];
+    }
+}
+- (void)removeView {
+    [self removeFromSuperview];
+}
+
+- (NSMutableArray *)sourceArray {
+    if (!_sourceArray) {
+        _sourceArray = [NSMutableArray array];
+    }
+    return _sourceArray;
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 176 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkSubmitAlertView.xib

@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <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="HomeworkSubmitAlertView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dzw-rR-csa">
+                    <rect key="frame" x="0.0" y="582" width="393" height="270"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="提交作业" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hsk-Rb-q0v">
+                            <rect key="frame" x="160.66666666666666" y="18" width="71.666666666666657" height="22"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="22" id="eUB-fH-EYS"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
+                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cancle_button" translatesAutoresizingMaskIntoConstraints="NO" id="vtm-bM-U1r">
+                            <rect key="frame" x="365" y="22" width="16" height="16"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="16" id="WMq-cF-RDt"/>
+                                <constraint firstAttribute="width" constant="16" id="uvB-y6-dsM"/>
+                            </constraints>
+                        </imageView>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fbG-9O-Hva">
+                            <rect key="frame" x="349" y="5" width="44" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="44" id="7m8-lK-UuN"/>
+                                <constraint firstAttribute="height" constant="44" id="wES-QG-iPO"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <connections>
+                                <action selector="cancelAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="2Or-ba-dcl"/>
+                            </connections>
+                        </button>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R84-m2-opW">
+                            <rect key="frame" x="14" y="58" width="365" height="108"/>
+                            <subviews>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homework_upload_bg" translatesAutoresizingMaskIntoConstraints="NO" id="9QQ-a4-HHB">
+                                    <rect key="frame" x="164.66666666666666" y="14" width="36" height="36"/>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="上传视频" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NGZ-hp-45Z">
+                                    <rect key="frame" x="154.66666666666666" y="55" width="56" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="20" id="BKM-ri-zM7"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
+                                    <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="(最多3个)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vHc-da-gO3">
+                                    <rect key="frame" x="153" y="77" width="59" height="17"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="17" id="qT3-ta-HkZ"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                    <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1wa-3N-J9d">
+                                    <rect key="frame" x="0.0" y="0.0" width="365" height="108"/>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                    <connections>
+                                        <action selector="addFile:" destination="iN0-l3-epB" eventType="touchUpInside" id="k1k-KL-eCg"/>
+                                    </connections>
+                                </button>
+                            </subviews>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="108" id="0Hl-rB-BPs"/>
+                                <constraint firstItem="NGZ-hp-45Z" firstAttribute="top" secondItem="9QQ-a4-HHB" secondAttribute="bottom" constant="5" id="4y8-8G-HFt"/>
+                                <constraint firstItem="9QQ-a4-HHB" firstAttribute="centerX" secondItem="R84-m2-opW" secondAttribute="centerX" id="Ixg-2n-drB"/>
+                                <constraint firstItem="1wa-3N-J9d" firstAttribute="leading" secondItem="R84-m2-opW" secondAttribute="leading" id="NjN-xh-nGf"/>
+                                <constraint firstItem="vHc-da-gO3" firstAttribute="centerX" secondItem="R84-m2-opW" secondAttribute="centerX" id="Qrg-h9-t7C"/>
+                                <constraint firstItem="9QQ-a4-HHB" firstAttribute="top" secondItem="R84-m2-opW" secondAttribute="top" constant="14" id="R3L-Zi-dDV"/>
+                                <constraint firstItem="NGZ-hp-45Z" firstAttribute="centerX" secondItem="R84-m2-opW" secondAttribute="centerX" id="VPW-A2-8EN"/>
+                                <constraint firstAttribute="trailing" secondItem="1wa-3N-J9d" secondAttribute="trailing" id="gaM-q7-mv0"/>
+                                <constraint firstItem="1wa-3N-J9d" firstAttribute="top" secondItem="R84-m2-opW" secondAttribute="top" id="sme-Fa-8Y3"/>
+                                <constraint firstAttribute="bottom" secondItem="1wa-3N-J9d" secondAttribute="bottom" id="tRx-pf-SMM"/>
+                                <constraint firstItem="vHc-da-gO3" firstAttribute="top" secondItem="NGZ-hp-45Z" secondAttribute="bottom" constant="2" id="xzB-th-aHR"/>
+                                <constraint firstItem="1wa-3N-J9d" firstAttribute="centerX" secondItem="R84-m2-opW" secondAttribute="centerX" id="yP9-I4-V4T"/>
+                            </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="10"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wvu-ao-PEY">
+                            <rect key="frame" x="14" y="59" width="365" height="99"/>
+                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="99" id="XZF-nF-mZC"/>
+                            </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="10"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="J3p-xj-Qlk">
+                            <rect key="frame" x="28" y="196" width="337" height="44"/>
+                            <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="MEG-oH-AYo"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="提交"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="22"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="submitAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="fsw-Ec-PaT"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" red="0.97254901959999995" green="0.97647058819999999" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstItem="R84-m2-opW" firstAttribute="leading" secondItem="dzw-rR-csa" secondAttribute="leading" constant="14" id="1aW-53-D5B"/>
+                        <constraint firstItem="hsk-Rb-q0v" firstAttribute="top" secondItem="dzw-rR-csa" secondAttribute="top" constant="18" id="2My-at-zQ7"/>
+                        <constraint firstItem="vtm-bM-U1r" firstAttribute="top" secondItem="dzw-rR-csa" secondAttribute="top" constant="22" id="6ek-48-8ao"/>
+                        <constraint firstAttribute="trailing" secondItem="Wvu-ao-PEY" secondAttribute="trailing" constant="14" id="9Wi-zF-ZKV"/>
+                        <constraint firstAttribute="trailing" secondItem="vtm-bM-U1r" secondAttribute="trailing" constant="12" id="Afp-V8-Kll"/>
+                        <constraint firstAttribute="trailing" secondItem="R84-m2-opW" secondAttribute="trailing" constant="14" id="Aib-0E-Zvs"/>
+                        <constraint firstAttribute="trailing" secondItem="fbG-9O-Hva" secondAttribute="trailing" id="Hy2-ba-wCw"/>
+                        <constraint firstItem="Wvu-ao-PEY" firstAttribute="top" secondItem="hsk-Rb-q0v" secondAttribute="bottom" constant="19" id="PEc-f9-XJf"/>
+                        <constraint firstItem="hsk-Rb-q0v" firstAttribute="centerX" secondItem="dzw-rR-csa" secondAttribute="centerX" id="Z5l-81-gDK"/>
+                        <constraint firstItem="J3p-xj-Qlk" firstAttribute="leading" secondItem="dzw-rR-csa" secondAttribute="leading" constant="28" id="cci-p4-FkH"/>
+                        <constraint firstItem="J3p-xj-Qlk" firstAttribute="top" secondItem="R84-m2-opW" secondAttribute="bottom" constant="30" id="eTi-nh-EaP"/>
+                        <constraint firstAttribute="trailing" secondItem="J3p-xj-Qlk" secondAttribute="trailing" constant="28" id="edE-fS-3ku"/>
+                        <constraint firstItem="Wvu-ao-PEY" firstAttribute="leading" secondItem="dzw-rR-csa" secondAttribute="leading" constant="14" id="epG-Gs-VSd"/>
+                        <constraint firstItem="R84-m2-opW" firstAttribute="top" secondItem="hsk-Rb-q0v" secondAttribute="bottom" constant="18" id="ksF-p1-zVw"/>
+                        <constraint firstAttribute="height" constant="270" id="osU-PQ-tc7"/>
+                        <constraint firstItem="fbG-9O-Hva" firstAttribute="top" secondItem="dzw-rR-csa" secondAttribute="top" constant="5" id="pcJ-0H-SIA"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="dzw-rR-csa" secondAttribute="trailing" id="1Ex-4G-qYN"/>
+                <constraint firstItem="dzw-rR-csa" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="jq5-Jf-jOY"/>
+                <constraint firstAttribute="bottom" secondItem="dzw-rR-csa" secondAttribute="bottom" id="y34-0i-7pl"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="bgView" destination="dzw-rR-csa" id="vgq-2D-uFF"/>
+                <outlet property="buttonContainer" destination="Wvu-ao-PEY" id="tFE-sD-mt9"/>
+                <outlet property="emptyView" destination="R84-m2-opW" id="fMH-6F-a4F"/>
+            </connections>
+            <point key="canvasLocation" x="38.931297709923662" y="19.718309859154932"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="cancle_button" width="20" height="20"/>
+        <image name="homework_upload_bg" width="36" height="36"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 14 - 14
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/View/HomeworkVideoView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" 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="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -14,14 +14,14 @@
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rO5-WR-JIz">
-                    <rect key="frame" x="0.0" y="11" width="258" height="122"/>
+                    <rect key="frame" x="0.0" y="0.0" width="269" height="144"/>
                     <subviews>
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="video_placeholder" translatesAutoresizingMaskIntoConstraints="NO" id="gHr-CE-99d">
-                            <rect key="frame" x="0.0" y="0.0" width="258" height="122"/>
+                            <rect key="frame" x="0.0" y="0.0" width="269" height="144"/>
                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         </imageView>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PPM-pp-KPh">
-                            <rect key="frame" x="107" y="39" width="44" height="44"/>
+                            <rect key="frame" x="112.5" y="50" width="44" height="44"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="44" id="34f-sk-BQa"/>
                                 <constraint firstAttribute="height" constant="44" id="Yfs-VJ-ptv"/>
@@ -44,18 +44,18 @@
                     </constraints>
                     <userDefinedRuntimeAttributes>
                         <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                            <real key="value" value="10"/>
+                            <real key="value" value="5"/>
                         </userDefinedRuntimeAttribute>
                     </userDefinedRuntimeAttributes>
                 </view>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ISP-Z6-g0a">
-                    <rect key="frame" x="247" y="0.0" width="22" height="22"/>
+                    <rect key="frame" x="245" y="2" width="22" height="22"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="22" id="6uC-Rk-yxh"/>
                         <constraint firstAttribute="height" constant="22" id="t7e-qc-N6I"/>
                     </constraints>
                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                    <state key="normal" image="video_delete"/>
+                    <state key="normal" image="delete_grey"/>
                     <connections>
                         <action selector="deleteAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="8yK-yg-qlh"/>
                     </connections>
@@ -63,11 +63,11 @@
             </subviews>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <constraints>
-                <constraint firstAttribute="bottom" secondItem="rO5-WR-JIz" secondAttribute="bottom" constant="11" id="e4v-r6-cOI"/>
-                <constraint firstItem="rO5-WR-JIz" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="11" id="iHL-C1-ymd"/>
-                <constraint firstAttribute="trailing" secondItem="rO5-WR-JIz" secondAttribute="trailing" constant="11" id="pPg-Wq-ZA1"/>
-                <constraint firstItem="ISP-Z6-g0a" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="qio-LT-SbC"/>
-                <constraint firstAttribute="trailing" secondItem="ISP-Z6-g0a" secondAttribute="trailing" id="sTY-Iv-Pnz"/>
+                <constraint firstAttribute="bottom" secondItem="rO5-WR-JIz" secondAttribute="bottom" id="e4v-r6-cOI"/>
+                <constraint firstItem="rO5-WR-JIz" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="iHL-C1-ymd"/>
+                <constraint firstAttribute="trailing" secondItem="rO5-WR-JIz" secondAttribute="trailing" id="pPg-Wq-ZA1"/>
+                <constraint firstItem="ISP-Z6-g0a" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="2" id="qio-LT-SbC"/>
+                <constraint firstAttribute="trailing" secondItem="ISP-Z6-g0a" secondAttribute="trailing" constant="2" id="sTY-Iv-Pnz"/>
                 <constraint firstItem="rO5-WR-JIz" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="xK9-L4-zph"/>
             </constraints>
             <nil key="simulatedTopBarMetrics"/>
@@ -81,8 +81,8 @@
         </view>
     </objects>
     <resources>
+        <image name="delete_grey" width="18" height="18"/>
         <image name="playVideo_image" width="26" height="26"/>
-        <image name="video_delete" width="22" height="22"/>
         <image name="video_placeholder" width="103" height="72"/>
     </resources>
 </document>