|
@@ -72,6 +72,8 @@
|
|
|
|
|
|
@property (nonatomic, assign) BOOL courseTimeFlag;
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL isFirstLoad;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation MyStyleViewController
|
|
@@ -80,8 +82,9 @@
|
|
|
[super viewDidLoad];
|
|
|
// Do any additional setup after loading the view.
|
|
|
self.ks_prefersNavigationBarHidden = YES;
|
|
|
+ self.isFirstLoad = YES;
|
|
|
[self configUI];
|
|
|
- [self requestMyStyle];
|
|
|
+ [self requestMyStyleRefreshTimeFlag:NO];
|
|
|
[self countUMEvent];
|
|
|
}
|
|
|
|
|
@@ -92,6 +95,10 @@
|
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
|
[super viewWillAppear:animated];
|
|
|
[self requestUserMessage];
|
|
|
+ if (self.isFirstLoad == NO) {
|
|
|
+ [self requestMyStyleRefreshTimeFlag:YES];
|
|
|
+ }
|
|
|
+ self.isFirstLoad = NO;
|
|
|
}
|
|
|
|
|
|
- (void)configUI {
|
|
@@ -123,7 +130,7 @@
|
|
|
[self.infoHeadView configUserMessage:self.mineInfo];
|
|
|
}
|
|
|
|
|
|
-- (void)requestMyStyle {
|
|
|
+- (void)requestMyStyleRefreshTimeFlag:(BOOL)refreshTimeFlag {
|
|
|
[LOADING_MANAGER showHUD];
|
|
|
[KSNetworkingManager queryTeacherStyleRequest:KS_GET success:^(NSDictionary * _Nonnull dic) {
|
|
|
[LOADING_MANAGER removeHUD];
|
|
@@ -131,16 +138,18 @@
|
|
|
NSDictionary *result = [dic ks_dictionaryValueForKey:@"data"];
|
|
|
NSString *subjectIds = [result ks_stringValueForKey:@"subjectId"];
|
|
|
NSString *subjectNames = [result ks_stringValueForKey:@"subjectName"];
|
|
|
- [self configWithSubjectMessage:subjectIds subjectName:subjectNames];
|
|
|
- self.courseTimeFlag = [result ks_boolValueForKey:@"courseTimeFlag"];
|
|
|
- // introduction
|
|
|
- self.content = [result ks_stringValueForKey:@"introduction"];
|
|
|
- NSArray *videoList = [result ks_arrayValueForKey:@"styleVideo"];
|
|
|
- [self.videoArray removeAllObjects];
|
|
|
- for (NSDictionary *parm in videoList) {
|
|
|
- StyleVideoModel *model = [[StyleVideoModel alloc] initWithDictionary:parm];
|
|
|
- [self.videoArray addObject:model];
|
|
|
+ if (refreshTimeFlag == NO) { // 刷新约课时间时,不处理其他刷新 避免修改数据被刷新
|
|
|
+ [self configWithSubjectMessage:subjectIds subjectName:subjectNames];
|
|
|
+ // introduction
|
|
|
+ self.content = [result ks_stringValueForKey:@"introduction"];
|
|
|
+ NSArray *videoList = [result ks_arrayValueForKey:@"styleVideo"];
|
|
|
+ [self.videoArray removeAllObjects];
|
|
|
+ for (NSDictionary *parm in videoList) {
|
|
|
+ StyleVideoModel *model = [[StyleVideoModel alloc] initWithDictionary:parm];
|
|
|
+ [self.videoArray addObject:model];
|
|
|
+ }
|
|
|
}
|
|
|
+ self.courseTimeFlag = [result ks_boolValueForKey:@"courseTimeFlag"];
|
|
|
}
|
|
|
else {
|
|
|
[LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
|