From 49f730b609a80143555bafd610e188c9f49aecf5 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Wed, 3 Dec 2025 16:26:49 +0800 Subject: [PATCH] 3 --- .../Localization/en.lproj/Localizable.strings | 9 ++ .../zh-Hans.lproj/Localizable.strings | 9 ++ keyBoard.xcodeproj/project.pbxproj | 12 ++ keyBoard/Class/Login/VC/KBEmailLoginVC.m | 9 +- keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.h | 16 ++ keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.m | 31 ++++ keyBoard/Class/Login/VC/KBForgetPwdVC.h | 4 +- keyBoard/Class/Login/VC/KBForgetPwdVC.m | 140 ++++++++++++++-- keyBoard/Class/Login/VC/KBForgetVerPwdVC.h | 16 ++ keyBoard/Class/Login/VC/KBForgetVerPwdVC.m | 149 ++++++++++++++++++ keyBoard/Class/Login/VC/KBLoginVC.m | 8 + 11 files changed, 391 insertions(+), 12 deletions(-) create mode 100644 keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.h create mode 100644 keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.m create mode 100644 keyBoard/Class/Login/VC/KBForgetVerPwdVC.h create mode 100644 keyBoard/Class/Login/VC/KBForgetVerPwdVC.m diff --git a/Shared/Localization/en.lproj/Localizable.strings b/Shared/Localization/en.lproj/Localizable.strings index b6869d0..ea15ccf 100644 --- a/Shared/Localization/en.lproj/Localizable.strings +++ b/Shared/Localization/en.lproj/Localizable.strings @@ -32,6 +32,15 @@ "Failed to save login state" = "Failed to save login state"; "请切换到主App完成登录" = "Please switch to the main app to finish signing in"; "Continue Via Email" = "Continue Via Email"; +"Login With Email Password" = "Login With Email Password"; +"Enter Email Address" = "Enter Email Address"; +"Enter Password" = "Enter Password"; +"Enter Repeat Password" = "Enter Repeat Password"; +"Please complete all fields" = "Please complete all fields"; +"The two passwords do not match" = "The two passwords do not match"; +"Reset Password" = "Reset Password"; +"Next Step" = "Next Step"; +"Enter Email Verification Code" = "Enter Email Verification Code"; // Language switching prompt diff --git a/Shared/Localization/zh-Hans.lproj/Localizable.strings b/Shared/Localization/zh-Hans.lproj/Localizable.strings index ac11730..e78f25b 100644 --- a/Shared/Localization/zh-Hans.lproj/Localizable.strings +++ b/Shared/Localization/zh-Hans.lproj/Localizable.strings @@ -32,6 +32,15 @@ "Failed to save login state" = "保存登录态失败"; "请切换到主App完成登录" = "请切换到主App完成登录"; "Continue Via Email" = "通过邮箱登录"; +"Login With Email Password" = "使用邮箱密码登录"; +"Enter Email Address" = "请输入邮箱地址"; +"Enter Password" = "请输入密码"; +"Enter Repeat Password" = "请再次输入密码"; +"Please complete all fields" = "请先填写完整信息"; +"The two passwords do not match" = "两次输入的密码不一致"; +"Reset Password" = "重置密码"; +"Next Step" = "下一步"; +"Enter Email Verification Code" = "请输入邮箱验证码"; // 语言切换提示 diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index c58b267..296448a 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -102,6 +102,8 @@ 0498BD652EE0116D006CC1D5 /* KBEmailLoginVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD642EE0116D006CC1D5 /* KBEmailLoginVC.m */; }; 0498BD682EE01180006CC1D5 /* KBEmailRegistVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD672EE01180006CC1D5 /* KBEmailRegistVC.m */; }; 0498BD6B2EE025FC006CC1D5 /* KBForgetPwdVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD6A2EE025FC006CC1D5 /* KBForgetPwdVC.m */; }; + 0498BD6E2EE0285D006CC1D5 /* KBForgetVerPwdVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD6D2EE0285D006CC1D5 /* KBForgetVerPwdVC.m */; }; + 0498BD712EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD702EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.m */; }; 049FB20B2EC1C13800FAB05D /* KBSkinBottomActionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 049FB20A2EC1C13800FAB05D /* KBSkinBottomActionView.m */; }; 049FB20E2EC1CD2800FAB05D /* KBAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 049FB20D2EC1CD2800FAB05D /* KBAlert.m */; }; 049FB2112EC1F72F00FAB05D /* KBMyListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 049FB2102EC1F72F00FAB05D /* KBMyListCell.m */; }; @@ -376,6 +378,10 @@ 0498BD672EE01180006CC1D5 /* KBEmailRegistVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBEmailRegistVC.m; sourceTree = ""; }; 0498BD692EE025FC006CC1D5 /* KBForgetPwdVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBForgetPwdVC.h; sourceTree = ""; }; 0498BD6A2EE025FC006CC1D5 /* KBForgetPwdVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBForgetPwdVC.m; sourceTree = ""; }; + 0498BD6C2EE0285D006CC1D5 /* KBForgetVerPwdVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBForgetVerPwdVC.h; sourceTree = ""; }; + 0498BD6D2EE0285D006CC1D5 /* KBForgetVerPwdVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBForgetVerPwdVC.m; sourceTree = ""; }; + 0498BD6F2EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBForgetPwdNewPwdVC.h; sourceTree = ""; }; + 0498BD702EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBForgetPwdNewPwdVC.m; sourceTree = ""; }; 049FB2092EC1C13800FAB05D /* KBSkinBottomActionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinBottomActionView.h; sourceTree = ""; }; 049FB20A2EC1C13800FAB05D /* KBSkinBottomActionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinBottomActionView.m; sourceTree = ""; }; 049FB20C2EC1CD2800FAB05D /* KBAlert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBAlert.h; sourceTree = ""; }; @@ -1335,6 +1341,10 @@ 0498BD642EE0116D006CC1D5 /* KBEmailLoginVC.m */, 0498BD692EE025FC006CC1D5 /* KBForgetPwdVC.h */, 0498BD6A2EE025FC006CC1D5 /* KBForgetPwdVC.m */, + 0498BD6C2EE0285D006CC1D5 /* KBForgetVerPwdVC.h */, + 0498BD6D2EE0285D006CC1D5 /* KBForgetVerPwdVC.m */, + 0498BD6F2EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.h */, + 0498BD702EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.m */, ); path = VC; sourceTree = ""; @@ -1709,6 +1719,7 @@ 04A9FE1B2EB892460020DB6D /* KBLocalizationManager.m in Sources */, 048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */, 04FC95D72EB1EA16007BD342 /* BaseTableView.m in Sources */, + 0498BD712EE02A41006CC1D5 /* KBForgetPwdNewPwdVC.m in Sources */, 048908EF2EBF861800FABA60 /* KBSkinSectionTitleCell.m in Sources */, 048908E32EBF821700FABA60 /* KBSkinDetailVC.m in Sources */, 0477BDF32EBB7B850055D639 /* KBDirectionIndicatorView.m in Sources */, @@ -1760,6 +1771,7 @@ 04122FB32EC73C0100EF7AB3 /* KBVipReviewListCell.m in Sources */, 048908DA2EBF61AF00FABA60 /* UICollectionViewLeftAlignedLayout.m in Sources */, 04C6EABF2EAF86530089C901 /* main.m in Sources */, + 0498BD6E2EE0285D006CC1D5 /* KBForgetVerPwdVC.m in Sources */, 04FC95CC2EB1E780007BD342 /* BaseTabBarController.m in Sources */, 0479205A2EDEE1FC004E8522 /* CRBoxTextView.m in Sources */, 0479205B2EDEE1FC004E8522 /* CRSecrectImageView.m in Sources */, diff --git a/keyBoard/Class/Login/VC/KBEmailLoginVC.m b/keyBoard/Class/Login/VC/KBEmailLoginVC.m index 48fb888..f1c2fb5 100644 --- a/keyBoard/Class/Login/VC/KBEmailLoginVC.m +++ b/keyBoard/Class/Login/VC/KBEmailLoginVC.m @@ -7,7 +7,7 @@ #import "KBEmailLoginVC.h" #import "KBEmailRegistVC.h" - +#import "KBForgetPwdVC.h" @interface KBEmailLoginVC () // 背景与顶部装饰 @@ -222,6 +222,13 @@ - (void)onTapForgotPassword { KBLOG(@"KBEmailLoginVC onTapForgotPassword"); + KBForgetPwdVC *vc = [[KBForgetPwdVC alloc] init]; + UINavigationController *nav = KB_CURRENT_NAV; + if ([nav isKindOfClass:[BaseNavigationController class]]) { + [(BaseNavigationController *)nav kb_pushViewControllerRemovingSameClass:vc animated:YES]; + } else { + [nav pushViewController:vc animated:YES]; + } } - (void)onTapSignUp { diff --git a/keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.h b/keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.h new file mode 100644 index 0000000..6d70c45 --- /dev/null +++ b/keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.h @@ -0,0 +1,16 @@ +// +// KBForgetPwdNewPwdVC.h +// keyBoard +// +// Created by Mac on 2025/12/3. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface KBForgetPwdNewPwdVC : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.m b/keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.m new file mode 100644 index 0000000..6039790 --- /dev/null +++ b/keyBoard/Class/Login/VC/KBForgetPwdNewPwdVC.m @@ -0,0 +1,31 @@ +// +// KBForgetPwdNewPwdVC.m +// keyBoard +// +// Created by Mac on 2025/12/3. +// + +#import "KBForgetPwdNewPwdVC.h" + +@interface KBForgetPwdNewPwdVC () + +@end + +@implementation KBForgetPwdNewPwdVC + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/keyBoard/Class/Login/VC/KBForgetPwdVC.h b/keyBoard/Class/Login/VC/KBForgetPwdVC.h index c5a5d60..fa16816 100644 --- a/keyBoard/Class/Login/VC/KBForgetPwdVC.h +++ b/keyBoard/Class/Login/VC/KBForgetPwdVC.h @@ -5,11 +5,11 @@ // Created by Mac on 2025/12/3. // -#import +#import "BaseViewController.h" NS_ASSUME_NONNULL_BEGIN -@interface KBForgetPwdVC : UIViewController +@interface KBForgetPwdVC : BaseViewController @end diff --git a/keyBoard/Class/Login/VC/KBForgetPwdVC.m b/keyBoard/Class/Login/VC/KBForgetPwdVC.m index 18b181f..7747a25 100644 --- a/keyBoard/Class/Login/VC/KBForgetPwdVC.m +++ b/keyBoard/Class/Login/VC/KBForgetPwdVC.m @@ -6,8 +6,13 @@ // #import "KBForgetPwdVC.h" +#import "KBForgetVerPwdVC.h" +@interface KBForgetPwdVC () -@interface KBForgetPwdVC () +@property (nonatomic, strong) UILabel *titleLabel; // Reset Password +@property (nonatomic, strong) UIView *emailFieldContainer; +@property (nonatomic, strong) UITextField *emailTextField; +@property (nonatomic, strong) UIButton *nextButton; // Next Step @end @@ -15,17 +20,134 @@ - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. + self.view.backgroundColor = [UIColor whiteColor]; + self.kb_titleLabel.text = KBLocalized(@"Reset Password"); + + [self setupUI]; } -/* -#pragma mark - Navigation +#pragma mark - UI -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. +- (void)setupUI { + [self.view addSubview:self.titleLabel]; + [self.view addSubview:self.emailFieldContainer]; + [self.emailFieldContainer addSubview:self.emailTextField]; + [self.view addSubview:self.nextButton]; + + // 标题:位于内容区域上方,距离自定义导航栏底部一定间距 + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.view).offset(24); + make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT + 32); + }]; + + // 邮箱输入容器 + [self.emailFieldContainer mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.titleLabel.mas_bottom).offset(24); + make.left.equalTo(self.view).offset(24); + make.right.equalTo(self.view).offset(-24); + make.height.mas_equalTo(52); + }]; + + [self.emailTextField mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.emailFieldContainer).insets(UIEdgeInsetsMake(0, 16, 0, 16)); + }]; + + // Next Step 按钮 + [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.emailFieldContainer.mas_bottom).offset(24); + make.left.right.equalTo(self.emailFieldContainer); + make.height.mas_equalTo(56); + }]; +} + +#pragma mark - Actions + +- (void)onTapNext { + NSString *email = [self.emailTextField.text ?: @"" stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (email.length == 0) { + [KBHUD showInfo:KBLocalized(@"Enter Email Address")]; + return; + } + KBLOG(@"KBForgetPwdVC next step with email=%@", email); + // TODO: 接 forgot password 接口 + KBForgetVerPwdVC *vc = [[KBForgetVerPwdVC alloc] init]; + UINavigationController *nav = KB_CURRENT_NAV; + if ([nav isKindOfClass:[BaseNavigationController class]]) { + [(BaseNavigationController *)nav kb_pushViewControllerRemovingSameClass:vc animated:YES]; + } else { + [nav pushViewController:vc animated:YES]; + } +} + +#pragma mark - UITextFieldDelegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + if (textField == self.emailTextField) { + [textField resignFirstResponder]; + [self onTapNext]; + } + return YES; +} + +#pragma mark - Lazy UI + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel new]; + _titleLabel.text = KBLocalized(@"Reset Password"); + _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _titleLabel.font = [KBFont bold:20]; + _titleLabel.textAlignment = NSTextAlignmentLeft; + } + return _titleLabel; +} + +- (UIView *)emailFieldContainer { + if (!_emailFieldContainer) { + _emailFieldContainer = [UIView new]; + _emailFieldContainer.backgroundColor = [UIColor colorWithHex:0xF7F7F7]; + _emailFieldContainer.layer.cornerRadius = 10.0; + _emailFieldContainer.layer.masksToBounds = YES; + } + return _emailFieldContainer; +} + +- (UITextField *)emailTextField { + if (!_emailTextField) { + _emailTextField = [[UITextField alloc] init]; + _emailTextField.delegate = self; + _emailTextField.keyboardType = UIKeyboardTypeEmailAddress; + _emailTextField.autocapitalizationType = UITextAutocapitalizationTypeNone; + _emailTextField.autocorrectionType = UITextAutocorrectionTypeNo; + _emailTextField.clearButtonMode = UITextFieldViewModeWhileEditing; + _emailTextField.textColor = [UIColor colorWithHex:KBBlackValue]; + _emailTextField.font = [KBFont regular:14]; + _emailTextField.returnKeyType = UIReturnKeyDone; + + NSString *ph = KBLocalized(@"Enter Email Address"); + _emailTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:ph + attributes:@{ + NSForegroundColorAttributeName : [UIColor colorWithWhite:0.75 alpha:1.0], + NSFontAttributeName : [KBFont regular:14] + }]; + } + return _emailTextField; +} + +- (UIButton *)nextButton { + if (!_nextButton) { + _nextButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_nextButton setTitle:KBLocalized(@"Next Step") forState:UIControlStateNormal]; + [_nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _nextButton.titleLabel.font = [KBFont medium:16]; + _nextButton.backgroundColor = [UIColor colorWithHex:KBColorValue]; + _nextButton.layer.cornerRadius = 28.0; + _nextButton.layer.masksToBounds = YES; + [_nextButton addTarget:self action:@selector(onTapNext) + forControlEvents:UIControlEventTouchUpInside]; + } + return _nextButton; } -*/ @end diff --git a/keyBoard/Class/Login/VC/KBForgetVerPwdVC.h b/keyBoard/Class/Login/VC/KBForgetVerPwdVC.h new file mode 100644 index 0000000..e06a60f --- /dev/null +++ b/keyBoard/Class/Login/VC/KBForgetVerPwdVC.h @@ -0,0 +1,16 @@ +// +// KBForgetVerPwdVC.h +// keyBoard +// +// Created by Mac on 2025/12/3. +// + +#import "BaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface KBForgetVerPwdVC : BaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Login/VC/KBForgetVerPwdVC.m b/keyBoard/Class/Login/VC/KBForgetVerPwdVC.m new file mode 100644 index 0000000..d779320 --- /dev/null +++ b/keyBoard/Class/Login/VC/KBForgetVerPwdVC.m @@ -0,0 +1,149 @@ +// +// KBForgetVerPwdVC.m +// keyBoard +// +// Created by Mac on 2025/12/3. +// + +#import "KBForgetVerPwdVC.h" +#import "CRBoxInputView.h" + +@interface KBForgetVerPwdVC () + +@property (nonatomic, strong) UILabel *titleLabel; // Reset Password +@property (nonatomic, strong) UILabel *subTitleLabel; // Enter Email Verification Code +@property (nonatomic, strong) CRBoxInputView *codeInputView; +@property (nonatomic, strong) UIButton *nextButton; // Next Step + +@end + +@implementation KBForgetVerPwdVC + +- (void)viewDidLoad { + [super viewDidLoad]; + self.view.backgroundColor = [UIColor whiteColor]; + self.kb_titleLabel.text = KBLocalized(@"Reset Password"); + + [self setupUI]; +} + +#pragma mark - UI + +- (void)setupUI { + [self.view addSubview:self.titleLabel]; + [self.view addSubview:self.subTitleLabel]; + [self.view addSubview:self.codeInputView]; + [self.view addSubview:self.nextButton]; + + // 标题 + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.view).offset(24); + make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT + 32); + }]; + + // 副标题 + [self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.titleLabel); + make.top.equalTo(self.titleLabel.mas_bottom).offset(16); + }]; + + // 验证码输入框(CRBoxInputView) + [self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.subTitleLabel.mas_bottom).offset(24); + make.left.equalTo(self.view).offset(24); + make.right.equalTo(self.view).offset(-24); + make.height.mas_equalTo(56); + }]; + + // Next Step 按钮 + [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.codeInputView.mas_bottom).offset(32); + make.left.equalTo(self.view).offset(24); + make.right.equalTo(self.view).offset(-24); + make.height.mas_equalTo(56); + }]; +} + +#pragma mark - Actions + +- (void)onTapNext { + NSString *code = self.codeInputView.textValue ?: @""; + if (code.length == 0) { + [KBHUD showInfo:KBLocalized(@"Enter Email Verification Code")]; + return; + } + KBLOG(@"KBVerPwdVC next step with code=%@", code); + // TODO: 接后续重置密码的下一步逻辑 +} + +#pragma mark - Lazy UI + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel new]; + _titleLabel.text = KBLocalized(@"Reset Password"); + _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _titleLabel.font = [KBFont bold:20]; + _titleLabel.textAlignment = NSTextAlignmentLeft; + } + return _titleLabel; +} + +- (UILabel *)subTitleLabel { + if (!_subTitleLabel) { + _subTitleLabel = [UILabel new]; + _subTitleLabel.text = KBLocalized(@"Enter Email Verification Code"); + _subTitleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _subTitleLabel.font = [KBFont regular:14]; + _subTitleLabel.textAlignment = NSTextAlignmentLeft; + } + return _subTitleLabel; +} + +- (CRBoxInputView *)codeInputView { + if (!_codeInputView) { + // 6 位验证码 + _codeInputView = [[CRBoxInputView alloc] initWithCodeLength:6]; + _codeInputView.backgroundColor = [UIColor clearColor]; + _codeInputView.ifNeedCursor = YES; + _codeInputView.keyBoardType = UIKeyboardTypeNumberPad; + _codeInputView.inputType = CRInputType_Number; + + // 布局:等宽方块,间距略大一些 +// CRBoxFlowLayout *layout = [[CRBoxFlowLayout alloc] init]; +// layout.itemSize = CGSizeMake(40, 48); +// layout.minimumInteritemSpacing = 12; +// layout.minimumLineSpacing = 12; +// layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; +// _codeInputView.boxFlowLayout = layout; + + CRBoxInputCellProperty *prop = [[CRBoxInputCellProperty alloc] init]; + prop.borderWidth = 0; + prop.cornerRadius = 8.0; + prop.cellBgColorNormal = [UIColor colorWithHex:0xF7F7F7]; + prop.cellBgColorSelected = [UIColor colorWithHex:0xE0F5F2]; + prop.cellFont = [KBFont bold:20]; + prop.cellTextColor = [UIColor colorWithHex:KBBlackValue]; + _codeInputView.customCellProperty = prop; + + [_codeInputView loadAndPrepareView]; + } + return _codeInputView; +} + +- (UIButton *)nextButton { + if (!_nextButton) { + _nextButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_nextButton setTitle:KBLocalized(@"Next Step") forState:UIControlStateNormal]; + [_nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _nextButton.titleLabel.font = [KBFont medium:16]; + _nextButton.backgroundColor = [UIColor colorWithHex:KBColorValue]; + _nextButton.layer.cornerRadius = 28.0; + _nextButton.layer.masksToBounds = YES; + [_nextButton addTarget:self action:@selector(onTapNext) + forControlEvents:UIControlEventTouchUpInside]; + } + return _nextButton; +} + +@end diff --git a/keyBoard/Class/Login/VC/KBLoginVC.m b/keyBoard/Class/Login/VC/KBLoginVC.m index 9ea3670..2b93580 100644 --- a/keyBoard/Class/Login/VC/KBLoginVC.m +++ b/keyBoard/Class/Login/VC/KBLoginVC.m @@ -11,6 +11,7 @@ #import "AppDelegate.h" #import "KBEmailRegistVC.h" #import "KBEmailLoginVC.h" +#import "KBForgetPwdVC.h" @interface KBLoginVC () @@ -218,6 +219,13 @@ - (void)onTapForgotPassword { // 打开忘记密码页 KBLOG(@"onTapForgotPassword"); + KBForgetPwdVC *vc = [[KBForgetPwdVC alloc] init]; + UINavigationController *nav = KB_CURRENT_NAV; + if ([nav isKindOfClass:[BaseNavigationController class]]) { + [(BaseNavigationController *)nav kb_pushViewControllerRemovingSameClass:vc animated:YES]; + } else { + [nav pushViewController:vc animated:YES]; + } } - (void)onTapBack {