Ver código fonte

课表和陪练课详情对接

Steven 3 anos atrás
pai
commit
639b210a08

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

@@ -439,6 +439,8 @@
 		BC1191ED280E55CB00A716F7 /* EvaluateDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1191EB280E55CA00A716F7 /* EvaluateDetailModel.m */; };
 		BC1191F0280E8A2800A716F7 /* TableCourseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1191EF280E8A2800A716F7 /* TableCourseModel.m */; };
 		BC1191F3280EAB9600A716F7 /* AccompanyDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1191F1280EAB9600A716F7 /* AccompanyDetailViewController.m */; };
+		BC1191F6280EBC7D00A716F7 /* AccompanyDetailBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1191F5280EBC7D00A716F7 /* AccompanyDetailBottomView.m */; };
+		BC1191F8280EBC8600A716F7 /* AccompanyDetailBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC1191F7280EBC8600A716F7 /* AccompanyDetailBottomView.xib */; };
 		BC1365B8280D130C00EB03E2 /* MyVideoCourseBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1365B7280D130C00EB03E2 /* MyVideoCourseBodyView.m */; };
 		BC1365BB280D162400EB03E2 /* MyVideoSearchView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1365BA280D162400EB03E2 /* MyVideoSearchView.m */; };
 		BC1365BD280D163200EB03E2 /* MyVideoSearchView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC1365BC280D163200EB03E2 /* MyVideoSearchView.xib */; };
@@ -1451,6 +1453,9 @@
 		BC1191EF280E8A2800A716F7 /* TableCourseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableCourseModel.m; sourceTree = "<group>"; };
 		BC1191F1280EAB9600A716F7 /* AccompanyDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccompanyDetailViewController.m; sourceTree = "<group>"; };
 		BC1191F2280EAB9600A716F7 /* AccompanyDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccompanyDetailViewController.h; sourceTree = "<group>"; };
+		BC1191F4280EBC7D00A716F7 /* AccompanyDetailBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccompanyDetailBottomView.h; sourceTree = "<group>"; };
+		BC1191F5280EBC7D00A716F7 /* AccompanyDetailBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AccompanyDetailBottomView.m; sourceTree = "<group>"; };
+		BC1191F7280EBC8600A716F7 /* AccompanyDetailBottomView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AccompanyDetailBottomView.xib; sourceTree = "<group>"; };
 		BC1365B6280D130C00EB03E2 /* MyVideoCourseBodyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyVideoCourseBodyView.h; sourceTree = "<group>"; };
 		BC1365B7280D130C00EB03E2 /* MyVideoCourseBodyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyVideoCourseBodyView.m; sourceTree = "<group>"; };
 		BC1365B9280D162400EB03E2 /* MyVideoSearchView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyVideoSearchView.h; sourceTree = "<group>"; };
@@ -3922,6 +3927,9 @@
 				BC5EB5A72803D85300B4A3B0 /* AccompanyAlertView.h */,
 				BC5EB5A82803D85300B4A3B0 /* AccompanyAlertView.m */,
 				BC5EB5AA2803D86500B4A3B0 /* AccompanyAlertView.xib */,
+				BC1191F4280EBC7D00A716F7 /* AccompanyDetailBottomView.h */,
+				BC1191F5280EBC7D00A716F7 /* AccompanyDetailBottomView.m */,
+				BC1191F7280EBC8600A716F7 /* AccompanyDetailBottomView.xib */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -4618,6 +4626,7 @@
 				BC2858302809451B0024697C /* EvaluateCouseCell.xib in Resources */,
 				BCA724002806AEA000DA0D0D /* AccompanyHomeworkCell.xib in Resources */,
 				27F9CB0127EC3D42003E0FE4 /* GroupListViewCell.xib in Resources */,
+				BC1191F8280EBC8600A716F7 /* AccompanyDetailBottomView.xib in Resources */,
 				BCA9CE3027FD8A9900D558C6 /* AccompanyNavView.xib in Resources */,
 				BCA9CE3527FD93C700D558C6 /* AccompanyEvaluateCell.xib in Resources */,
 				27D5D5D227EDBA9400B4720C /* NoticeEditBodyView.xib in Resources */,
