RegistBasicInformationView.m 2.04 KB
//
//  RegistBasicInformationView.m
//  CNLiveUserSystemDemo
//
//  Created by iOS on 16/9/14.
//  Copyright © 2016年 zhulin. All rights reserved.
//

#import "RegistBasicInformationView.h"

static BOOL isPhone;

@implementation RegistBasicInformationView

- (instancetype)initWithFrame:(CGRect)frame hasPwd:(BOOL)pwd isPhone:(BOOL)phone
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        
        if (phone) {
            isPhone = YES;
        } else {
            isPhone = NO;
        }
        
        [self addSubview:self.phoneTF];
        [self addSubview:self.verificationTF];
        
        if (pwd) {
            [self addSubview:self.setPwdTF];
        }
    }
    return self;
}

#pragma mark <GetMethod>
- (UITextField *)phoneTF
{
    if (!_phoneTF) {
        _phoneTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 0, KScreenWidth - 110, 57)];
        if (isPhone) {
            _phoneTF.placeholder = @"请输入手机号";
            _phoneTF.keyboardType = UIKeyboardTypeNumberPad;
        } else {
            _phoneTF.placeholder = @"请输入手机号或邮箱";
        }
        _phoneTF.font = [UIFont systemFontOfSize:17];
        _phoneTF.clearButtonMode = UITextFieldViewModeWhileEditing;
    }
    return _phoneTF;
}

- (UITextField *)verificationTF
{
    if (!_verificationTF) {
        _verificationTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 57, KScreenWidth - 20, 57)];
        _verificationTF.placeholder = @"请输入您收到的验证码";
        _verificationTF.keyboardType = UIKeyboardTypeNumberPad;
        _verificationTF.font = [UIFont systemFontOfSize:17];
    }
    return _verificationTF;
}

- (UITextField *)setPwdTF
{
    if (!_setPwdTF) {
        _setPwdTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 114, KScreenWidth - 20, 57)];
        _setPwdTF.placeholder = @"请设置密码:6-20位字母或数字";
        _setPwdTF.font = [UIFont systemFontOfSize:17];
        _setPwdTF.secureTextEntry = YES;
    }
    return _setPwdTF;
}


@end