HJAuthFailedViewController.m 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. - (void)viewWillAppear:(BOOL)animated {
  18. [super viewWillAppear:animated];
  19. [self.navigationController setNavigationBarHidden:NO animated:animated];
  20. }
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. [self hj_setupNavBar];
  24. self.title = @"实名认证";
  25. [self initSubViews];
  26. }
  27. #pragma mark - init
  28. - (void)initSubViews {
  29. [self.view addSubview:self.bgView];
  30. [self.bgView addSubview:self.imageV];
  31. [self.bgView addSubview:self.label];
  32. [self.view addSubview:self.uploadBtn];
  33. [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.center.equalTo(self.view);
  35. }];
  36. [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
  37. make.centerX.equalTo(self.bgView);
  38. make.top.equalTo(self.bgView.mas_top).offset(0);
  39. }];
  40. [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.centerX.equalTo(self.bgView);
  42. make.top.equalTo(self.imageV.mas_bottom).offset(57);
  43. make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
  44. }];
  45. [self.uploadBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.left.equalTo(self.view).offset(15);
  47. make.right.equalTo(self.view).offset(-15);
  48. make.bottom.equalTo(self.view).offset(-20);
  49. make.height.mas_equalTo(50);
  50. }];
  51. }
  52. #pragma mark - event response
  53. - (void)uploadButtonClicked {
  54. HJAuthViewController *vc = [[HJAuthViewController alloc]init];
  55. [self.navigationController pushViewController:vc animated:YES];
  56. }
  57. #pragma mark - setter & getter
  58. - (UIView *)bgView {
  59. if (_bgView == nil)
  60. {
  61. _bgView = [[UIView alloc]init];
  62. }
  63. return _bgView;
  64. }
  65. - (UIImageView *)imageV {
  66. if (_imageV == nil)
  67. {
  68. _imageV = [[UIImageView alloc]init];
  69. _imageV.image = [UIImage imageNamed:@"info_merge_fail"];
  70. }
  71. return _imageV;
  72. }
  73. - (UILabel *)label {
  74. if (_label == nil)
  75. {
  76. _label = [[UILabel alloc]init];
  77. _label.text = @"您的审核未通过,\n原因可能是信息或上传图片与要求不符,\n请按照提示要求重新上传您的实名认证资料。";
  78. _label.font = [UIFont systemFontOfSize:14];
  79. _label.textColor = COLOR_BACK6;
  80. _label.numberOfLines = 0;
  81. _label.textAlignment = NSTextAlignmentCenter;
  82. }
  83. return _label;
  84. }
  85. - (UIButton *)uploadBtn {
  86. if (_uploadBtn == nil)
  87. {
  88. _uploadBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  89. [_uploadBtn setTitle:@"重新上传" forState:UIControlStateNormal];
  90. _uploadBtn.titleLabel.font = [UIFont systemFontOfSize:18];
  91. [_uploadBtn addTarget:self action:@selector(uploadButtonClicked) forControlEvents:UIControlEventTouchUpInside];
  92. [_uploadBtn az_setGradientBackgroundWithColors:@[COLOR_GRADIENT_START, COLOR_GRADIENT_END] locations:@[@(0.0),@(1.0f)] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
  93. _uploadBtn.layer.cornerRadius = 5;
  94. _uploadBtn.layer.masksToBounds = YES;
  95. }
  96. return _uploadBtn;
  97. }
  98. @end