// // ASLoginBindingC.m // westkissMob // // Created by 王猛 on 2022/11/16. // #import "ASLoginBindingC.h" #import "EamilTFmatchV.h" #import @interface ASLoginBindingC () @property (nonatomic, strong) EamilTFmatchV *xxx_regMmailV; @property (nonatomic, strong) TT_CustonTF *xxx_firstName; @property (nonatomic, strong) TT_CustonTF *xxx_lasetName; @property (nonatomic, strong) UIButton *xxx_bindBtn; @end @implementation ASLoginBindingC - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithHexString:@"#FFF8F9"]; self.title = @"BINDING"; [self tt_addSubviews]; } - (void)tt_addSubviews{ [self.view addSubview:self.xxx_firstName]; [self.view addSubview:self.xxx_lasetName]; [self.view addSubview:self.xxx_regMmailV]; [self.view addSubview:self.xxx_bindBtn]; [self.view bringSubviewToFront:self.xxx_regMmailV]; } -(void)handle_xxx_bindBtnEvent:(UIButton *)btn{ if (self.xxx_firstName.text.length == 0) { [self.view makeToast:@"Please Input FirstName" duration:2 position:CSToastPositionCenter]; return; }else if (self.xxx_lasetName.text.length == 0){ [self.view makeToast:@"Please Input LastName" duration:2 position:CSToastPositionCenter]; return; }else if(self.xxx_regMmailV.xxx_emailTF.text.length == 0 || ![Current_normalTool xxx_isValidateEmail:self.xxx_regMmailV.xxx_emailTF.text]){ [self.view makeToast:@"Please prvide an email address." duration:2 position:CSToastPositionCenter]; return; } NSMutableDictionary *parDIc = [NSMutableDictionary dictionaryWithDictionary:self.thirdLogDic]; parDIc[@"firstName"] = self.xxx_firstName.text; parDIc[@"lastName"] =self.xxx_lasetName.text; parDIc[@"email"] = self.xxx_regMmailV.xxx_emailTF.text; if (self.bindFinishBlock) { self.bindFinishBlock(parDIc); [self dismissViewControllerAnimated:YES completion:nil]; } } -(TT_CustonTF *)xxx_firstName{ IPhoneXHeigh if (!_xxx_firstName) { _xxx_firstName = [TT_ControlTool FTT_ControlToolUITextFieldFrame:CGRectMake(20, securitytop_Y+50, (KScreenWidth-60)/2, 50) PlaceHolder:@"* First Name" andLifImage:nil AndRightImage:nil LiftImageFrame:CGRectZero RightImageFrame:CGRectZero AndTag:0 AndKeyboardType:UIKeyboardTypeDefault clearButtonMode:UITextFieldViewModeAlways AndReturnKeyType:UIReturnKeyDone masksToBounds:YES conrenRadius:4 BorderColor:[UIColor colorWithHexString:@"#000000"] BorderWidth:1]; _xxx_firstName.font = [UIFont systemFontOfSize:14]; _xxx_firstName.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"]; _xxx_firstName.textAlignment = NSTextAlignmentCenter; _xxx_firstName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"* First Name" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#0B0B0B"]}]; } return _xxx_firstName; } -(TT_CustonTF *)xxx_lasetName{ if (!_xxx_lasetName) { _xxx_lasetName = [TT_ControlTool FTT_ControlToolUITextFieldFrame:CGRectMake(CGRectGetMaxX(self.xxx_firstName.frame)+20,self.xxx_firstName.mj_y, (KScreenWidth-60)/2, 50) PlaceHolder:@"* Last Name" andLifImage:nil AndRightImage:nil LiftImageFrame:CGRectZero RightImageFrame:CGRectZero AndTag:0 AndKeyboardType:UIKeyboardTypeDefault clearButtonMode:UITextFieldViewModeAlways AndReturnKeyType:UIReturnKeyDone masksToBounds:YES conrenRadius:4 BorderColor:[UIColor colorWithHexString:@"#000000"] BorderWidth:1]; _xxx_lasetName.font = [UIFont systemFontOfSize:14]; _xxx_lasetName.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"]; _xxx_lasetName.textAlignment = NSTextAlignmentCenter; _xxx_lasetName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"* Last Name" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#0B0B0B"]}]; } return _xxx_lasetName; } -(EamilTFmatchV *)xxx_regMmailV{ if (!_xxx_regMmailV) { _xxx_regMmailV = [[EamilTFmatchV alloc]initWithFrame:CGRectMake(0,CGRectGetMaxY(self.xxx_firstName.frame)+30 , KScreenWidth, 50)]; } return _xxx_regMmailV; } -(UIButton *)xxx_bindBtn{ if(!_xxx_bindBtn){ _xxx_bindBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _xxx_bindBtn.frame = CGRectMake(20, CGRectGetMaxY(self.xxx_regMmailV.frame)+30, KScreenWidth-40, 45); [_xxx_bindBtn setTitle:@"BINDING" forState:UIControlStateNormal]; [_xxx_bindBtn setTitleColor:[UIColor colorWithHexString:@"#FFFFFF"] forState:UIControlStateNormal]; _xxx_bindBtn.backgroundColor = [UIColor colorWithHexString:@"#000000"]; _xxx_bindBtn.layer.cornerRadius = 4; _xxx_bindBtn.clipsToBounds = YES; [_xxx_bindBtn addTarget:self action:@selector(handle_xxx_bindBtnEvent:) forControlEvents:UIControlEventTouchUpInside]; } return _xxx_bindBtn; } @end