forgetPwdViewController.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.centerY.equalTo(self.backBtn.mas_centerY);
  30. make.width.mas_equalTo(80);
  31. make.right.mas_equalTo(-20);
  32. make.height.mas_equalTo(30);
  33. }];
  34. [self initBaseUIfun];
  35. }
  36. #pragma mark 点击返回
  37. - (void)backBtnPressed{
  38. if(_isCheckPwdType){
  39. [self.navigationController popViewControllerAnimated:YES];
  40. return;
  41. }
  42. //发个通知 记录进入了设置密码
  43. [[NSNotificationCenter defaultCenter] postNotificationName:forgetPwdBackNotification object:nil];
  44. }
  45. #pragma mark 点击右导航线
  46. - (void)rightBtnPressed{
  47. forgetSecretKeyViewController *vc = [forgetSecretKeyViewController new];
  48. [self.navigationController pushViewController:vc animated:YES];
  49. }
  50. #pragma mark UI
  51. - (void)initBaseUIfun
  52. {
  53. self.view.backgroundColor = HWF5F7FAColor;
  54. AuthCodeInputView *view = [[AuthCodeInputView alloc] init];
  55. [self.view addSubview:view];
  56. [view mas_makeConstraints:^(MASConstraintMaker *make) {
  57. make.left.mas_equalTo(0);
  58. make.top.mas_equalTo(self.navBarBGView.mas_bottom).offset(0);
  59. make.right.mas_equalTo(0);
  60. make.bottom.mas_equalTo(0);
  61. }];
  62. KWeakSelf
  63. view.authSuccess = ^(BOOL success) {
  64. if(success){
  65. [weakSelf gotoSetPwdVCFun];
  66. }
  67. };
  68. }
  69. #pragma mark 跳转设置密码界面
  70. - (void)gotoSetPwdVCFun
  71. {
  72. /*设置密码*/
  73. SetPWDFirstViewController *nextVC = [[SetPWDFirstViewController alloc] init];
  74. nextVC.isForgetPwdType = YES;
  75. [self.navigationController pushViewController:nextVC animated:YES];
  76. }
  77. @end