HJAuthFailedViewController.m 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //
  2. // HJAuthFailedViewController.m
  3. // HappyJob
  4. //
  5. // Created by Bob on 2019/4/19.
  6. // Copyright © 2019 Bob. All rights reserved.
  7. //
  8. #import "HJAuthFailedViewController.h"
  9. #import "HJAuthViewController.h"
  10. @interface HJAuthFailedViewController ()
  11. @property (nonatomic, strong) UIView *bgView;
  12. @property (nonatomic, strong) UIImageView *imageV;
  13. @property (nonatomic, strong) UILabel *label;
  14. @property (nonatomic, strong) UIButton *uploadBtn;
  15. @end
  16. @implementation HJAuthFailedViewController
  17. #pragma mark - cycle life
  18. - (void)viewWillAppear:(BOOL)animated {
  19. [super viewWillAppear:animated];
  20. [self.navigationController setNavigationBarHidden:NO animated:animated];
  21. }
  22. - (void)viewDidLoad {
  23. [super viewDidLoad];
  24. [self hj_setupNavBar];
  25. self.title = @"实名认证";
  26. [self initSubViews];
  27. }
  28. #pragma mark - init
  29. - (void)initSubViews {
  30. [self.view addSubview:self.bgView];
  31. [self.bgView addSubview:self.imageV];
  32. [self.bgView addSubview:self.label];
  33. [self.view addSubview:self.uploadBtn];
  34. [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.center.equalTo(self.view);
  36. }];
  37. [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.centerX.equalTo(self.bgView);
  39. make.top.equalTo(self.bgView.mas_top).offset(0);
  40. }];
  41. [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.centerX.equalTo(self.bgView);
  43. make.top.equalTo(self.imageV.mas_bottom).offset(57);
  44. make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
  45. }];
  46. [self.uploadBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  47. make.left.equalTo(self.view).offset(15);
  48. make.right.equalTo(self.view).offset(-15);
  49. make.bottom.equalTo(self.view).offset(-20);
  50. make.height.mas_equalTo(50);
  51. }];
  52. }
  53. #pragma mark - event response
  54. - (void)uploadButtonClicked {
  55. HJAuthViewController *vc = [[HJAuthViewController alloc]init];
  56. [self.navigationController pushViewController:vc animated:YES];
  57. }
  58. #pragma mark - lazy
  59. - (UIView *)bgView {
  60. if (_bgView == nil)
  61. {
  62. _bgView = [[UIView alloc]init];
  63. }
  64. return _bgView;
  65. }
  66. - (UIImageView *)imageV {
  67. if (_imageV == nil)
  68. {
  69. _imageV = [[UIImageView alloc]init];
  70. _imageV.image = [UIImage imageNamed:@"info_merge_fail"];
  71. }
  72. return _imageV;
  73. }
  74. - (UILabel *)label {
  75. if (_label == nil)
  76. {
  77. _label = [[UILabel alloc]init];
  78. _label.text = @"您的审核未通过,\n原因可能是信息或上传图片与要求不符,\n请按照提示要求重新上传您的实名认证资料。";
  79. _label.font = [UIFont systemFontOfSize:14];
  80. _label.textColor = COLOR_666666;
  81. _label.numberOfLines = 0;
  82. _label.textAlignment = NSTextAlignmentCenter;
  83. }
  84. return _label;
  85. }
  86. - (UIButton *)uploadBtn {
  87. if (_uploadBtn == nil)
  88. {
  89. _uploadBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  90. [_uploadBtn setTitle:@"重新上传" forState:UIControlStateNormal];
  91. _uploadBtn.titleLabel.font = [UIFont systemFontOfSize:18];
  92. [_uploadBtn addTarget:self action:@selector(uploadButtonClicked) forControlEvents:UIControlEventTouchUpInside];
  93. _uploadBtn.backgroundColor = COLOR_0177FF;
  94. _uploadBtn.layer.cornerRadius = 5;
  95. _uploadBtn.layer.masksToBounds = YES;
  96. }
  97. return _uploadBtn;
  98. }
  99. @end