Skip to content

Commit b4649b0

Browse files
committed
MR 详情页面调整
1 parent 553f762 commit b4649b0

File tree

8 files changed

+16
-47
lines changed

8 files changed

+16
-47
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@
6969
13FB5D3B1CA17A6400EE127C /* PR_push@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D1A1CA17A6400EE127C /* PR_push@3x.png */; };
7070
13FB5D3C1CA17A6400EE127C /* PR_update_content@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D1B1CA17A6400EE127C /* PR_update_content@2x.png */; };
7171
13FB5D3D1CA17A6400EE127C /* PR_update_content@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D1C1CA17A6400EE127C /* PR_update_content@3x.png */; };
72-
13FB5D3F1CA17A6400EE127C /* EPointLikeHead@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D1E1CA17A6400EE127C /* EPointLikeHead@2x.png */; };
73-
13FB5D401CA17A6400EE127C /* EPointLikeHead@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D1F1CA17A6400EE127C /* EPointLikeHead@3x.png */; };
7472
13FB5D411CA17A6400EE127C /* PR_refuse@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D201CA17A6400EE127C /* PR_refuse@2x.png */; };
7573
13FB5D421CA17A6400EE127C /* PR_refuse@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D211CA17A6400EE127C /* PR_refuse@3x.png */; };
7674
13FB5D431CA17A6400EE127C /* PR_grant_undo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 13FB5D221CA17A6400EE127C /* PR_grant_undo@2x.png */; };
@@ -1615,8 +1613,6 @@
16151613
13FB5D1A1CA17A6400EE127C /* PR_push@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PR_push@3x.png"; sourceTree = "<group>"; };
16161614
13FB5D1B1CA17A6400EE127C /* PR_update_content@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PR_update_content@2x.png"; sourceTree = "<group>"; };
16171615
13FB5D1C1CA17A6400EE127C /* PR_update_content@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PR_update_content@3x.png"; sourceTree = "<group>"; };
1618-
13FB5D1E1CA17A6400EE127C /* EPointLikeHead@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "EPointLikeHead@2x.png"; sourceTree = "<group>"; };
1619-
13FB5D1F1CA17A6400EE127C /* EPointLikeHead@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "EPointLikeHead@3x.png"; sourceTree = "<group>"; };
16201616
13FB5D201CA17A6400EE127C /* PR_refuse@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PR_refuse@2x.png"; sourceTree = "<group>"; };
16211617
13FB5D211CA17A6400EE127C /* PR_refuse@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PR_refuse@3x.png"; sourceTree = "<group>"; };
16221618
13FB5D221CA17A6400EE127C /* PR_grant_undo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PR_grant_undo@2x.png"; sourceTree = "<group>"; };
@@ -3767,8 +3763,6 @@
37673763
13FB5D1A1CA17A6400EE127C /* PR_push@3x.png */,
37683764
13FB5D1B1CA17A6400EE127C /* PR_update_content@2x.png */,
37693765
13FB5D1C1CA17A6400EE127C /* PR_update_content@3x.png */,
3770-
13FB5D1E1CA17A6400EE127C /* EPointLikeHead@2x.png */,
3771-
13FB5D1F1CA17A6400EE127C /* EPointLikeHead@3x.png */,
37723766
13FB5D201CA17A6400EE127C /* PR_refuse@2x.png */,
37733767
13FB5D211CA17A6400EE127C /* PR_refuse@3x.png */,
37743768
13FB5D221CA17A6400EE127C /* PR_grant_undo@2x.png */,
@@ -7561,7 +7555,6 @@
75617555
4E2DB33F1BA6A2FE002F27C4 /* keyboard_emotion_monkey_gif@2x.png in Resources */,
75627556
8E97CEB41A0C7E26006F9AD7 /* coding_emoji_29@2x.png in Resources */,
75637557
4EAE06C11B7B51AF00179F4B /* file_activity_icon_move_file@2x.png in Resources */,
7564-
13FB5D3F1CA17A6400EE127C /* EPointLikeHead@2x.png in Resources */,
75657558
D0C448081C02DCAC00DC1C4B /* addBtn_Nav@3x.png in Resources */,
75667559
B14689BB1EE100B200B01371 /* vip_3_75@3x.png in Resources */,
75677560
D0C4480C1C02DCAC00DC1C4B /* info_Nav@3x.png in Resources */,
@@ -7862,7 +7855,6 @@
78627855
4E80E94F1E02911E00DE1BC6 /* search_icon_tweet@3x.png in Resources */,
78637856
B1C871651EB182C7003DACF0 /* taskPriority0_small@3x.png in Resources */,
78647857
8E97CEAF1A0C7E26006F9AD7 /* coding_emoji_24@2x.png in Resources */,
7865-
13FB5D401CA17A6400EE127C /* EPointLikeHead@3x.png in Resources */,
78667858
13FB5D4A1CA17A6400EE127C /* PointLikeHead@2x.png in Resources */,
78677859
8E97CEA11A0C7E26006F9AD7 /* coding_emoji_10@2x.png in Resources */,
78687860
D0C447A31C02A3C700DC1C4B /* me_normal@2x.png in Resources */,

