|
@@ -46,8 +46,6 @@
|
|
|
|
|
|
@property (nonatomic, assign) BOOL isFirstLoad;
|
|
|
|
|
|
-@property (nonatomic, assign) BOOL tenantAlbumStatus; // 当前专辑状态 是否可用
|
|
|
-
|
|
|
@property (nonatomic, strong) NSMutableArray *sourceArray; // 分类数据
|
|
|
|
|
|
@property (nonatomic, assign) NSInteger albumCount; // 专辑数量
|
|
@@ -56,6 +54,8 @@
|
|
|
|
|
|
@property (nonatomic, strong) NSMutableArray *albumListArray; // 专辑数据
|
|
|
|
|
|
+@property (nonatomic, strong) GroupAlbumModel *albumModel; // 小组专辑信息
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation TenantDarkViewController
|
|
@@ -241,14 +241,22 @@
|
|
|
}
|
|
|
|
|
|
- (void)refreshWithModel:(GroupAlbumModel *)displayModel {
|
|
|
-
|
|
|
+ self.albumModel = displayModel;
|
|
|
self.chooseAlbumId = displayModel.internalBaseClassIdentifier;
|
|
|
UserDefaultSet(self.chooseAlbumId, TENANT_ALBUMID);
|
|
|
|
|
|
- self.tenantAlbumStatus = displayModel.status;
|
|
|
[self.navView configAlbumName:displayModel.name];
|
|
|
NSMutableArray *sourceArray = [NSMutableArray array];
|
|
|
NSMutableArray *aniArray = [NSMutableArray array];
|
|
|
+
|
|
|
+ // COURSEWARE
|
|
|
+ if (displayModel.coursewareCounts > 0) {
|
|
|
+ TenantAlbumModel *model = [[TenantAlbumModel alloc] init];
|
|
|
+ model.subjectType = @"COURSEWARE";
|
|
|
+ [sourceArray addObject:model];
|
|
|
+ [aniArray addObject:@"cloudCourse_Ani.json"];
|
|
|
+ }
|
|
|
+
|
|
|
// 声部
|
|
|
if (displayModel.subjectCounts > 0) {
|
|
|
TenantAlbumModel *model = [[TenantAlbumModel alloc] init];
|
|
@@ -273,14 +281,6 @@
|
|
|
[aniArray addObject:@"mutiMusic_Ani.json"];
|
|
|
}
|
|
|
|
|
|
- // COURSEWARE
|
|
|
- if (displayModel.coursewareCounts > 0) {
|
|
|
- TenantAlbumModel *model = [[TenantAlbumModel alloc] init];
|
|
|
- model.subjectType = @"COURSEWARE";
|
|
|
- [sourceArray addObject:model];
|
|
|
- [aniArray addObject:@"cloudCourse_Ani.json"];
|
|
|
- }
|
|
|
-
|
|
|
self.sourceArray = [NSMutableArray arrayWithArray:sourceArray];
|
|
|
self.animationNameArray = [NSMutableArray arrayWithArray:aniArray];
|
|
|
[self.pagerView reloadData];
|
|
@@ -349,7 +349,7 @@
|
|
|
}
|
|
|
|
|
|
- (__kindof UICollectionViewCell *)pagerView:(TYCyclePagerView *)pagerView cellForItemAtIndex:(NSInteger)index {
|
|
|
- BOOL isLock = self.tenantAlbumStatus == YES ? NO : YES;
|
|
|
+ BOOL isLock = self.albumModel.status == YES ? NO : YES;
|
|
|
TenantHomeSubjectListCell *cell = [pagerView dequeueReusableCellWithReuseIdentifier:@"TenantHomeSubjectListCell" forIndex:index];
|
|
|
[cell configWithJsonSting:self.animationNameArray[index] isLock:isLock];
|
|
|
if (pagerView.curIndex == index) {
|
|
@@ -376,13 +376,13 @@
|
|
|
|
|
|
- (void)pagerView:(TYCyclePagerView *)pageView didSelectedItemCell:(__kindof UICollectionViewCell *)cell atIndex:(NSInteger)index {
|
|
|
|
|
|
- BOOL isLock = self.tenantAlbumStatus == YES ? NO : YES;
|
|
|
+ BOOL isLock = self.albumModel.status == YES ? NO : YES;
|
|
|
if (isLock) {
|
|
|
TenantAlbumModel *model = self.sourceArray[index];
|
|
|
NSString *subjectType = model.subjectType;
|
|
|
|
|
|
KSBaseWKWebViewController *ctrl = [[KSBaseWKWebViewController alloc] init];
|
|
|
- ctrl.url = [NSString stringWithFormat:@"%@%@?subjectType=%@&albumId=%@",TENANT_WEBHOST,@"/#/train-tool",subjectType,self.chooseAlbumId];
|
|
|
+ ctrl.url = [NSString stringWithFormat:@"%@%@?subjectType=%@&albumId=%@",TENANT_WEBHOST,@"/#/train-tool",subjectType,self.albumModel.internalBaseClassIdentifier];
|
|
|
[self.navigationController pushViewController:ctrl animated:YES];
|
|
|
}
|
|
|
else { // 跳转到对应页面
|
|
@@ -390,12 +390,12 @@
|
|
|
NSString *subjectType = model.subjectType;
|
|
|
if ([subjectType isEqualToString:@"COURSEWARE"]) { // 云教程
|
|
|
KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
|
|
|
- webCtrl.url = [NSString stringWithFormat:@"%@/#/lessonCourseware?albumId=%@", TENANT_WEBHOST, self.chooseAlbumId];
|
|
|
+ webCtrl.url = [NSString stringWithFormat:@"%@/#/lessonCourseware?albumId=%@", TENANT_WEBHOST, self.albumModel.internalBaseClassIdentifier];
|
|
|
[self.navigationController pushViewController:webCtrl animated:YES];
|
|
|
}
|
|
|
else {
|
|
|
KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
|
|
|
- webCtrl.url = [NSString stringWithFormat:@"%@/#/train-list?subjectType=%@&albumId=%@", TENANT_WEBHOST,subjectType, self.chooseAlbumId];
|
|
|
+ webCtrl.url = [NSString stringWithFormat:@"%@/#/train-list?subjectType=%@&albumId=%@", TENANT_WEBHOST,subjectType, self.albumModel.internalBaseClassIdentifier];
|
|
|
[self.navigationController pushViewController:webCtrl animated:YES];
|
|
|
}
|
|
|
|