inputPwdVC.m 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. //
  2. // inputPwdVC.m
  3. // shiku_im
  4. //
  5. // Created by flyeagleTang on 14-6-10.
  6. // Copyright (c) 2014年 Reese. All rights reserved.
  7. //
  8. #import "inputPwdVC.h"
  9. #import "PSRegisterBaseVC.h"
  10. #import "resumeData.h"
  11. #define HEIGHT 44
  12. @interface inputPwdVC ()<UITextFieldDelegate>
  13. @end
  14. @implementation inputPwdVC
  15. @synthesize telephone;
  16. - (id)init
  17. {
  18. self = [super init];
  19. if (self) {
  20. self.isGotoBack = YES;
  21. self.title = [NSString stringWithFormat:@"%@",Localized(@"JX_PassWord")];
  22. self.heightFooter = 0;
  23. self.heightHeader = JX_SCREEN_TOP;
  24. //self.view.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT);
  25. [self createHeadAndFoot];
  26. self.tableBody.backgroundColor = HEXCOLOR(0xF2F2F2);
  27. int n = INSETS;
  28. _pwd = [[UITextField alloc] initWithFrame:CGRectMake(INSETS,n,WIDTH,HEIGHT)];
  29. _pwd.delegate = self;
  30. _pwd.autocorrectionType = UITextAutocorrectionTypeNo;
  31. _pwd.autocapitalizationType = UITextAutocapitalizationTypeNone;
  32. _pwd.enablesReturnKeyAutomatically = YES;
  33. _pwd.borderStyle = UITextBorderStyleRoundedRect;
  34. _pwd.returnKeyType = UIReturnKeyDone;
  35. _pwd.clearButtonMode = UITextFieldViewModeWhileEditing;
  36. _pwd.placeholder = Localized(@"JX_InputPassWord");
  37. _pwd.secureTextEntry = YES;
  38. [self.tableBody addSubview:_pwd];
  39. // [_pwd release];
  40. n = n+HEIGHT+INSETS;
  41. _repeat = [[UITextField alloc] initWithFrame:CGRectMake(INSETS,n,WIDTH,HEIGHT)];
  42. _repeat.delegate = self;
  43. _repeat.autocorrectionType = UITextAutocorrectionTypeNo;
  44. _repeat.autocapitalizationType = UITextAutocapitalizationTypeNone;
  45. _repeat.enablesReturnKeyAutomatically = YES;
  46. _repeat.borderStyle = UITextBorderStyleRoundedRect;
  47. _repeat.returnKeyType = UIReturnKeyDone;
  48. _repeat.clearButtonMode = UITextFieldViewModeWhileEditing;
  49. _repeat.placeholder = Localized(@"JX_ConfirmPassWord");
  50. _repeat.secureTextEntry = YES;
  51. [self.tableBody addSubview:_repeat];
  52. // [_repeat release];
  53. n = n+HEIGHT+INSETS;
  54. UIButton* _btn = [UIFactory createCommonButton:Localized(@"JX_NextStep") target:self action:@selector(onClick)];
  55. _btn.custom_acceptEventInterval = .25f;
  56. _btn.frame = CGRectMake(INSETS, n, WIDTH, HEIGHT);
  57. [self.tableBody addSubview:_btn];
  58. }
  59. return self;
  60. }
  61. -(void)dealloc{
  62. // [super dealloc];
  63. }
  64. - (void)viewDidLoad
  65. {
  66. [super viewDidLoad];
  67. // Do any additional setup after loading the view.
  68. }
  69. - (void)didReceiveMemoryWarning
  70. {
  71. [super didReceiveMemoryWarning];
  72. }
  73. -(void)onClick{
  74. // if([_pwd.text length]<=0){
  75. // [g_App showAlert:Localized(@"JX_InputPassWord")];
  76. // return;
  77. // }
  78. // if([_repeat.text length]<=0){
  79. // [g_App showAlert:Localized(@"JX_ConfirmPassWord")];
  80. // return;
  81. // }
  82. // if(![_pwd.text isEqualToString:_repeat.text]){
  83. // [g_App showAlert:Localized(@"JX_PasswordFiled")];
  84. // return;
  85. // }
  86. JXUserObject* user = [JXUserObject sharedInstance];
  87. user.telephone = telephone;
  88. user.password = [g_server getMD5String:_pwd.text];
  89. user.companyId = [NSNumber numberWithInt:self.isCompany];
  90. PSRegisterBaseVC* vc = [PSRegisterBaseVC alloc];
  91. vc.password = _pwd.text;
  92. vc.isRegister = YES;
  93. vc.resumeId = nil;
  94. vc.resume = [[resumeBaseData alloc]init];
  95. vc.user = user;
  96. vc = [vc init];
  97. // [g_window addSubview:vc.view];
  98. [g_navigation pushViewController:vc animated:YES];
  99. // [user release];
  100. [self actionQuit];
  101. }
  102. - (BOOL)textFieldShouldReturn:(UITextField *)textField
  103. {
  104. [self.view endEditing:YES];
  105. return YES;
  106. }
  107. @end