Browse Source

课程详情进入教室按钮显示逻辑修改

Steven 7 tháng trước cách đây
mục cha
commit
248de0ddd7

+ 14 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -104,6 +104,7 @@
         else {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
+        [self evaluateViewDisplay];
         [self.tableView reloadData];
     } faliure:^(NSError * _Nonnull error) {
         
@@ -140,24 +141,31 @@
     }];
 }
 
+- (void)evaluateViewDisplay {
+    if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
+        self.tableView.tableFooterView = [UIView new];
+    }
+    else {
+        self.tableView.tableFooterView = self.bottomView;
+        self.bottomView.sureButton.userInteractionEnabled = YES;
+        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
+        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
+        [self.bottomView.sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    }
+}
+
 - (void)evaluateWithStatusLabel:(UILabel *)statusLabel {
     if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
         statusLabel.text = @"已结束";
         statusLabel.textColor = HexRGB(0x999999);
-        [self.bottomView.sureButton setTitle:@"已结束" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:HexRGB(0xd5d5d5)];
     }
     else if ([self.homeworkModel.courseStatus isEqualToString:@"ING"]) {
         statusLabel.text = @"进行中";
         statusLabel.textColor = THEMECOLOR;
-        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
     }
     else {
         statusLabel.text = @"未开始";
         statusLabel.textColor = HexRGB(0xff802c);
-        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
     }
 }
 

+ 4 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Course/MusicRoom/Controller/MusicRoomViewController.m

@@ -104,16 +104,14 @@
 
 - (void)evaluateBottomButtonStatus {
     if ([self.detailModel.courseStatus isEqualToString:@"COMPLETE"]) {
-        [self.bottomView.sureButton setTitle:@"已结束" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:HexRGB(0xd5d5d5)];
-    }
-    else if ([self.detailModel.courseStatus isEqualToString:@"ING"]) {
-        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
+        self.tableView.tableFooterView = [UIView new];
     }
     else {
+        self.tableView.tableFooterView = self.bottomView;
+        self.bottomView.sureButton.userInteractionEnabled = YES;
         [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
         [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
+        [self.bottomView.sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     }
 }
 

+ 14 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Course/VIPCourse/Controller/VipCouseDetailViewController.m

@@ -105,12 +105,26 @@
         else {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
+        [self evaluateViewDisplay];
         [self.tableView reloadData];
     } faliure:^(NSError * _Nonnull error) {
         
     }];
 }
 
+- (void)evaluateViewDisplay {
+    if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
+        self.tableView.tableFooterView = [UIView new];
+    }
+    else {
+        self.tableView.tableFooterView = self.bottomView;
+        self.bottomView.sureButton.userInteractionEnabled = YES;
+        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
+        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
+        [self.bottomView.sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    }
+}
+
 - (void)requestEvaluateMessage {
     [KSNetworkingManager selectRepliedRequest:KS_POST courseGroupId:self.courseGroupId courseScheduleId:self.courseId studentId:self.studentId success:^(NSDictionary * _Nonnull dic) {
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
@@ -145,20 +159,14 @@
     if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
         statusLabel.text = @"已结束";
         statusLabel.textColor = HexRGB(0x999999);
-        [self.bottomView.sureButton setTitle:@"已结束" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:HexRGB(0xd5d5d5)];
     }
     else if ([self.homeworkModel.courseStatus isEqualToString:@"ING"]) {
         statusLabel.text = @"进行中";
         statusLabel.textColor = THEMECOLOR;
-        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
     }
     else {
         statusLabel.text = @"未开始";
         statusLabel.textColor = HexRGB(0xff802c);
-        [self.bottomView.sureButton setTitle:@"进入教室" forState:UIControlStateNormal];
-        [self.bottomView.sureButton setBackgroundColor:THEMECOLOR];
     }
 }