Skip to content

Commit e491978

Browse files
committed
实现了取消的功能
1 parent 27a2519 commit e491978

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

Coding_iOS/Controllers/MRDetailViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (void)configBottomView{
128128
BOOL canAction = self.curPreMRPRInfo.can_edit.boolValue ||(canCancel && self.curPreMRPRInfo.mrpr.granted.boolValue);//有权限 || (作者身份 && 被授权)
129129
BOOL canAuthorization = self.curPreMRPRInfo.can_edit.boolValue &&!canCancel &&!self.curPreMRPRInfo.author_can_edit.boolValue && !self.curPreMRPRInfo.mrpr.granted.boolValue;
130130
BOOL canCancelAuthorization = self.curPreMRPRInfo.can_edit.boolValue &&!canCancel &&!self.curPreMRPRInfo.author_can_edit.boolValue && self.curPreMRPRInfo.mrpr.granted.boolValue;
131-
BOOL hasBottomView = self.curPreMRPRInfo.mrpr.status <= MRPRStatusCannotMerge && (canAction || canCancel);
131+
BOOL hasBottomView = self.curMRPRInfo.mrpr.status <= MRPRStatusCannotMerge && (canAction || canCancel);
132132
if (!hasBottomView) {
133133
[_bottomView removeFromSuperview];
134134
}else if (!_bottomView){

Coding_iOS/Models/MRPR.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef NS_ENUM(NSInteger, MRPRStatus) {
4949
- (NSDictionary *)toAcceptParams;
5050
- (NSString *)toRefusePath;
5151
- (NSString *)toCancelPath;
52+
- (NSString *)toCancelMRPath;
5253
- (NSString *)toAuthorizationPath;
5354

5455
@end

Coding_iOS/Models/MRPR.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ - (NSString *)toCancelPath{
104104
return [[self p_prePath] stringByAppendingString:@"cancel"];
105105
}
106106

107+
- (NSString *)toCancelMRPath{
108+
return [[self path] stringByAppendingString:@"cancel"];
109+
}
110+
107111
- (NSString *)toAuthorizationPath{
108112
return [[self p_prePath] stringByAppendingString:@"grant"];
109113
}

Coding_iOS/Util/Manager/Coding_NetAPIManager.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,19 @@ - (void)request_MRPRAuthorization:(MRPR *)curMRPR andBlock:(void (^)(id data, NS
839839
}];
840840
}
841841

842+
- (void)request_MRPRCancel:(MRPR *)curMRPR andBlock:(void (^)(id data, NSError *error))block {
843+
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:[curMRPR toCancelPath] withParams:nil withMethodType:Post andBlock:^(id data, NSError *error) {
844+
if (data) {
845+
[MobClick event:kUmeng_Event_Request_ActionOfServer label:@"MRPR_取消合并"];
846+
847+
block(data, nil);
848+
}else{
849+
block(nil, error);
850+
}
851+
}];
852+
853+
}
854+
842855
- (void)request_MRPRCancelAuthorization:(MRPR *)curMRPR andBlock:(void (^)(id data, NSError *error))block{
843856
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:[curMRPR toAuthorizationPath] withParams:nil withMethodType:Delete andBlock:^(id data, NSError *error) {
844857
if (data) {

0 commit comments

Comments
 (0)