|
|
@@ -46,6 +46,7 @@ FBAPIManagerDelegate
|
|
|
@property (nonatomic, strong) HJApproveStatusAPIManager *approveStatusAPIManager;//认证状态的
|
|
|
@property (nonatomic, strong) HJGetResumeAPIManager *getResumeAPIManager;//简历的
|
|
|
@property (nonatomic, strong) NSIndexPath *selextIndexPath;
|
|
|
+@property (nonatomic, assign) HJAuthStatusType authStatus;//实名认证状态
|
|
|
|
|
|
|
|
|
@end
|
|
|
@@ -115,51 +116,51 @@ FBAPIManagerDelegate
|
|
|
[manager fetchDataWithBox:self.dataBox];
|
|
|
[self.refreshHeader endRefreshing];
|
|
|
}
|
|
|
-
|
|
|
if (manager == self.approveStatusAPIManager)
|
|
|
{
|
|
|
- HJAuthStatusType status = (HJAuthStatusType)[[manager fetchDataWithBox:self.dataBox] integerValue];
|
|
|
- if (status == HJAuthStatusTypeNoAuth)
|
|
|
- {//没有认证
|
|
|
- HJAuthViewController *authVC = [[HJAuthViewController alloc] init];
|
|
|
- authVC.hidesBottomBarWhenPushed = YES;
|
|
|
- [self.navigationController pushViewController:authVC animated:YES];
|
|
|
- }
|
|
|
- else if (status == HJAuthStatusTypeAuthing)
|
|
|
- {//认证中
|
|
|
- HJAuthingViewController *authingVC = [[HJAuthingViewController alloc] init];
|
|
|
- authingVC.hidesBottomBarWhenPushed = YES;
|
|
|
- [self.navigationController pushViewController:authingVC animated:YES];
|
|
|
- }
|
|
|
- else if (status == HJAuthStatusTypeAuthFailed)
|
|
|
- {//失败
|
|
|
- HJAuthFailedViewController *authFailedVC = [[HJAuthFailedViewController alloc] init];
|
|
|
- authFailedVC.hidesBottomBarWhenPushed = YES;
|
|
|
- [self.navigationController pushViewController:authFailedVC animated:YES];
|
|
|
- }
|
|
|
- else
|
|
|
+ self.authStatus = (HJAuthStatusType)[[manager fetchDataWithBox:self.dataBox] integerValue];
|
|
|
+ if (self.selextIndexPath)
|
|
|
{
|
|
|
- if (self.selextIndexPath.row == 1)
|
|
|
- {
|
|
|
- self.selextIndexPath = nil;
|
|
|
+ self.selextIndexPath = nil;
|
|
|
+ if (self.authStatus == HJAuthStatusTypeAuthSuccess)
|
|
|
+ {//认证成功
|
|
|
HJIdentitySwitchViewController *vc = [[HJIdentitySwitchViewController alloc]init];
|
|
|
vc.hidesBottomBarWhenPushed = YES;
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- [self.view fb_showSuccessWithStatus:@"已认证"];
|
|
|
+ [self realnameAuthentication];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (self.authStatus == HJAuthStatusTypeNoAuth)
|
|
|
+ {//没有认证
|
|
|
+ HJAuthViewController *authVC = [[HJAuthViewController alloc] init];
|
|
|
+ authVC.hidesBottomBarWhenPushed = YES;
|
|
|
+ [self.navigationController pushViewController:authVC animated:YES];
|
|
|
+ }
|
|
|
+ else if (self.authStatus == HJAuthStatusTypeAuthing)
|
|
|
+ {//认证中
|
|
|
+ HJAuthingViewController *authingVC = [[HJAuthingViewController alloc] init];
|
|
|
+ authingVC.hidesBottomBarWhenPushed = YES;
|
|
|
+ [self.navigationController pushViewController:authingVC animated:YES];
|
|
|
+ }
|
|
|
+ else if (self.authStatus == HJAuthStatusTypeAuthFailed)
|
|
|
+ {//失败
|
|
|
+ HJAuthFailedViewController *authFailedVC = [[HJAuthFailedViewController alloc] init];
|
|
|
+ authFailedVC.hidesBottomBarWhenPushed = YES;
|
|
|
+ [self.navigationController pushViewController:authFailedVC animated:YES];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (manager == self.getUserInfoAPIManager || manager == self.approveStatusAPIManager)
|
|
|
{
|
|
|
//在headerView布局修改后一定要先调用tableView layoutIfNeeded,然后再调用reloadData不然会有布局Bug
|
|
|
[self.tableView layoutIfNeeded];
|
|
|
[self.tableView reloadData];
|
|
|
}
|
|
|
-
|
|
|
if (manager == self.getResumeAPIManager)
|
|
|
{
|
|
|
// 不需要根据返回值来处理视图,在DataBox类中做了封装
|
|
|
@@ -168,7 +169,6 @@ FBAPIManagerDelegate
|
|
|
[self.refreshHeader endRefreshing];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- (void)managerCallAPIDidFailed:(FBBaseAPIManager *)manager {
|
|
|
|
|
|
[self.refreshHeader endRefreshing];
|
|
|
@@ -255,6 +255,47 @@ FBAPIManagerDelegate
|
|
|
[self.navigationController pushViewController:profileVC animated:YES];
|
|
|
}
|
|
|
}
|
|
|
+/* 我要招人的实名认证状态 */
|
|
|
+- (void)realnameAuthentication{
|
|
|
+
|
|
|
+ HJConfirmPanelViewController *vc = [[HJConfirmPanelViewController alloc] init];
|
|
|
+ vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
|
|
|
+ vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
|
|
|
+ self.navigationController.definesPresentationContext = NO;
|
|
|
+ vc.titleLabel.text = @"未经实名认证无法切换账号,是否现在进行实名认证?";
|
|
|
+ vc.titleIcon.image = nil;
|
|
|
+ [vc.cancelButton setTitle:@"以后再说" forState:UIControlStateNormal];
|
|
|
+ [vc.confirmButton setTitle:@"现在就去" forState:UIControlStateNormal];
|
|
|
+ [vc.confirmButton addTarget:self
|
|
|
+ action:@selector(editButtonClicked:)
|
|
|
+ forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self presentViewController:vc animated:YES completion:nil];
|
|
|
+
|
|
|
+}
|
|
|
+- (void)editButtonClicked:(UIButton *)sender {
|
|
|
+
|
|
|
+ [self dismissViewControllerAnimated:NO completion:^{
|
|
|
+
|
|
|
+ if (self.authStatus == HJAuthStatusTypeNoAuth)
|
|
|
+ {//没有认证
|
|
|
+ HJAuthViewController *authVC = [[HJAuthViewController alloc] init];
|
|
|
+ authVC.hidesBottomBarWhenPushed = YES;
|
|
|
+ [self.navigationController pushViewController:authVC animated:YES];
|
|
|
+ }
|
|
|
+ else if (self.authStatus == HJAuthStatusTypeAuthing)
|
|
|
+ {//认证中
|
|
|
+ HJAuthingViewController *authingVC = [[HJAuthingViewController alloc] init];
|
|
|
+ authingVC.hidesBottomBarWhenPushed = YES;
|
|
|
+ [self.navigationController pushViewController:authingVC animated:YES];
|
|
|
+ }
|
|
|
+ else if (self.authStatus == HJAuthStatusTypeAuthFailed)
|
|
|
+ {//失败
|
|
|
+ HJAuthFailedViewController *authFailedVC = [[HJAuthFailedViewController alloc] init];
|
|
|
+ authFailedVC.hidesBottomBarWhenPushed = YES;
|
|
|
+ [self.navigationController pushViewController:authFailedVC animated:YES];
|
|
|
+ }
|
|
|
+ }];
|
|
|
+}
|
|
|
|
|
|
#pragma mark - event response
|
|
|
|