@@ -121,15 +121,15 @@ - (void)setSearchPros:(PublicSearchModel *)searchPros{
121
121
case eSearchType_Task:
122
122
[self .dateSource addObjectsFromArray: _searchPros.tasks.list];
123
123
break ;
124
- case eSearchType_Topic:
125
- [self .dateSource addObjectsFromArray: _searchPros.project_topics.list];
126
- break ;
124
+ // case eSearchType_Topic:
125
+ // [self.dateSource addObjectsFromArray:_searchPros.project_topics.list];
126
+ // break;
127
127
case eSearchType_Merge:
128
128
[self .dateSource addObjectsFromArray: _searchPros.merge_requests.list];
129
129
break ;
130
- case eSearchType_Pull:
131
- [self .dateSource addObjectsFromArray: _searchPros.pull_requests.list];
132
- break ;
130
+ // case eSearchType_Pull:
131
+ // [self.dateSource addObjectsFromArray:_searchPros.pull_requests.list];
132
+ // break;
133
133
default :
134
134
break ;
135
135
}
@@ -185,18 +185,18 @@ - (void)loadMore {
185
185
currentPage=[_searchPros.tasks.page intValue ];
186
186
totalPage=[_searchPros.tasks.totalPage intValue ];
187
187
break ;
188
- case eSearchType_Topic:
189
- currentPage=[_searchPros.project_topics.page intValue ];
190
- totalPage=[_searchPros.project_topics.totalPage intValue ];
191
- break ;
188
+ // case eSearchType_Topic:
189
+ // currentPage=[_searchPros.project_topics.page intValue];
190
+ // totalPage=[_searchPros.project_topics.totalPage intValue];
191
+ // break;
192
192
case eSearchType_Merge:
193
193
currentPage=[_searchPros.merge_requests.page intValue ];
194
194
totalPage=[_searchPros.merge_requests.totalPage intValue ];
195
195
break ;
196
- case eSearchType_Pull:
197
- currentPage=[_searchPros.pull_requests.page intValue ];
198
- totalPage=[_searchPros.pull_requests.totalPage intValue ];
199
- break ;
196
+ // case eSearchType_Pull:
197
+ // currentPage=[_searchPros.pull_requests.page intValue];
198
+ // totalPage=[_searchPros.pull_requests.totalPage intValue];
199
+ // break;
200
200
default :
201
201
break ;
202
202
}
@@ -279,22 +279,22 @@ - (void)requestDataWithPage:(NSInteger)page {
279
279
}
280
280
weakSelf.isLoading = NO ;
281
281
}];
282
- }else if (_curSearchType==eSearchType_Pull){
283
- [[Coding_NetAPIManager sharedManager ] requestWithSearchString: _searchBarText typeStr: @" pr" andPage: page andBlock: ^(id data, NSError *error) {
284
- if (data) {
285
- NSDictionary *dataDic = (NSDictionary *)data;
286
- NSArray *resultA = [NSObject arrayFromJSON: dataDic[@" list" ] ofObjects: @" MRPR" ];
287
- [weakSelf.searchPros.pull_requests.list addObjectsFromArray: resultA];
288
- // 更新page
289
- weakSelf.searchPros .pull_requests .page = dataDic[@" page" ] ;
290
- weakSelf.searchPros .pull_requests .totalPage = dataDic[@" totalPage" ] ;
291
- [weakSelf.dateSource addObjectsFromArray: resultA];
292
- [weakSelf.searchTableView reloadData ];
293
- [weakSelf.searchTableView.infiniteScrollingView stopAnimating ];
294
- weakSelf.searchTableView .showsInfiniteScrolling = [weakSelf showTotalPage ];
295
- }
296
- weakSelf.isLoading = NO ;
297
- }];
282
+ // }else if(_curSearchType==eSearchType_Pull){
283
+ // [[Coding_NetAPIManager sharedManager] requestWithSearchString:_searchBarText typeStr:@"pr" andPage:page andBlock:^(id data, NSError *error) {
284
+ // if(data) {
285
+ // NSDictionary *dataDic = (NSDictionary *)data;
286
+ // NSArray *resultA = [NSObject arrayFromJSON:dataDic[@"list"] ofObjects:@"MRPR"];
287
+ // [weakSelf.searchPros.pull_requests.list addObjectsFromArray:resultA];
288
+ // //更新page
289
+ // weakSelf.searchPros.pull_requests.page = dataDic[@"page"] ;
290
+ // weakSelf.searchPros.pull_requests.totalPage = dataDic[@"totalPage"] ;
291
+ // [weakSelf.dateSource addObjectsFromArray:resultA];
292
+ // [weakSelf.searchTableView reloadData];
293
+ // [weakSelf.searchTableView.infiniteScrollingView stopAnimating];
294
+ // weakSelf.searchTableView.showsInfiniteScrolling = [weakSelf showTotalPage];
295
+ // }
296
+ // weakSelf.isLoading = NO;
297
+ // }];
298
298
}else if (_curSearchType==eSearchType_Task){
299
299
[[Coding_NetAPIManager sharedManager ] requestWithSearchString: _searchBarText typeStr: @" task" andPage: page andBlock: ^(id data, NSError *error) {
300
300
if (data) {
@@ -339,32 +339,32 @@ - (void)requestDataWithPage:(NSInteger)page {
339
339
}
340
340
weakSelf.isLoading = NO ;
341
341
}];
342
- }else if (_curSearchType==eSearchType_Topic){
343
- [[Coding_NetAPIManager sharedManager ] requestWithSearchString: _searchBarText typeStr: @" topic" andPage: page andBlock: ^(id data, NSError *error) {
344
- if (data) {
345
- NSDictionary *dataDic = (NSDictionary *)data;
346
- NSArray *resultA = [NSObject arrayFromJSON: dataDic[@" list" ] ofObjects: @" ProjectTopic" ];
347
-
348
- // topic 处理 content 关键字
349
- NSArray *resultTopic =dataDic[@" list" ];
350
- for (int i=0 ;i<[resultA count ];i++) {
351
- ProjectTopic *curTopic=[resultA objectAtIndex: i];
352
- if ([resultTopic count ]>i) {
353
- curTopic.contentStr = [[[resultTopic objectAtIndex: i] objectForKey: @" content" ] firstObject ];
354
- }
355
- }
356
-
357
- [weakSelf.searchPros.project_topics.list addObjectsFromArray: resultA];
358
- // 更新page
359
- weakSelf.searchPros .project_topics .page = dataDic[@" page" ] ;
360
- weakSelf.searchPros .project_topics .totalPage = dataDic[@" totalPage" ] ;
361
- [weakSelf.dateSource addObjectsFromArray: resultA];
362
- [weakSelf.searchTableView reloadData ];
363
- [weakSelf.searchTableView.infiniteScrollingView stopAnimating ];
364
- weakSelf.searchTableView .showsInfiniteScrolling = [weakSelf showTotalPage ];
365
- }
366
- weakSelf.isLoading = NO ;
367
- }];
342
+ // }else if(_curSearchType==eSearchType_Topic){
343
+ // [[Coding_NetAPIManager sharedManager] requestWithSearchString:_searchBarText typeStr:@"topic" andPage:page andBlock:^(id data, NSError *error) {
344
+ // if(data) {
345
+ // NSDictionary *dataDic = (NSDictionary *)data;
346
+ // NSArray *resultA = [NSObject arrayFromJSON:dataDic[@"list"] ofObjects:@"ProjectTopic"];
347
+ //
348
+ // //topic 处理 content 关键字
349
+ // NSArray *resultTopic =dataDic[@"list"];
350
+ // for (int i=0;i<[resultA count];i++) {
351
+ // ProjectTopic *curTopic=[resultA objectAtIndex:i];
352
+ // if ([resultTopic count]>i) {
353
+ // curTopic.contentStr= [[[resultTopic objectAtIndex:i] objectForKey:@"content"] firstObject];
354
+ // }
355
+ // }
356
+ //
357
+ // [weakSelf.searchPros.project_topics.list addObjectsFromArray:resultA];
358
+ // //更新page
359
+ // weakSelf.searchPros.project_topics.page = dataDic[@"page"] ;
360
+ // weakSelf.searchPros.project_topics.totalPage = dataDic[@"totalPage"] ;
361
+ // [weakSelf.dateSource addObjectsFromArray:resultA];
362
+ // [weakSelf.searchTableView reloadData];
363
+ // [weakSelf.searchTableView.infiniteScrollingView stopAnimating];
364
+ // weakSelf.searchTableView.showsInfiniteScrolling = [weakSelf showTotalPage];
365
+ // }
366
+ // weakSelf.isLoading = NO;
367
+ // }];
368
368
}else {
369
369
[self .searchTableView.infiniteScrollingView stopAnimating ];
370
370
self.searchTableView .showsInfiniteScrolling = NO ;
@@ -411,27 +411,27 @@ - (void)refreshHeaderTitle{
411
411
titleStr=[NSString stringWithFormat: @" 共搜索到 %ld 个与\" %@ \" 相关的任务" , [_searchPros.tasks.totalRow longValue ],_searchBarText];
412
412
}
413
413
break ;
414
- case eSearchType_Topic:
415
- if ([_searchPros.project_topics.totalRow longValue ]==0 ) {
416
- titleStr=nil ;
417
- }else {
418
- titleStr=[NSString stringWithFormat: @" 共搜索到 %ld 个与\" %@ \" 相关的讨论" , [_searchPros.project_topics.totalRow longValue ],_searchBarText];
419
- }
420
- break ;
414
+ // case eSearchType_Topic:
415
+ // if ([_searchPros.project_topics.totalRow longValue]==0) {
416
+ // titleStr=nil;
417
+ // }else{
418
+ // titleStr=[NSString stringWithFormat:@"共搜索到 %ld 个与\"%@\"相关的讨论", [_searchPros.project_topics.totalRow longValue],_searchBarText];
419
+ // }
420
+ // break;
421
421
case eSearchType_Merge:
422
422
if ([_searchPros.merge_requests.totalRow longValue ]==0 ) {
423
423
titleStr=nil ;
424
424
}else {
425
425
titleStr=[NSString stringWithFormat: @" 共搜索到 %ld 个与\" %@ \" 相关的合并请求" , [_searchPros.merge_requests.totalRow longValue ],_searchBarText];
426
426
}
427
427
break ;
428
- case eSearchType_Pull:
429
- if ([_searchPros.pull_requests.totalRow longValue ]==0 ) {
430
- titleStr=nil ;
431
- }else {
432
- titleStr=[NSString stringWithFormat: @" 共搜索到 %ld 个与\" %@ \" 相关的 Pull 请求" , [_searchPros.pull_requests.totalRow longValue ],_searchBarText];
433
- }
434
- break ;
428
+ // case eSearchType_Pull:
429
+ // if ([_searchPros.pull_requests.totalRow longValue]==0) {
430
+ // titleStr=nil;
431
+ // }else{
432
+ // titleStr=[NSString stringWithFormat:@"共搜索到 %ld 个与\"%@\"相关的 Pull 请求", [_searchPros.pull_requests.totalRow longValue],_searchBarText];
433
+ // }
434
+ // break;
435
435
default :
436
436
break ;
437
437
}
@@ -456,15 +456,15 @@ -(BOOL)showTotalPage{
456
456
case eSearchType_Task:
457
457
return _searchPros.tasks .page <_searchPros.tasks .totalPage ;
458
458
break ;
459
- case eSearchType_Topic:
460
- return _searchPros.project_topics .page <_searchPros.project_topics .totalPage ;
461
- break ;
459
+ // case eSearchType_Topic:
460
+ // return _searchPros.project_topics.page<_searchPros.project_topics.totalPage;
461
+ // break;
462
462
case eSearchType_Merge:
463
463
return _searchPros.merge_requests .page <_searchPros.merge_requests .totalPage ;
464
464
break ;
465
- case eSearchType_Pull:
466
- return _searchPros.pull_requests .page <_searchPros.pull_requests .totalPage ;
467
- break ;
465
+ // case eSearchType_Pull:
466
+ // return _searchPros.pull_requests.page<_searchPros.pull_requests.totalPage;
467
+ // break;
468
468
default :
469
469
return NO ;
470
470
break ;
@@ -489,15 +489,15 @@ -(BOOL)noEmptyList{
489
489
case eSearchType_Task:
490
490
return [_searchPros.tasks.list count ];
491
491
break ;
492
- case eSearchType_Topic:
493
- return [_searchPros.project_topics.list count ];
494
- break ;
492
+ // case eSearchType_Topic:
493
+ // return [_searchPros.project_topics.list count];
494
+ // break;
495
495
case eSearchType_Merge:
496
496
return [_searchPros.merge_requests.list count ];
497
497
break ;
498
- case eSearchType_Pull:
499
- return [_searchPros.pull_requests.list count ];
500
- break ;
498
+ // case eSearchType_Pull:
499
+ // return [_searchPros.pull_requests.list count];
500
+ // break;
501
501
default :
502
502
return TRUE ;
503
503
break ;
@@ -550,24 +550,24 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
550
550
cell.task =task;
551
551
[tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
552
552
return cell;
553
- }else if (_curSearchType==eSearchType_Topic){
554
- TopicSearchCell *cell = [tableView dequeueReusableCellWithIdentifier: @" TopicSearchCell" forIndexPath: indexPath];
555
- ProjectTopic *topic =_dateSource[indexPath.row];
556
- cell.curTopic = topic;
557
- [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
558
- return cell;
553
+ // }else if(_curSearchType==eSearchType_Topic){
554
+ // TopicSearchCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TopicSearchCell" forIndexPath:indexPath];
555
+ // ProjectTopic *topic =_dateSource[indexPath.row];
556
+ // cell.curTopic = topic;
557
+ // [tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
558
+ // return cell;
559
559
}else if (_curSearchType==eSearchType_Merge){
560
560
PRMRSearchCell *cell = [tableView dequeueReusableCellWithIdentifier: @" PRMRSearchCell" forIndexPath: indexPath];
561
561
MRPR *curMRPR =_dateSource[indexPath.row];
562
562
cell.curMRPR = curMRPR;
563
563
[tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
564
564
return cell;
565
- }else if (_curSearchType==eSearchType_Pull){
566
- PRMRSearchCell *cell = [tableView dequeueReusableCellWithIdentifier: @" PRMRSearchCell" forIndexPath: indexPath];
567
- MRPR *curMRPR =_dateSource[indexPath.row];
568
- cell.curMRPR = curMRPR;
569
- [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
570
- return cell;
565
+ // }else if(_curSearchType==eSearchType_Pull){
566
+ // PRMRSearchCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PRMRSearchCell" forIndexPath:indexPath];
567
+ // MRPR *curMRPR =_dateSource[indexPath.row];
568
+ // cell.curMRPR = curMRPR;
569
+ // [tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
570
+ // return cell;
571
571
}else {
572
572
return [[UITableViewCell alloc ] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: @" cell" ];
573
573
}
@@ -586,12 +586,12 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
586
586
}else if (_curSearchType==eSearchType_Task){
587
587
Task *task = _dateSource[indexPath.row];
588
588
return [TaskSearchCell cellHeightWithObj: task];
589
- }else if (_curSearchType==eSearchType_Topic){
590
- ProjectTopic *topic = _dateSource[indexPath.row];
591
- return [TopicSearchCell cellHeightWithObj: topic];
592
- }else if (_curSearchType==eSearchType_Pull){
593
- MRPR *mrpr = _dateSource[indexPath.row];
594
- return [PRMRSearchCell cellHeightWithObj: mrpr];
589
+ // }else if(_curSearchType==eSearchType_Topic){
590
+ // ProjectTopic *topic = _dateSource[indexPath.row];
591
+ // return [TopicSearchCell cellHeightWithObj:topic];
592
+ // }else if (_curSearchType==eSearchType_Pull){
593
+ // MRPR *mrpr = _dateSource[indexPath.row];
594
+ // return [PRMRSearchCell cellHeightWithObj:mrpr];
595
595
}else if (_curSearchType==eSearchType_Merge){
596
596
MRPR *mrpr = _dateSource[indexPath.row];
597
597
return [PRMRSearchCell cellHeightWithObj: mrpr];
0 commit comments