Skip to content

Commit b1c634e

Browse files
committed
项目 添加成员
1 parent 0d43ddc commit b1c634e

7 files changed

Lines changed: 61 additions & 1 deletion

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@
372372
4E6CBE551D8EA9D100644086 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E6CBE531D8EA9D100644086 /* [email protected] */; };
373373
4E6CBE581D8FBDF500644086 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E6CBE561D8FBDF500644086 /* [email protected] */; };
374374
4E6CBE591D8FBDF500644086 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E6CBE571D8FBDF500644086 /* [email protected] */; };
375+
4E6CBE5C1D8FC7A500644086 /* ProjectServiceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E6CBE5B1D8FC7A500644086 /* ProjectServiceInfo.m */; };
375376
4E6D71891A75F00E005AD988 /* YLGIFImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E6D71861A75F00E005AD988 /* YLGIFImage.m */; };
376377
4E6D718A1A75F00E005AD988 /* YLImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E6D71881A75F00E005AD988 /* YLImageView.m */; };
377378
4E6FB0551B5799B100B0A17B /* ProjectTag.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E6FB0541B5799B100B0A17B /* ProjectTag.m */; };
@@ -1704,6 +1705,8 @@
17041705
4E6CBE531D8EA9D100644086 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
17051706
4E6CBE561D8FBDF500644086 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
17061707
4E6CBE571D8FBDF500644086 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1708+
4E6CBE5A1D8FC7A500644086 /* ProjectServiceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectServiceInfo.h; sourceTree = "<group>"; };
1709+
4E6CBE5B1D8FC7A500644086 /* ProjectServiceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectServiceInfo.m; sourceTree = "<group>"; };
17071710
4E6D71851A75F00E005AD988 /* YLGIFImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YLGIFImage.h; sourceTree = "<group>"; };
17081711
4E6D71861A75F00E005AD988 /* YLGIFImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YLGIFImage.m; sourceTree = "<group>"; };
17091712
4E6D71871A75F00E005AD988 /* YLImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YLImageView.h; sourceTree = "<group>"; };
@@ -5232,6 +5235,8 @@
52325235
D09AA5B91BFDBA4B008CA9EB /* PublicSearchModel.m */,
52335236
4E87DE011D813BBE00D1B5B1 /* UserServiceInfo.h */,
52345237
4E87DE021D813BBE00D1B5B1 /* UserServiceInfo.m */,
5238+
4E6CBE5A1D8FC7A500644086 /* ProjectServiceInfo.h */,
5239+
4E6CBE5B1D8FC7A500644086 /* ProjectServiceInfo.m */,
52355240
4ED4B4951D82939700EED8C6 /* Team.h */,
52365241
4ED4B4961D82939700EED8C6 /* Team.m */,
52375242
);
@@ -6598,6 +6603,7 @@
65986603
8E1C3DEC19E7D58A00EF3032 /* ActionSheetDatePicker.m in Sources */,
65996604
8EF643B619FF7E2900F7EEB0 /* Input_OnlyText_Cell.m in Sources */,
66006605
4E07D3081A4A96EA009EDDF2 /* FileListUploadCell.m in Sources */,
6606+
4E6CBE5C1D8FC7A500644086 /* ProjectServiceInfo.m in Sources */,
66016607
4EE1A22F1B5D02CA004284F1 /* ProjectListView.m in Sources */,
66026608
4E00229D1B735075005308DE /* EAIntroView.m in Sources */,
66036609
4EA679161A1496A7001A0324 /* ProjectFolders.m in Sources */,