Coding_iOS/Controllers/MRDetailViewController.m

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ - (void)viewWillAppear:(BOOL)animated {
125125

126126
- (void)configBottomView{
127127
BOOL canCancel = [self.curPreMRPRInfo.mrpr.author.global_key isEqualToString:[Login curLoginUser].global_key];
128-
BOOL canAction = self.curPreMRPRInfo.can_edit.boolValue ||(canCancel && self.curPreMRPRInfo.mrpr.granted.boolValue);//有权限 || (作者身份 && 被授权)
129-
BOOL canAuthorization = self.curPreMRPRInfo.can_edit.boolValue &&!canCancel &&!self.curPreMRPRInfo.author_can_edit.boolValue && !self.curPreMRPRInfo.mrpr.granted.boolValue;
130-
BOOL canCancelAuthorization = self.curPreMRPRInfo.can_edit.boolValue &&!canCancel &&!self.curPreMRPRInfo.author_can_edit.boolValue && self.curPreMRPRInfo.mrpr.granted.boolValue;
128+
BOOL canAction = (self.curPreMRPRInfo.can_merge.boolValue || self.curPreMRPRInfo.can_edit.boolValue) ||(canCancel && self.curPreMRPRInfo.mrpr.granted.boolValue);//有权限 || (作者身份 && 被授权)
129+
BOOL canAuthorization = NO;//NO 不是说不可以,只是说不要这按钮了
130+
BOOL canCancelAuthorization = NO;//NO 不是说不可以,只是说不要这按钮了
131131
BOOL hasBottomView = self.curMRPRInfo.mrpr.status <= MRPRStatusCannotMerge && (canAction || canCancel);
132132
if(self.curMRPRInfo == nil || self.curPreMRPRInfo == nil) {
133133
hasBottomView = NO ;
@@ -405,10 +405,6 @@ - (void)authorizationMRPR{
405405
[[Coding_NetAPIManager sharedManager] request_MRPRAuthorization:_curMRPRInfo.mrpr andBlock:^(id data, NSError *error) {
406406
if (data) {
407407
weakSelf.curPreMRPRInfo.mrpr.granted = @1;
408-
// weakSelf.bottomView = nil;
409-
[weakSelf refresh];
410-
[weakSelf.myTableView reloadData];
411-
[weakSelf configBottomView];
412408
}
413409
}];
414410
}
@@ -418,10 +414,6 @@ - (void)cancelAuthorizationMRPR{
418414
[[Coding_NetAPIManager sharedManager] request_MRPRCancelAuthorization:_curMRPRInfo.mrpr andBlock:^(id data, NSError *error) {
419415
if (data) {
420416
weakSelf.curPreMRPRInfo.mrpr.granted = @0;
421-
// weakSelf.bottomView = nil;
422-
[weakSelf refresh];
423-
[weakSelf.myTableView reloadData];
424-
[weakSelf configBottomView];
425417
}
426418
}];
427419
}
@@ -586,15 +578,22 @@ - (void)jiaYi{
586578
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.reviewGoodPath withParams:nil withMethodType:Delete andBlock:^(id data, NSError *error) {
587579
weakSelf.isLike = @1;
588580
[weakSelf refresh];
581+
if (weakSelf.curPreMRPRInfo.can_grant.boolValue) {
582+
[weakSelf cancelAuthorizationMRPR];
583+
}
589584
}];
590585
} else {
591586
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.reviewGoodPath withParams:nil withMethodType:Post andBlock:^(id data, NSError *error) {
592587
weakSelf.isLike = @0;
593588
[weakSelf refresh];
589+
if (weakSelf.curPreMRPRInfo.can_grant.boolValue) {
590+
[weakSelf authorizationMRPR];
591+
}
594592
}];
595593
}
596594
}
597595
}
596+
598597
- (void)goToReviewerList{
599598
NSArray *apparray= [[NSBundle mainBundle]loadNibNamed:@"ReviewerListController" owner:nil options:nil];
600599
ReviewerListController *appview=[apparray firstObject];
-1.2 KB
Binary file not shown.
-1.81 KB
Binary file not shown.
420 Bytes
Loading
622 Bytes
Loading

Coding_iOS/Models/MRPRPreInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@property (strong, nonatomic) MRPR *merge_request;
1616
@property (strong, nonatomic) MRPR *mrpr;
1717
@property (strong, nonatomic) NSNumber *can_edit_src_branch;
18-
@property (strong, nonatomic) NSNumber *can_edit;
18+
@property (strong, nonatomic) NSNumber *can_edit, *can_merge, *can_grant;
1919
@property (strong, nonatomic) NSNumber *author_can_edit;
2020

2121
@end

Coding_iOS/Views/Cell/MRReviewerCell.m

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ @interface MRReviewerCell ()
1313
@property (strong, nonatomic) UIImageView *imgView;
1414
@property (strong, nonatomic) UILabel *titleLabel;
1515
@property (strong, nonatomic) UILabel *rightLabel;
16-
@property (strong, nonatomic) UIImageView *likeImgView;
1716
@end
1817

1918
@implementation MRReviewerCell
@@ -48,23 +47,12 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4847
self.rightLabel = [UILabel new];
4948
self.rightLabel.text = @"添加";
5049
self.rightLabel.font = [UIFont systemFontOfSize:15];
51-
//[self.rightLabel setTextColor:kColor999];
5250
[self.contentView addSubview:self.rightLabel];
5351
[self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
54-
//make.left.equalTo(_imgView.mas_right).offset(15);
55-
make.right.equalTo(self.contentView).offset(0);
52+
make.right.equalTo(self.contentView).offset(-kPaddingLeftWidth);
5653
make.centerY.height.equalTo(self.contentView);
5754
}];
5855
}
59-
if (!self.likeImgView) {
60-
self.likeImgView = [UIImageView new];
61-
[self.contentView addSubview:self.likeImgView];
62-
[self.likeImgView mas_makeConstraints:^(MASConstraintMaker *make) {
63-
make.size.mas_equalTo(CGSizeMake(20, 20));
64-
make.right.equalTo(self.contentView).offset(-40);
65-
make.centerY.equalTo(self.contentView);
66-
}];
67-
}
6856
UIView *rightSideV = [UIView new];
6957
[self.contentView addSubview:rightSideV];
7058
[rightSideV mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -82,6 +70,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
8270
}
8371

