forgetPwdViewController.m 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // forgetPwdViewController.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/11/6.
  6. //
  7. #import "forgetPwdViewController.h"
  8. #import "AuthCodeInputView.h"
  9. #import "SetPWDFirstViewController.h"
  10. #import "forgetSecretKeyViewController.h"
  11. @interface forgetPwdViewController ()
  12. @end
  13. @implementation forgetPwdViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. [self.toolBar setHidden:YES];
  18. [self.navigationBar setHidden:YES];
  19. [self.navBarBGView setHidden:NO];
  20. NSString *curTitle = NSLocalizedString(@"input_pwd_forget_secret_key",nil);
  21. UIButton *rightBut = [[UIButton alloc] init];
  22. //rightBut.backgroundColor = [UIColor redColor];
  23. [rightBut setTitle:curTitle forState:UIControlStateNormal];
  24. rightBut.titleLabel.font = [UIFont systemFontOfSize:16.0];
  25. [rightBut setTitleColor:[UIColor hwColor:@"#13B2EB" alpha:1.0] forState:UIControlStateNormal];
  26. [rightBut addTarget:self action:@selector(rightBtnPressed) forControlEvents:UIControlEventTouchUpInside];
  27. [self.navBarBGView addSubview:rightBut];
  28. rightBut.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  29. [rightBut mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.centerY.equalTo(self.backBtn.mas_centerY);
  31. make.width.mas_equalTo(250);
  32. make.right.mas_equalTo(-20);
  33. make.height.mas_equalTo(30);
  34. }];
  35. [self initBaseUIfun];
  36. }
  37. #pragma mark 点击返回
  38. - (void)backBtnPressed{
  39. if(_isCheckPwdType){
  40. [self.navigationController popViewControllerAnimated:YES];
  41. return;
  42. }
  43. //发个通知 记录进入了设置密码
  44. [[NSNotificationCenter defaultCenter] postNotificationName:forgetPwdBackNotification object:nil];
  45. }
  46. #pragma mark 点击右导航线
  47. - (void)rightBtnPressed{
  48. forgetSecretKeyViewController *vc = [forgetSecretKeyViewController new];
  49. [self.navigationController pushViewController:vc animated:YES];
  50. }
  51. #pragma mark UI
  52. - (void)initBaseUIfun
  53. {
  54. self.view.backgroundColor = HWF5F7FAColor;
  55. AuthCodeInputView *view = [[AuthCodeInputView alloc] init];
  56. [self.view addSubview:view];
  57. [view mas_makeConstraints:^(MASConstraintMaker *make) {
  58. make.left.mas_equalTo(0);
  59. make.top.mas_equalTo(self.navBarBGView.mas_bottom).offset(0);
  60. make.right.mas_equalTo(0);
  61. make.bottom.mas_equalTo(0);
  62. }];
  63. KWeakSelf
  64. view.authSuccess = ^(BOOL success) {
  65. if(success){
  66. [weakSelf gotoSetPwdVCFun];
  67. }
  68. };
  69. }
  70. #pragma mark 跳转设置密码界面
  71. - (void)gotoSetPwdVCFun
  72. {
  73. /*设置密码*/
  74. SetPWDFirstViewController *nextVC = [[SetPWDFirstViewController alloc] init];
  75. nextVC.isForgetPwdType = YES;
  76. [self.navigationController pushViewController:nextVC animated:YES];
  77. }
  78. @end