@@ -4908,6 +4917,7 @@
 				277931D127E30FC20010E277 /* UrlDecode.m in Sources */,
 				277931F227E30FC20010E277 /* NSDictionary+Extension.m in Sources */,
 				27D83F5727F4224F00062476 /* LivePreviewBodyView.m in Sources */,
+				BC1191F6280EBC7D00A716F7 /* AccompanyDetailBottomView.m in Sources */,
 				277932B927E30FFE0010E277 /* TADotView.m in Sources */,
 				2773204D27EDB72B008FAECA /* LFPopupMenu.m in Sources */,
 				BCC03F8F2805484200461B7C /* StyleVideoModel.m in Sources */,

BIN
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 275 - 9
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -14,13 +14,36 @@
 #import "AccompanyArrangeCell.h"
 #import "AccompanyHomeworkCell.h"
 #import "AccompanyRemarkCell.h"
+#import "HomeworkDetailModel.h"
+#import "EvaluateDetailModel.h"
+#import "AccompanyDetailBottomView.h"
+#import "KSChatConversationViewController.h"
+#import "WMPlayer.h"
 
-@interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
+@interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate>
+{
+    WMPlayer *_wmPlayer;
+    CGRect _playerFrame;
+}
+@property (nonatomic, strong) UIView *bgView;
+
+@property (nonatomic, assign) BOOL isRatation;
 
 @property (nonatomic, strong) AccompanyNavView *navView;
 
 @property (nonatomic, strong) UITableView *tableView;
 
+@property (nonatomic, strong) HomeworkDetailModel *homeworkModel;
+
+@property (nonatomic, strong) EvaluateDetailModel *evaluateModel;
+
+@property (nonatomic, strong) AccompanyDetailBottomView *bottomView;
+
+@property (nonatomic, strong) AccompanyAlertView *alertView;
+
+@property (nonatomic, strong) NSMutableArray *fileArray;
+
+
 @end
 
 @implementation AccompanyDetailViewController
@@ -30,25 +53,59 @@
     // Do any additional setup after loading the view.
     self.ks_prefersNavigationBarHidden = YES;
     [self configUI];
-    [self requestMessage];
+    [self requestCourseInfoMessage];
 }
 
-- (void)requestMessage {
-    
+- (void)requestCourseInfoMessage {
+    [self requestHomeworkMessage];
+    [self requestEvaluateMessage];
 }
 
 - (void)requestHomeworkMessage {
-    
+    [KSNetworkingManager homeworkDetailRequest:KS_GET courseId:self.courseId success:^(NSDictionary * _Nonnull dic) {
+        if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            self.homeworkModel = [[HomeworkDetailModel alloc] initWithDictionary:[dic dictionaryValueForKey:@"data"]];
+            if (self.homeworkModel.submitHomework == 1) {
+                if (![NSString isEmptyString:self.homeworkModel.studentAttachments]) {
+                    self.fileArray = [NSMutableArray arrayWithArray:[self.homeworkModel.studentAttachments componentsSeparatedByString:@","]];
+                }
+                else {
+                    self.fileArray = [NSMutableArray array];
+                }
+            }
+            else {
+                self.fileArray = [NSMutableArray array];
+            }
+        }
+        else {
+            [self MBPShow:MESSAGEKEY];
+        }
+        [self.tableView reloadData];
+    } faliure:^(NSError * _Nonnull error) {
+        
+    }];
 }
 
-//- (void)request
+- (void)requestEvaluateMessage {
+    [KSNetworkingManager selectRepliedRequest:KS_POST courseGroupId:self.courseId courseScheduleId:self.courseGroupId studentId:self.studentId success:^(NSDictionary * _Nonnull dic) {
+        if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            self.evaluateModel = [[EvaluateDetailModel alloc] initWithDictionary:[dic dictionaryValueForKey:@"data"]];
+        }
+        else {
+            [self MBPShow:MESSAGEKEY];
+        }
+        [self.tableView reloadData];
+    } faliure:^(NSError * _Nonnull error) {
+        
+    }];
+}
 
 - (void)configUI {
     [self.scrollView removeFromSuperview];
     [self.view addSubview:self.navView];
     CGFloat height = [self.navView getViewHeight];
     [self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.right.top.mas_equalTo(self);
+        make.left.right.top.mas_equalTo(self.view);
         make.height.mas_equalTo(height);
     }];
     [self.view addSubview:self.tableView];
