Commit dc0a557f419c607de9d3df63d3b1105f02eb0214
1 parent
21685f37
修复积分bug0.3.0
Showing
4 changed files
with
24 additions
and
1 deletions
CNLiveCMineModule.podspec
CNLiveCMineModule/Classes/CNCMine/Present/CNMinePresent.h
CNLiveCMineModule/Classes/CNCMine/Present/CNMinePresent.m
| ... | ... | @@ -640,4 +640,21 @@ |
| 640 | 640 | |
| 641 | 641 | }]; |
| 642 | 642 | } |
| 643 | + | |
| 644 | ++ (void)getTaskList | |
| 645 | +{ | |
| 646 | + NSDictionary *params = @{@"sid":CNUserShareModel.uid?CNUserShareModel.uid:@""}; | |
| 647 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNIntegralGetTasksUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 648 | + if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 649 | + if([responseObject isKindOfClass:[NSDictionary class]]){ | |
| 650 | + //存入任务列表 | |
| 651 | + if(responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]){ | |
| 652 | + [CNCSubMinePresent writeJsonName:@"TaskList.json" dic:responseObject[@"data"]]; | |
| 653 | + } | |
| 654 | + } | |
| 655 | + } | |
| 656 | + | |
| 657 | + }]; | |
| 658 | +} | |
| 659 | + | |
| 643 | 660 | @end | ... | ... |
CNLiveCMineModule/Classes/CNCMine/ViewController/CNLiveMineVC.m
| ... | ... | @@ -88,7 +88,9 @@ static NSString *const CNSobotNotification_NewMessage = @"CNSobotNotification_Ne |
| 88 | 88 | self.toolView.frame = CGRectMake(self.orderView.left, self.activityView.bottom + DS_adapt_length(16), self.orderView.width, DS_adapt_length(145 + 42*RATIO)); |
| 89 | 89 | self.versionLabel.frame = CGRectMake(self.orderView.left, self.toolView.bottom + DS_adapt_length(16), kScreenWidth, DS_adapt_length(16)); |
| 90 | 90 | self.bgScrollView.contentSize = CGSizeMake(kScreenWidth, self.versionLabel.bottom + DS_adapt_length(8)); |
| 91 | + [self getTaskList]; | |
| 91 | 92 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addTolks) name:CNSobotNotification_NewMessage object:nil]; |
| 93 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getTaskList) name:UIApplicationDidBecomeActiveNotification object:nil]; | |
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 96 | - (void)viewWillAppear:(BOOL)animated |
| ... | ... | @@ -155,6 +157,9 @@ static NSString *const CNSobotNotification_NewMessage = @"CNSobotNotification_Ne |
| 155 | 157 | { |
| 156 | 158 | return YES; |
| 157 | 159 | } |
| 160 | +- (void)getTaskList{ | |
| 161 | + [CNMinePresent getTaskList]; | |
| 162 | +} | |
| 158 | 163 | - (void)addTolks{ |
| 159 | 164 | if ([[CNLiveCMineService shareMineProtocol] haveUnreadMessage]) { |
| 160 | 165 | self.topImageView.codesView.model = [CNMinePresent dataSourceCodesModel:@"."]; | ... | ... |