8472
- (void)prepareForReuse{
73+
[super prepareForReuse];
8574
[self removeTip];
8675
}
8776

@@ -113,33 +102,22 @@ - (void)setImageStr:(NSString *)imgStr
113102
self.imgView.image = [UIImage imageNamed:imgStr];
114103
self.titleLabel.text = @"评审者";
115104
if(!ower) {
116-
[self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
117-
//make.left.equalTo(_imgView.mas_right).offset(15);
118-
make.right.equalTo(self.contentView).offset(-20);
119-
make.centerY.height.equalTo(self.contentView);
120-
}];
121105
self.selectionStyle = UITableViewCellSelectionStyleNone;
122106
if([hasLikeMr isEqual:@1]) {
123-
self.rightLabel.text = @"+1";
124-
[self.rightLabel setTextColor:kColorBrandBlue];
125-
[self.likeImgView setHidden:NO];
126-
self.likeImgView.image = [UIImage imageNamed:@"EPointLikeHead"];
107+
self.rightLabel.text = @"允许合并";
127108
} else {
128-
[self.rightLabel setTextColor:kColorBrandBlue];
129-
self.rightLabel.text = @"撤销 +1";
130-
[self.likeImgView setHidden:YES];
109+
self.rightLabel.text = @"撤销允许合并";
131110
}
111+
[self.rightLabel setTextColor:kColorLightBlue];
132112
} else {
133113
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
134114
self.rightLabel.text = @"添加";
135115
[self.rightLabel setTextColor:kColor999];
136-
[self.likeImgView setHidden:YES];
137116
}
138117
}
139118

140119
-(void) cantReviewer {
141120
self.rightLabel.hidden = YES;
142-
self.likeImgView.hidden = YES;
143121
self.accessoryType = UITableViewCellAccessoryNone;
144122
}
145123

0 commit comments

Comments
 (0)