// // MerchantAdminSetupView.m // merchant // // Created by qitewei on 2025/8/14. // Copyright © 2025 xfg. All rights reserved. // #import "MerchantAdminSetupView.h" #import "UIView+Extention.h" @implementation MerchantAdminSetupView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self setupUI]; [self setupConstraints]; } return self; } - (void)setupUI { self.backgroundColor = [UIColor clearColor]; // 添加姓名区域 [self setupNameSection]; // 添加电话号码区域 [self setupPhoneSection]; // 添加验证码区域 [self setupVerifyCodeSection]; // 添加密码区域 [self setupPasswordSection]; } - (void)setupNameSection { [self.contentView addSubview:self.nameLabel]; [self.contentView addSubview:self.nameTextField]; } - (void)setupPhoneSection { [self.contentView addSubview:self.phoneLabel]; [self.contentView addSubview:self.phoneTextField]; [self.contentView addSubview:self.phoneWarningView]; [self.phoneWarningView addSubview:self.phoneWarningIcon]; [self.phoneWarningView addSubview:self.phoneWarningLabel]; } - (void)setupVerifyCodeSection { [self.contentView addSubview:self.verifyCodeLabel]; [self.contentView addSubview:self.verifyCodeContainerView]; [self.verifyCodeContainerView addSubview:self.verifyCodeTextField]; [self.verifyCodeContainerView addSubview:self.getVerifyCodeButton]; } - (void)setupPasswordSection { [self.contentView addSubview:self.passwordSectionLabel]; [self.contentView addSubview:self.passwordWarningView]; [self.passwordWarningView addSubview:self.passwordWarningIcon]; [self.passwordWarningView addSubview:self.passwordWarningLabel]; [self.contentView addSubview:self.passwordLabel]; [self.contentView addSubview:self.passwordContainerView]; [self.passwordContainerView addSubview:self.passwordTextField]; [self.passwordContainerView addSubview:self.passwordEyeButton]; [self.contentView addSubview:self.confirmPasswordLabel]; [self.contentView addSubview:self.confirmPasswordContainerView]; [self.confirmPasswordContainerView addSubview:self.confirmPasswordTextField]; [self.confirmPasswordContainerView addSubview:self.confirmPasswordEyeButton]; } - (void)setupConstraints { // 姓名 [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(kRealValue(24)); make.top.equalTo(self.contentView).offset(kRealValue(20)); }]; [self.nameTextField mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.right.equalTo(self.contentView).offset(-kRealValue(24)); make.top.equalTo(self.nameLabel.mas_bottom).offset(kRealValue(12)); make.height.mas_equalTo(kRealValue(48)); }]; // 电话号码 [self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.top.equalTo(self.nameTextField.mas_bottom).offset(kRealValue(24)); }]; [self.phoneTextField mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.phoneLabel); make.right.equalTo(self.contentView).offset(-kRealValue(24)); make.top.equalTo(self.phoneLabel.mas_bottom).offset(kRealValue(12)); make.height.mas_equalTo(kRealValue(48)); }]; // 电话号码提示信息 [self.phoneWarningView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.phoneTextField); make.top.equalTo(self.phoneTextField.mas_bottom).offset(kRealValue(8)); make.height.mas_equalTo(kRealValue(32)); }]; [self.phoneWarningIcon mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.phoneWarningView).offset(kRealValue(8)); make.centerY.equalTo(self.phoneWarningView); make.size.mas_equalTo(CGSizeMake(kRealValue(14), kRealValue(14))); }]; [self.phoneWarningLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.phoneWarningIcon.mas_right).offset(kRealValue(6)); make.right.equalTo(self.phoneWarningView).offset(-kRealValue(8)); make.centerY.equalTo(self.phoneWarningView); }]; // 验证码 [self.verifyCodeLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.top.equalTo(self.phoneWarningView.mas_bottom).offset(kRealValue(24)); }]; [self.verifyCodeContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.verifyCodeLabel); make.right.equalTo(self.contentView).offset(-kRealValue(24)); make.top.equalTo(self.verifyCodeLabel.mas_bottom).offset(kRealValue(12)); make.height.mas_equalTo(kRealValue(48)); }]; [self.getVerifyCodeButton mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.verifyCodeContainerView).offset(-kRealValue(8)); make.centerY.equalTo(self.verifyCodeContainerView); make.width.mas_equalTo(kRealValue(80)); make.height.mas_equalTo(kRealValue(32)); }]; [self.verifyCodeTextField mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.verifyCodeContainerView).offset(kRealValue(16)); make.right.equalTo(self.getVerifyCodeButton.mas_left).offset(-kRealValue(8)); make.centerY.equalTo(self.verifyCodeContainerView); make.height.mas_equalTo(kRealValue(48)); }]; // PC端商家后台登录密码标题 [self.passwordSectionLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.top.equalTo(self.verifyCodeContainerView.mas_bottom).offset(kRealValue(24)); }]; // 密码提示信息 [self.passwordWarningView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.right.equalTo(self.contentView).offset(-kRealValue(24)); make.top.equalTo(self.passwordSectionLabel.mas_bottom).offset(kRealValue(8)); make.height.mas_equalTo(kRealValue(32)); }]; [self.passwordWarningIcon mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.passwordWarningView).offset(kRealValue(8)); make.centerY.equalTo(self.passwordWarningView); make.size.mas_equalTo(CGSizeMake(kRealValue(14), kRealValue(14))); }]; [self.passwordWarningLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.passwordWarningIcon.mas_right).offset(kRealValue(6)); make.right.equalTo(self.passwordWarningView).offset(-kRealValue(8)); make.centerY.equalTo(self.passwordWarningView); }]; // 密码输入框 [self.passwordLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.top.equalTo(self.passwordWarningView.mas_bottom).offset(kRealValue(16)); }]; [self.passwordContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.passwordLabel); make.right.equalTo(self.contentView).offset(-kRealValue(24)); make.top.equalTo(self.passwordLabel.mas_bottom).offset(kRealValue(12)); make.height.mas_equalTo(kRealValue(48)); }]; [self.passwordEyeButton mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.passwordContainerView).offset(-kRealValue(16)); make.centerY.equalTo(self.passwordContainerView); make.size.mas_equalTo(CGSizeMake(kRealValue(20), kRealValue(20))); }]; [self.passwordTextField mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.passwordContainerView).offset(kRealValue(16)); make.right.equalTo(self.passwordEyeButton.mas_left).offset(-kRealValue(8)); make.centerY.equalTo(self.passwordContainerView); make.height.mas_equalTo(kRealValue(48)); }]; // 确认密码输入框 [self.confirmPasswordLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.nameLabel); make.top.equalTo(self.passwordContainerView.mas_bottom).offset(kRealValue(24)); }]; [self.confirmPasswordContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.confirmPasswordLabel); make.right.equalTo(self.contentView).offset(-kRealValue(24)); make.top.equalTo(self.confirmPasswordLabel.mas_bottom).offset(kRealValue(12)); make.height.mas_equalTo(kRealValue(48)); make.bottom.equalTo(self.contentView).offset(-kRealValue(20)); }]; [self.confirmPasswordEyeButton mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.confirmPasswordContainerView).offset(-kRealValue(16)); make.centerY.equalTo(self.confirmPasswordContainerView); make.size.mas_equalTo(CGSizeMake(kRealValue(20), kRealValue(20))); }]; [self.confirmPasswordTextField mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.confirmPasswordContainerView).offset(kRealValue(16)); make.right.equalTo(self.confirmPasswordEyeButton.mas_left).offset(-kRealValue(8)); make.centerY.equalTo(self.confirmPasswordContainerView); make.height.mas_equalTo(kRealValue(48)); }]; } #pragma mark - Actions - (void)getVerifyCodeButtonTapped:(UIButton *)sender { // TODO: 实现获取验证码功能 NSLog(@"Get verify code button tapped"); // 简单的倒计时效果 sender.enabled = NO; [sender setTitle:ASLocalizedString(@"60s后重试") forState:UIControlStateDisabled]; [sender setTitleColor:[UIColor grayColor] forState:UIControlStateDisabled]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ sender.enabled = YES; [sender setTitle:ASLocalizedString(@"获取验证码") forState:UIControlStateNormal]; }); } - (void)passwordEyeButtonTapped:(UIButton *)sender { self.passwordTextField.secureTextEntry = !self.passwordTextField.secureTextEntry; UIImage *eyeImage = self.passwordTextField.secureTextEntry ? [UIImage imageNamed:@"icon_eye_close"] : [UIImage imageNamed:@"icon_eye_open"]; if (!eyeImage) { // 使用系统图标作为降级方案 if (@available(iOS 13.0, *)) { eyeImage = self.passwordTextField.secureTextEntry ? [UIImage systemImageNamed:@"eye.slash"] : [UIImage systemImageNamed:@"eye"]; } } [sender setImage:eyeImage forState:UIControlStateNormal]; } - (void)confirmPasswordEyeButtonTapped:(UIButton *)sender { self.confirmPasswordTextField.secureTextEntry = !self.confirmPasswordTextField.secureTextEntry; UIImage *eyeImage = self.confirmPasswordTextField.secureTextEntry ? [UIImage imageNamed:@"icon_eye_close"] : [UIImage imageNamed:@"icon_eye_open"]; if (!eyeImage) { // 使用系统图标作为降级方案 if (@available(iOS 13.0, *)) { eyeImage = self.confirmPasswordTextField.secureTextEntry ? [UIImage systemImageNamed:@"eye.slash"] : [UIImage systemImageNamed:@"eye"]; } } [sender setImage:eyeImage forState:UIControlStateNormal]; } #pragma mark - Lazy Loading - (UILabel *)nameLabel { if (!_nameLabel) { _nameLabel = [[UILabel alloc] init]; _nameLabel.text = ASLocalizedString(@"姓名"); _nameLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; _nameLabel.textColor = [UIColor blackColor]; // 添加红色星号 NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:_nameLabel.text]; NSAttributedString *redStar = [[NSAttributedString alloc] initWithString:@" *" attributes:@{ NSForegroundColorAttributeName: [UIColor redColor], NSFontAttributeName: [UIFont systemFontOfSize:16 weight:UIFontWeightMedium] }]; [attributedText appendAttributedString:redStar]; _nameLabel.attributedText = attributedText; } return _nameLabel; } - (UITextField *)nameTextField { if (!_nameTextField) { _nameTextField = [[UITextField alloc] init]; _nameTextField.placeholder = ASLocalizedString(@"请输入管理员姓名"); _nameTextField.font = [UIFont systemFontOfSize:16]; _nameTextField.textColor = [UIColor blackColor]; _nameTextField.backgroundColor = [UIColor whiteColor]; _nameTextField.layer.cornerRadius = kRealValue(8); _nameTextField.layer.borderWidth = 1; _nameTextField.layer.borderColor = [UIColor colorWithHexString:@"#E5E5E5"].CGColor; // 设置内边距 UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kRealValue(16), kRealValue(48))]; _nameTextField.leftView = leftView; _nameTextField.leftViewMode = UITextFieldViewModeAlways; UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kRealValue(16), kRealValue(48))]; _nameTextField.rightView = rightView; _nameTextField.rightViewMode = UITextFieldViewModeAlways; } return _nameTextField; } - (UILabel *)phoneLabel { if (!_phoneLabel) { _phoneLabel = [[UILabel alloc] init]; _phoneLabel.text = ASLocalizedString(@"电话号码"); _phoneLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; _phoneLabel.textColor = [UIColor blackColor]; // 添加红色星号 NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:_phoneLabel.text]; NSAttributedString *redStar = [[NSAttributedString alloc] initWithString:@" *" attributes:@{ NSForegroundColorAttributeName: [UIColor redColor], NSFontAttributeName: [UIFont systemFontOfSize:16 weight:UIFontWeightMedium] }]; [attributedText appendAttributedString:redStar]; _phoneLabel.attributedText = attributedText; } return _phoneLabel; } - (UITextField *)phoneTextField { if (!_phoneTextField) { _phoneTextField = [[UITextField alloc] init]; _phoneTextField.placeholder = ASLocalizedString(@"请输入管理员电话号码"); _phoneTextField.font = [UIFont systemFontOfSize:16]; _phoneTextField.textColor = [UIColor blackColor]; _phoneTextField.backgroundColor = [UIColor whiteColor]; _phoneTextField.layer.cornerRadius = kRealValue(8); _phoneTextField.layer.borderWidth = 1; _phoneTextField.layer.borderColor = [UIColor colorWithHexString:@"#E5E5E5"].CGColor; _phoneTextField.keyboardType = UIKeyboardTypePhonePad; // 设置内边距 UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kRealValue(16), kRealValue(48))]; _phoneTextField.leftView = leftView; _phoneTextField.leftViewMode = UITextFieldViewModeAlways; UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kRealValue(16), kRealValue(48))]; _phoneTextField.rightView = rightView; _phoneTextField.rightViewMode = UITextFieldViewModeAlways; } return _phoneTextField; } - (UIView *)phoneWarningView { if (!_phoneWarningView) { _phoneWarningView = [[UIView alloc] init]; _phoneWarningView.backgroundColor = [UIColor colorWithHexString:@"#FFF8E1"]; _phoneWarningView.layer.cornerRadius = kRealValue(6); } return _phoneWarningView; } - (UIImageView *)phoneWarningIcon { if (!_phoneWarningIcon) { _phoneWarningIcon = [[UIImageView alloc] init]; UIImage *warningImage = [UIImage imageNamed:@"store_bank_tips"]; if (!warningImage) { if (@available(iOS 13.0, *)) { warningImage = [UIImage systemImageNamed:@"info.circle.fill"]; } } _phoneWarningIcon.image = warningImage; _phoneWarningIcon.contentMode = UIViewContentModeScaleAspectFit; _phoneWarningIcon.tintColor = [UIColor colorWithHexString:@"#F57C00"]; } return _phoneWarningIcon; } - (UILabel *)phoneWarningLabel { if (!_phoneWarningLabel) { _phoneWarningLabel = [[UILabel alloc] init]; _phoneWarningLabel.text = ASLocalizedString(@"此电话默认为PC端商家后台管理登录账号"); _phoneWarningLabel.font = [UIFont systemFontOfSize:11]; _phoneWarningLabel.textColor = [UIColor colorWithHexString:@"#F57C00"]; _phoneWarningLabel.numberOfLines = 0; } return _phoneWarningLabel; } - (UILabel *)verifyCodeLabel { if (!_verifyCodeLabel) { _verifyCodeLabel = [[UILabel alloc] init]; _verifyCodeLabel.text = ASLocalizedString(@"验证码"); _verifyCodeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; _verifyCodeLabel.textColor = [UIColor blackColor]; // 添加红色星号 NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:_verifyCodeLabel.text]; NSAttributedString *redStar = [[NSAttributedString alloc] initWithString:@" *" attributes:@{ NSForegroundColorAttributeName: [UIColor redColor], NSFontAttributeName: [UIFont systemFontOfSize:16 weight:UIFontWeightMedium] }]; [attributedText appendAttributedString:redStar]; _verifyCodeLabel.attributedText = attributedText; } return _verifyCodeLabel; } - (UIView *)verifyCodeContainerView { if (!_verifyCodeContainerView) { _verifyCodeContainerView = [[UIView alloc] init]; _verifyCodeContainerView.backgroundColor = [UIColor whiteColor]; _verifyCodeContainerView.layer.cornerRadius = kRealValue(8); _verifyCodeContainerView.layer.borderWidth = 1; _verifyCodeContainerView.layer.borderColor = [UIColor colorWithHexString:@"#E5E5E5"].CGColor; } return _verifyCodeContainerView; } - (UITextField *)verifyCodeTextField { if (!_verifyCodeTextField) { _verifyCodeTextField = [[UITextField alloc] init]; _verifyCodeTextField.placeholder = ASLocalizedString(@"请输入验证码"); _verifyCodeTextField.font = [UIFont systemFontOfSize:16]; _verifyCodeTextField.textColor = [UIColor blackColor]; _verifyCodeTextField.backgroundColor = [UIColor clearColor]; _verifyCodeTextField.keyboardType = UIKeyboardTypeNumberPad; _verifyCodeTextField.borderStyle = UITextBorderStyleNone; } return _verifyCodeTextField; } - (UIButton *)getVerifyCodeButton { if (!_getVerifyCodeButton) { _getVerifyCodeButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_getVerifyCodeButton setTitle:ASLocalizedString(@"获取验证码") forState:UIControlStateNormal]; [_getVerifyCodeButton setTitleColor:[UIColor colorWithHexString:@"#1A65FF"] forState:UIControlStateNormal]; _getVerifyCodeButton.titleLabel.font = [UIFont systemFontOfSize:12]; _getVerifyCodeButton.backgroundColor = [UIColor clearColor]; _getVerifyCodeButton.layer.cornerRadius = kRealValue(4); _getVerifyCodeButton.layer.borderWidth = 1; _getVerifyCodeButton.layer.borderColor = [UIColor colorWithHexString:@"#1A65FF"].CGColor; [_getVerifyCodeButton addTarget:self action:@selector(getVerifyCodeButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; } return _getVerifyCodeButton; } - (UILabel *)passwordSectionLabel { if (!_passwordSectionLabel) { _passwordSectionLabel = [[UILabel alloc] init]; _passwordSectionLabel.text = ASLocalizedString(@"PC端商家后台登录密码"); _passwordSectionLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; _passwordSectionLabel.textColor = [UIColor blackColor]; // 添加红色星号 NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:_passwordSectionLabel.text]; NSAttributedString *redStar = [[NSAttributedString alloc] initWithString:@" *" attributes:@{ NSForegroundColorAttributeName: [UIColor redColor], NSFontAttributeName: [UIFont systemFontOfSize:16 weight:UIFontWeightMedium] }]; [attributedText appendAttributedString:redStar]; _passwordSectionLabel.attributedText = attributedText; } return _passwordSectionLabel; } - (UIView *)passwordWarningView { if (!_passwordWarningView) { _passwordWarningView = [[UIView alloc] init]; _passwordWarningView.backgroundColor = [UIColor colorWithHexString:@"#FFF8E1"]; _passwordWarningView.layer.cornerRadius = kRealValue(6); } return _passwordWarningView; } - (UIImageView *)passwordWarningIcon { if (!_passwordWarningIcon) { _passwordWarningIcon = [[UIImageView alloc] init]; UIImage *warningImage = [UIImage imageNamed:@"store_bank_tips"]; if (!warningImage) { if (@available(iOS 13.0, *)) { warningImage = [UIImage systemImageNamed:@"info.circle.fill"]; } } _passwordWarningIcon.image = warningImage; _passwordWarningIcon.contentMode = UIViewContentModeScaleAspectFit; _passwordWarningIcon.tintColor = [UIColor colorWithHexString:@"#F57C00"]; } return _passwordWarningIcon; } - (UILabel *)passwordWarningLabel { if (!_passwordWarningLabel) { _passwordWarningLabel = [[UILabel alloc] init]; _passwordWarningLabel.text = ASLocalizedString(@"请牢记此密码,用于PC端商家后台管理登录"); _passwordWarningLabel.font = [UIFont systemFontOfSize:11]; _passwordWarningLabel.textColor = [UIColor colorWithHexString:@"#F57C00"]; _passwordWarningLabel.numberOfLines = 0; } return _passwordWarningLabel; } - (UILabel *)passwordLabel { if (!_passwordLabel) { _passwordLabel = [[UILabel alloc] init]; _passwordLabel.text = ASLocalizedString(@"请输入密码"); _passwordLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; _passwordLabel.textColor = [UIColor blackColor]; } return _passwordLabel; } - (UIView *)passwordContainerView { if (!_passwordContainerView) { _passwordContainerView = [[UIView alloc] init]; _passwordContainerView.backgroundColor = [UIColor whiteColor]; _passwordContainerView.layer.cornerRadius = kRealValue(8); _passwordContainerView.layer.borderWidth = 1; _passwordContainerView.layer.borderColor = [UIColor colorWithHexString:@"#E5E5E5"].CGColor; } return _passwordContainerView; } - (UITextField *)passwordTextField { if (!_passwordTextField) { _passwordTextField = [[UITextField alloc] init]; _passwordTextField.placeholder = ASLocalizedString(@"请输入密码"); _passwordTextField.font = [UIFont systemFontOfSize:16]; _passwordTextField.textColor = [UIColor blackColor]; _passwordTextField.backgroundColor = [UIColor clearColor]; _passwordTextField.secureTextEntry = YES; _passwordTextField.borderStyle = UITextBorderStyleNone; } return _passwordTextField; } - (UIButton *)passwordEyeButton { if (!_passwordEyeButton) { _passwordEyeButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *eyeImage = [UIImage imageNamed:@"store_password4"]; [_passwordEyeButton setImage:eyeImage forState:UIControlStateNormal]; _passwordEyeButton.tintColor = [UIColor grayColor]; [_passwordEyeButton addTarget:self action:@selector(passwordEyeButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; } return _passwordEyeButton; } - (UILabel *)confirmPasswordLabel { if (!_confirmPasswordLabel) { _confirmPasswordLabel = [[UILabel alloc] init]; _confirmPasswordLabel.text = ASLocalizedString(@"再次输入密码"); _confirmPasswordLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; _confirmPasswordLabel.textColor = [UIColor blackColor]; } return _confirmPasswordLabel; } - (UIView *)confirmPasswordContainerView { if (!_confirmPasswordContainerView) { _confirmPasswordContainerView = [[UIView alloc] init]; _confirmPasswordContainerView.backgroundColor = [UIColor whiteColor]; _confirmPasswordContainerView.layer.cornerRadius = kRealValue(8); _confirmPasswordContainerView.layer.borderWidth = 1; _confirmPasswordContainerView.layer.borderColor = [UIColor colorWithHexString:@"#E5E5E5"].CGColor; } return _confirmPasswordContainerView; } - (UITextField *)confirmPasswordTextField { if (!_confirmPasswordTextField) { _confirmPasswordTextField = [[UITextField alloc] init]; _confirmPasswordTextField.placeholder = ASLocalizedString(@"再次输入密码"); _confirmPasswordTextField.font = [UIFont systemFontOfSize:16]; _confirmPasswordTextField.textColor = [UIColor blackColor]; _confirmPasswordTextField.backgroundColor = [UIColor clearColor]; _confirmPasswordTextField.secureTextEntry = YES; _confirmPasswordTextField.borderStyle = UITextBorderStyleNone; } return _confirmPasswordTextField; } - (UIButton *)confirmPasswordEyeButton { if (!_confirmPasswordEyeButton) { _confirmPasswordEyeButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *eyeImage = [UIImage imageNamed:@"store_password4"]; [_confirmPasswordEyeButton setImage:eyeImage forState:UIControlStateNormal]; _confirmPasswordEyeButton.tintColor = [UIColor grayColor]; [_confirmPasswordEyeButton addTarget:self action:@selector(confirmPasswordEyeButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; } return _confirmPasswordEyeButton; } @end