|
@@ -73,6 +73,10 @@
|
|
|
|
|
|
@property (nonatomic, strong) NSString *adjustEndTime; // 可调整结束时间
|
|
@property (nonatomic, strong) NSString *adjustEndTime; // 可调整结束时间
|
|
|
|
|
|
|
|
+@property (nonatomic, assign) NSInteger groupStartTime; // 小组课开课前可进入时间配置(分钟)
|
|
|
|
+
|
|
|
|
+@property (nonatomic, assign) NSInteger groupEndTime; // 小组课结束后退出时间配置(分钟)
|
|
|
|
+
|
|
@end
|
|
@end
|
|
|
|
|
|
@implementation CourseViewController
|
|
@implementation CourseViewController
|
|
@@ -373,9 +377,13 @@
|
|
|
|
|
|
self.liveStartTime = [config ks_integerValueForKey:@"liveStartTime"];
|
|
self.liveStartTime = [config ks_integerValueForKey:@"liveStartTime"];
|
|
self.liveEndTime = [config ks_integerValueForKey:@"liveEndTime"];
|
|
self.liveEndTime = [config ks_integerValueForKey:@"liveEndTime"];
|
|
|
|
+
|
|
self.pianoStartTime = [config ks_integerValueForKey:@"pianoStartTime"];
|
|
self.pianoStartTime = [config ks_integerValueForKey:@"pianoStartTime"];
|
|
self.pianoEndTime = [config ks_integerValueForKey:@"pianoEndTime"];
|
|
self.pianoEndTime = [config ks_integerValueForKey:@"pianoEndTime"];
|
|
|
|
|
|
|
|
+ self.groupStartTime = [config ks_integerValueForKey:@"groupStartTime"];
|
|
|
|
+ self.groupEndTime = [config ks_intValueForKey:@"groupEndTime"];
|
|
|
|
+
|
|
NSArray *courseArray = [[dic ks_dictionaryValueForKey:@"data"] ks_arrayValueForKey:@"studentList"];
|
|
NSArray *courseArray = [[dic ks_dictionaryValueForKey:@"data"] ks_arrayValueForKey:@"studentList"];
|
|
NSMutableArray *lessonArray = [NSMutableArray array];
|
|
NSMutableArray *lessonArray = [NSMutableArray array];
|
|
for (NSDictionary *parm in courseArray) {
|
|
for (NSDictionary *parm in courseArray) {
|
|
@@ -468,10 +476,11 @@
|
|
else { // 琴房课 PIANO_ROOM_CLASS
|
|
else { // 琴房课 PIANO_ROOM_CLASS
|
|
|
|
|
|
BOOL isGroup = [model.courseType isEqualToString:@"GROUP"] ? YES : NO;
|
|
BOOL isGroup = [model.courseType isEqualToString:@"GROUP"] ? YES : NO;
|
|
|
|
+ NSInteger beforeTime = isGroup ? self.groupStartTime : self.pianoStartTime;
|
|
MusicRoomCourseCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MusicRoomCourseCell"];
|
|
MusicRoomCourseCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MusicRoomCourseCell"];
|
|
MJWeakSelf;
|
|
MJWeakSelf;
|
|
- [cell configWithSource:model isGroup:isGroup beforeTime:self.pianoStartTime callback:^(NSString * _Nonnull targetId) {
|
|
|
|
- [weakSelf chatAction:targetId groupName:@"" isGroup:YES];
|
|
|
|
|
|
+ [cell configWithCourseMessage:model isGroup:isGroup beforeTime:beforeTime actionCallback:^(MUSIC_COURSE_TYPE type, TableCourseModel * _Nonnull courseModel) {
|
|
|
|
+ [weakSelf musicRoomAction:type source:courseModel];
|
|
}];
|
|
}];
|
|
return cell;
|
|
return cell;
|
|
}
|
|
}
|
|
@@ -491,18 +500,10 @@
|
|
[self liveCourseDetail:model.courseId courseGroupId:model.courseGoupId];
|
|
[self liveCourseDetail:model.courseId courseGroupId:model.courseGoupId];
|
|
}
|
|
}
|
|
else if ([model.courseType isEqualToString:@"GROUP"]) {
|
|
else if ([model.courseType isEqualToString:@"GROUP"]) {
|
|
- MusicRoomViewController *ctrl = [[MusicRoomViewController alloc] init];
|
|
|
|
- ctrl.courseType = MUTIL_COURSE_TYPE_GROUP;
|
|
|
|
- ctrl.courseId = model.courseId;
|
|
|
|
- ctrl.courseGroupId = model.courseGoupId;
|
|
|
|
- [self.navigationController pushViewController:ctrl animated:YES];
|
|
|
|
|
|
+ [self showMusicRoomDetail:model];
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- MusicRoomViewController *ctrl = [[MusicRoomViewController alloc] init];
|
|
|
|
- ctrl.courseType = MUTIL_COURSE_TYPE_MUSIC;
|
|
|
|
- ctrl.courseId = model.courseId;
|
|
|
|
- ctrl.courseGroupId = model.courseGoupId;
|
|
|
|
- [self.navigationController pushViewController:ctrl animated:YES];
|
|
|
|
|
|
+ [self showMusicRoomDetail:model];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -550,6 +551,45 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)musicRoomAction:(MUSIC_COURSE_TYPE)action source:(TableCourseModel *)source {
|
|
|
|
+ switch (action) {
|
|
|
|
+ case MUSIC_COURSE_TYPE_CHAT:
|
|
|
|
+ {
|
|
|
|
+ [self chatAction:source.imGroupId groupName:@"" isGroup:YES];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case MUSIC_COURSE_TYPE_ADJUST:
|
|
|
|
+ {
|
|
|
|
+ [self adjustCourseAction:source];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case MUSIC_COURSE_TYPE_DETAIL:
|
|
|
|
+ {
|
|
|
|
+ [self showMusicRoomDetail:source];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+- (void)showMusicRoomDetail:(TableCourseModel *)source {
|
|
|
|
+ if ([source.courseType isEqualToString:@"GROUP"]) {
|
|
|
|
+ MusicRoomViewController *ctrl = [[MusicRoomViewController alloc] init];
|
|
|
|
+ ctrl.courseType = MUTIL_COURSE_TYPE_GROUP;
|
|
|
|
+ ctrl.courseId = source.courseId;
|
|
|
|
+ ctrl.courseGroupId = source.courseGoupId;
|
|
|
|
+ [self.navigationController pushViewController:ctrl animated:YES];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ MusicRoomViewController *ctrl = [[MusicRoomViewController alloc] init];
|
|
|
|
+ ctrl.courseType = MUTIL_COURSE_TYPE_MUSIC;
|
|
|
|
+ ctrl.courseId = source.courseId;
|
|
|
|
+ ctrl.courseGroupId = source.courseGoupId;
|
|
|
|
+ [self.navigationController pushViewController:ctrl animated:YES];
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
- (void)adjustCourseAction:(TableCourseModel *)source {
|
|
- (void)adjustCourseAction:(TableCourseModel *)source {
|
|
// 获取当前课程的时间
|
|
// 获取当前课程的时间
|
|
NSString *formatString = @"yyyy-MM-dd HH:mm:ss";
|
|
NSString *formatString = @"yyyy-MM-dd HH:mm:ss";
|
|
@@ -636,7 +676,6 @@
|
|
switch (action) {
|
|
switch (action) {
|
|
case LIVECOURSEACTION_CHAT: // 聊天
|
|
case LIVECOURSEACTION_CHAT: // 聊天
|
|
{
|
|
{
|
|
-
|
|
|
|
[self chatAction:source.imGroupId groupName:@"" isGroup:YES];
|
|
[self chatAction:source.imGroupId groupName:@"" isGroup:YES];
|
|
}
|
|
}
|
|
break;
|
|
break;
|