|
@@ -52,43 +52,46 @@
|
|
|
// time
|
|
|
[self evaluateTimeLabelWithBeginTime:model.startTime endTime:model.endTime];
|
|
|
|
|
|
+ self.opreationButton.userInteractionEnabled = NO;
|
|
|
+ self.opreationButton.hidden = YES;
|
|
|
+
|
|
|
if ([model.status isEqualToString:@"NOT_START"]) { // 未开始
|
|
|
self.courseStatus.text = @"未开始";
|
|
|
self.courseStatus.textColor = HexRGB(0xff802C);
|
|
|
|
|
|
self.type = ACCOMPANY_DETAIL;
|
|
|
- self.opreationButton.userInteractionEnabled = YES;
|
|
|
- [self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
|
+
|
|
|
+// [self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
|
}
|
|
|
else if ([model.status isEqualToString:@"ING"]) { // 进行中
|
|
|
self.courseStatus.text = @"进行中";
|
|
|
self.courseStatus.textColor = THEMECOLOR;
|
|
|
self.type = ACCOMPANY_DETAIL;
|
|
|
- self.opreationButton.userInteractionEnabled = YES;
|
|
|
- [self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
|
+// self.opreationButton.userInteractionEnabled = YES;
|
|
|
+// [self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
|
}
|
|
|
else if ([model.status isEqualToString:@"COMPLETE"]) { // 已结束
|
|
|
self.courseStatus.text = @"已结束";
|
|
|
self.courseStatus.textColor = HexRGB(0x999999);
|
|
|
- // 判断显示评价还是已评价
|
|
|
- BOOL hasEvaluate = NO;
|
|
|
- if (hasEvaluate) {
|
|
|
- self.type = ACCOMPANY_DETAIL;
|
|
|
- self.opreationButton.userInteractionEnabled = YES;
|
|
|
- [self.opreationButton setTitle:@"评价" forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setTitleColor:THEMECOLOR forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setBackgroundColor:HexRGB(0xffffff)];
|
|
|
- }
|
|
|
- else {
|
|
|
- self.opreationButton.userInteractionEnabled = NO;
|
|
|
- [self.opreationButton setTitle:@"已评价" forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setTitleColor:THEMECOLOR forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setBackgroundColor:HexRGB(0xffffff)];
|
|
|
- }
|
|
|
+// // 判断显示评价还是已评价
|
|
|
+// BOOL hasEvaluate = NO;
|
|
|
+// if (hasEvaluate) {
|
|
|
+// self.type = ACCOMPANY_DETAIL;
|
|
|
+// self.opreationButton.userInteractionEnabled = YES;
|
|
|
+// [self.opreationButton setTitle:@"评价" forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setTitleColor:THEMECOLOR forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setBackgroundColor:HexRGB(0xffffff)];
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// self.opreationButton.userInteractionEnabled = NO;
|
|
|
+// [self.opreationButton setTitle:@"已评价" forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setTitleColor:THEMECOLOR forState:UIControlStateNormal];
|
|
|
+// [self.opreationButton setBackgroundColor:HexRGB(0xffffff)];
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -110,17 +113,30 @@
|
|
|
self.courseStatus.text = @"未开始";
|
|
|
self.courseStatus.textColor = HexRGB(0xff802C);
|
|
|
|
|
|
- self.type = ACCOMPANY_DETAIL;
|
|
|
- self.opreationButton.userInteractionEnabled = YES;
|
|
|
- [self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
- [self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
|
+ // 判断按钮显示调课还是进入教室
|
|
|
+ NSDate *currentDate = [NSDate date];
|
|
|
+ NSDate *beginDate = [self getCourseBeginDate:model.startTime];
|
|
|
+ NSTimeInterval beginTimeInterval = [beginDate timeIntervalSinceDate:currentDate];
|
|
|
+
|
|
|
+ if (beginTimeInterval < beforeTime * 60) {
|
|
|
+ self.type = ACCOMPANY_DETAIL;
|
|
|
+ self.opreationButton.userInteractionEnabled = YES;
|
|
|
+ self.opreationButton.hidden = NO;
|
|
|
+ [self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
+ [self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
+ [self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.opreationButton.userInteractionEnabled = NO;
|
|
|
+ self.opreationButton.hidden = YES;
|
|
|
+ }
|
|
|
}
|
|
|
else if ([model.status isEqualToString:@"ING"]) { // 进行中
|
|
|
self.courseStatus.text = @"进行中";
|
|
|
self.courseStatus.textColor = THEMECOLOR;
|
|
|
self.type = ACCOMPANY_DETAIL;
|
|
|
self.opreationButton.userInteractionEnabled = YES;
|
|
|
+ self.opreationButton.hidden = NO;
|
|
|
[self.opreationButton setTitle:@"进入教室" forState:UIControlStateNormal];
|
|
|
[self.opreationButton setTitleColor:HexRGB(0xffffff) forState:UIControlStateNormal];
|
|
|
[self.opreationButton setBackgroundColor:THEMECOLOR];
|
|
@@ -133,12 +149,14 @@
|
|
|
if (hasEvaluate) {
|
|
|
self.type = ACCOMPANY_DETAIL;
|
|
|
self.opreationButton.userInteractionEnabled = YES;
|
|
|
+ self.opreationButton.hidden = NO;
|
|
|
[self.opreationButton setTitle:@"评价" forState:UIControlStateNormal];
|
|
|
[self.opreationButton setTitleColor:THEMECOLOR forState:UIControlStateNormal];
|
|
|
[self.opreationButton setBackgroundColor:HexRGB(0xffffff)];
|
|
|
}
|
|
|
else {
|
|
|
self.opreationButton.userInteractionEnabled = NO;
|
|
|
+ self.opreationButton.hidden = NO;
|
|
|
[self.opreationButton setTitle:@"已评价" forState:UIControlStateNormal];
|
|
|
[self.opreationButton setTitleColor:THEMECOLOR forState:UIControlStateNormal];
|
|
|
[self.opreationButton setBackgroundColor:HexRGB(0xffffff)];
|