SKRegisterViewController.m 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // RegisterViewController.m
  3. // SikeyComm
  4. //
  5. // Created by 刘振兴 on 2024/2/5.
  6. // Copyright © 2024 BaH Cy. All rights reserved.
  7. //
  8. #import "SKRegisterViewController.h"
  9. #import "SKBindPhoneViewController.h"
  10. #import "SKWebViewViewController.h"
  11. @implementation SKRegisterViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view.
  15. //[self addBackButton];
  16. [self setAgree:NO];
  17. [self.agreeBtn setSelected:NO];
  18. [self initAccountType];
  19. [self initView];
  20. [self autoAccount];
  21. }
  22. - (void)viewWillAppear:(BOOL)animated {
  23. [super viewWillAppear:animated];
  24. [self.navigationController setNavigationBarHidden:NO];
  25. }
  26. - (void)initView {
  27. NSString* s0 = NSLocalizedString(@"Login.Read.Agree.0", nil);
  28. NSString* s1 = NSLocalizedString(@"Login.Read.Agree.1", nil);
  29. NSString* s = [NSString stringWithFormat:@"%@%@", s0, s1];
  30. NSMutableAttributedString *content = [[NSMutableAttributedString alloc] initWithString:s];
  31. NSRange contentRange = NSMakeRange(s0.length, s1.length);
  32. [content addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:contentRange];
  33. self.mPrivacyPolicyLabel.attributedText = content;
  34. }
  35. - (void)autoAccount {
  36. #ifdef SK_DEBUG_ACCOUNT
  37. self.mEmailNumTextField.text = @"131459421@163.com";
  38. self.mPwdNewTextField.text = @"liu123456";
  39. self.mPhoneNumTextField.text = @"18616012216";
  40. self.mPhoneNumTextField.text = @"liu123456";
  41. #endif
  42. }
  43. - (IBAction)confirmAction:(id)sender{
  44. [[UIApplication sharedApplication].keyWindow endEditing:YES];
  45. if ([self checkAccount] == NO)
  46. return;
  47. if (![self isAgree]) {
  48. [EasyTextView showInfoText:NSLocalizedString(@"Not.Agree.License.Yet", nil)];//@"您还未同意协定"];
  49. return;
  50. }
  51. [self confirmActionEx];
  52. }
  53. - (void)confirmActionEx {
  54. int area = [UserDataHelper getLoginType];
  55. if (area == 0) {
  56. [self phoneRegisterRequest];
  57. } else {
  58. [self showBindPhoneNumber:nil];
  59. }
  60. }
  61. #pragma mark -
  62. - (void)onTimerCallback:(NSInteger)timeLeft {
  63. [self refreshCaptchaButton:timeLeft];
  64. }
  65. - (IBAction)agreeAction:(UIButton *)sender {
  66. [[UIApplication sharedApplication].keyWindow endEditing:YES];
  67. BOOL status = !sender.selected;
  68. [self setAgree:status];
  69. [sender setSelected:status];
  70. }
  71. - (IBAction)checkLiscense:(id)sender {
  72. NSString* language = [EUtil getSupportLanguage];
  73. NSString* url = [NSString stringWithFormat:@"%@%@%@", @"https://life-content.idoocloud.com/page/privacy_policy/", language, @"/VeryFit%20Kids.html"];
  74. NSString *title = NSLocalizedString(@"License.PrivacyPolicy", nil);
  75. SKWebViewViewController *webVc = [[self storyboard] instantiateViewControllerWithIdentifier:@"WebViewVC"];
  76. webVc.title = title;
  77. webVc.urlToOpen = url;
  78. [self pushViewController:webVc animated:YES];
  79. }
  80. - (IBAction)onOnlinePrivacyPolicy:(id)sender {
  81. [MobClick event:@"ClickLiscense"];
  82. UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"PrivacyPolicyVC"];
  83. [self pushViewController:controller animated:YES];
  84. }
  85. - (IBAction)onEndUserLicenseAgreement:(id)sender {
  86. [MobClick event:@"ClickLiscense"];
  87. UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"LiscenseVC"];
  88. [self pushViewController:controller animated:YES];
  89. }
  90. - (void)showBindPhoneNumber:(id)sender {
  91. [MobClick event:@"ClickLiscense"];
  92. SKBindPhoneViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"BindPhoneVC"];
  93. controller.email = self.mEmailNumTextField.text;
  94. controller.password = self.mPwdTextField.text;
  95. controller.captcha = self.mEmailCaptchaLocalTextField.text;
  96. [self pushViewController:controller animated:YES];
  97. }
  98. @end