|
@@ -35,6 +35,8 @@
|
|
|
|
|
|
@property (nonatomic, strong) NSString *subjectId;
|
|
|
|
|
|
+@property (nonatomic, assign) NSInteger subjectIndex;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation HomeArrangeLiveCourseView
|
|
@@ -69,16 +71,10 @@
|
|
|
[weakSelf.collectionView.mj_footer endRefreshingWithNoMoreData];
|
|
|
}
|
|
|
}];
|
|
|
- [self defaultSubject];
|
|
|
}
|
|
|
return self;
|
|
|
}
|
|
|
|
|
|
-- (void)defaultSubject {
|
|
|
- self.subjectId = USER_MANAGER.userInfo.subjectId;
|
|
|
- self.searchView.subjectLabel.text = [NSString returnNoNullStringWithString:USER_MANAGER.userInfo.subjectName];
|
|
|
-}
|
|
|
-
|
|
|
- (void)endRefresh {
|
|
|
@weakObj(self);
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
@@ -314,8 +310,8 @@
|
|
|
[nameArray addObject:[parm ks_stringValueForKey:@"subjectName"]];
|
|
|
}
|
|
|
MJWeakSelf;
|
|
|
- KSChoosePicker *picker = [[KSChoosePicker alloc] initWithTitle:@"" sourceData:nameArray lastChooseIndex:0 sureButtonColor:THEMECOLOR chooseReturnWithBlock:^(NSString * _Nonnull returnValue, NSInteger chooseIndex) {
|
|
|
-
|
|
|
+ KSChoosePicker *picker = [[KSChoosePicker alloc] initWithTitle:@"" sourceData:nameArray lastChooseIndex:self.subjectIndex sureButtonColor:THEMECOLOR chooseReturnWithBlock:^(NSString * _Nonnull returnValue, NSInteger chooseIndex) {
|
|
|
+ weakSelf.subjectIndex = chooseIndex;
|
|
|
weakSelf.searchView.subjectLabel.text = returnValue;
|
|
|
NSDictionary *parm = self.subjectList[chooseIndex];
|
|
|
weakSelf.subjectId = [parm ks_stringValueForKey:@"subjectId"];
|
|
@@ -330,6 +326,23 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)setSubjectList:(NSMutableArray *)subjectList {
|
|
|
+ _subjectList = subjectList;
|
|
|
+ [self defaultSubject:subjectList];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)defaultSubject:(NSMutableArray *)subjectList {
|
|
|
+
|
|
|
+ self.subjectId = USER_MANAGER.userInfo.subjectId;
|
|
|
+ self.searchView.subjectLabel.text = [NSString returnNoNullStringWithString:USER_MANAGER.userInfo.subjectName];
|
|
|
+ for (NSInteger index = 0; index < subjectList.count; index++) {
|
|
|
+ NSDictionary *parm = subjectList[index];
|
|
|
+ if ([[parm ks_stringValueForKey:@"subjectId"] isEqualToString:self.subjectId]) {
|
|
|
+ self.subjectIndex = index;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
/*
|
|
|
// Only override drawRect: if you perform custom drawing.
|
|
|
// An empty implementation adversely affects performance during animation.
|