Steven 3 éve
szülő
commit
4f1e1cf0b6
19 módosított fájl, 177 hozzáadás és 9 törlés
  1. BIN
      KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate
  2. 2 2
      KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 6 0
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/Contents.json
  4. 22 0
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alertTips.imageset/Contents.json
  5. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alertTips.imageset/image_alertTips@2x.png
  6. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alertTips.imageset/image_alertTips@3x.png
  7. 22 0
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_camera.imageset/Contents.json
  8. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_camera.imageset/image_alert_camera@2x.png
  9. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_camera.imageset/image_alert_camera@3x.png
  10. 22 0
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_mic.imageset/Contents.json
  11. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_mic.imageset/image_alert_mic@2x.png
  12. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_mic.imageset/image_alert_mic@3x.png
  13. 4 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.h
  14. 92 5
      KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m
  15. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyCourseInfoCell.h
  16. 0 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyCourseInfoCell.m
  17. 1 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyDetailBottomView.xib
  18. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Home/EvaluateCourse/Controller/EvaluateDetailViewController.m
  19. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Home/Homework/Controller/HomeworkDetailViewController.m

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


+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -90,8 +90,8 @@
             filePath = "KulexiuForTeacher/Module/Home/EvaluateCourse/Controller/EvaluateDetailViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "104"
-            endingLineNumber = "104"
+            startingLineNumber = "106"
+            endingLineNumber = "106"
             landmarkName = "-evaluateAction:"
             landmarkType = "7">
          </BreakpointContent>

+ 6 - 0
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 22 - 0
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alertTips.imageset/Contents.json

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

BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alertTips.imageset/image_alertTips@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alertTips.imageset/image_alertTips@3x.png


+ 22 - 0
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_camera.imageset/Contents.json

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

BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_camera.imageset/image_alert_camera@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_camera.imageset/image_alert_camera@3x.png


+ 22 - 0
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_mic.imageset/Contents.json

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

BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_mic.imageset/image_alert_mic@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/CustomAlert/image_alert_mic.imageset/image_alert_mic@3x.png


+ 4 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.h

@@ -18,6 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *studentId;
 
+@property (nonatomic, assign) NSInteger joinRoomBeforeTime; // 上课开始时间
+
+@property (nonatomic, assign) NSInteger quitRomeEndTime;    // 下课截止时间
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 92 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -19,6 +19,8 @@
 #import "AccompanyDetailBottomView.h"
 #import "KSChatConversationViewController.h"
 #import "WMPlayer.h"
+#import "RecordCheckManager.h"
+#import "KSPremissionAlert.h"
 
 @interface AccompanyDetailViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate>
 {
@@ -116,6 +118,24 @@
     }];
 }
 
+- (void)evaluateWithStatusLabel:(UILabel *)statusLabel {
+    if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
+        statusLabel.text = @"已结束";
+        statusLabel.textColor = HexRGB(0x999999);
+        [self.bottomView.sureButton setBackgroundColor:HexRGB(0xd5d5d5)];
+    }
+    else if ([self.homeworkModel.courseStatus isEqualToString:@"ING"]) {
+        statusLabel.text = @"进行中";
+        statusLabel.textColor = THEMECOLOR;
+        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
+    }
+    else {
+        statusLabel.text = @"未开始";
+        statusLabel.textColor = HexRGB(0xff802c);
+        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
+    }
+}
+
 
 #pragma mark --- table data source
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -125,6 +145,7 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     if (indexPath.row == 0) {
         AccompanyCourseInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyCourseInfoCell"];
+        [self evaluateWithStatusLabel:cell.statusLabel];
         [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;
@@ -252,6 +273,14 @@
 
 // 评价作业
 - (void)evaluateHomework {
+    if (self.homeworkModel.decorateHomework == 0) {
+        [self MBPShow:@"您还未布置作业"];
+        return;
+    }
+    else if (self.homeworkModel.submitHomework == 0) {
+        [self MBPShow:@"学生还未提交作业"];
+        return;
+    }
     self.alertView = [AccompanyAlertView shareInstance];
     self.alertView.alertTitle.text = @"作业点评";
     self.alertView.tipsLabel.text = @"请输入您对本次作业的点评";
@@ -358,9 +387,8 @@
         [_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];
-        _tableView.tableFooterView = bottomView;
+        self.bottomView.frame = CGRectMake(0, 0, kScreenWidth, 70);
+        self.tableView.tableFooterView = self.bottomView;
     }
     return _tableView;
 }
@@ -381,15 +409,74 @@
         _bottomView = [AccompanyDetailBottomView shareInstance];
         MJWeakSelf;
         [_bottomView joinroomCallback:^{
-            [weakSelf joinRoomAction];
+            [weakSelf tryJoinRoom];
         }];
     }
     return _bottomView;
 }
 
