Commit ab24e86dbd39941d6d7cac87cffd233e4f75deb2

Authored by zhangxiaowen
1 parent 33d7b9fe

no message

CNLiveIntegralModule/Classes/Controller/CNLiveTaskListController.m
@@ -124,14 +124,18 @@ @@ -124,14 +124,18 @@
124 [QMUITips showLoadingInView:self.view]; 124 [QMUITips showLoadingInView:self.view];
125 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNIntegralGetTasksUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { 125 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNIntegralGetTasksUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
126 [QMUITips hideAllTipsInView:self.view]; 126 [QMUITips hideAllTipsInView:self.view];
127 - [self hideEmptyView];  
128 - if (error) {  
129 - if (self.data.count == 0) {  
130 - if (error.code == -1001) {  
131 - [self showEmptyViewWithImage:[UIImage imageNamed:@"dd_wlcw"] text:@"无法连接网络" detailText:@"别紧张,试试看刷新页面~" buttonTitle:@" 重试 " buttonAction:@selector(loadData)];  
132 - [self setCNAPIErrorEmptyView];  
133 - }  
134 - } 127 +
  128 + if (error) {
  129 + if (error.code == -1001||error.code == -1003||error.code == -1009) {
  130 + [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoNet noData:self.data.count == 0 block:^{
  131 + [self loadData];
  132 + }];
  133 + }else{
  134 + [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeLoadFail noData:self.data.count == 0 block:^{
  135 + [self loadData];
  136 + }];
  137 + }
  138 + self.tableView.emptyView.backgroundColor = [UIColor whiteColor];
135 return; 139 return;
136 } 140 }
137 if(responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]){ 141 if(responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]){
@@ -139,6 +143,9 @@ @@ -139,6 +143,9 @@
139 [self.data addObject:model]; 143 [self.data addObject:model];
140 self.headView.score = model.integral; 144 self.headView.score = model.integral;
141 [self.tableView reloadData]; 145 [self.tableView reloadData];
  146 + [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoData noData:self.data.count == 0 block:nil];
  147 + self.tableView.emptyView.backgroundColor = [UIColor whiteColor];
  148 +
142 if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { 149 if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) {
143 if([responseObject isKindOfClass:[NSDictionary class]]){ 150 if([responseObject isKindOfClass:[NSDictionary class]]){
144 //存入任务列表 151 //存入任务列表
CNLiveIntegralModule/Classes/View/CNLiveTaskListHeaderView.m
@@ -126,7 +126,8 @@ static const NSInteger margin = 15; @@ -126,7 +126,8 @@ static const NSInteger margin = 15;
126 _getScore.textColor = [UIColor whiteColor]; 126 _getScore.textColor = [UIColor whiteColor];
127 _getScore.font = UIFontMake(32); 127 _getScore.font = UIFontMake(32);
128 _getScore.userInteractionEnabled = YES; 128 _getScore.userInteractionEnabled = YES;
129 - 129 + _getScore.text = @"0.00";
  130 +
130 } 131 }
131 return _getScore; 132 return _getScore;
132 133