Commit fedc545b0dd986c87fc4e33ccc8c931ceb30a04d
1 parent
ab24e86d
no message
Showing
2 changed files
with
18 additions
and
17 deletions
CNLiveIntegralModule/Classes/Controller/CNLiveIntegralDetailsController.h
CNLiveIntegralModule/Classes/Controller/CNLiveTaskListController.m
| ... | ... | @@ -122,29 +122,32 @@ |
| 122 | 122 | [CNLiveNetworking setAllowRequestDefaultArgument:YES]; |
| 123 | 123 | [CNLiveNetworking setupShowDataResult:NO]; |
| 124 | 124 | [QMUITips showLoadingInView:self.view]; |
| 125 | + __weak typeof(self) weakSelf = self; | |
| 125 | 126 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNIntegralGetTasksUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { |
| 126 | - [QMUITips hideAllTipsInView:self.view]; | |
| 127 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 128 | + if(!strongSelf) return ; | |
| 129 | + [QMUITips hideAllTipsInView:strongSelf.view]; | |
| 127 | 130 | |
| 128 | 131 | if (error) { |
| 129 | 132 | if (error.code == -1001||error.code == -1003||error.code == -1009) { |
| 130 | - [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoNet noData:self.data.count == 0 block:^{ | |
| 133 | + [strongSelf.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoNet noData:strongSelf.data.count == 0 block:^{ | |
| 131 | 134 | [self loadData]; |
| 132 | 135 | }]; |
| 133 | 136 | }else{ |
| 134 | - [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeLoadFail noData:self.data.count == 0 block:^{ | |
| 135 | - [self loadData]; | |
| 137 | + [strongSelf.tableView showEmptyViewWithType:CNLiveCustomTipsTypeLoadFail noData:strongSelf.data.count == 0 block:^{ | |
| 138 | + [strongSelf loadData]; | |
| 136 | 139 | }]; |
| 137 | 140 | } |
| 138 | - self.tableView.emptyView.backgroundColor = [UIColor whiteColor]; | |
| 141 | + strongSelf.tableView.emptyView.backgroundColor = [UIColor whiteColor]; | |
| 139 | 142 | return; |
| 140 | 143 | } |
| 141 | 144 | if(responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]){ |
| 142 | 145 | CNLiveTaskListModel *model = [CNLiveTaskListModel mj_objectWithKeyValues:responseObject[@"data"]]; |
| 143 | - [self.data addObject:model]; | |
| 144 | - self.headView.score = model.integral; | |
| 145 | - [self.tableView reloadData]; | |
| 146 | - [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoData noData:self.data.count == 0 block:nil]; | |
| 147 | - self.tableView.emptyView.backgroundColor = [UIColor whiteColor]; | |
| 146 | + [strongSelf.data addObject:model]; | |
| 147 | + strongSelf.headView.score = model.integral; | |
| 148 | + [strongSelf.tableView reloadData]; | |
| 149 | + [strongSelf.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoData noData:strongSelf.data.count == 0 block:nil]; | |
| 150 | + strongSelf.tableView.emptyView.backgroundColor = [UIColor whiteColor]; | |
| 148 | 151 | |
| 149 | 152 | if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { |
| 150 | 153 | if([responseObject isKindOfClass:[NSDictionary class]]){ |
| ... | ... | @@ -286,11 +289,11 @@ |
| 286 | 289 | } |
| 287 | 290 | |
| 288 | 291 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ |
| 289 | - return 0.1; // 注意要设置为0.1,不能设置为0 | |
| 292 | + return 0.1; | |
| 290 | 293 | } |
| 291 | 294 | |
| 292 | 295 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ |
| 293 | - return 45.0; // 注意要设置为0.1,不能设置为0 | |
| 296 | + return 45.0; | |
| 294 | 297 | } |
| 295 | 298 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| 296 | 299 | return 70; |
| ... | ... | @@ -383,10 +386,6 @@ |
| 383 | 386 | return _headView; |
| 384 | 387 | } |
| 385 | 388 | |
| 386 | -- (UIImage *)navigationBarBackgroundImage{ | |
| 387 | - return [UIImage imageWithColor:[UIColor clearColor]]; | |
| 388 | -} | |
| 389 | - | |
| 390 | 389 | - (UIStatusBarStyle)preferredStatusBarStyle{ |
| 391 | 390 | return UIStatusBarStyleLightContent; |
| 392 | 391 | } | ... | ... |