|
|
@@ -7,26 +7,28 @@
|
|
|
//
|
|
|
|
|
|
#import "BHomeResumeDetailViewController.h"
|
|
|
-#import "BHomeResumeDetailTopCell.h"
|
|
|
-#import "BHomeResumeDetailIntentionCell.h"
|
|
|
-#import "BHomeResumeDetailExperienceCell.h"
|
|
|
-#import "BHomeResumeDetailExperienceListCell.h"
|
|
|
#import "BHomeInvitationViewController.h"
|
|
|
+#import "BHomeResumeBasicInformation.h"
|
|
|
+#import "BHomeResumeObjectiveView.h"
|
|
|
+#import "BHomeResumeWorkExperienceView.h"
|
|
|
#import "BHomeResumeDetailAPI.h"//简历详情
|
|
|
#import "BHomeResumeDetailModel.h"
|
|
|
#import "BHomeDataBox.h"
|
|
|
|
|
|
@interface BHomeResumeDetailViewController ()
|
|
|
<
|
|
|
-UITableViewDelegate,
|
|
|
-UITableViewDataSource,
|
|
|
FBAPIManagerDelegate,
|
|
|
-FBAPIManagerInterceptor
|
|
|
+FBAPIManagerInterceptor,
|
|
|
+FBScrollLayoutViewDelegate,
|
|
|
+UINavigationControllerDelegate,
|
|
|
+UIGestureRecognizerDelegate
|
|
|
>
|
|
|
+@property (nonatomic, strong) FBScrollLayoutView *scrollLayoutView;
|
|
|
+@property (nonatomic, strong) BHomeResumeBasicInformation *basicInfoView;
|
|
|
+@property (nonatomic, strong) BHomeResumeObjectiveView *objectiveView ;
|
|
|
+@property (nonatomic, strong) BHomeResumeWorkExperienceView *experienceView;
|
|
|
|
|
|
-@property (nonatomic, strong) UITableView *tableView;
|
|
|
@property (nonatomic, strong) UIButton *invitationBtn;//邀请btn
|
|
|
-@property (nonatomic, strong) UIButton *phoneBtn;//电话沟通
|
|
|
@property (nonatomic, strong) BHomeResumeDetailAPI *detailAPI;
|
|
|
@property (nonatomic, strong) BHomeDataBox *dataBox;
|
|
|
@property (nonatomic, strong) NSDictionary *dataDict;
|
|
|
@@ -35,17 +37,32 @@ FBAPIManagerInterceptor
|
|
|
|
|
|
@implementation BHomeResumeDetailViewController
|
|
|
|
|
|
+- (void)viewWillAppear:(BOOL)animated {
|
|
|
+
|
|
|
+ [super viewWillAppear:animated];
|
|
|
+ [self.navigationController setNavigationBarHidden:NO animated:YES];
|
|
|
+ self.navigationController.delegate = self;
|
|
|
+ self.navigationController.interactivePopGestureRecognizer.delegate = self;
|
|
|
+
|
|
|
+}
|
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|
|
|
|
|
|
- self.navigationItem.title = @"简历详情";
|
|
|
- [self hj_setupWhiteColorNavBar];
|
|
|
+ self.navigationItem.title = @"个人简历";
|
|
|
+ [self hj_setupNavBar];
|
|
|
+ [self autoLayOutViews];
|
|
|
self.detailAPI.resumeId = self.resumeID;
|
|
|
[self.detailAPI start];
|
|
|
- [self autoLayOutViews];
|
|
|
-
|
|
|
// 错误页面刷新事件
|
|
|
[self.view.errorView.refreshButton addTarget:self action:@selector(refreshButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+
|
|
|
+}
|
|
|
+#pragma mark - 导航栏的代理
|
|
|
+
|
|
|
+- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
|
|
|
+ // 判断要显示的控制器是否是自己
|
|
|
+ // BOOL isPushSelfClass = [viewController isKindOfClass:[self class]];
|
|
|
+ [self.navigationController setNavigationBarHidden:NO animated:animated];
|
|
|
|
|
|
}
|
|
|
#pragma mark - event response
|
|
|
@@ -56,7 +73,7 @@ FBAPIManagerInterceptor
|
|
|
|
|
|
}
|
|
|
/* 邀请面试 */
|
|
|
-- (void)invitationButtonClick {
|
|
|
+- (void)invitationButtonClick:(UIButton *)btn {
|
|
|
|
|
|
BHomeResumeDetailModel *model = [BHomeResumeDetailModel yy_modelWithJSON:self.dataDict];
|
|
|
BHomeInvitationViewController *invitation = [[BHomeInvitationViewController alloc]init];
|
|
|
@@ -67,7 +84,7 @@ FBAPIManagerInterceptor
|
|
|
|
|
|
}
|
|
|
/*电话沟通*/
|
|
|
-- (void)phoneButtonClick {
|
|
|
+- (void)phoneButtonClick:(UIButton *)btn {
|
|
|
|
|
|
BHomeResumeDetailModel *model = [BHomeResumeDetailModel yy_modelWithJSON:self.dataDict];
|
|
|
NSMutableString* str=[[NSMutableString alloc] initWithFormat:@"tel:%@",model.phone];
|
|
|
@@ -75,7 +92,28 @@ FBAPIManagerInterceptor
|
|
|
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
|
|
|
[self.view addSubview:callWebview];
|
|
|
}
|
|
|
-
|
|
|
+/* 复制微信号 */
|
|
|
+- (void)WeChatBUttonClick:(UIButton *)btn {
|
|
|
+
|
|
|
+ BHomeResumeDetailModel *model = [BHomeResumeDetailModel yy_modelWithJSON:self.dataDict];
|
|
|
+ if (model.wechatNumber.length > 0)
|
|
|
+ {
|
|
|
+ UIPasteboard*pab = [UIPasteboard generalPasteboard];
|
|
|
+ [pab setString:model.wechatNumber];
|
|
|
+ if(pab == nil)
|
|
|
+ {
|
|
|
+ [self.view fb_showInfoWithStatus:@"复制失败"];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ [self.view fb_showInfoWithStatus:@"复制成功"];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ [self.view fb_showInfoWithStatus:@"暂无微信号无法完成复制"];
|
|
|
+ }
|
|
|
+}
|
|
|
#pragma mark - FBAPIManagerInterceptor
|
|
|
|
|
|
- (BOOL)manager:(FBBaseAPIManager *)manager shouldStartCallAPIWithParams:(NSDictionary *)params {
|
|
|
@@ -97,7 +135,9 @@ FBAPIManagerInterceptor
|
|
|
if (manager == self.detailAPI)
|
|
|
{
|
|
|
self.dataDict = [manager fetchDataWithBox:self.dataBox][@"data"][@"hpResume"];
|
|
|
- [self.tableView reloadData];
|
|
|
+ [self.basicInfoView configurationBasicInformationData:self.dataDict];
|
|
|
+ [self.objectiveView configurationObjectivea:self.dataDict];
|
|
|
+ [self.experienceView configurationWorkExperience:self.dataDict];
|
|
|
}
|
|
|
}
|
|
|
- (void)managerCallAPIDidFailed:(FBBaseAPIManager *)manager {
|
|
|
@@ -106,111 +146,110 @@ FBAPIManagerInterceptor
|
|
|
[self.view fb_showFailureWithStatus:manager.errorMessage];
|
|
|
|
|
|
}
|
|
|
-#pragma mark - UITableViewDelegate
|
|
|
|
|
|
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
|
+#pragma mark - FBScrollLayoutViewDelegate
|
|
|
+
|
|
|
+- (void)scrollLayoutViewMakeConstraints:(FBScrollLayoutView *)scrollLayoutView {
|
|
|
|
|
|
- return 2;
|
|
|
+ [scrollLayoutView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.edges.equalTo(self.view);
|
|
|
+ }];
|
|
|
}
|
|
|
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
+- (void)subviewsMakeConstraintsInScrollLayoutView:(FBScrollLayoutView *)scrollLayoutView contentView:(UIView *)contentView {
|
|
|
|
|
|
- if (section == 0)
|
|
|
- {
|
|
|
- return 2;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- BHomeResumeDetailModel *model = [BHomeResumeDetailModel yy_modelWithJSON:self.dataDict];
|
|
|
- return 1 + model.hpResumeWorkExperienceList.count;
|
|
|
- }
|
|
|
+ [self.basicInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+
|
|
|
+ make.top.equalTo(contentView.mas_top).offset(0);
|
|
|
+ make.left.right.equalTo(contentView);
|
|
|
+
|
|
|
+ }];
|
|
|
+ [self.objectiveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+
|
|
|
+ make.left.right.equalTo(contentView);
|
|
|
+ make.top.equalTo(self.basicInfoView.mas_bottom).offset(0);
|
|
|
+ }];
|
|
|
+ [self.experienceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+
|
|
|
+ make.left.right.equalTo(contentView);
|
|
|
+ make.top.equalTo(self.objectiveView.mas_bottom).offset(0);
|
|
|
+ }];
|
|
|
+ [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+
|
|
|
+ make.bottom.equalTo(self.experienceView.mas_bottom).with.offset(0);
|
|
|
+ }];
|
|
|
+}
|
|
|
+- (void)subviewsMakeConstraintsInScrollLayoutView:(FBScrollLayoutView *)scrollLayoutView footerView:(UIView *)footerView {
|
|
|
+
|
|
|
+ [footerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(64);
|
|
|
+ }];
|
|
|
+ [self.invitationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+
|
|
|
+ make.edges.equalTo(footerView).with.insets(UIEdgeInsetsMake(10, 15, 10, 15));
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 布局
|
|
|
+
|
|
|
+- (void)autoLayOutViews {
|
|
|
+
|
|
|
+ self.view.backgroundColor = COLOR_GRAYFA;
|
|
|
+
|
|
|
+ [self.view addSubview:self.scrollLayoutView];
|
|
|
+ [self.scrollLayoutView.contentView addSubview:self.basicInfoView];
|
|
|
+ [self.scrollLayoutView.contentView addSubview:self.objectiveView];
|
|
|
+ [self.scrollLayoutView.contentView addSubview:self.experienceView];
|
|
|
+ [self.scrollLayoutView.footerView addSubview:self.invitationBtn];
|
|
|
+ [self.scrollLayoutView makeConstraints];
|
|
|
+
|
|
|
}
|
|
|
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
+
|
|
|
+#pragma mark - setter and getter
|
|
|
+
|
|
|
+- (FBScrollLayoutView *)scrollLayoutView {
|
|
|
|
|
|
- if (indexPath.section == 0)
|
|
|
+ if (_scrollLayoutView == nil)
|
|
|
{
|
|
|
- if (indexPath.row == 0)
|
|
|
+ _scrollLayoutView = [[FBScrollLayoutView alloc] init];
|
|
|
+ _scrollLayoutView.delegate = self;
|
|
|
+ // 去除顶部空白
|
|
|
+ if (@available(iOS 11.0, *))
|
|
|
{
|
|
|
- static NSString *topCell = @"topCell";
|
|
|
- BHomeResumeDetailTopCell *cell = [tableView dequeueReusableCellWithIdentifier:topCell];
|
|
|
- if (cell == nil)
|
|
|
- {
|
|
|
- cell = [[BHomeResumeDetailTopCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:topCell];
|
|
|
- }
|
|
|
- [cell bHomeResumeDetailTopCellDict:self.dataDict];
|
|
|
- return cell;
|
|
|
+ _scrollLayoutView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- static NSString *intentionCell = @"intentionCell";
|
|
|
- BHomeResumeDetailIntentionCell *cell = [tableView dequeueReusableCellWithIdentifier:intentionCell];
|
|
|
- if (cell == nil)
|
|
|
- {
|
|
|
- cell = [[BHomeResumeDetailIntentionCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:intentionCell];
|
|
|
- }
|
|
|
- [cell bHomeResumeDetailIntentionCellDict:self.dataDict];
|
|
|
- return cell;
|
|
|
+ self.automaticallyAdjustsScrollViewInsets = NO;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ return _scrollLayoutView;
|
|
|
+}
|
|
|
+- (BHomeResumeBasicInformation *)basicInfoView {
|
|
|
+
|
|
|
+ if (_basicInfoView == nil)
|
|
|
{
|
|
|
- if (indexPath.row == 0)
|
|
|
- {
|
|
|
- static NSString *experienceCell = @"experienceCell";
|
|
|
- BHomeResumeDetailExperienceCell *cell = [tableView dequeueReusableCellWithIdentifier:experienceCell];
|
|
|
- if (cell == nil)
|
|
|
- {
|
|
|
- cell = [[BHomeResumeDetailExperienceCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:experienceCell];
|
|
|
- }
|
|
|
- return cell;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- static NSString *listCell = @"listCell";
|
|
|
- BHomeResumeDetailExperienceListCell *cell = [tableView dequeueReusableCellWithIdentifier:listCell];
|
|
|
- if (cell == nil)
|
|
|
- {
|
|
|
- cell = [[BHomeResumeDetailExperienceListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:listCell];
|
|
|
- }
|
|
|
- BHomeResumeDetailModel *model = [BHomeResumeDetailModel yy_modelWithJSON:self.dataDict];
|
|
|
- [cell bHomeResumeDetailExperienceListCell:model.hpResumeWorkExperienceList andIndexpath:indexPath];
|
|
|
- return cell;
|
|
|
- }
|
|
|
+ _basicInfoView = [[BHomeResumeBasicInformation alloc]init];
|
|
|
+ [_basicInfoView.phoneBtn addTarget:self action:@selector(phoneButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [_basicInfoView.WeChatBtn addTarget:self action:@selector(WeChatBUttonClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
}
|
|
|
+ return _basicInfoView;
|
|
|
}
|
|
|
-
|
|
|
-#pragma mark - 布局
|
|
|
-
|
|
|
-- (void)autoLayOutViews {
|
|
|
+- (BHomeResumeObjectiveView *)objectiveView {
|
|
|
|
|
|
- self.view.backgroundColor = COLOR_GRAYFA;
|
|
|
- [self.view addSubview:self.tableView];
|
|
|
- [self.view addSubview:self.invitationBtn];
|
|
|
- [self.view addSubview:self.phoneBtn];
|
|
|
- __weak typeof(self) weakSelf = self;
|
|
|
- [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
-
|
|
|
- make.left.top.right.offset(0);
|
|
|
- make.bottom.equalTo(weakSelf.invitationBtn.mas_top).offset(-10);
|
|
|
- }];
|
|
|
- [_invitationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
-
|
|
|
- make.left.equalTo(weakSelf.view).offset(35);
|
|
|
- make.bottom.equalTo(weakSelf.view).offset(-30);
|
|
|
- make.size.mas_offset(CGSizeMake((SCREEN_WIDTH - 115)/2, 35));
|
|
|
- }];
|
|
|
- [_phoneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
-
|
|
|
- make.right.equalTo(weakSelf.view).offset(-35);
|
|
|
- make.bottom.equalTo(weakSelf.view).offset(-30);
|
|
|
- make.size.mas_offset(CGSizeMake((SCREEN_WIDTH - 115)/2, 35));
|
|
|
- }];
|
|
|
-
|
|
|
- _invitationBtn.layer.cornerRadius = 35/2;
|
|
|
- _phoneBtn.layer.cornerRadius = 35/2;
|
|
|
+ if (_objectiveView == nil)
|
|
|
+ {
|
|
|
+ _objectiveView = [[BHomeResumeObjectiveView alloc]init];
|
|
|
+ }
|
|
|
+ return _objectiveView;
|
|
|
+}
|
|
|
+- (BHomeResumeWorkExperienceView *)experienceView {
|
|
|
+
|
|
|
+ if (_experienceView == nil)
|
|
|
+ {
|
|
|
+ _experienceView = [[BHomeResumeWorkExperienceView alloc]init];
|
|
|
+ }
|
|
|
+ return _experienceView;
|
|
|
}
|
|
|
-
|
|
|
-#pragma mark - setter && getter
|
|
|
-
|
|
|
- (BHomeDataBox *)dataBox {
|
|
|
|
|
|
if (_dataBox == nil)
|
|
|
@@ -229,44 +268,25 @@ FBAPIManagerInterceptor
|
|
|
}
|
|
|
return _detailAPI;
|
|
|
}
|
|
|
-- (UITableView *)tableView {
|
|
|
-
|
|
|
- if (_tableView == nil)
|
|
|
- {
|
|
|
- _tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
|
|
|
- _tableView.delegate = self;
|
|
|
- _tableView.dataSource = self;
|
|
|
- _tableView.separatorStyle = NO;
|
|
|
- _tableView.backgroundColor = COLOR_GRAYFA;
|
|
|
- _tableView.rowHeight = UITableViewAutomaticDimension;
|
|
|
- _tableView.estimatedRowHeight = 10.0;
|
|
|
- }
|
|
|
- return _tableView;
|
|
|
-}
|
|
|
+
|
|
|
- (UIButton *)invitationBtn {
|
|
|
|
|
|
if (_invitationBtn == nil)
|
|
|
{
|
|
|
_invitationBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
[_invitationBtn setTitle:@"邀请面试" forState:UIControlStateNormal];
|
|
|
- _invitationBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
|
|
- _invitationBtn.backgroundColor = COLOR_BLUE_4183E1;
|
|
|
- [_invitationBtn addTarget:self action:@selector(invitationButtonClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ _invitationBtn.titleLabel.font = [UIFont systemFontOfSize:17];
|
|
|
+ [_invitationBtn addTarget:self action:@selector(invitationButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ _invitationBtn.layer.cornerRadius = 5;
|
|
|
+ _invitationBtn.layer.masksToBounds = YES;
|
|
|
+ [_invitationBtn az_setGradientBackgroundWithColors:@[COLOR_GRADIENT_START, COLOR_GRADIENT_END]
|
|
|
+ locations:@[@(0.0),@(1.0f)]
|
|
|
+ startPoint:CGPointMake(0, 0)
|
|
|
+ endPoint:CGPointMake(1, 0)];
|
|
|
}
|
|
|
return _invitationBtn;
|
|
|
}
|
|
|
-- (UIButton *)phoneBtn {
|
|
|
-
|
|
|
- if (_phoneBtn == nil)
|
|
|
- {
|
|
|
- _phoneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- [_phoneBtn setTitle:@"电话沟通" forState:UIControlStateNormal];
|
|
|
- _phoneBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
|
|
- _phoneBtn.backgroundColor = COLOR_BLUE_4183E1;
|
|
|
- [_phoneBtn addTarget:self action:@selector(phoneButtonClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- }
|
|
|
- return _phoneBtn;
|
|
|
-}
|
|
|
+
|
|
|
/*
|
|
|
#pragma mark - Navigation
|
|
|
|