| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- //
- // HJAuthView.m
- // HappyJob
- //
- // Created by 张晓光 on 2021/6/4.
- // Copyright © 2021 Bob. All rights reserved.
- //
- #import "HJAuthView.h"
- @implementation HJAuthView
- - (instancetype)initWithFrame:(CGRect)frame {
-
- if (self = [super initWithFrame:frame])
- {
- self.backgroundColor = COLOR_F5F5F5;
- [self makeConstraints];
- }
- return self;
- }
- #pragma mark -- 布局
- - (void)makeConstraints {
-
- [self addSubview:self.topView];
- [self.topView addSubview:self.promptLabel];
- [self.topView addSubview:self.cardPositiveView];
- [self.topView addSubview:self.cardReverseView];
- [self addSubview:self.nameView];
- [self addSubview:self.IDView];
- [self addSubview:self.bottomView];
- [self.bottomView addSubview:self.applyButton];
-
- [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.top.right.equalTo(self).offset(0);
- }];
- [self.promptLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.top.right.equalTo(self.topView).offset(0);
- make.height.mas_equalTo(40);
- }];
- NSArray *IDArray = @[self.cardPositiveView,self.cardReverseView];
- [IDArray mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedSpacing:25 leadSpacing:15 tailSpacing:15];
- [IDArray mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.top.equalTo(self.promptLabel.mas_bottom).offset(28);
- make.bottom.equalTo(self.topView.mas_bottom).offset(-28);
- }];
-
- [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.right.equalTo(self).offset(0);
- make.top.equalTo(self.topView.mas_bottom).offset(10);
- make.height.mas_equalTo(60);
- }];
- [self.IDView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.right.equalTo(self).offset(0);
- make.top.equalTo(self.nameView.mas_bottom).offset(0);
- make.height.mas_equalTo(60);
- }];
- [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.bottom.right.equalTo(self).offset(0);
- make.height.mas_equalTo(64);
- }];
- [self.applyButton mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.centerY.equalTo(self.bottomView);
- make.left.equalTo(self.bottomView).offset(15);
- make.right.equalTo(self.bottomView).offset(-15);
- make.height.mas_equalTo(44);
- }];
-
- self.IDView.hidden = YES;
- self.nameView.hidden = YES;
- }
- #pragma mark -- lazy
- - (UIView *)topView {
-
- if (_topView == nil)
- {
- _topView = [[UIView alloc] init];
- _topView.backgroundColor = [UIColor whiteColor];
- }
- return _topView;
- }
- - (UILabel *)promptLabel {
-
- if (_promptLabel == nil)
- {
- _promptLabel = [[UILabel alloc] init];
- _promptLabel.text = @"为了您的账户及资金安全,请上传本人真实身份证照片!";
- _promptLabel.font = [UIFont systemFontOfSize:13];
- _promptLabel.textColor = [UIColor colorFromHexString:@"FF6300"];
- _promptLabel.backgroundColor = [UIColor colorFromHexString:@"FFEBE3"];
- _promptLabel.textAlignment = NSTextAlignmentCenter;
- }
- return _promptLabel;
- }
- - (HJLabelTextFieldView *)nameView {
-
- if (_nameView == nil)
- {
- _nameView = [[HJLabelTextFieldView alloc] init];
- _nameView.titleLabel.text = @"姓名:";
- _nameView.contentTextField.placeholder = @"请输入真实姓名";
- _nameView.hiddenRightImageV = YES;
- _nameView.contentTextField.userInteractionEnabled = NO;
- _nameView.contentTextField.textColor = [UIColor colorFromHexString:@"AAAAAA"];
- }
- return _nameView;
- }
- - (HJLabelTextFieldView *)IDView {
-
- if (_IDView == nil)
- {
- _IDView = [[HJLabelTextFieldView alloc] init];
- _IDView.titleLabel.text = @"证件号码:";
- _IDView.contentTextField.placeholder = @"请输入证件号码";
- _IDView.hiddenRightImageV = YES;
- _IDView.contentTextField.userInteractionEnabled = NO;
- _IDView.contentTextField.textColor = [UIColor colorFromHexString:@"AAAAAA"];
- }
- return _IDView;
- }
- - (HJAuthUploadImageView *)cardPositiveView {
-
- if (_cardPositiveView == nil)
- {
- _cardPositiveView = [[HJAuthUploadImageView alloc] init];
- _cardPositiveView.pictureImageV.image = [UIImage imageNamed:@"auth_card_foreground"];
- [_cardPositiveView.titleLabel setTitle:@"身份证正面" forState:UIControlStateNormal];
- }
- return _cardPositiveView;
- }
- - (HJAuthUploadImageView *)cardReverseView {
-
- if (_cardReverseView == nil)
- {
- _cardReverseView = [[HJAuthUploadImageView alloc] init];
- _cardReverseView.pictureImageV.image = [UIImage imageNamed:@"auth_card_background"];
- [_cardReverseView.titleLabel setTitle:@"身份证背面" forState:UIControlStateNormal];
- }
- return _cardReverseView;
- }
- - (UIView *)bottomView {
-
- if (_bottomView == nil)
- {
- _bottomView = [[UIView alloc] init];
- _bottomView.backgroundColor = [UIColor whiteColor];
- }
- return _bottomView;
- }
- - (UIButton *)applyButton {
-
- if (_applyButton == nil)
- {
- _applyButton = [UIButton buttonWithType:UIButtonTypeCustom];
- [_applyButton setTitle:@"提交认证" forState:UIControlStateNormal];
- _applyButton.titleLabel.font = [UIFont boldSystemFontOfSize:17];
- // _applyButton.userInteractionEnabled = NO;
- _applyButton.backgroundColor = [UIColor colorFromHexString:@"0177FF" Alpha:0.5];
- _applyButton.layer.cornerRadius = 5;
- _applyButton.layer.masksToBounds = YES;
- }
- return _applyButton;
- }
- @end
|