Skip to content

Commit 81abbf7

Browse files
committed
退出项目时,给提示
1 parent c763c22 commit 81abbf7

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

Coding_iOS/Controllers/ProjectMemberListViewController.m

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,19 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
183183
}
184184
}
185185

186+
- (void)quitSelf_ProjectMember:(ProjectMember *)curMember{
187+
__weak typeof(self) weakSelf = self;
188+
[[Coding_NetAPIManager sharedManager] request_ProjectMember_Quit:curMember andBlock:^(id data, NSError *error) {
189+
if (data) {
190+
if (weakSelf.type == ProMemTypeProject) {
191+
if (weakSelf.cellBtnBlock) {
192+
weakSelf.cellBtnBlock(curMember);
193+
}
194+
}
195+
}
196+
}];
197+
}
198+
186199
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
187200
MemberCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_MemberCell forIndexPath:indexPath];
188201
ProjectMember *curMember;
@@ -200,15 +213,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
200213
}
201214
if (curMember.user_id.intValue == [Login curLoginUser].id.intValue) {
202215
// 自己,退出项目
203-
[[Coding_NetAPIManager sharedManager] request_ProjectMember_Quit:curMember andBlock:^(id data, NSError *error) {
204-
if (data) {
205-
if (weakSelf.type == ProMemTypeProject) {
206-
if (weakSelf.cellBtnBlock) {
207-
weakSelf.cellBtnBlock(curMember);
208-
}
209-
}
216+
UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle:@"确定退出项目?" buttonTitles:nil destructiveTitle:@"确认退出" cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
217+
if (index == 0) {
218+
[weakSelf quitSelf_ProjectMember:curMember];
210219
}
211220
}];
221+
[actionSheet showInView:kKeyWindow];
212222
}else{
213223
// 别人,发起私信
214224
if (_type == ProMemTypeProject) {

0 commit comments

Comments
 (0)