Coding_iOS/Controllers/AddUserViewController.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,20 @@ - (BOOL)userIsQuering:(User *)curUser{
126126
return NO;
127127
}
128128
#pragma mark Table M
129+
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
130+
return 44;
131+
}
132+
133+
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
134+
NSInteger leftNum = _curProject.max_member.integerValue - _addedArray.count;
135+
UILabel *label = [UILabel labelWithSystemFontSize:13 textColorHexString:@"0x999999"];
136+
label.backgroundColor = self.view.backgroundColor;
137+
label.textAlignment = NSTextAlignmentCenter;
138+
label.textColor = leftNum > 0? kColor999: [UIColor colorWithHexString:@"0xAA0000" andAlpha:0.8];
139+
label.text = leftNum > 0? [NSString stringWithFormat:@"你还可以添加 %lu 个项目成员", leftNum]: @"已到达到成员最大数,不能再继续选择成员!";
140+
return label;
141+
}
142+
129143
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
130144
if (self.type == AddUserTypeProjectRoot && _searchedArray.count == 0) {
131145
return 2;

Coding_iOS/Models/Project.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@interface Project : NSObject
1212
@property (readwrite, nonatomic, strong) NSString *icon, *name, *owner_user_name, *backend_project_path, *full_name, *description_mine, *path, *parent_depot_path, *current_user_role,*project_path;
13-
@property (readwrite, nonatomic, strong) NSNumber *id, *owner_id, *is_public, *un_read_activities_count, *done, *processing, *star_count, *stared, *watch_count, *watched, *fork_count, *forked, *recommended, *pin, *current_user_role_id, *type, *gitReadmeEnabled;
13+
@property (readwrite, nonatomic, strong) NSNumber *id, *owner_id, *is_public, *un_read_activities_count, *done, *processing, *star_count, *stared, *watch_count, *watched, *fork_count, *forked, *recommended, *pin, *current_user_role_id, *type, *gitReadmeEnabled, *max_member;
1414
@property (assign, nonatomic) BOOL isStaring, isWatching, isLoadingMember, isLoadingDetail;
1515

1616
@property (strong, nonatomic) User *owner;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ProjectServiceInfo.h
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 2016/9/19.
6+
// Copyright © 2016年 Coding. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface ProjectServiceInfo : NSObject
12+
@property (strong, nonatomic) NSNumber *max_member, *git_memory, *used_day, *member, *max_git_memory;
13+
@end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ProjectServiceInfo.m
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 2016/9/19.
6+
// Copyright © 2016年 Coding. All rights reserved.
7+
//
8+
9+
#import "ProjectServiceInfo.h"
10+
11+
@implementation ProjectServiceInfo
12+
13+
@end

Coding_iOS/Util/Manager/Coding_NetAPIManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ typedef NS_ENUM(NSInteger, PurposeType) {
9292
- (void)request_TransferProject:(Project *)project toUser:(User *)user passCode:(NSString *)passCode type:(VerifyType)type andBlock:(void (^)(Project *data, NSError *error))block;
9393
- (void)request_EditAliasOfMember:(ProjectMember *)curMember inProject:(Project *)curPro andBlock:(void (^)(id data, NSError *error))block;
9494
- (void)request_EditTypeOfMember:(ProjectMember *)curMember inProject:(Project *)curPro andBlock:(void (^)(id data, NSError *error))block;
95+
- (void)request_ProjectServiceInfo:(Project *)curPro andBlock:(void (^)(id data, NSError *error))block;
9596

9697
#pragma mark Team
9798
- (void)request_JoinedTeamsBlock:(void (^)(id data, NSError *error))block;

Coding_iOS/Util/Manager/Coding_NetAPIManager.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#import "UserServiceInfo.h"
1919
#import "Team.h"
2020
#import "TeamMember.h"
21+
#import "ProjectServiceInfo.h"
2122

2223
@implementation Coding_NetAPIManager
2324
+ (instancetype)sharedManager {
@@ -601,6 +602,18 @@ - (void)request_EditTypeOfMember:(ProjectMember *)curMember inProject:(Project *
601602
}];
602603
}
603604

605+
- (void)request_ProjectServiceInfo:(Project *)curPro andBlock:(void (^)(id data, NSError *error))block{
606+
NSString *path = [NSString stringWithFormat:@"api/user/%@/project/%@/service_info", curPro.owner_user_name, curPro.name];
607+
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:path withParams:nil withMethodType:Get andBlock:^(id data, NSError *error) {
608+
if (data) {
609+
[MobClick event:kUmeng_Event_Request_Get label:@"项目_信息"];
610+
611+
data = [NSObject arrayFromJSON:data[@"data"] ofObjects:@"ProjectServiceInfo"];
612+
}
613+
block(data, error);
614+
}];
615+
}
616+
604617
#pragma mark Team
605618
- (void)request_JoinedTeamsBlock:(void (^)(id data, NSError *error))block{
606619
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:@"api/team/joined" withParams:nil withMethodType:Get andBlock:^(id data, NSError *error) {

0 commit comments

Comments
 (0)