@@ -68,34 +125,222 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     if (indexPath.row == 0) {
         AccompanyCourseInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyCourseInfoCell"];
+        [cell configWithStartTime:self.homeworkModel.startTime endTime:self.homeworkModel.endTime studentAvatar:self.homeworkModel.studentAvatar studentName:self.homeworkModel.studentName studentId:self.homeworkModel.studentId studentSubject:self.homeworkModel.subjectName];
+        cell.hideChatButton = NO;
+        MJWeakSelf;
+        [cell chatCalkback:^{
+            [weakSelf chatAction];
+        }];
+        
         return cell;
     }
     else if (indexPath.row == 1) {
         AccompanyEvaluateCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyEvaluateCell"];
+        NSString *message = self.evaluateModel.teacherReplied;
+        BOOL hasEvaluate = [NSString isEmptyString:self.evaluateModel.teacherReplied] ? NO : YES;
+        MJWeakSelf;
+        [cell configWithEvaluateMessage:message hasEvaluate:hasEvaluate callback:^{
+            [weakSelf evaluateCourse];
+        }];
         return cell;
     }
     else if (indexPath.row == 2) {
         AccompanyStudentEvaCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyStudentEvaCell"];
+        NSString *message = self.evaluateModel.studentReplied;
+        BOOL hasEvaluate = [NSString isEmptyString:self.evaluateModel.studentReplied] ? NO : YES;
+        [cell configWithEvaluateMessage:message starNum:self.evaluateModel.score hasEvaluate:hasEvaluate];
         return cell;
     }
     else if (indexPath.row == 3) {
         AccompanyArrangeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyArrangeCell"];
-        
+        BOOL hasArrange = self.homeworkModel.decorateHomework == 1 ? YES : NO;
+        MJWeakSelf;
+        [cell configWithHomeworkContent:self.homeworkModel.content hasArrangeHomework:hasArrange callback:^{
+            [weakSelf arrangeHomework];
+        }];
         return cell;
     }
     else if (indexPath.row == 4) {
+        BOOL hasSubmitHomework = self.homeworkModel.submitHomework == 1 ? YES : NO;
         AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
+        MJWeakSelf;
+        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework callback:^(NSInteger viewIndex) {
+            [weakSelf playVideoIndex:viewIndex];
+        }];
         return cell;
     }
     else {
         AccompanyRemarkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyRemarkCell"];
+        BOOL hasEvaluate = self.homeworkModel.reviewHomework == 1? YES : NO;
+        MJWeakSelf;
+        [cell configWithRemarkMessage:self.homeworkModel.teacherReplied hasEvaluate:hasEvaluate callback:^{
+            [weakSelf evaluateHomework];
+        }];
         return cell;
     }
 }
 
-#pragma mark --- lazying
+- (void)chatAction {
+    if (self.homeworkModel && ![NSString isEmptyString:self.homeworkModel.studentId]) {
+        KSChatConversationViewController *conversationVC = [[KSChatConversationViewController alloc] init];
+        conversationVC.targetId = self.homeworkModel.studentId;
+        conversationVC.title = self.homeworkModel.studentName;
+        conversationVC.conversationType = ConversationType_PRIVATE;
+        [self.navigationController pushViewController:conversationVC animated:YES];
+    }
+}
 
+- (void)evaluateCourse {
+    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:NO];
+    MJWeakSelf;
+    [self.alertView sureCallback:^(NSString * _Nonnull content, NSInteger starNum) {
+        [weakSelf evaluateAction:content];
+    }];
+}
 
