| | |
| | | userPhoneTextField.placeholder = @"请输入手机号"; |
| | | userPhoneTextField.font = [UIFont fontWithName:@"Arial" size:16]; |
| | | userPhoneTextField.delegate = self; |
| | | [userPhoneTextField setValue:RgbColor(40, 41, 42) forKeyPath:@"_placeholderLabel.textColor"]; |
| | | [userPhoneTextField setValue:RgbColor(149, 149, 150) forKeyPath:@"_placeholderLabel.textColor"]; |
| | | //userPhoneTextField.layer.borderColor = [RgbColor(213, 213, 213) CGColor]; |
| | | userPhoneTextField.textColor = RgbColor(40, 41, 42); |
| | | userPhoneTextField.textColor = RgbColor(149, 149, 150); |
| | | |
| | | userPhoneTextField.keyboardType = UIKeyboardTypeNumberPad; |
| | | userPhoneTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; |
| | |
| | | checkCodeTextField.placeholder = @"请输入验证码"; |
| | | checkCodeTextField.font = [UIFont fontWithName:@"Arial" size:16]; |
| | | checkCodeTextField.delegate = self; |
| | | [checkCodeTextField setValue:RgbColor(40, 41, 42) forKeyPath:@"_placeholderLabel.textColor"]; |
| | | [checkCodeTextField setValue:RgbColor(149, 149, 150) forKeyPath:@"_placeholderLabel.textColor"]; |
| | | //userPhoneTextField.layer.borderColor = [RgbColor(213, 213, 213) CGColor]; |
| | | checkCodeTextField.textColor = RgbColor(40, 41, 42); |
| | | checkCodeTextField.textColor = RgbColor(149, 149, 150); |
| | | checkCodeTextField.keyboardType = UIKeyboardTypeNumberPad; |
| | | checkCodeTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; |
| | | // 设置一个空白blankView,15.0就是这块View的宽度width,也是光标的位置,根据你自己的需要设定大小 |
| | |
| | | userNewPwdTextField.placeholder = @"请输入密码"; |
| | | userNewPwdTextField.font = [UIFont fontWithName:@"Arial" size:16]; |
| | | userNewPwdTextField.delegate = self; |
| | | [userNewPwdTextField setValue:RgbColor(40, 41, 42) forKeyPath:@"_placeholderLabel.textColor"]; |
| | | [userNewPwdTextField setValue:RgbColor(149, 149, 150) forKeyPath:@"_placeholderLabel.textColor"]; |
| | | //userPhoneTextField.layer.borderColor = [RgbColor(213, 213, 213) CGColor]; |
| | | userNewPwdTextField.textColor = RgbColor(40, 41, 42); |
| | | userNewPwdTextField.textColor = RgbColor(149, 149, 150); |
| | | userNewPwdTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; |
| | | // 设置一个空白blankView,15.0就是这块View的宽度width,也是光标的位置,根据你自己的需要设定大小 |
| | | userNewPwdTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(userNewPwdTextField.frame.origin.x,userNewPwdTextField.frame.origin.y,10.0, userNewPwdTextField.frame.size.height)]; |
| | |
| | | |
| | | getCheckCodeLabel = [[GloriaLabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-textFieldW)/2+40+textFieldW-40-100+2, SCREEN_HEIGHT/2-50, 80, textFieldH/2)]; |
| | | getCheckCodeLabel.font = FONT12; |
| | | getCheckCodeLabel.backgroundColor = RgbColor(251, 50, 81); |
| | | getCheckCodeLabel.backgroundColor = kUIColorFromRGB(0x00a2ff); |
| | | getCheckCodeLabel.textColor = [UIColor whiteColor]; |
| | | getCheckCodeLabel.textAlignment = NSTextAlignmentCenter; |
| | | getCheckCodeLabel.layer.borderColor = [RgbColor(251, 50, 81) CGColor]; |
| | |
| | | backLoginBtn.frame = CGRectMake((SCREEN_WIDTH-200)/2, SCREEN_HEIGHT/2+225, 200, 40); |
| | | [backLoginBtn setTitle:@"已有账号,返回登录" forState:UIControlStateNormal]; |
| | | backLoginBtn.titleLabel.font = [UIFont systemFontOfSize: 16.0]; |
| | | [backLoginBtn setTitleColor:RgbColor(241, 0, 39) forState:UIControlStateNormal]; |
| | | [backLoginBtn setTitleColor:kUIColorFromRGB(0x00a2ff) forState:UIControlStateNormal]; |
| | | [backLoginBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.view addSubview:backLoginBtn]; |
| | | |
| | |
| | | else |
| | | { |
| | | |
| | | NSString *path = [[NSString alloc] initWithFormat:@"/user/register"]; |
| | | NSString *path = [[NSString alloc] initWithFormat:USER_REGISTER]; |
| | | |
| | | CommonReqModel * model = [[CommonReqModel alloc] init]; |
| | | |
| | | model.username = userPhoneTextField.text; |
| | | model.phone = userPhoneTextField.text; |
| | | model.password = userNewPwdTextField.text; |
| | | model.code = checkCodeTextField.text; |
| | | |
| | | MPWeakSelf(self); |
| | | [NetworkSingleton networkingPostMethod:model.toDic urlName:path success:^(id responseBody) |
| | | [NetworkSingleton networkingGetMethod:model.toDic urlName:path success:^(id responseBody) |
| | | { |
| | | MPStrongSelf(self); |
| | | BaseResModel * resModel = [Global toBaseModel:responseBody]; |
| | |
| | | //获取验证码 |
| | | -(void)getCheckCodeAction |
| | | { |
| | | NSString *path = [[NSString alloc] initWithFormat:@"/user/request_code"]; |
| | | NSString *path = [[NSString alloc] initWithFormat:SEND_REGISTER_SMS]; |
| | | |
| | | CommonReqModel * model = [[CommonReqModel alloc] init]; |
| | | model.tel = userPhoneTextField.text; |
| | | model.type = @"1"; |
| | | model.phone = userPhoneTextField.text; |
| | | model.type = @"register"; |
| | | |
| | | //NSMutableDictionary *param = [[NSMutableDictionary alloc] init]; |
| | | //[param setObject:userPhoneTextField.text forKey:@"phone"]; |
| | | |
| | | MPWeakSelf(self); |
| | | [NetworkSingleton networkingPostMethod:model.toDic urlName:path success:^(id responseBody) |
| | | [NetworkSingleton networkingGetMethod:model.toDic urlName:path success:^(id responseBody) |
| | | { |
| | | BaseResModel * resModel = [Global toBaseModel:responseBody]; |
| | | |
| | |
| | | } |
| | | else if( textLength == 11 && [StringUtil isMobile:[userPhoneTextField.text stringByAppendingString:string]] == YES) |
| | | { |
| | | getCheckCodeLabel.textColor = NAVIGATIONTINTCOLOR; |
| | | getCheckCodeLabel.backgroundColor = [UIColor whiteColor]; |
| | | getCheckCodeLabel.textColor = [UIColor whiteColor]; |
| | | getCheckCodeLabel.backgroundColor = RgbColor(251, 50, 81); |
| | | sendBtn.userInteractionEnabled = YES; |
| | | } |
| | | else |
| | | { |
| | | getCheckCodeLabel.backgroundColor = RgbColor(251, 50, 81); |
| | | getCheckCodeLabel.backgroundColor = kUIColorFromRGB(0x00a2ff); |
| | | getCheckCodeLabel.textColor = [UIColor whiteColor]; |
| | | sendBtn.userInteractionEnabled = NO; |
| | | } |