Skip to content

Commit 106d79e

Browse files
committed
实现了点击赞的功能
1 parent f89ea99 commit 106d79e

File tree

4 files changed

+41
-31
lines changed

4 files changed

+41
-31
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5614,7 +5614,7 @@
56145614
ORGANIZATIONNAME = Coding;
56155615
TargetAttributes = {
56165616
8E47700F198770E700997D05 = {
5617-
DevelopmentTeam = QN5Z87S3LH;
5617+
DevelopmentTeam = EGLUV565VE;
56185618
SystemCapabilities = {
56195619
com.apple.BackgroundModes = {
56205620
enabled = 0;
@@ -6929,7 +6929,7 @@
69296929
"$(PROJECT_DIR)/Coding_iOS/Util/Audio/opencore-amr-iOS/lib",
69306930
"$(PROJECT_DIR)/Coding_iOS/Vendor/UMSocial_Sdk_4.3.0_Extra/SinaSSO",
69316931
);
6932-
PRODUCT_BUNDLE_IDENTIFIER = net.coding.CodingForiOS;
6932+
PRODUCT_BUNDLE_IDENTIFIER = com.tencent.tmgptest.zqzg;
69336933
PRODUCT_NAME = Coding_iOS;
69346934
PROVISIONING_PROFILE = "";
69356935
TARGETED_DEVICE_FAMILY = 1;
@@ -6968,7 +6968,7 @@
69686968
"$(PROJECT_DIR)/Coding_iOS/Util/Audio/opencore-amr-iOS/lib",
69696969
"$(PROJECT_DIR)/Coding_iOS/Vendor/UMSocial_Sdk_4.3.0_Extra/SinaSSO",
69706970
);
6971-
PRODUCT_BUNDLE_IDENTIFIER = net.coding.CodingForiOS;
6971+
PRODUCT_BUNDLE_IDENTIFIER = com.tencent.tmgptest.zqzg;
69726972
PRODUCT_NAME = Coding_iOS;
69736973
PROVISIONING_PROFILE = "";
69746974
TARGETED_DEVICE_FAMILY = 1;

Coding_iOS/Coding_iOS-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
</array>
3838
<key>CFBundleVersion</key>
3939
<string>3.8.1.201603151930</string>
40+
<key>ITSAppUsesNonExemptEncryption</key>
41+
<false/>
4042
<key>LSApplicationQueriesSchemes</key>
4143
<array>
4244
<string>wechat</string>
@@ -105,7 +107,5 @@
105107
</array>
106108
<key>UIViewControllerBasedStatusBarAppearance</key>
107109
<false/>
108-
<key>ITSAppUsesNonExemptEncryption</key>
109-
<false/>
110110
</dict>
111111
</plist>

Coding_iOS/Controllers/MRDetailViewController.m

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ @interface MRDetailViewController ()<UITableViewDataSource, UITableViewDelegate,
6161
@property (strong, nonatomic) NSMutableArray *activityList;
6262
@property (strong, nonatomic) NSMutableArray *activityCList;
6363
@property (strong, nonatomic) NSMutableArray *allDiscussions;
64+
@property (strong, nonatomic) NSString *reviewGoodPath;
65+
@property (assign, nonatomic) BOOL isLike;
6466
@end
6567

6668
@implementation MRDetailViewController
@@ -88,6 +90,7 @@ - (void)viewDidLoad{
8890
self.referencePath = [NSString stringWithFormat:@"/api/user/%@/project/%@/resource_reference/%@", _curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
8991
self.activityPath = [NSString stringWithFormat:@"/api/user/%@/project/%@/git/merge/%@/activities", _curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
9092
self.diffPath = [NSString stringWithFormat:@"/api/user/%@/project/%@/git/merge/%@/commitDiffContent",_curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
93+
self.reviewGoodPath = [NSString stringWithFormat:@"/api/user/%@/project/%@/git/merge/%@/review_good",_curMRPR.des_owner_name, _curMRPR.des_project_name,self.curMRPR.iid];
9194
__weak typeof(self) weakSelf = self;
9295
_myTableView = ({
9396
UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
@@ -273,17 +276,11 @@ - (void)refresh{
273276
[weakSelf.view endLoading];
274277
[weakSelf.myRefreshControl endRefreshing];
275278
if (data) {
276-
if (weakSelf.curMRPRInfo.contentHeight > 1) {
277-
[(MRPRBaseInfo *)data setContentHeight:weakSelf.curMRPRInfo.contentHeight];
278-
}
279+
279280
weakSelf.curReviewersInfo = data;
280281

281282
[weakSelf.myTableView reloadData];
282-
[weakSelf configBottomView];
283283
}
284-
[weakSelf.view configBlankPage:EaseBlankPageTypeView hasData:(_curMRPRInfo != nil) hasError:(error != nil) reloadButtonBlock:^(id sender) {
285-
[weakSelf refresh];
286-
}];
287284
}];
288285

289286
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.referencePath withParams:@{@"iid": _curMRPR.iid} withMethodType:Get andBlock:^(id data, NSError *error) {
@@ -555,10 +552,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
555552
else {
556553
Reviewer* tmpReviewer = [self checkUserisReviewer];
557554
if(tmpReviewer == nil){
555+
self.isLike = YES;
558556
[cell setImageStr:@"PRReviewer" isowner:NO hasLikeMr:YES];
559557
} else {
558+
self.isLike = NO;
560559
[cell setImageStr:@"PRReviewer" isowner:NO hasLikeMr:NO];
561560
}
561+
562562
}
563563
//[cell setImageStr:@"PRReviewer" andTitle:@"评审者"];
564564
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];
@@ -687,25 +687,34 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
687687
}
688688
}else if (indexPath.section == 2){//Disclosure
689689
if (indexPath.row == 0) {
690-
if(![self CurrentUserIsOwer]) return;
691-
NSArray *apparray= [[NSBundle mainBundle]loadNibNamed:@"ReviewerListController" owner:nil options:nil];
692-
ReviewerListController *appview=[apparray firstObject];
693-
appview.currentProject = self.curProject;
694-
appview.curMRPR = self.curMRPR;
695690

696-
[self.navigationController pushViewController:appview animated:YES];
697-
}else {
698-
MRPRFilesViewController *vc = [MRPRFilesViewController new];
699-
vc.curMRPR = _curMRPR;
700-
vc.curMRPRInfo = _curMRPRInfo;
701-
vc.curProject = _curProject;
702-
[self.navigationController pushViewController:vc animated:YES];
703-
if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_LineNote_FileChange]) {
704-
[[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_LineNote_FileChange];
705-
[[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_LineNote_MRPR];
706-
NProjectItemCell *cell = (NProjectItemCell *)[tableView cellForRowAtIndexPath:indexPath];
707-
[cell removeTip];
691+
if([self CurrentUserIsOwer]) {
692+
NSArray *apparray= [[NSBundle mainBundle]loadNibNamed:@"ReviewerListController" owner:nil options:nil];
693+
ReviewerListController *appview=[apparray firstObject];
694+
appview.currentProject = self.curProject;
695+
appview.curMRPR = self.curMRPR;
696+
697+
[self.navigationController pushViewController:appview animated:YES];
708698
}
699+
else {
700+
__weak typeof(self) weakSelf = self;
701+
if (!self.isLike) {
702+
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.reviewGoodPath withParams:nil withMethodType:Delete andBlock:^(id data, NSError *error) {
703+
704+
[weakSelf refresh];
705+
706+
}];
707+
} else {
708+
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:self.reviewGoodPath withParams:nil withMethodType:Post andBlock:^(id data, NSError *error) {
709+
710+
[weakSelf refresh];
711+
712+
}];
713+
}
714+
715+
}
716+
}else {
717+
709718
}
710719
}else if (self.activityList.count > 0 && indexPath.section == 3){//Comment
711720

Coding_iOS/Views/Cell/PRReviewerCell.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ - (void)setImageStr:(NSString *)imgStr
112112
self.selectionStyle = UITableViewCellSelectionStyleNone;
113113
if(hasLikeMr) {
114114
self.rightLabel.text = @"+1";
115-
self.likeImgView.image = [UIImage imageNamed:@"PointLikeHead"];
115+
[self.likeImgView setHidden:NO];
116+
self.likeImgView.image = [UIImage imageNamed:@"EPointLikeHead"];
116117
} else {
117-
self.rightLabel.text = @"撤销 -1";
118+
self.rightLabel.text = @"撤销 +1";
118119
[self.likeImgView setHidden:YES];
119120
}
120121
} else {

0 commit comments

Comments
 (0)