2021-09-14 21:01:09 +08:00
|
|
|
|
//
|
|
|
|
|
// LoginFullInfoViewController.m
|
|
|
|
|
// xplan-ios
|
|
|
|
|
//
|
|
|
|
|
// Created by 冯硕 on 2021/9/14.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "LoginFullInfoViewController.h"
|
|
|
|
|
///Third
|
|
|
|
|
#import <Masonry/Masonry.h>
|
|
|
|
|
#import <ReactiveObjC/ReactiveObjC.h>
|
|
|
|
|
///Tool
|
|
|
|
|
#import "XPMacro.h"
|
|
|
|
|
#import "ThemeColor.h"
|
|
|
|
|
#import "UIImage+Utils.h"
|
|
|
|
|
#import "UIButton+EnlargeTouchArea.h"
|
2021-09-27 20:16:27 +08:00
|
|
|
|
#import "StatisticsServiceHelper.h"
|
2021-11-04 15:14:13 +08:00
|
|
|
|
#import "AccountInfoStorage.h"
|
2021-12-01 16:51:55 +08:00
|
|
|
|
#import "TTPopup.h"
|
2021-09-15 18:41:40 +08:00
|
|
|
|
///Model
|
|
|
|
|
#import "ThirdUserInfo.h"
|
2021-09-14 21:01:09 +08:00
|
|
|
|
///P
|
|
|
|
|
#import "LoginFullInfoPresenter.h"
|
|
|
|
|
#import "LoginFullInfoProtocol.h"
|
|
|
|
|
|
2022-06-02 18:53:45 +08:00
|
|
|
|
UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol>
|
|
|
|
|
///完善资料
|
|
|
|
|
@property (nonatomic,strong) UILabel *titleLabel;
|
|
|
|
|
///性别后期无法修改
|
|
|
|
|
@property (nonatomic,strong) UILabel *remindLabel;
|
|
|
|
|
///昵称的背景
|
|
|
|
|
@property (nonatomic,strong) UIView * backView;
|
|
|
|
|
///容器
|
|
|
|
|
@property (nonatomic,strong) UIStackView *stackView;
|
|
|
|
|
///显示昵称
|
|
|
|
|
@property (nonatomic,strong) UILabel *nameLabel;
|
|
|
|
|
///输入框
|
|
|
|
|
@property (nonatomic,strong) UITextField *textField;
|
|
|
|
|
///更新
|
|
|
|
|
@property (nonatomic,strong) UIButton *refreshButton;
|
|
|
|
|
///x性别的容器
|
|
|
|
|
@property (nonatomic,strong) UIStackView *sexStackView;
|
|
|
|
|
///男用户
|
|
|
|
|
@property (nonatomic,strong) UIButton *maleButton;
|
|
|
|
|
///女用户
|
|
|
|
|
@property (nonatomic,strong) UIButton *femaleButton;
|
|
|
|
|
///下一步
|
|
|
|
|
@property (nonatomic,strong) UIButton *nextButton;
|
2021-12-01 16:51:55 +08:00
|
|
|
|
///邀请码
|
|
|
|
|
@property (nonatomic,strong) UILabel *codeLabel;
|
|
|
|
|
///邀请码的容器
|
|
|
|
|
@property (nonatomic,strong) UIView *codeContainView;
|
|
|
|
|
///邀请码输入框
|
|
|
|
|
@property (nonatomic,strong) UITextField *codeTextField;
|
|
|
|
|
///选填
|
|
|
|
|
@property (nonatomic,strong) UILabel *codeDesLabel;
|
|
|
|
|
///本软件只提供给18
|
|
|
|
|
@property (nonatomic,strong) UILabel *limitLabel;
|
2021-09-15 18:41:40 +08:00
|
|
|
|
///第三方的用户信息
|
|
|
|
|
@property (nonatomic,strong) ThirdUserInfo *thirdInfo;
|
|
|
|
|
///目前选择的性别
|
|
|
|
|
@property (nonatomic,copy) NSString *sexString;
|
2021-09-14 21:01:09 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation LoginFullInfoViewController
|
|
|
|
|
|
2022-01-14 18:45:07 +08:00
|
|
|
|
- (BOOL)isHiddenNavBar {
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
- (LoginFullInfoPresenter *)createPresenter {
|
|
|
|
|
return [[LoginFullInfoPresenter alloc] init];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
|
|
|
[super viewDidLoad];
|
|
|
|
|
[self initSubViews];
|
|
|
|
|
[self initSubViewConstraints];
|
|
|
|
|
[self initEvents];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-15 18:41:40 +08:00
|
|
|
|
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
|
|
|
|
[self.view endEditing:YES];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
#pragma mark - Private Method
|
|
|
|
|
- (void)initSubViews {
|
|
|
|
|
[self.view addSubview:self.titleLabel];
|
|
|
|
|
[self.view addSubview:self.remindLabel];
|
|
|
|
|
[self.view addSubview:self.backView];
|
|
|
|
|
[self.view addSubview:self.sexStackView];
|
2021-12-01 16:51:55 +08:00
|
|
|
|
[self.view addSubview:self.codeLabel];
|
|
|
|
|
[self.view addSubview:self.codeContainView];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
[self.view addSubview:self.nextButton];
|
2021-12-01 16:51:55 +08:00
|
|
|
|
[self.view addSubview:self.limitLabel];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
[self.backView addSubview:self.stackView];
|
|
|
|
|
[self.stackView addArrangedSubview:self.nameLabel];
|
|
|
|
|
[self.stackView addArrangedSubview:self.textField];
|
|
|
|
|
[self.stackView addArrangedSubview:self.refreshButton];
|
|
|
|
|
|
|
|
|
|
[self.sexStackView addArrangedSubview:self.maleButton];
|
|
|
|
|
[self.sexStackView addArrangedSubview:self.femaleButton];
|
2021-09-15 18:41:40 +08:00
|
|
|
|
|
2021-12-01 16:51:55 +08:00
|
|
|
|
[self.codeContainView addSubview:self.codeTextField];
|
|
|
|
|
[self.codeContainView addSubview:self.codeDesLabel];
|
|
|
|
|
|
2021-11-08 15:01:09 +08:00
|
|
|
|
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].userName.length > 0) {
|
2021-09-15 18:41:40 +08:00
|
|
|
|
self.textField.text = [self.presenter getThirdUserInfo].userName;
|
|
|
|
|
} else {
|
|
|
|
|
[self.presenter randomRequestNick];
|
|
|
|
|
}
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)initSubViewConstraints {
|
|
|
|
|
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.centerX.mas_equalTo(self.view);
|
2021-12-01 16:51:55 +08:00
|
|
|
|
make.top.mas_equalTo(self.view).offset(60 + kSafeAreaTopHeight);
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.remindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.centerX.mas_equalTo(self.view);
|
|
|
|
|
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(8);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.mas_equalTo(self.view).inset(52);
|
|
|
|
|
make.height.mas_equalTo(45);
|
|
|
|
|
make.top.mas_equalTo(self.remindLabel.mas_bottom).offset(49);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.mas_equalTo(self.backView).inset(25);
|
|
|
|
|
make.top.bottom.mas_equalTo(self.backView);
|
|
|
|
|
}];
|
2021-09-15 18:41:40 +08:00
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
|
|
|
|
|
[self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.mas_equalTo(self.backView);
|
|
|
|
|
make.top.mas_equalTo(self.backView.mas_bottom).offset(15);
|
|
|
|
|
}];
|
|
|
|
|
|
2021-12-01 16:51:55 +08:00
|
|
|
|
[self.codeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.mas_equalTo(self.view);
|
|
|
|
|
make.top.mas_equalTo(self.sexStackView.mas_bottom).offset(20);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.codeContainView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.height.mas_equalTo(self.backView);
|
|
|
|
|
make.top.mas_equalTo(self.codeLabel.mas_bottom).offset(11);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.codeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.mas_equalTo(self.codeContainView).offset(10);
|
|
|
|
|
make.top.bottom.mas_equalTo(self.codeContainView);
|
|
|
|
|
make.right.mas_equalTo(self.codeDesLabel.mas_left).offset(-5);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.codeDesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.right.mas_equalTo(self.codeContainView).offset(-25);
|
|
|
|
|
make.centerY.mas_equalTo(self.codeContainView);
|
|
|
|
|
}];
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
[self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.mas_equalTo(self.view).inset(52);
|
|
|
|
|
make.height.mas_equalTo(45);
|
2021-12-01 16:51:55 +08:00
|
|
|
|
make.top.mas_equalTo(self.codeContainView.mas_bottom).offset(75);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.limitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.mas_equalTo(self.view);
|
|
|
|
|
make.bottom.mas_equalTo(self.view.mas_bottom).offset(-15);
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)initEvents {
|
|
|
|
|
@weakify(self);
|
2021-09-15 18:41:40 +08:00
|
|
|
|
[[self.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
|
|
|
|
|
if (value.length > 15) {
|
|
|
|
|
value = [value substringToIndex:15];
|
|
|
|
|
}
|
|
|
|
|
return value;
|
|
|
|
|
}] subscribeNext:^(id _Nullable x) {
|
|
|
|
|
@strongify(self);
|
|
|
|
|
self.textField.text = x;
|
|
|
|
|
[self updateNextButton];
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///更新用户信息
|
|
|
|
|
- (void)updateUserInfo {
|
2021-12-01 16:51:55 +08:00
|
|
|
|
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl] gender:self.maleButton.selected ? @"1":@"2" nick:self.textField.text inviteCode:self.codeTextField.text roomUid:nil shareUid:nil shareChannel:nil];
|
2021-09-15 18:41:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///获取头像 可能是从第三方获取的头像
|
|
|
|
|
- (NSString *)getAvatarUrl {
|
|
|
|
|
NSString * avatar;
|
|
|
|
|
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) {
|
|
|
|
|
avatar = [self.presenter getThirdUserInfo].avatarUrl;
|
|
|
|
|
} else {
|
2024-01-31 10:43:03 +08:00
|
|
|
|
avatar = @"https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/default_avatar.png";
|
2021-09-15 18:41:40 +08:00
|
|
|
|
}
|
|
|
|
|
return avatar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)updateNextButton {
|
|
|
|
|
if (self.textField.text.length > 0 && self.sexString.length > 0) {
|
|
|
|
|
self.nextButton.enabled = YES;
|
|
|
|
|
} else {
|
|
|
|
|
self.nextButton.enabled = NO;
|
|
|
|
|
}
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - LoginFullInfoProtocol
|
|
|
|
|
- (void)requestRandomNickSuccess:(NSString *)nick {
|
|
|
|
|
self.textField.text = nick;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)complementInfoSuccess {
|
2021-09-27 20:16:27 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginRepariSuccess];
|
2021-11-04 15:14:13 +08:00
|
|
|
|
///需要重新加载一次 ticket 刷新tabbar的item
|
|
|
|
|
[[AccountInfoStorage instance] saveTicket:nil];
|
2021-09-15 18:41:40 +08:00
|
|
|
|
UIViewController *vc = self.presentingViewController;
|
|
|
|
|
while (vc.presentingViewController) {
|
|
|
|
|
vc = vc.presentingViewController;
|
|
|
|
|
}
|
|
|
|
|
[vc dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
}];
|
2022-06-02 18:53:45 +08:00
|
|
|
|
NSString * inviteCode = self.codeTextField.text.length > 0 ? self.codeTextField.text : @"";
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:kUserCompleteInfoFinishKey object:inviteCode];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
2021-11-30 16:58:00 +08:00
|
|
|
|
#pragma mark - Event Response
|
|
|
|
|
- (void)nextButtonAction:(UIButton *)sender {
|
2021-12-01 16:51:55 +08:00
|
|
|
|
if (self.codeTextField.text.length <= 0) {
|
|
|
|
|
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
|
|
|
|
config.title = @"";
|
|
|
|
|
config.message = @"当前未填写邀请码哦~ \n 确认继续下一步吗";
|
|
|
|
|
[TTPopup alertWithConfig:config confirmHandler:^{
|
|
|
|
|
[self updateUserInfo];
|
|
|
|
|
} cancelHandler:^{
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
} else {
|
|
|
|
|
[self updateUserInfo];
|
|
|
|
|
}
|
2021-11-30 16:58:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)refreshButtonAction:(UIButton *)sender {
|
|
|
|
|
CAKeyframeAnimation *lAni = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
|
|
|
|
|
lAni.duration = 1;
|
|
|
|
|
lAni.values=@[@0,@(M_PI*2)];
|
|
|
|
|
//使得动画结束后,保持动画效果
|
|
|
|
|
lAni.removedOnCompletion = NO;
|
|
|
|
|
lAni.fillMode = kCAFillModeForwards;
|
|
|
|
|
[sender.layer addAnimation:lAni forKey:nil];
|
|
|
|
|
[self.presenter randomRequestNick];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)maleButtonAction:(UIButton *)sender {
|
|
|
|
|
self.femaleButton.selected = NO;
|
|
|
|
|
sender.selected = YES;
|
|
|
|
|
self.sexString = @"1";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)femaleButtonAction:(UIButton *)sender {
|
|
|
|
|
sender.selected = YES;
|
|
|
|
|
self.maleButton.selected = NO;
|
|
|
|
|
self.sexString = @"2";
|
|
|
|
|
}
|
2021-09-14 21:01:09 +08:00
|
|
|
|
|
|
|
|
|
#pragma mark - Getters And Setters
|
2021-09-15 18:41:40 +08:00
|
|
|
|
- (void)setSexString:(NSString *)sexString {
|
|
|
|
|
_sexString = sexString;
|
|
|
|
|
[self updateNextButton];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
- (UILabel *)titleLabel {
|
|
|
|
|
if (!_titleLabel) {
|
|
|
|
|
_titleLabel = [[UILabel alloc] init];
|
|
|
|
|
_titleLabel.text = @"完善资料";
|
|
|
|
|
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:18];
|
|
|
|
|
_titleLabel.textColor = [ThemeColor mainTextColor];
|
|
|
|
|
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
|
|
}
|
|
|
|
|
return _titleLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)remindLabel {
|
|
|
|
|
if (!_remindLabel) {
|
|
|
|
|
_remindLabel = [[UILabel alloc] init];
|
|
|
|
|
_remindLabel.text = @"性别后期无法进行修改";
|
|
|
|
|
_remindLabel.font = [UIFont systemFontOfSize:13];
|
|
|
|
|
_remindLabel.textColor = [ThemeColor secondTextColor];
|
|
|
|
|
}
|
|
|
|
|
return _remindLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIStackView *)stackView {
|
|
|
|
|
if (!_stackView) {
|
|
|
|
|
_stackView = [[UIStackView alloc] init];
|
|
|
|
|
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
|
|
|
|
_stackView.distribution = UIStackViewDistributionFill;
|
|
|
|
|
_stackView.alignment = UIStackViewAlignmentFill;
|
|
|
|
|
_stackView.spacing = 10;
|
|
|
|
|
}
|
|
|
|
|
return _stackView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIView *)backView {
|
|
|
|
|
if (!_backView) {
|
|
|
|
|
_backView = [[UIView alloc] init];
|
|
|
|
|
_backView.backgroundColor = [ThemeColor appCellBackgroundColor];
|
|
|
|
|
_backView.layer.masksToBounds = YES;
|
|
|
|
|
_backView.layer.cornerRadius = 45/2;
|
|
|
|
|
}
|
|
|
|
|
return _backView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)nameLabel {
|
|
|
|
|
if (!_nameLabel) {
|
|
|
|
|
_nameLabel = [[UILabel alloc] init];
|
|
|
|
|
_nameLabel.text = @"昵称";
|
|
|
|
|
_nameLabel.font = [UIFont systemFontOfSize:15];
|
|
|
|
|
_nameLabel.textColor = [ThemeColor secondTextColor];
|
2021-09-15 18:41:40 +08:00
|
|
|
|
[_nameLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
[_nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return _nameLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UITextField *)textField {
|
|
|
|
|
if (!_textField) {
|
|
|
|
|
_textField = [[UITextField alloc] init];
|
|
|
|
|
_textField.textColor = [ThemeColor mainTextColor];
|
|
|
|
|
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
|
|
|
|
_textField.borderStyle = UITextBorderStyleNone;
|
|
|
|
|
_textField.tintColor = [ThemeColor appMainColor];
|
|
|
|
|
_textField.textAlignment = NSTextAlignmentRight;
|
|
|
|
|
_textField.backgroundColor = [UIColor clearColor];
|
|
|
|
|
}
|
|
|
|
|
return _textField;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)refreshButton {
|
|
|
|
|
if (!_refreshButton) {
|
|
|
|
|
_refreshButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_refreshButton setImage:[UIImage imageNamed:@"login_full_info_refresh"] forState:UIControlStateNormal];
|
|
|
|
|
[_refreshButton setImage:[UIImage imageNamed:@"login_full_info_refresh"] forState:UIControlStateSelected];
|
2021-09-15 18:41:40 +08:00
|
|
|
|
[_refreshButton setEnlargeEdgeWithTop:0 right:0 bottom:0 left:10];
|
|
|
|
|
[_refreshButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
|
|
|
|
[_refreshButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
2021-11-30 16:58:00 +08:00
|
|
|
|
[_refreshButton addTarget:self action:@selector(refreshButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
return _refreshButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIStackView *)sexStackView {
|
|
|
|
|
if (!_sexStackView) {
|
|
|
|
|
_sexStackView = [[UIStackView alloc] init];
|
|
|
|
|
_sexStackView.axis = UILayoutConstraintAxisHorizontal;
|
|
|
|
|
_sexStackView.distribution = UIStackViewDistributionFill;
|
|
|
|
|
_sexStackView.alignment = UIStackViewAlignmentCenter;
|
|
|
|
|
_sexStackView.spacing = 15;
|
|
|
|
|
}
|
|
|
|
|
return _sexStackView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)maleButton {
|
|
|
|
|
if (!_maleButton) {
|
|
|
|
|
_maleButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_maleButton setImage:[UIImage imageNamed:@"login_full_info_male_normal"] forState:UIControlStateNormal];
|
|
|
|
|
[_maleButton setImage:[UIImage imageNamed:@"login_full_info_male_select"] forState:UIControlStateSelected];
|
2021-11-30 16:58:00 +08:00
|
|
|
|
[_maleButton addTarget:self action:@selector(maleButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
return _maleButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)femaleButton {
|
|
|
|
|
if (!_femaleButton) {
|
|
|
|
|
_femaleButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_femaleButton setImage:[UIImage imageNamed:@"login_full_info_female_normal"] forState:UIControlStateNormal];
|
|
|
|
|
[_femaleButton setImage:[UIImage imageNamed:@"login_full_info_female_select"] forState:UIControlStateSelected];
|
2021-11-30 16:58:00 +08:00
|
|
|
|
[_femaleButton addTarget:self action:@selector(femaleButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
return _femaleButton;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-01 16:51:55 +08:00
|
|
|
|
- (UIView *)codeContainView {
|
|
|
|
|
if (!_codeContainView) {
|
|
|
|
|
_codeContainView = [[UIView alloc] init];
|
|
|
|
|
_codeContainView.backgroundColor = [ThemeColor appCellBackgroundColor];
|
|
|
|
|
_codeContainView.layer.masksToBounds= YES;
|
|
|
|
|
_codeContainView.layer.cornerRadius = 45/2;
|
|
|
|
|
}
|
|
|
|
|
return _codeContainView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UITextField *)codeTextField {
|
|
|
|
|
if (!_codeTextField) {
|
|
|
|
|
_codeTextField = [[UITextField alloc] init];
|
|
|
|
|
_codeTextField.textColor = [ThemeColor mainTextColor];
|
|
|
|
|
_codeTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
|
|
|
|
_codeTextField.borderStyle = UITextBorderStyleNone;
|
|
|
|
|
_codeTextField.tintColor = [ThemeColor appMainColor];
|
|
|
|
|
_codeTextField.textAlignment = NSTextAlignmentLeft;
|
|
|
|
|
_codeTextField.backgroundColor = [UIColor clearColor];
|
|
|
|
|
}
|
|
|
|
|
return _codeTextField;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)codeLabel {
|
|
|
|
|
if (!_codeLabel) {
|
|
|
|
|
_codeLabel = [[UILabel alloc] init];
|
|
|
|
|
_codeLabel.text = @"邀请码";
|
|
|
|
|
_codeLabel.font = [UIFont systemFontOfSize:18];
|
|
|
|
|
_codeLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
|
|
_codeLabel.textColor = [ThemeColor secondTextColor];
|
|
|
|
|
}
|
|
|
|
|
return _codeLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)codeDesLabel {
|
|
|
|
|
if (!_codeDesLabel) {
|
|
|
|
|
_codeDesLabel = [[UILabel alloc] init];
|
|
|
|
|
_codeDesLabel.text = @"(选填)";
|
|
|
|
|
_codeDesLabel.font = [UIFont systemFontOfSize:15];
|
|
|
|
|
_codeDesLabel.textColor = [ThemeColor textThirdColor];
|
|
|
|
|
[_codeDesLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
|
|
|
|
}
|
|
|
|
|
return _codeDesLabel;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
- (UIButton *)nextButton{
|
|
|
|
|
if (!_nextButton) {
|
|
|
|
|
_nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
_nextButton.layer.masksToBounds = YES;
|
|
|
|
|
_nextButton.layer.cornerRadius = 45/2.f;
|
|
|
|
|
[_nextButton setTitle:@"下一步" forState:UIControlStateNormal];
|
2021-09-23 18:35:40 +08:00
|
|
|
|
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
[_nextButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal];
|
|
|
|
|
_nextButton.enabled = NO;
|
|
|
|
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
|
|
|
|
[_nextButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor disableButtonColor], [ThemeColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
|
|
|
|
|
[_nextButton setBackgroundImage:image forState:UIControlStateNormal];
|
2021-11-30 16:58:00 +08:00
|
|
|
|
[_nextButton addTarget:self action:@selector(nextButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
2021-09-14 21:01:09 +08:00
|
|
|
|
}
|
|
|
|
|
return _nextButton;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-01 16:51:55 +08:00
|
|
|
|
- (UILabel *)limitLabel {
|
|
|
|
|
if (!_limitLabel) {
|
|
|
|
|
_limitLabel = [[UILabel alloc] init];
|
|
|
|
|
_limitLabel.text = @"本软件只提供给18岁或以上用户使用";
|
|
|
|
|
_limitLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
|
|
_limitLabel.font = [UIFont systemFontOfSize:12];
|
|
|
|
|
_limitLabel.textColor = [ThemeColor textThirdColor];
|
|
|
|
|
}
|
|
|
|
|
return _limitLabel;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-14 21:01:09 +08:00
|
|
|
|
@end
|