+- (void)evaluateAction:(NSString *)content {
+    if ([NSString isEmptyString:content]) {
+        [self MBPShow:@"请输入评价内容"];
+        return;
+    }
+    [self showhud];
+    [KSNetworkingManager teacherCourseRepliedRequest:KS_POST courseScheduleId:self.courseId courseGroupId:self.courseGroupId studentId:self.studentId teacherReplied:content success:^(NSDictionary * _Nonnull dic) {
+        [self removehub];
+        if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            [self MBPShow:@"评价成功"];
+            [self requestCourseInfoMessage];
+        }
+        else {
+            [self MBPShow:MESSAGEKEY];
+        }
+    } faliure:^(NSError * _Nonnull error) {
+        [self removehub];
+    }];
+}
+
+- (void)arrangeHomework {
+    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:NO];
+    MJWeakSelf;
+    [self.alertView sureCallback:^(NSString * _Nonnull content, NSInteger starNum) {
+        [weakSelf arrangeAction:content];
+    }];
+}
+
+- (void)arrangeAction:(NSString *)homeworkContent {
+    [self showhud];
+    [KSNetworkingManager homeworkDecorateRequest:KS_POST content:homeworkContent courseScheduleId:self.courseId success:^(NSDictionary * _Nonnull dic) {
+        [self removehub];
+        if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            [self MBPShow:@"布置成功"];
+            [self requestCourseInfoMessage];
+        }
+        else {
+            [self MBPShow:MESSAGEKEY];
+        }
+    } faliure:^(NSError * _Nonnull error) {
+        [self removehub];
+    }];
+}
+
+// 评价作业
+- (void)evaluateHomework {
+    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:NO];
+    MJWeakSelf;
+    [self.alertView sureCallback:^(NSString * _Nonnull content, NSInteger starNum) {
+        [weakSelf commentAction:content];
+    }];
+}
+
+- (void)commentAction:(NSString *)commentMessage {
+    [self showhud];
+    [KSNetworkingManager homeworkReviewRequest:KS_POST courseScheduleId:self.courseId review:commentMessage success:^(NSDictionary * _Nonnull dic) {
+        [self removehub];
+        if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            [self MBPShow:@"点评成功"];
+            [self requestCourseInfoMessage];
+        }
+        else {
+            [self MBPShow:MESSAGEKEY];
+        }
+    } faliure:^(NSError * _Nonnull error) {
+        [self removehub];
+    }];
+}
+
+
+- (void)playVideoIndex:(NSInteger)index {
+    if (self.fileArray.count > index) {
+        NSString *fileUrl = self.fileArray[index];
+        [self playVideoWithUrl:fileUrl];
+    }
+}
+
+#pragma mark ------ WMPlayer
+- (void)playVideoWithUrl:(NSString *)fileUrl {
+    fileUrl = [fileUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    _playerFrame = CGRectMake(0, iPhoneXSafeTopMargin, kScreenWidth, kScreenHeight - iPhoneXSafeTopMargin - iPhoneXSafeBottomMargin);
+    _wmPlayer = [[WMPlayer alloc] initWithFrame:_playerFrame];
+    WMPlayerModel *playModel = [[WMPlayerModel alloc] init];
+    playModel.videoURL = [NSURL URLWithString:fileUrl];
+    _wmPlayer.playerModel = playModel;
+    _wmPlayer.delegate = self;
+    _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
+    _bgView.backgroundColor = [UIColor blackColor];
+    [[UIApplication sharedApplication].keyWindow addSubview:_bgView];
+    [[UIApplication sharedApplication].keyWindow addSubview:_wmPlayer];
+    [[UIApplication sharedApplication].keyWindow bringSubviewToFront:_wmPlayer];
+    
+    [_wmPlayer play];
+}
+
+- (void)wmplayer:(WMPlayer *)wmplayer clickedCloseButton:(UIButton *)backBtn {
+    [wmplayer removePlayer];
+    [_bgView removeFromSuperview];
+    [self setNeedsStatusBarAppearanceUpdate];
+}
+
+- (void)wmplayer:(WMPlayer *)wmplayer clickedFullScreenButton:(UIButton *)fullScreenBtn {
+    self.isRatation = !self.isRatation;
+    
+    if (self.isRatation) {
+        [wmplayer removeFromSuperview];
+        [UIView animateWithDuration:1.0f animations:^{
+            wmplayer.transform = CGAffineTransformMakeRotation(M_PI_2);
+            
+        } completion:^(BOOL finished) {
+            wmplayer.frame = CGRectMake(0, iPhoneXSafeTopMargin, kScreenWidth, kScreenHeight - iPhoneXSafeTopMargin - iPhoneXSafeBottomMargin);
+            [[UIApplication sharedApplication].keyWindow addSubview:wmplayer];
+            [[UIApplication sharedApplication].keyWindow bringSubviewToFront:wmplayer];
+        }];
+    }
+    else {
+        [wmplayer removeFromSuperview];
+        
+        [UIView animateWithDuration:1.0f animations:^{
+            //        复原
+            wmplayer.transform = CGAffineTransformIdentity;
+            
+        } completion:^(BOOL finished) {
+            wmplayer.frame = CGRectMake(0, iPhoneXSafeTopMargin, kScreenWidth, kScreenHeight - iPhoneXSafeTopMargin - iPhoneXSafeBottomMargin);
+            [[UIApplication sharedApplication].keyWindow addSubview:wmplayer];
+            [[UIApplication sharedApplication].keyWindow bringSubviewToFront:wmplayer];
+        }];
+    }
+}
+
+#pragma mark --- lazying
 - (UITableView *)tableView {
     if (!_tableView) {
         _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
@@ -106,6 +351,12 @@
         _tableView.showsHorizontalScrollIndicator = NO;
         _tableView.backgroundColor = [UIColor clearColor];
         _tableView.rowHeight = UITableViewAutomaticDimension;
+        [_tableView registerNib:[UINib nibWithNibName:@"AccompanyCourseInfoCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyCourseInfoCell"];
+        [_tableView registerNib:[UINib nibWithNibName:@"AccompanyEvaluateCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyEvaluateCell"];
+        [_tableView registerNib:[UINib nibWithNibName:@"AccompanyStudentEvaCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyStudentEvaCell"];
+        [_tableView registerNib:[UINib nibWithNibName:@"AccompanyArrangeCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyArrangeCell"];
+        [_tableView registerNib:[UINib nibWithNibName:@"AccompanyHomeworkCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyHomeworkCell"];
+        [_tableView registerNib:[UINib nibWithNibName:@"AccompanyRemarkCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyRemarkCell"];
         _tableView.estimatedRowHeight = 136.0f;
         UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
         bottomView.backgroundColor = [UIColor clearColor];
@@ -113,6 +364,7 @@
     }
     return _tableView;
 }
+
 - (AccompanyNavView *)navView {
     if (!_navView) {
         _navView = [AccompanyNavView shareInstance];
@@ -124,6 +376,20 @@
     return _navView;
 }
 
+- (AccompanyDetailBottomView *)bottomView {
+    if (!_bottomView) {
+        _bottomView = [AccompanyDetailBottomView shareInstance];
+        MJWeakSelf;
+        [_bottomView joinroomCallback:^{
+            [weakSelf joinRoomAction];
+        }];
+    }
+    return _bottomView;
+}
+
+- (void)joinRoomAction {
+    
+}
 /*
 #pragma mark - Navigation
 

+ 4 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyCourseInfoCell.h

@@ -9,12 +9,16 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+typedef void(^AccompanyChatCallback)(void);
+
 @interface AccompanyCourseInfoCell : UITableViewCell
 
 @property (nonatomic, assign) BOOL hideChatButton;
 
 - (void)configWithStartTime:(NSString *)beginTime endTime:(NSString *)endTime studentAvatar:(NSString *)studentAvatar studentName:(NSString *)studentName studentId:(NSString *)studentId studentSubject:(NSString *)studentSubject;
 
+- (void)chatCalkback:(AccompanyChatCallback)callback;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 13 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyCourseInfoCell.m

@@ -21,6 +21,8 @@
 
 @property (nonatomic, strong) NSString *userName;
 
+@property (nonatomic, copy) AccompanyChatCallback callback;
+
 @end
 
 @implementation AccompanyCourseInfoCell
@@ -63,6 +65,17 @@
     }
 }
 
+- (void)chatCalkback:(AccompanyChatCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (IBAction)chatAction:(id)sender {
+    if (self.callback) {
+        self.callback();
+    }
+}
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 13 - 10
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyCourseInfoCell.xib

@@ -35,8 +35,8 @@
                                     <constraint firstAttribute="width" constant="16" id="kpa-Xw-v8k"/>
                                 </constraints>
                             </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2021/09/17 14:00~14:25" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dYZ-ZA-mKb">
-                                <rect key="frame" x="34" y="11" width="147" height="18"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dYZ-ZA-mKb">
+                                <rect key="frame" x="34" y="11" width="0.0" height="18"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="18" id="Cjh-qx-oBI"/>
                                 </constraints>
@@ -44,8 +44,8 @@
                                 <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="已结束" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sy0-Ds-ef0">
-                                <rect key="frame" x="278" y="11.5" width="50" height="17"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sy0-Ds-ef0">
+                                <rect key="frame" x="278" y="20" width="50" height="0.0"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="50" id="hjG-kD-dSK"/>
                                 </constraints>
@@ -65,8 +65,8 @@
                                     </userDefinedRuntimeAttribute>
                                 </userDefinedRuntimeAttributes>
                             </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="张豆豆" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mNS-6d-8wr">
-                                <rect key="frame" x="68" y="56" width="49" height="24"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mNS-6d-8wr">
+                                <rect key="frame" x="68" y="56" width="0.0" height="24"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="24" id="CXE-YJ-Psv"/>
                                 </constraints>
@@ -75,10 +75,10 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2RD-hr-hLB">
-                                <rect key="frame" x="68" y="83" width="44" height="20"/>
+                                <rect key="frame" x="68" y="83" width="10" height="20"/>
                                 <subviews>
-                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="单簧管" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g0Z-7O-ahT">
-                                        <rect key="frame" x="5" y="0.0" width="34" height="20"/>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g0Z-7O-ahT">
+                                        <rect key="frame" x="5" y="0.0" width="0.0" height="20"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="11"/>
                                         <color key="textColor" red="1" green="0.54901960780000003" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
@@ -99,13 +99,16 @@
                                 </userDefinedRuntimeAttributes>
                             </view>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dZv-fL-5CE">
-                                <rect key="frame" x="117" y="48" width="40" height="40"/>
+                                <rect key="frame" x="68" y="48" width="40" height="40"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="40" id="DSU-U0-FpE"/>
                                     <constraint firstAttribute="width" constant="40" id="PGx-kW-17W"/>
                                 </constraints>
                                 <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                 <state key="normal" image="course_chat"/>
+                                <connections>
+                                    <action selector="chatAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="Mja-PS-NEH"/>
+                                </connections>
                             </button>
                         </subviews>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>

+ 24 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyDetailBottomView.h

@@ -0,0 +1,24 @@
+//
+//  AccompanyDetailBottomView.h
+//  KulexiuForTeacher
+//
+//  Created by 王智 on 2022/4/19.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef void(^JoinClassroomAction)();
+
+@interface AccompanyDetailBottomView : UIView
+
+@property (weak, nonatomic) IBOutlet UIButton *sureButton;
+
++ (instancetype)shareInstance;
+
+- (void)joinroomCallback:(JoinClassroomAction)callback;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 43 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyDetailBottomView.m

@@ -0,0 +1,43 @@
+//
+//  AccompanyDetailBottomView.m
+//  KulexiuForTeacher
+//
+//  Created by 王智 on 2022/4/19.
+//
+
+#import "AccompanyDetailBottomView.h"
+
+@interface AccompanyDetailBottomView ()
+
+@property (nonatomic, copy) JoinClassroomAction callback;
+
+@end
+
+@implementation AccompanyDetailBottomView
+
++ (instancetype)shareInstance {
+    AccompanyDetailBottomView *view = [[[NSBundle mainBundle] loadNibNamed:@"AccompanyDetailBottomView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)joinroomCallback:(JoinClassroomAction)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (IBAction)joinClassroom:(id)sender {
+    if (self.callback) {
+        self.callback();
+    }
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 49 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyDetailBottomView.xib

@@ -0,0 +1,49 @@
+<?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">
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <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="AccompanyDetailBottomView">
+            <rect key="frame" x="0.0" y="0.0" width="414" height="97"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rQe-Un-bUG">
+                    <rect key="frame" x="28" y="15" width="358" height="44"/>
+                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="ObK-NO-oFb"/>
+                    </constraints>
+                    <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="joinClassroom:" destination="iN0-l3-epB" eventType="touchUpInside" id="Rjm-Sl-roL"/>
+                    </connections>
+                </button>
+            </subviews>
+            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="rQe-Un-bUG" secondAttribute="trailing" constant="28" id="9dH-1T-aSO"/>
+                <constraint firstItem="rQe-Un-bUG" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="15" id="ldd-sP-BZe"/>
+                <constraint firstItem="rQe-Un-bUG" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="28" id="pLN-ap-tbg"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="sureButton" destination="rQe-Un-bUG" id="OAG-tI-gcF"/>
+            </connections>
+            <point key="canvasLocation" x="166.66666666666669" y="-202.56696428571428"/>
+        </view>
+    </objects>
+</document>

+ 31 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyStudentEvaCell.m

@@ -6,6 +6,17 @@
 //
 
 #import "AccompanyStudentEvaCell.h"
+#import "KSStarView.h"
+
+@interface AccompanyStudentEvaCell ()
+
+@property (weak, nonatomic) IBOutlet UIView *emptyView;
+
+@property (weak, nonatomic) IBOutlet KSStarView *starView;
+
+@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
+
+@end
 
 @implementation AccompanyStudentEvaCell
 
@@ -13,10 +24,29 @@
     [super awakeFromNib];
     // Initialization code
     self.selectionStyle = UITableViewCellSelectionStyleNone;
+    self.starView.allowMark = NO;
 }
 
 - (void)configWithEvaluateMessage:(NSString *)evaluateMessage starNum:(NSInteger)starNum hasEvaluate:(BOOL)hasEvaluate {
-    
+    if (hasEvaluate) {
+        self.emptyView.hidden = YES;
+        self.starView.hidden = NO;
+        self.starView.rate = starNum / 5.0f;
+        if (![NSString isEmptyString:evaluateMessage]) {
+            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+            [paragraphStyle setLineSpacing:4];//调整行间距
+            NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:evaluateMessage attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x333333)}];
+            self.contentLabel.attributedText = attr;
+        }
+        else {
+            self.contentLabel.text = @"";
+        }
+    }
+    else {
+        self.starView.hidden = YES;
+        self.emptyView.hidden = NO;
+        self.contentLabel.text = @"";
+    }
 }
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {

+ 26 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyStudentEvaCell.xib

@@ -36,6 +36,12 @@
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CS9-1I-B48">
                                 <rect key="frame" x="11" y="38" width="327" height="89"/>
                                 <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EsB-Oa-Z2T">
+                                        <rect key="frame" x="9" y="11" width="312" height="0.0"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                                        <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hQW-1x-wjy">
                                         <rect key="frame" x="0.0" y="0.0" width="327" height="89"/>
                                         <subviews>
@@ -73,10 +79,14 @@
                                 </subviews>
                                 <color key="backgroundColor" red="0.96862745100000003" green="0.97254901959999995" blue="0.97647058819999999" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="EsB-Oa-Z2T" secondAttribute="trailing" constant="6" id="5xt-b6-PGZ"/>
                                     <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="88" id="7RR-SG-Yi9"/>
                                     <constraint firstAttribute="bottom" secondItem="hQW-1x-wjy" secondAttribute="bottom" id="GJe-TE-bSx"/>
+                                    <constraint firstItem="EsB-Oa-Z2T" firstAttribute="leading" secondItem="CS9-1I-B48" secondAttribute="leading" constant="9" id="GLF-Re-FzW"/>
                                     <constraint firstItem="hQW-1x-wjy" firstAttribute="top" secondItem="CS9-1I-B48" secondAttribute="top" id="O7C-Vg-7Zq"/>
                                     <constraint firstItem="hQW-1x-wjy" firstAttribute="leading" secondItem="CS9-1I-B48" secondAttribute="leading" id="a1e-ZX-t0w"/>
+                                    <constraint firstItem="EsB-Oa-Z2T" firstAttribute="top" secondItem="CS9-1I-B48" secondAttribute="top" constant="11" id="jYU-qf-rxd"/>
+                                    <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="EsB-Oa-Z2T" secondAttribute="bottom" constant="5" id="pqA-5s-uyS"/>
                                     <constraint firstAttribute="trailing" secondItem="hQW-1x-wjy" secondAttribute="trailing" id="rAJ-YZ-OLt"/>
                                 </constraints>
                                 <userDefinedRuntimeAttributes>
@@ -85,7 +95,7 @@
                                     </userDefinedRuntimeAttribute>
                                 </userDefinedRuntimeAttributes>
                             </view>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9CO-NU-fBc">
+                            <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9CO-NU-fBc">
                                 <rect key="frame" x="285" y="2" width="51" height="36"/>
                                 <subviews>
                                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accompany_edit" translatesAutoresizingMaskIntoConstraints="NO" id="Eli-XV-2VU">
@@ -119,6 +129,14 @@
                                     <constraint firstAttribute="trailing" secondItem="gWn-lJ-nkZ" secondAttribute="trailing" id="UW7-ac-w43"/>
                                 </constraints>
                             </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ay0-L4-b3f" customClass="KSStarView">
+                                <rect key="frame" x="84" y="10.5" width="95" height="19"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="19" id="eW0-fj-mRq"/>
+                                    <constraint firstAttribute="width" constant="95" id="nK2-cu-ogo"/>
+                                </constraints>
+                            </view>
                         </subviews>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
@@ -130,7 +148,9 @@
                             <constraint firstAttribute="bottom" secondItem="CS9-1I-B48" secondAttribute="bottom" constant="10" 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="11" id="gf9-Gz-x7R"/>
+                            <constraint firstItem="ay0-L4-b3f" firstAttribute="centerY" secondItem="dMT-VK-l9k" secondAttribute="centerY" id="jIr-kE-YQZ"/>
                             <constraint firstItem="dMT-VK-l9k" firstAttribute="leading" secondItem="ltT-kf-P7C" secondAttribute="trailing" constant="5" id="nVb-RO-bhR"/>
+                            <constraint firstItem="ay0-L4-b3f" firstAttribute="leading" secondItem="dMT-VK-l9k" secondAttribute="trailing" constant="6" id="utq-Wc-6C9"/>
                             <constraint firstItem="CS9-1I-B48" firstAttribute="top" secondItem="dMT-VK-l9k" secondAttribute="bottom" constant="8" id="vO4-d5-COg"/>
                             <constraint firstItem="dMT-VK-l9k" firstAttribute="centerY" secondItem="ltT-kf-P7C" secondAttribute="centerY" id="zc4-aL-rgC"/>
                         </constraints>
@@ -150,6 +170,11 @@
             </tableViewCellContentView>
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <connections>
+                <outlet property="contentLabel" destination="EsB-Oa-Z2T" id="1cB-Q6-0hE"/>
+                <outlet property="emptyView" destination="hQW-1x-wjy" id="6lZ-04-MNt"/>
+                <outlet property="starView" destination="ay0-L4-b3f" id="CV2-cE-TLq"/>
+            </connections>
             <point key="canvasLocation" x="131.15942028985509" y="120.87053571428571"/>
         </tableViewCell>
     </objects>

+ 0 - 23
KulexiuForTeacher/KulexiuForTeacher/Module/Course/Controller/AccompanyDetailViewController.h

@@ -1,23 +0,0 @@
-//
-//  AccompanyDetailViewController.h
-//  KulexiuForTeacher
-//
-//  Created by 王智 on 2022/4/6.
-//
-
-#import "KSBaseViewController.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/// 陪练课详情
-@interface AccompanyDetailViewController : KSBaseViewController
-
-@property (nonatomic, strong) NSString *courseId;
-
-@property (nonatomic, strong) NSString *courseGroupId;
-
-@property (nonatomic, strong) NSString *studentId;
-
-@end
-
-NS_ASSUME_NONNULL_END