Skip to content

Commit bc1bdd8

Browse files
committed
修改了删除相关资源的问题
1 parent 059795f commit bc1bdd8

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,6 @@
15391539
4E62410A1B74D65400E1533C /* search_tweet_like@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search_tweet_like@2x.png"; sourceTree = "<group>"; };
15401540
4E63189A1BDA198000EFED97 /* MRListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRListViewController.h; sourceTree = "<group>"; };
15411541
4E63189B1BDA198000EFED97 /* MRListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRListViewController.m; sourceTree = "<group>"; };
1542-
4E63189E1BDA199600EFED97 /* MRDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRDetailViewController.m; sourceTree = "<group>"; };
15431542
4E6318A01BDA261100EFED97 /* MRListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRListView.h; sourceTree = "<group>"; };
15441543
4E6318A11BDA261100EFED97 /* MRListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRListView.m; sourceTree = "<group>"; };
15451544
4E63839B1B3262D300D98648 /* taskPriority0@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "taskPriority0@2x.png"; sourceTree = "<group>"; };
@@ -4599,7 +4598,6 @@
45994598
4ECF70421B18514F000280FF /* PRListViewController.m */,
46004599
4E63189A1BDA198000EFED97 /* MRListViewController.h */,
46014600
4E63189B1BDA198000EFED97 /* MRListViewController.m */,
4602-
4E63189E1BDA199600EFED97 /* MRDetailViewController.m */,
46034601
4E4D6A5F1B1C65C100FD2E49 /* MRPRCommitsViewController.h */,
46044602
4E4D6A601B1C65C100FD2E49 /* MRPRCommitsViewController.m */,
46054603
4E4D6A621B1C65F700FD2E49 /* MRPRFilesViewController.h */,

Coding_iOS/Controllers/MRDetailViewController.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ - (void)viewDidLoad{
9090
self.activityPath = [NSString stringWithFormat:@"/api/user/%@/project/%@/git/merge/%@/activities", _curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
9191
self.diffPath = [NSString stringWithFormat:@"/api/user/%@/project/%@/git/merge/%@/commitDiffContent",_curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
9292
self.reviewGoodPath = [NSString stringWithFormat:@"/api/user/%@/project/%@/git/merge/%@/review_good",_curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
93-
__weak typeof(self) weakSelf = self;
9493
_myTableView = ({
9594
UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
9695
tableView.backgroundColor = kColorTableSectionBg;
@@ -210,7 +209,6 @@ - (void)updateProjectStatus {
210209
}
211210

212211
- (BOOL) shouldShowReviews {
213-
Reviewer* tmpReviewer;
214212
if(self.curReviewersInfo.reviewers.count + self.curReviewersInfo.volunteer_reviewers.count > 0) return YES;
215213
return NO;
216214
}
@@ -234,7 +232,6 @@ - (void)refresh{
234232
weakSelf.curMRPRInfo = data;
235233
NSMutableArray *resultA = weakSelf.curMRPRInfo.discussions;
236234
if(resultA != nil){
237-
BOOL flag = false;
238235
[weakSelf.allDiscussions removeAllObjects];
239236
if(weakSelf.allDiscussions == nil || weakSelf.allDiscussions.count <= 0) {
240237
for (int i = 0; i<resultA.count; i ++) {
@@ -275,7 +272,13 @@ - (void)refresh{
275272

276273
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.referencePath withParams:@{@"iid": _curMRPR.iid} withMethodType:Get andBlock:^(id data, NSError *error) {
277274
if (data) {
278-
weakSelf.resourceReference = [NSObject objectOfClass:@"ResourceReference" fromJSON:data[@"data"]];
275+
if (weakSelf.resourceReference == nil) {
276+
weakSelf.resourceReference = [NSObject objectOfClass:@"ResourceReference" fromJSON:data[@"data"]];
277+
} else {
278+
weakSelf.resourceReference = [NSObject objectOfClass:@"ResourceReference" fromJSON:data[@"data"]];
279+
[weakSelf.myTableView reloadData];
280+
}
281+
279282
}
280283
}];
281284

@@ -285,7 +288,6 @@ - (void)refresh{
285288
id resultData = [data valueForKeyPath:@"data"];
286289
NSMutableArray *resultA = [NSObject arrayFromJSON:resultData ofObjects:@"ProjectLineNote"];
287290
if(resultA != nil){
288-
BOOL flag = false;
289291
[weakSelf.activityCList removeAllObjects];
290292
if(weakSelf.activityCList == nil || weakSelf.activityCList.count <= 0) {
291293
for (int i = 0; i<resultA.count; i ++) {
@@ -519,6 +521,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
519521
[cell setImageStr:@"PR_TaskResource" andTitle:@"关联资源"];
520522
if(self.resourceReference.itemList.count > 0) {
521523
[cell setrightText:[NSString stringWithFormat:@"%lu",(unsigned long)self.resourceReference.itemList.count]];
524+
} else {
525+
[cell setNorightText];
522526
}
523527
}
524528
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];

Coding_iOS/Views/Cell/NProjectItemCell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@interface NProjectItemCell : UITableViewCell
1414
- (void)setImageStr:(NSString *)imgStr andTitle:(NSString *)title;
1515
- (void)setrightText:(NSString *)rightText;
16+
- (void)setNorightText;
1617
- (void)addTip:(NSString *)countStr;
1718
- (void)addTipIcon;
1819
- (void)removeTip;

Coding_iOS/Views/Cell/NProjectItemCell.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ - (void)setrightText:(NSString *)rightText {
101101
self.rightLabel.text = rightText;
102102
}
103103

104+
- (void)setNorightText {
105+
[self.rightLabel setHidden:YES];
106+
}
107+
104108
+ (CGFloat)cellHeight{
105109
return 44.0;
106110
}

0 commit comments

Comments
 (0)