123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- //
- // RegisterViewController.m
- // sikey comm
- //
- // Created by 刘振兴 on 2024/2/5.
- // Copyright © 2024 BaH Cy. All rights reserved.
- //
- #import "SKRegisterViewController.h"
- #import "SKBindPhoneViewController.h"
- #import "SKWebViewViewController.h"
- @implementation SKRegisterViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
- //[self addBackButton];
-
- [self setAgree:NO];
- [self.agreeBtn setSelected:NO];
-
- [self initAccountType];
-
- [self initView];
- [self autoAccount];
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [self.navigationController setNavigationBarHidden:NO];
- }
- - (void)initView {
- NSString* s0 = NSLocalizedString(@"Login.Read.Agree.0", nil);
- NSString* s1 = NSLocalizedString(@"Login.Read.Agree.1", nil);
- NSString* s = [NSString stringWithFormat:@"%@%@", s0, s1];
- NSMutableAttributedString *content = [[NSMutableAttributedString alloc] initWithString:s];
- NSRange contentRange = NSMakeRange(s0.length, s1.length);
- [content addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:contentRange];
- self.mPrivacyPolicyLabel.attributedText = content;
- }
- - (void)autoAccount {
- #ifdef SK_DEBUG_ACCOUNT
- self.mEmailNumTextField.text = @"131459421@163.com";
- self.mPwdNewTextField.text = @"liu123456";
- self.mPhoneNumTextField.text = @"18616012216";
- self.mPhoneNumTextField.text = @"liu123456";
- #endif
- }
- - (IBAction)confirmAction:(id)sender{
- [[UIApplication sharedApplication].keyWindow endEditing:YES];
- if ([self checkAccount] == NO)
- return;
-
- if (![self isAgree]) {
- [EasyTextView showInfoText:NSLocalizedString(@"Not.Agree.License.Yet", nil)];//@"您还未同意协定"];
- return;
- }
-
- [self confirmActionEx];
- }
- - (void)confirmActionEx {
- int area = [UserDataHelper getSelectArea];
- if (area == 0) {
- [self phoneRegisterRequest];
- } else {
- [self showBindPhoneNumber:nil];
- }
- }
- #pragma mark -
- - (void)onTimerCallback:(NSInteger)timeLeft {
- [self refreshCaptchaButton:timeLeft];
- }
- - (IBAction)agreeAction:(UIButton *)sender {
- [[UIApplication sharedApplication].keyWindow endEditing:YES];
- BOOL status = !sender.selected;
- [self setAgree:status];
- [sender setSelected:status];
- }
- - (IBAction)checkLiscense:(id)sender {
- NSString* language = [EUtil getSupportLanguage];
- NSString* url = [NSString stringWithFormat:@"%@%@%@", @"https://life-content.idoocloud.com/page/privacy_policy/", language, @"/VeryFit%20Kids.html"];
- NSString *title = NSLocalizedString(@"License.PrivacyPolicy", nil);
- SKWebViewViewController *webVc = [[self storyboard] instantiateViewControllerWithIdentifier:@"WebViewVC"];
- webVc.title = title;
- webVc.urlToOpen = url;
- [self pushViewController:webVc animated:YES];
- }
- - (IBAction)onOnlinePrivacyPolicy:(id)sender {
- [MobClick event:@"ClickLiscense"];
- UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"PrivacyPolicyVC"];
- [self pushViewController:controller animated:YES];
- }
- - (IBAction)onEndUserLicenseAgreement:(id)sender {
- [MobClick event:@"ClickLiscense"];
- UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"LiscenseVC"];
- [self pushViewController:controller animated:YES];
- }
- - (void)showBindPhoneNumber:(id)sender {
- [MobClick event:@"ClickLiscense"];
- SKBindPhoneViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"BindPhoneVC"];
- controller.email = self.mEmailNumTextField.text;
- controller.password = self.mPwdNewTextField.text;
- controller.captcha = self.mEmailCaptchaLocalTextField.text;
- [self pushViewController:controller animated:YES];
- }
- @end
|