-- (void)joinRoomAction {
+- (void)tryJoinRoom {
+    [self joinClassRoom];
+    return;
+    NSDateFormatter *dateFormatter = [NSObject getDateformatter];
+    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
+    NSDate *beginDate = [dateFormatter dateFromString:self.homeworkModel.startTime];
+    NSDate *endDate = [dateFormatter dateFromString:self.homeworkModel.endTime];
+    NSDate *currentDate = [NSDate date];
+    NSTimeInterval beginTimeInterval = [beginDate timeIntervalSinceDate:currentDate];
+    NSTimeInterval endTimeInterval = [currentDate timeIntervalSinceDate:endDate];
+    if (beginTimeInterval <= self.joinRoomBeforeTime * 60 && endTimeInterval < 0) {
+        [self joinClassRoom];
+    }
+    else if (endTimeInterval > 0) {
+        [self MBPShow:@"该课程已结束"];
+    }
+    else {
+        NSString *tipsString = [NSString stringWithFormat:@"课程还未开始,请在上课前%zd分钟进入", self.joinRoomBeforeTime];
+        [self MBPShow:tipsString];
+    }
+}
+
+// 加入房间
+- (void)joinClassRoom {
+    // 加入房间前判断摄像头和麦克风逻辑
+    PREMISSIONTYPE micEnable = [RecordCheckManager checkPermissionShowAlert:NO showInView:nil];
+    PREMISSIONTYPE cameraEnable = [RecordCheckManager checkCameraPremissionAvaiable:NO showInView:nil];
+    if (micEnable == PREMISSIONTYPE_YES && cameraEnable == PREMISSIONTYPE_YES) {
+        // 进入教室
+        // 判断是否进行课前检测
+        
+//        [self.classManager joinRoomWithId:[NSString stringWithFormat:@"%zd", self.courseMessage.internalBaseClassIdentifier] subjectName:self.courseMessage.subjectName subjectId:self.courseMessage.subjectId classEndTime:self.courseMessage.endClassTime quitEndTime:self.quitRomeEndTime inViewController:self];
+    }
+    else {
+        if (micEnable == PREMISSIONTYPE_NO && cameraEnable == PREMISSIONTYPE_NO) { // 如果麦克风权限和摄像头权限都没有
+            [self showAlertWithMessage:@"请开启相机和麦克风访问权限" type:CHECKDEVICETYPE_BOTH];
+        }
+        else if (micEnable == PREMISSIONTYPE_NO) { // 如果没有麦克风权限
+            [self showAlertWithMessage:@"请开启麦克风访问权限" type:CHECKDEVICETYPE_MIC];
+        }
+        else if (cameraEnable == PREMISSIONTYPE_NO) { // 如果没有摄像头权限
+            [self showAlertWithMessage:@"请开启相机访问权限" type:CHECKDEVICETYPE_CAMREA];
+        }
+    }
+}
+
+- (void)showAlertWithMessage:(NSString *)message type:(CHECKDEVICETYPE)deviceType {
+    [KSPremissionAlert shareInstanceDisplayImage:deviceType message:message showInView:self.view cancel:^{
+        
+    } confirm:^{
+        [self openSettingView];
+    }];
     
 }
+
+- (void)openSettingView {
+    if (@available(iOS 10, *)) {
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
+    } else {
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    }
+}
 /*
 #pragma mark - Navigation
 

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

@@ -13,6 +13,8 @@ typedef void(^AccompanyChatCallback)(void);
 
 @interface AccompanyCourseInfoCell : UITableViewCell
 
+@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
+
 @property (nonatomic, assign) BOOL hideChatButton;
 
 - (void)configWithStartTime:(NSString *)beginTime endTime:(NSString *)endTime studentAvatar:(NSString *)studentAvatar studentName:(NSString *)studentName studentId:(NSString *)studentId studentSubject:(NSString *)studentSubject;

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

@@ -13,7 +13,6 @@
 @property (weak, nonatomic) IBOutlet UIImageView *studentAvatar;
 @property (weak, nonatomic) IBOutlet UILabel *studentName;
 @property (weak, nonatomic) IBOutlet UILabel *studentSubject;
-@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
 
 @property (weak, nonatomic) IBOutlet UIButton *chatButton;
 

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyDetailBottomView.xib

@@ -11,7 +11,7 @@
         <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"/>
+            <autoresizingMask key="autoresizingMask"/>
             <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"/>

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/EvaluateCourse/Controller/EvaluateDetailViewController.m

@@ -66,6 +66,8 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     if (indexPath.row == 0) { // 课程信息
         AccompanyCourseInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyCourseInfoCell"];
+        cell.statusLabel.text = @"已结束";
+        cell.statusLabel.textColor = HexRGB(0x999999);
 //        [cell configWithStartTime:self.detailModel.startTime endTime:self.detailModel.endTime studentAvatar:self.detailModel.studentAvatar studentName:self.detailModel.studentName studentId:self.detailModel.studentId studentSubject:self.detailModel.subjectName];
         cell.hideChatButton = YES;
         return cell;

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Homework/Controller/HomeworkDetailViewController.m

@@ -98,6 +98,8 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     if (indexPath.row == 0) { // 课程信息
         AccompanyCourseInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyCourseInfoCell"];
+        cell.statusLabel.text = @"已结束";
+        cell.statusLabel.textColor = HexRGB(0x999999);
         [cell configWithStartTime:self.detailModel.startTime endTime:self.detailModel.endTime studentAvatar:self.detailModel.studentAvatar studentName:self.detailModel.studentName studentId:self.detailModel.studentId studentSubject:self.detailModel.subjectName];
         cell.hideChatButton = YES;
         return cell;