HJAuthViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. //
  2. // HJAuthViewController.m
  3. // HappyJob
  4. //
  5. // Created by Bob on 2019/4/19.
  6. // Copyright © 2019 Bob. All rights reserved.
  7. //
  8. #import "HJAuthViewController.h"
  9. #import "FBScrollLayoutView.h"
  10. #import "UIButton+HJGradientButton.h"
  11. #import "HJAuthSectionView.h"
  12. #import "HJAuthingViewController.h"
  13. #import "HJAuthSuccessViewController.h"
  14. #import "UIButton+Layout.h"
  15. #import "HJAuthNavBarView.h"
  16. #import "UIView+FBProgressHUD.h"
  17. #import "HJRealApproveAPIManager.h"
  18. #import "HJMeDataBox.h"
  19. #import "UIViewController+FBImagePicker.h"
  20. static const CGFloat LeadSpacing = 15;
  21. static const CGFloat TailSpacing = 15;
  22. static const CGFloat FixedSpacing = 30;
  23. @interface HJAuthViewController () <FBScrollLayoutViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, FBAPIManagerDelegate, FBAPIManagerInterceptor>
  24. @property (nonatomic, strong) FBScrollLayoutView *scrollLayoutView;
  25. @property (nonatomic, strong) HJAuthNavBarView *navBarView;
  26. @property (nonatomic, strong) UIButton *applyButton;
  27. @property (nonatomic, strong) HJAuthSectionView *authSectionView1;
  28. @property (nonatomic, strong) HJAuthSectionView *authSectionView2;
  29. @property (nonatomic, strong) HJAuthSectionView *authSectionView3;
  30. @property (nonatomic, strong) UITextField *nameTextField;
  31. @property (nonatomic, strong) UITextField *cardTextField;
  32. @property (nonatomic, strong) UIView *lineH;
  33. @property (nonatomic, strong) UIButton *cardForegroundButton;
  34. @property (nonatomic, strong) UIButton *cardBackgroundButton;
  35. @property (nonatomic, strong) UIImageView *cardPhotoIcon;
  36. @property (nonatomic, strong) UIButton *cardPhotoButton;
  37. @property (nonatomic, strong) UILabel *remarkLabel1;
  38. @property (nonatomic, strong) UILabel *remarkLabel2;
  39. @property (nonatomic, strong) HJMeDataBox *dataBox;
  40. @property (nonatomic, strong) HJRealApproveAPIManager *realApproveAPIManager;
  41. @property (nonatomic, strong) UIButton *selectedCardButton;
  42. @end
  43. @implementation HJAuthViewController
  44. - (void)viewDidLoad {
  45. [super viewDidLoad];
  46. self.title = @"实名认证";
  47. self.view.backgroundColor = [UIColor whiteColor];
  48. [self.view addSubview:self.navBarView];
  49. [self.navBarView mas_makeConstraints:^(MASConstraintMaker *make) {
  50. make.top.left.right.equalTo(self.view);
  51. make.height.mas_equalTo(HJNavBarDefaultHeight);
  52. }];
  53. [self.view addSubview:self.scrollLayoutView];
  54. [self.scrollLayoutView.contentView addSubview:self.authSectionView1];
  55. [self.scrollLayoutView.contentView addSubview:self.nameTextField];
  56. [self.scrollLayoutView.contentView addSubview:self.lineH];
  57. [self.scrollLayoutView.contentView addSubview:self.cardTextField];
  58. [self.scrollLayoutView.contentView addSubview:self.authSectionView2];
  59. [self.scrollLayoutView.contentView addSubview:self.cardForegroundButton];
  60. [self.scrollLayoutView.contentView addSubview:self.cardBackgroundButton];
  61. [self.scrollLayoutView.contentView addSubview:self.authSectionView3];
  62. [self.scrollLayoutView.contentView addSubview:self.cardPhotoIcon];
  63. [self.scrollLayoutView.contentView addSubview:self.cardPhotoButton];
  64. [self.scrollLayoutView.contentView addSubview:self.remarkLabel1];
  65. [self.scrollLayoutView.contentView addSubview:self.remarkLabel2];
  66. [self.scrollLayoutView.footerView addSubview:self.applyButton];
  67. [self.scrollLayoutView makeConstraints];
  68. }
  69. #pragma mark - FBScrollLayoutViewDelegate
  70. - (void)scrollLayoutViewMakeConstraints:(FBScrollLayoutView *)scrollLayoutView {
  71. [scrollLayoutView mas_makeConstraints:^(MASConstraintMaker *make) {
  72. make.top.equalTo(self.navBarView.mas_bottom);
  73. make.left.right.equalTo(self.view);
  74. make.bottom.equalTo(self.mas_bottomLayoutGuide);
  75. }];
  76. }
  77. - (void)subviewsMakeConstraintsInScrollLayoutView:(FBScrollLayoutView *)scrollLayoutView contentView:(UIView *)contentView {
  78. [self.authSectionView1 mas_makeConstraints:^(MASConstraintMaker *make) {
  79. make.top.left.right.equalTo(contentView);
  80. make.height.mas_equalTo(40);
  81. }];
  82. [self.nameTextField mas_makeConstraints:^(MASConstraintMaker *make) {
  83. make.top.equalTo(self.authSectionView1.mas_bottom).with.offset(3);
  84. make.left.equalTo(contentView).with.offset(40);
  85. make.right.equalTo(contentView).with.offset(-40);
  86. make.height.mas_equalTo(30);
  87. }];
  88. [self.lineH mas_makeConstraints:^(MASConstraintMaker *make) {
  89. make.top.equalTo(self.nameTextField.mas_bottom).with.offset(3);
  90. make.left.right.equalTo(contentView);
  91. make.height.mas_equalTo(1);
  92. }];
  93. [self.cardTextField mas_makeConstraints:^(MASConstraintMaker *make) {
  94. make.top.equalTo(self.lineH.mas_bottom).with.offset(3);
  95. make.left.right.height.equalTo(self.nameTextField);
  96. }];
  97. // 身份证件照片
  98. [self.authSectionView2 mas_makeConstraints:^(MASConstraintMaker *make) {
  99. make.top.equalTo(self.cardTextField.mas_bottom).with.offset(3);
  100. make.left.right.height.equalTo(self.authSectionView1);
  101. }];
  102. // 二等分布局
  103. [self.cardForegroundButton mas_makeConstraints:^(MASConstraintMaker *make) {
  104. make.top.equalTo(self.authSectionView2.mas_bottom).with.offset(24);
  105. make.left.equalTo(contentView).with.offset(LeadSpacing);
  106. make.size.mas_equalTo(self.cardForegroundButton.frame.size);
  107. }];
  108. [self.cardBackgroundButton mas_makeConstraints:^(MASConstraintMaker *make) {
  109. make.top.equalTo(self.authSectionView2.mas_bottom).with.offset(24);
  110. make.right.equalTo(contentView).with.offset(-TailSpacing);
  111. make.size.mas_equalTo(self.cardBackgroundButton.frame.size);
  112. }];
  113. // 手持身份证照片
  114. [self.authSectionView3 mas_makeConstraints:^(MASConstraintMaker *make) {
  115. make.top.equalTo(self.cardBackgroundButton.mas_bottom).with.offset(24);
  116. make.left.right.height.equalTo(self.authSectionView1);
  117. }];
  118. // 二等分布局
  119. [self.cardPhotoIcon mas_makeConstraints:^(MASConstraintMaker *make) {
  120. make.top.equalTo(self.authSectionView3.mas_bottom).with.offset(24);
  121. make.left.equalTo(contentView).with.offset(LeadSpacing);
  122. make.size.mas_equalTo(self.cardPhotoIcon.frame.size);
  123. }];
  124. [self.cardPhotoButton mas_makeConstraints:^(MASConstraintMaker *make) {
  125. make.top.equalTo(self.authSectionView3.mas_bottom).with.offset(24);
  126. make.right.equalTo(contentView).with.offset(-TailSpacing);
  127. make.size.mas_equalTo(self.cardPhotoButton.frame.size);
  128. }];
  129. [self.remarkLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
  130. make.top.equalTo(self.cardPhotoIcon.mas_bottom).with.offset(30);
  131. make.centerX.equalTo(contentView);
  132. }];
  133. [self.remarkLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
  134. make.top.equalTo(self.remarkLabel1.mas_bottom).with.offset(5);
  135. make.centerX.equalTo(contentView);
  136. }];
  137. [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
  138. make.bottom.equalTo(self.remarkLabel2.mas_bottom).with.offset(8);
  139. }];
  140. }
  141. - (void)subviewsMakeConstraintsInScrollLayoutView:(FBScrollLayoutView *)scrollLayoutView footerView:(UIView *)footerView {
  142. [footerView mas_makeConstraints:^(MASConstraintMaker *make) {
  143. make.height.mas_equalTo(60);
  144. }];
  145. [self.applyButton mas_makeConstraints:^(MASConstraintMaker *make) {
  146. make.edges.equalTo(footerView).with.insets(UIEdgeInsetsMake(11, 9, 7, 9));
  147. }];
  148. }
  149. #pragma mark - UIImagePickerControllerDelegate
  150. - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  151. NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
  152. //当选择的类型是图片
  153. if ([type isEqualToString:@"public.image"]) {
  154. //先把图片转成NSData
  155. UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
  156. if (self.selectedCardButton == self.cardForegroundButton) {
  157. self.realApproveAPIManager.cardFrontImage = image;
  158. }
  159. if (self.selectedCardButton == self.cardBackgroundButton) {
  160. self.realApproveAPIManager.cardBackImage = image;
  161. }
  162. if (self.selectedCardButton == self.cardPhotoButton) {
  163. self.realApproveAPIManager.cardHoldImage = image;
  164. }
  165. // NSData *data = UIImagePNGRepresentation(image);
  166. // if (data == nil) {
  167. // data = UIImageJPEGRepresentation(image, 1.0);
  168. // }
  169. // //图片保存的路径
  170. // //这里将图片放在沙盒的documents文件夹中
  171. // NSString *DocumentsPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
  172. // //文件管理器
  173. // NSFileManager *fileManager = [NSFileManager defaultManager];
  174. // //把刚刚图片转换的data对象拷贝至沙盒中并保存为image.png
  175. // [fileManager createDirectoryAtPath:DocumentsPath withIntermediateDirectories:YES attributes:nil error:nil];
  176. // [fileManager createFileAtPath:[DocumentsPath stringByAppendingString:@"/userHeader.png"] contents:data attributes:nil];
  177. //关闭相册界面
  178. [self.selectedCardButton setBackgroundImage:image forState:UIControlStateSelected];
  179. self.selectedCardButton.selected = YES;
  180. [self dismissViewControllerAnimated:YES completion:^{
  181. self.selectedCardButton = nil;
  182. }];
  183. }
  184. }
  185. - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
  186. [self dismissViewControllerAnimated:YES completion:^{
  187. self.selectedCardButton = nil;
  188. }];
  189. }
  190. #pragma mark - FBAPIManagerInterceptor
  191. - (BOOL)manager:(FBBaseAPIManager *)manager shouldStartCallAPIWithParams:(NSDictionary *)params {
  192. [self.view fb_showLoading];
  193. NSString *errorMessage = nil;
  194. if (self.nameTextField.text.length == 0) {
  195. [self.nameTextField becomeFirstResponder];
  196. errorMessage = @"请您先填写真实姓名";
  197. } else if (self.nameTextField.text.length > 30) {
  198. [self.nameTextField becomeFirstResponder];
  199. errorMessage = @"姓名不能超过30个字符";
  200. } else if (self.cardTextField.text.length != 18) {
  201. [self.cardTextField becomeFirstResponder];
  202. errorMessage = @"请您先填写正确的身份证号";
  203. } else if (!self.cardForegroundButton.selected) {
  204. errorMessage = @"请您先上传证件正面照";
  205. } else if (!self.cardBackgroundButton.selected) {
  206. errorMessage = @"请您先上传证件背面照";
  207. } else if (!self.cardPhotoButton.selected) {
  208. errorMessage = @"请您先上传手持证件照";
  209. }
  210. if (errorMessage != nil) {
  211. [self.view fb_showFailureWithStatus:errorMessage];
  212. return NO;
  213. }
  214. return YES;
  215. }
  216. - (void)managerShouldFinishCallAPI:(FBBaseAPIManager *)manager {
  217. [self.view fb_dismiss];
  218. }
  219. #pragma mark - FBAPIManagerDelegate
  220. - (void)managerCallAPIDidSuccess:(FBBaseAPIManager *)manager {
  221. if (manager == self.realApproveAPIManager) {
  222. id fetchData = [manager fetchDataWithBox:self.dataBox];
  223. if ([fetchData isKindOfClass:[NSString class]]) {
  224. [self.view fb_showSuccessWithStatus:fetchData completion:^{
  225. [self.navigationController popToRootViewControllerAnimated:YES];
  226. }];
  227. }
  228. }
  229. }
  230. - (void)managerCallAPIDidFailed:(FBBaseAPIManager *)manager {
  231. if (manager == self.realApproveAPIManager) {
  232. id fetchData = [manager fetchDataWithBox:self.dataBox];
  233. if ([fetchData isKindOfClass:[NSString class]]) {
  234. [self.view fb_showFailureWithStatus:fetchData];
  235. }
  236. }
  237. }
  238. #pragma mark - event response
  239. - (void)applyButtonClicked:(UIButton *)sender {
  240. self.realApproveAPIManager.realName = self.nameTextField.text;
  241. self.realApproveAPIManager.cardNumber = self.cardTextField.text;
  242. [self.realApproveAPIManager start];
  243. }
  244. - (void)backButtonClicked:(UIButton *)sender {
  245. [self.navigationController popToRootViewControllerAnimated:YES];
  246. }
  247. - (void)openImagePicker:(UIButton *)sender {
  248. // 被点击的上传按钮
  249. self.selectedCardButton = sender;
  250. [self fb_openImagePickerWithPhotoHandler:^(UIImagePickerController * _Nonnull imagePicker) {
  251. imagePicker.delegate = self;
  252. } cameraHandler:^(UIImagePickerController * _Nonnull imagePicker) {
  253. imagePicker.delegate = self;
  254. } cancelHandler:^{
  255. self.selectedCardButton = nil;
  256. }];
  257. }
  258. #pragma mark - private methods
  259. - (UIButton *)createButtonWithTitle:(NSString *)title imageNamed:(NSString *)imageNamed {
  260. UIImage *image = [UIImage imageNamed:imageNamed];
  261. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  262. button.layer.borderWidth = 1;
  263. button.layer.borderColor = [UIColor lightGrayColor].CGColor;
  264. button.layer.cornerRadius = 6;
  265. button.layer.masksToBounds = YES;
  266. [button setImage:image forState:UIControlStateNormal];
  267. [button setImage:[UIImage new] forState:UIControlStateSelected];
  268. [button setBackgroundImage:[UIImage new] forState:UIControlStateNormal];
  269. if (title != nil) {
  270. button.titleLabel.font = [UIFont systemFontOfSize:HJHorizontalScale(11)];
  271. button.titleLabel.textAlignment = NSTextAlignmentCenter;
  272. [button setTitle:title forState:UIControlStateNormal];
  273. [button setTitle:@"" forState:UIControlStateSelected];
  274. [button setTitleColor:[UIColor colorWithRed:204/255.0 green:204/255.0 blue:204/255.0 alpha:1.0] forState:UIControlStateNormal];
  275. }
  276. //按钮固定尺寸
  277. CGSize size = CGSizeMake((SCREEN_WIDTH-LeadSpacing-TailSpacing-FixedSpacing)/2, 103);
  278. //文字图片上下显示
  279. CGSize imageSize = image.size;
  280. CGSize titleSize = CGSizeMake(105, 12);
  281. CGFloat maxWidth = size.width;
  282. CGFloat padding = 13;
  283. button.imageRect = CGRectMake((maxWidth - imageSize.width) / 2, 30, imageSize.width, imageSize.height);
  284. button.titleRect = CGRectMake((maxWidth - titleSize.width) / 2, 30 + imageSize.height + padding, titleSize.width, titleSize.height);
  285. button.frame = CGRectMake(0, 0, size.width, size.height);
  286. return button;
  287. }
  288. #pragma mark - getters and setters
  289. - (HJMeDataBox *)dataBox {
  290. if (_dataBox == nil) {
  291. _dataBox = [[HJMeDataBox alloc] init];
  292. }
  293. return _dataBox;
  294. }
  295. - (HJRealApproveAPIManager *)realApproveAPIManager {
  296. if (_realApproveAPIManager == nil) {
  297. _realApproveAPIManager = [[HJRealApproveAPIManager alloc] init];
  298. _realApproveAPIManager.APIManagerDelegate = self;
  299. _realApproveAPIManager.APIManagerInterceptor = self;
  300. }
  301. return _realApproveAPIManager;
  302. }
  303. - (HJAuthNavBarView *)navBarView {
  304. if (_navBarView == nil) {
  305. _navBarView = [[HJAuthNavBarView alloc] init];
  306. _navBarView.backgroundColor = [UIColor whiteColor];
  307. _navBarView.titleLabel.text = @"实名认证";
  308. _navBarView.titleLabel.textColor = [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0];
  309. [_navBarView.backButton setImage:[UIImage imageNamed:@"navbar_back_black"] forState:UIControlStateNormal];
  310. [_navBarView.backButton addTarget:self action:@selector(backButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
  311. }
  312. return _navBarView;
  313. }
  314. - (UILabel *)remarkLabel1 {
  315. if (_remarkLabel1 == nil) {
  316. _remarkLabel1 = [[UILabel alloc] init];
  317. _remarkLabel1.text = @"1,身份证信息仅供开心工作平台提供诚信保证使用;";
  318. _remarkLabel1.textColor = [UIColor lightGrayColor];
  319. _remarkLabel1.font = [UIFont systemFontOfSize:10];
  320. }
  321. return _remarkLabel1;
  322. }
  323. - (UILabel *)remarkLabel2 {
  324. if (_remarkLabel2 == nil) {
  325. _remarkLabel2 = [[UILabel alloc] init];
  326. _remarkLabel2.text = @"2,开心工作承诺不向其他第三方透露您的个人信息。";
  327. _remarkLabel2.textColor = [UIColor lightGrayColor];
  328. _remarkLabel2.font = [UIFont systemFontOfSize:10];
  329. }
  330. return _remarkLabel2;
  331. }
  332. - (UIImageView *)cardPhotoIcon {
  333. if (_cardPhotoIcon == nil) {
  334. _cardPhotoIcon = [[UIImageView alloc] init];
  335. _cardPhotoIcon.layer.borderWidth = 1;
  336. _cardPhotoIcon.layer.borderColor = [UIColor lightGrayColor].CGColor;
  337. _cardPhotoIcon.layer.cornerRadius = 6;
  338. _cardPhotoIcon.layer.masksToBounds = YES;
  339. _cardPhotoIcon.image = [UIImage imageNamed:@"auth_card_photo"];
  340. _cardPhotoIcon.contentMode = UIViewContentModeCenter;
  341. CGSize size = CGSizeMake((SCREEN_WIDTH-LeadSpacing-TailSpacing-FixedSpacing)/2, 103);
  342. _cardPhotoIcon.frame = CGRectMake(0, 0, size.width, size.height);
  343. }
  344. return _cardPhotoIcon;
  345. }
  346. - (UIButton *)cardPhotoButton {
  347. if (_cardPhotoButton == nil) {
  348. _cardPhotoButton = [self createButtonWithTitle:@"点击上传手持证件照" imageNamed:@"auth_photo"];
  349. [_cardPhotoButton addTarget:self action:@selector(openImagePicker:) forControlEvents:UIControlEventTouchUpInside];
  350. }
  351. return _cardPhotoButton;
  352. }
  353. - (UIButton *)cardForegroundButton {
  354. if (_cardForegroundButton == nil) {
  355. _cardForegroundButton = [self createButtonWithTitle:@"点击上传证件正面照" imageNamed:@"auth_card_foreground"];
  356. [_cardForegroundButton addTarget:self action:@selector(openImagePicker:) forControlEvents:UIControlEventTouchUpInside];
  357. }
  358. return _cardForegroundButton;
  359. }
  360. - (UIButton *)cardBackgroundButton {
  361. if (_cardBackgroundButton == nil) {
  362. _cardBackgroundButton = [self createButtonWithTitle:@"点击上传证件背面照" imageNamed:@"auth_card_background"];
  363. [_cardBackgroundButton addTarget:self action:@selector(openImagePicker:) forControlEvents:UIControlEventTouchUpInside];
  364. }
  365. return _cardBackgroundButton;
  366. }
  367. - (UITextField *)nameTextField {
  368. if (_nameTextField == nil) {
  369. _nameTextField = [[UITextField alloc] init];
  370. _nameTextField.placeholder = @"您的姓名";
  371. _nameTextField.borderStyle = UITextBorderStyleNone;
  372. _nameTextField.keyboardType = UIKeyboardTypeDefault;
  373. _nameTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
  374. _nameTextField.font = [UIFont systemFontOfSize:14];
  375. }
  376. return _nameTextField;
  377. }
  378. - (UITextField *)cardTextField {
  379. if (_cardTextField == nil) {
  380. _cardTextField = [[UITextField alloc] init];
  381. _cardTextField.placeholder = @"您的身份证号码";
  382. _cardTextField.borderStyle = UITextBorderStyleNone;
  383. _cardTextField.keyboardType = UIKeyboardTypeASCIICapable;
  384. _cardTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
  385. _cardTextField.font = [UIFont systemFontOfSize:14];
  386. }
  387. return _cardTextField;
  388. }
  389. - (UIView *)lineH {
  390. if (_lineH == nil) {
  391. _lineH = [[UIView alloc] init];
  392. _lineH.backgroundColor = [UIColor colorWithRed:238/255.0 green:238/255.0 blue:238/255.0 alpha:1.0];
  393. }
  394. return _lineH;
  395. }
  396. - (HJAuthSectionView *)authSectionView1 {
  397. if (_authSectionView1 == nil) {
  398. _authSectionView1 = [[HJAuthSectionView alloc] init];
  399. _authSectionView1.titleLabel.text = @"身份信息";
  400. }
  401. return _authSectionView1;
  402. }
  403. - (HJAuthSectionView *)authSectionView2 {
  404. if (_authSectionView2 == nil) {
  405. _authSectionView2 = [[HJAuthSectionView alloc] init];
  406. _authSectionView2.titleLabel.text = @"身份证件照片";
  407. }
  408. return _authSectionView2;
  409. }
  410. - (HJAuthSectionView *)authSectionView3 {
  411. if (_authSectionView3 == nil) {
  412. _authSectionView3 = [[HJAuthSectionView alloc] init];
  413. _authSectionView3.titleLabel.text = @"手持身份证照片";
  414. }
  415. return _authSectionView3;
  416. }
  417. - (UIButton *)applyButton {
  418. if (_applyButton == nil) {
  419. _applyButton = [UIButton hj_createGradientButtonWithTitle:@"提交"];
  420. [_applyButton addTarget:self action:@selector(applyButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
  421. }
  422. return _applyButton;
  423. }
  424. - (FBScrollLayoutView *)scrollLayoutView {
  425. if (_scrollLayoutView == nil) {
  426. _scrollLayoutView = [[FBScrollLayoutView alloc] init];
  427. _scrollLayoutView.delegate = self;
  428. }
  429. return _scrollLayoutView;
  430. }
  431. @end