更换项目
This commit is contained in:
@@ -1,202 +0,0 @@
|
||||
//
|
||||
// ConsumerPrivacyRegard.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/1.
|
||||
//
|
||||
|
||||
#import "ConsumerPrivacyRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <YYText/YYText.h>
|
||||
#import "YUMIConstant.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIHtmlUrl.h"
|
||||
#import "MKJPopup.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YUMITissueRegardGovernancer.h"
|
||||
|
||||
NSString * const kYouMiNumberCountKey = @"kYouMinumbernnagna";
|
||||
@interface ConsumerPrivacyRegard ()
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) YYTextView *satisfperformanceSequencignation;
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
@property (nonatomic, strong) UIButton *acknowledgementBtuton;
|
||||
@property (nonatomic, strong) UIButton *exitBtuton;
|
||||
@end
|
||||
|
||||
@implementation ConsumerPrivacyRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Response
|
||||
- (void)onAgreementBtutonTicktack:(UIButton *)sender {
|
||||
if (sender == self.acknowledgementBtuton) {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:@"isShow" forKey:kYouMiNumberCountKey];
|
||||
[defaults synchronize];
|
||||
[MKJPopup dismiss];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)routeBtutonTicktack:(UIButton *)sender {
|
||||
[self routeAplictowardsionlictowardsion];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
self.layer.masksToBounds = YES;
|
||||
self.layer.cornerRadius = 10;
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.satisfperformanceSequencignation];
|
||||
[self addSubview:self.stackView];
|
||||
[self.stackView addArrangedSubview:self.exitBtuton];
|
||||
[self.stackView addArrangedSubview:self.acknowledgementBtuton];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KScreenWidth - 38 * 2);
|
||||
make.height.mas_equalTo(424);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(18);
|
||||
make.centerX.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.satisfperformanceSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(55);
|
||||
make.left.mas_equalTo(28);
|
||||
make.right.mas_equalTo(-28);
|
||||
make.bottom.mas_equalTo(-68);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(-20);
|
||||
make.left.right.mas_equalTo(self).inset(15);
|
||||
make.height.mas_equalTo(36);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)routeAplictowardsionlictowardsion {
|
||||
[MKJPopup dismiss];
|
||||
[UIView beginAnimations:@"exitApplication" context:nil];
|
||||
[UIView setAnimationDuration:0.5];
|
||||
[UIView setAnimationDelegate:self];
|
||||
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self cache:NO];
|
||||
[UIView setAnimationDidStopSelector:@selector(brectifynessAccomplished:finished:context:)];
|
||||
[UIView commitAnimations];
|
||||
}
|
||||
- (void)brectifynessAccomplished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
|
||||
if ([animationID compare:@"exitApplication"] == 0) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16.f weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor precautiousChampionPrettify];
|
||||
_titleLabel.text = [NSString stringWithFormat:YMLocalizedString(@"User_Privacy_View_0"), AppName];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (YYTextView *)satisfperformanceSequencignation {
|
||||
if (!_satisfperformanceSequencignation) {
|
||||
_satisfperformanceSequencignation = [[YYTextView alloc]init];
|
||||
_satisfperformanceSequencignation.editable = NO;
|
||||
_satisfperformanceSequencignation.showsVerticalScrollIndicator = NO;
|
||||
_satisfperformanceSequencignation.showsHorizontalScrollIndicator = NO;
|
||||
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.lineSpacing = 4;
|
||||
NSString * agreement = [NSString stringWithFormat:YMLocalizedString(@"User_Privacy_View_1"), AppName];
|
||||
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] init];
|
||||
NSAttributedString *att1 = [[NSAttributedString alloc] initWithString:agreement attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14], NSForegroundColorAttributeName : [DJDKMIMOMColor essayTertiusPrettify], NSParagraphStyleAttributeName : paragraphStyle, NSKernAttributeName : @(1.0)}];
|
||||
|
||||
NSMutableAttributedString *att2 = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"User_Privacy_View_2") attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14 weight:UIFontWeightMedium], NSForegroundColorAttributeName : [DJDKMIMOMColor essayTertiusPrettify], NSParagraphStyleAttributeName : paragraphStyle, NSKernAttributeName : @(1.0)}];
|
||||
@kWeakify(self);
|
||||
[att2 yy_setTextHighlightRange:NSMakeRange(8, 6) color:[DJDKMIMOMColor aplictowardsionMainPrettify] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@kStrongify(self);
|
||||
[MKJPopup dismiss];
|
||||
YUMITissueRegardGovernancer *web = [[YUMITissueRegardGovernancer alloc] init];
|
||||
web.url = URLWithType(kPrivacyURL);
|
||||
[self.controller.navigationController pushViewController:web animated:YES];
|
||||
}];
|
||||
|
||||
[att2 yy_setTextHighlightRange:NSMakeRange(15, 6) color:[DJDKMIMOMColor aplictowardsionMainPrettify] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@kStrongify(self);
|
||||
[MKJPopup dismiss];
|
||||
YUMITissueRegardGovernancer *web = [[YUMITissueRegardGovernancer alloc] init];
|
||||
web.url = URLWithType(kUserProtocalURL);
|
||||
[self.controller.navigationController pushViewController:web animated:YES];
|
||||
}];
|
||||
|
||||
[attStr appendAttributedString:att1];
|
||||
[attStr appendAttributedString:att2];
|
||||
|
||||
_satisfperformanceSequencignation.attributedText = attStr;
|
||||
}
|
||||
return _satisfperformanceSequencignation;
|
||||
}
|
||||
|
||||
- (UIButton *)acknowledgementBtuton {
|
||||
if (!_acknowledgementBtuton) {
|
||||
_acknowledgementBtuton = [[UIButton alloc]init];
|
||||
[_acknowledgementBtuton setTitle:YMLocalizedString(@"User_Privacy_View_3") forState:UIControlStateNormal];
|
||||
_acknowledgementBtuton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_acknowledgementBtuton setTitleColor:[DJDKMIMOMColor mainEssayPrettify] forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor acknowledgementBtutonObliquityInititowardsePrettify],[DJDKMIMOMColor acknowledgementBtutonObliquityConcludePrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
[_acknowledgementBtuton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
_acknowledgementBtuton.layer.cornerRadius = 18;
|
||||
_acknowledgementBtuton.layer.masksToBounds = YES;
|
||||
[_acknowledgementBtuton addTarget:self action:@selector(onAgreementBtutonTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _acknowledgementBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)exitBtuton {
|
||||
if (!_exitBtuton) {
|
||||
_exitBtuton = [[UIButton alloc]init];
|
||||
[_exitBtuton setTitle:YMLocalizedString(@"User_Privacy_View_4") forState:UIControlStateNormal];
|
||||
_exitBtuton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_exitBtuton setTitleColor:[DJDKMIMOMColor revoctowardsionBtutonEssayPrettify] forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor revoctowardsionBtutonObliquityInititowardsePrettify],[DJDKMIMOMColor revoctowardsionBtutonObliquityConcludePrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
[_exitBtuton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
_exitBtuton.layer.cornerRadius = 18;
|
||||
_exitBtuton.layer.masksToBounds = YES;
|
||||
[_exitBtuton addTarget:self action:@selector(routeBtutonTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _exitBtuton;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFillEqually;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 20;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
24
YuMi/Modules/YMLogin/View/CustomView/LoginVerifCodeView.h
Normal file
24
YuMi/Modules/YMLogin/View/CustomView/LoginVerifCodeView.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// LoginVerifCodeView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/8.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginVerifCodeView : UIView
|
||||
|
||||
///输入的验证码 有几位
|
||||
@property (nonatomic,assign) int number;
|
||||
///输入的字符串的
|
||||
@property (nonatomic,copy) void(^textFieldChangeBlock)(NSString *);
|
||||
///是否密文输入
|
||||
@property (nonatomic, assign) BOOL shouldBeSecurity;
|
||||
///类型
|
||||
@property (nonatomic,assign) int type;//1.转赠钻石
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
165
YuMi/Modules/YMLogin/View/CustomView/LoginVerifCodeView.m
Normal file
165
YuMi/Modules/YMLogin/View/CustomView/LoginVerifCodeView.m
Normal file
@@ -0,0 +1,165 @@
|
||||
//
|
||||
// LoginVerifCodeView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "LoginVerifCodeView.h"
|
||||
///第三方
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
|
||||
@interface LoginVerifCodeView ()
|
||||
///输入框的占位符
|
||||
@property (nonatomic,strong) UITextField *textField;
|
||||
///显示label的数组
|
||||
@property (nonatomic,strong) NSMutableArray<UILabel *> *lableArray;
|
||||
@end
|
||||
|
||||
|
||||
@implementation LoginVerifCodeView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self initEvents];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.textField];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initEvents {
|
||||
@weakify(self);
|
||||
[[self.textField rac_signalForControlEvents:UIControlEventEditingChanged] subscribeNext:^(__kindof UITextField *textField) {
|
||||
@strongify(self);
|
||||
[self updateLablesWithText:textField];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updateLablesWithText:(UITextField *)textField {
|
||||
if (textField.text.length > self.lableArray.count) {
|
||||
textField.text = [textField.text substringToIndex:self.lableArray.count];
|
||||
}
|
||||
if (textField.text.length >= self.number) {
|
||||
[textField resignFirstResponder];
|
||||
if (_textFieldChangeBlock) {
|
||||
_textFieldChangeBlock(textField.text);
|
||||
}
|
||||
}
|
||||
|
||||
for (UILabel *pwLab in self.lableArray) {
|
||||
if (pwLab.tag < (100 + textField.text.length)) {
|
||||
if (self.shouldBeSecurity) {
|
||||
pwLab.text = @"●";
|
||||
} else {
|
||||
NSRange range = NSMakeRange(pwLab.tag-100, 1);
|
||||
pwLab.text = [textField.text substringWithRange:range];
|
||||
}
|
||||
}else{
|
||||
pwLab.text = @"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configLabelArray {
|
||||
CGFloat itemWidth = 45;
|
||||
CGFloat itemHeight = 45;
|
||||
CGFloat itemSpace = 11;
|
||||
for (int i = 0; i < _number; i++) {
|
||||
UILabel * label = [[UILabel alloc] init];
|
||||
label.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
label.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
|
||||
label.layer.masksToBounds = YES;
|
||||
label.layer.cornerRadius = 10;
|
||||
label.tag = 100 + i;
|
||||
[self addSubview:label];
|
||||
[label mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemHeight));
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.left.mas_equalTo(self).offset((itemWidth + itemSpace)* i);
|
||||
}];
|
||||
[self.lableArray addObject:label];
|
||||
}
|
||||
|
||||
UILabel * label = [self.lableArray lastObject];
|
||||
if (label) {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(label.mas_right);
|
||||
make.height.mas_equalTo(itemHeight);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configLabelArrayOfGiveDiamond {
|
||||
CGFloat itemWidth = kGetScaleWidth(50);
|
||||
CGFloat itemHeight = kGetScaleWidth(50);
|
||||
CGFloat itemSpace = kGetScaleWidth(9);
|
||||
for (int i = 0; i < _number; i++) {
|
||||
UILabel * label = [[UILabel alloc] init];
|
||||
label.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
label.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.backgroundColor = UIColorFromRGB(0xF0F5F6);
|
||||
label.layer.masksToBounds = YES;
|
||||
label.layer.cornerRadius = kGetScaleWidth(4);
|
||||
label.tag = 100 + i;
|
||||
[self addSubview:label];
|
||||
[label mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemHeight));
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.left.mas_equalTo(self).offset((itemWidth + itemSpace)* i);
|
||||
}];
|
||||
[self.lableArray addObject:label];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setNumber:(int)number {
|
||||
_number = number;
|
||||
if(self.type == 1 && _number > 0){
|
||||
[self configLabelArrayOfGiveDiamond];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_number > 0) {
|
||||
[self configLabelArray];
|
||||
}
|
||||
}
|
||||
|
||||
- (UITextField *)textField {
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.tintColor = [UIColor clearColor];
|
||||
_textField.textColor = [UIColor clearColor];
|
||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
[_textField becomeFirstResponder];
|
||||
}
|
||||
return _textField;
|
||||
}
|
||||
|
||||
- (NSMutableArray<UILabel *> *)lableArray {
|
||||
if (!_lableArray) {
|
||||
_lableArray = [NSMutableArray array];
|
||||
}
|
||||
return _lableArray;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// SurmountValidationCodeRegard.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/8.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountValidationCodeRegard : UIView
|
||||
|
||||
@property (nonatomic,assign) int number;
|
||||
@property (nonatomic,copy) void(^textFieldChangeBlock)(NSString *);
|
||||
@property (nonatomic, assign) BOOL shouldBeAssurance;
|
||||
@property (nonatomic,assign) int type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,161 +0,0 @@
|
||||
//
|
||||
// SurmountValidationCodeRegard.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "SurmountValidationCodeRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
|
||||
@interface SurmountValidationCodeRegard ()
|
||||
@property (nonatomic,strong) UITextField *essayUniverse;
|
||||
@property (nonatomic,strong) NSMutableArray<UILabel *> *sequencigntionGarment;
|
||||
@end
|
||||
|
||||
|
||||
@implementation SurmountValidationCodeRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[self initOccurrences];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.essayUniverse];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.essayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initOccurrences {
|
||||
@weakify(self);
|
||||
[[self.essayUniverse rac_signalForControlEvents:UIControlEventEditingChanged] subscribeNext:^(__kindof UITextField *essayUniverse) {
|
||||
@strongify(self);
|
||||
[self refurbishSequencigntionsAboutEssay:essayUniverse];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)refurbishSequencigntionsAboutEssay:(UITextField *)essayUniverse {
|
||||
if (essayUniverse.text.length > self.sequencigntionGarment.count) {
|
||||
essayUniverse.text = [essayUniverse.text substringToIndex:self.sequencigntionGarment.count];
|
||||
}
|
||||
if (essayUniverse.text.length >= self.number) {
|
||||
[essayUniverse resignFirstResponder];
|
||||
if (_textFieldChangeBlock) {
|
||||
_textFieldChangeBlock(essayUniverse.text);
|
||||
}
|
||||
}
|
||||
|
||||
for (UILabel *pwLab in self.sequencigntionGarment) {
|
||||
if (pwLab.tag < (100 + essayUniverse.text.length)) {
|
||||
if (self.shouldBeAssurance) {
|
||||
pwLab.text = @"●";
|
||||
} else {
|
||||
NSRange range = NSMakeRange(pwLab.tag-100, 1);
|
||||
pwLab.text = [essayUniverse.text substringWithRange:range];
|
||||
}
|
||||
}else{
|
||||
pwLab.text = @"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prohibitipositionSequencigntowardsionGarment {
|
||||
CGFloat itemWidth = 45;
|
||||
CGFloat itemAltitude = 45;
|
||||
CGFloat itemSpace = 11;
|
||||
for (int i = 0; i < _number; i++) {
|
||||
UILabel * label = [[UILabel alloc] init];
|
||||
label.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
label.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.backgroundColor = [DJDKMIMOMColor aplictowardsionElementEncouragegroundPrettify];
|
||||
label.layer.masksToBounds = YES;
|
||||
label.layer.cornerRadius = 10;
|
||||
label.tag = 100 + i;
|
||||
[self addSubview:label];
|
||||
[label mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemAltitude));
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.left.mas_equalTo(self).offset((itemWidth + itemSpace)* i);
|
||||
}];
|
||||
[self.sequencigntionGarment addObject:label];
|
||||
}
|
||||
|
||||
UILabel * label = [self.sequencigntionGarment lastObject];
|
||||
if (label) {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(label.mas_right);
|
||||
make.height.mas_equalTo(itemAltitude);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prohibitipositionSequencigntowardsionGarmentHLOfGiveDiamond {
|
||||
CGFloat itemWidth = kGetScaleWidth(50);
|
||||
CGFloat itemAltitude = kGetScaleWidth(50);
|
||||
CGFloat itemSpace = kGetScaleWidth(9);
|
||||
for (int i = 0; i < _number; i++) {
|
||||
UILabel * label = [[UILabel alloc] init];
|
||||
label.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
label.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.backgroundColor = UIColorFromRGB(0xF0F5F6);
|
||||
label.layer.masksToBounds = YES;
|
||||
label.layer.cornerRadius = kGetScaleWidth(4);
|
||||
label.tag = 100 + i;
|
||||
[self addSubview:label];
|
||||
[label mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemAltitude));
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.left.mas_equalTo(self).offset((itemWidth + itemSpace)* i);
|
||||
}];
|
||||
[self.sequencigntionGarment addObject:label];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setNumber:(int)number {
|
||||
_number = number;
|
||||
if(self.type == 1 && _number > 0){
|
||||
[self prohibitipositionSequencigntowardsionGarmentHLOfGiveDiamond];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_number > 0) {
|
||||
[self prohibitipositionSequencigntowardsionGarment];
|
||||
}
|
||||
}
|
||||
|
||||
- (UITextField *)essayUniverse {
|
||||
if (!_essayUniverse) {
|
||||
_essayUniverse = [[UITextField alloc] init];
|
||||
_essayUniverse.tintColor = [UIColor clearColor];
|
||||
_essayUniverse.textColor = [UIColor clearColor];
|
||||
_essayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
[_essayUniverse becomeFirstResponder];
|
||||
}
|
||||
return _essayUniverse;
|
||||
}
|
||||
|
||||
- (NSMutableArray<UILabel *> *)sequencigntionGarment {
|
||||
if (!_sequencigntionGarment) {
|
||||
_sequencigntionGarment = [NSMutableArray array];
|
||||
}
|
||||
return _sequencigntionGarment;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ConsumerPrivacyRegard.h
|
||||
// UserPrivacyView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/1.
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ConsumerPrivacyRegard : UIView
|
||||
@interface UserPrivacyView : UIView
|
||||
///
|
||||
@property (nonatomic,strong) UIViewController * controller;
|
||||
@end
|
||||
|
211
YuMi/Modules/YMLogin/View/CustomView/UserPrivacyView.m
Normal file
211
YuMi/Modules/YMLogin/View/CustomView/UserPrivacyView.m
Normal file
@@ -0,0 +1,211 @@
|
||||
//
|
||||
// UserPrivacyView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/1.
|
||||
//
|
||||
|
||||
#import "UserPrivacyView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <YYText/YYText.h>
|
||||
///Tool
|
||||
#import "YUMIConstant.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIHtmlUrl.h"
|
||||
#import "TTPopup.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///VC
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
NSString * const kYouMiNumberCountKey = @"kYouMinumbernnagna";
|
||||
@interface UserPrivacyView ()
|
||||
///title
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
///内容
|
||||
@property (nonatomic, strong) YYTextView *contentLabel;
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///确认
|
||||
@property (nonatomic, strong) UIButton *confirmButton;
|
||||
///退出
|
||||
@property (nonatomic, strong) UIButton *exitButton;
|
||||
@end
|
||||
|
||||
@implementation UserPrivacyView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Response
|
||||
- (void)onAgreementButtonClick:(UIButton *)sender {
|
||||
if (sender == self.confirmButton) {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:@"isShow" forKey:kYouMiNumberCountKey];
|
||||
[defaults synchronize];
|
||||
[TTPopup dismiss];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)exitButtonClick:(UIButton *)sender {
|
||||
[self exitApplication];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
self.layer.masksToBounds = YES;
|
||||
self.layer.cornerRadius = 10;
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.contentLabel];
|
||||
[self addSubview:self.stackView];
|
||||
[self.stackView addArrangedSubview:self.exitButton];
|
||||
[self.stackView addArrangedSubview:self.confirmButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KScreenWidth - 38 * 2);
|
||||
make.height.mas_equalTo(424);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(18);
|
||||
make.centerX.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(55);
|
||||
make.left.mas_equalTo(28);
|
||||
make.right.mas_equalTo(-28);
|
||||
make.bottom.mas_equalTo(-68);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(-20);
|
||||
make.left.right.mas_equalTo(self).inset(15);
|
||||
make.height.mas_equalTo(36);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
///退出app
|
||||
- (void)exitApplication {
|
||||
[TTPopup dismiss];
|
||||
[UIView beginAnimations:@"exitApplication" context:nil];
|
||||
[UIView setAnimationDuration:0.5];
|
||||
[UIView setAnimationDelegate:self];
|
||||
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self cache:NO];
|
||||
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
|
||||
[UIView commitAnimations];
|
||||
}
|
||||
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
|
||||
if ([animationID compare:@"exitApplication"] == 0) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16.f weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor alertTitleColor];
|
||||
_titleLabel.text = [NSString stringWithFormat:YMLocalizedString(@"UserPrivacyView0"), AppName];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (YYTextView *)contentLabel {
|
||||
if (!_contentLabel) {
|
||||
_contentLabel = [[YYTextView alloc]init];
|
||||
_contentLabel.editable = NO;
|
||||
_contentLabel.showsVerticalScrollIndicator = NO;
|
||||
_contentLabel.showsHorizontalScrollIndicator = NO;
|
||||
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.lineSpacing = 4;
|
||||
NSString * agreement = [NSString stringWithFormat:YMLocalizedString(@"UserPrivacyView1"), AppName];
|
||||
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] init];
|
||||
NSAttributedString *att1 = [[NSAttributedString alloc] initWithString:agreement attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14], NSForegroundColorAttributeName : [DJDKMIMOMColor textThirdColor], NSParagraphStyleAttributeName : paragraphStyle, NSKernAttributeName : @(1.0)}];
|
||||
|
||||
NSMutableAttributedString *att2 = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"UserPrivacyView2") attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14 weight:UIFontWeightMedium], NSForegroundColorAttributeName : [DJDKMIMOMColor textThirdColor], NSParagraphStyleAttributeName : paragraphStyle, NSKernAttributeName : @(1.0)}];
|
||||
@kWeakify(self);
|
||||
[att2 yy_setTextHighlightRange:NSMakeRange(8, 6) color:[DJDKMIMOMColor appMainColor] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@kStrongify(self);
|
||||
[TTPopup dismiss];
|
||||
XPWebViewController *web = [[XPWebViewController alloc] init];
|
||||
web.url = URLWithType(kPrivacyURL);
|
||||
[self.controller.navigationController pushViewController:web animated:YES];
|
||||
}];
|
||||
|
||||
[att2 yy_setTextHighlightRange:NSMakeRange(15, 6) color:[DJDKMIMOMColor appMainColor] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@kStrongify(self);
|
||||
[TTPopup dismiss];
|
||||
XPWebViewController *web = [[XPWebViewController alloc] init];
|
||||
web.url = URLWithType(kUserProtocalURL);
|
||||
[self.controller.navigationController pushViewController:web animated:YES];
|
||||
}];
|
||||
|
||||
[attStr appendAttributedString:att1];
|
||||
[attStr appendAttributedString:att2];
|
||||
|
||||
_contentLabel.attributedText = attStr;
|
||||
}
|
||||
return _contentLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)confirmButton {
|
||||
if (!_confirmButton) {
|
||||
_confirmButton = [[UIButton alloc]init];
|
||||
[_confirmButton setTitle:YMLocalizedString(@"UserPrivacyView3") forState:UIControlStateNormal];
|
||||
_confirmButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_confirmButton setTitleColor:[DJDKMIMOMColor mainTextColor] forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
[_confirmButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
_confirmButton.layer.cornerRadius = 18;
|
||||
_confirmButton.layer.masksToBounds = YES;
|
||||
[_confirmButton addTarget:self action:@selector(onAgreementButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _confirmButton;
|
||||
}
|
||||
|
||||
- (UIButton *)exitButton {
|
||||
if (!_exitButton) {
|
||||
_exitButton = [[UIButton alloc]init];
|
||||
[_exitButton setTitle:YMLocalizedString(@"UserPrivacyView4") forState:UIControlStateNormal];
|
||||
_exitButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_exitButton setTitleColor:[DJDKMIMOMColor cancelButtonTextColor] forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor cancelButtonGradientStartColor],[DJDKMIMOMColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
[_exitButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
_exitButton.layer.cornerRadius = 18;
|
||||
_exitButton.layer.masksToBounds = YES;
|
||||
[_exitButton addTarget:self action:@selector(exitButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _exitButton;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFillEqually;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 20;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// YMLoginBindSuccessView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef void(^XPBindViewDismissHandler)(void);
|
||||
@interface XPLoginBindSuccessView : UIView
|
||||
@property (nonatomic, copy) XPBindViewDismissHandler dismissHandler;
|
||||
+ (void)showBindSuccessViewWithHandler:(XPBindViewDismissHandler)handler;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
126
YuMi/Modules/YMLogin/View/CustomView/XPLoginBindSuccessView.m
Normal file
126
YuMi/Modules/YMLogin/View/CustomView/XPLoginBindSuccessView.m
Normal file
@@ -0,0 +1,126 @@
|
||||
//
|
||||
// YMLoginBindSuccessView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "XPLoginBindSuccessView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "TTPopup.h"
|
||||
|
||||
@interface XPLoginBindSuccessView ()
|
||||
|
||||
@property (nonatomic, strong) UIImageView *successImageView;
|
||||
@property (nonatomic, strong) UILabel *textLabel;
|
||||
@property (nonatomic, strong) UIButton *closeBtn;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPLoginBindSuccessView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self baseUI];
|
||||
[self initViews];
|
||||
[self initConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark lifeCycle
|
||||
- (void)baseUI {
|
||||
self.layer.cornerRadius = 8.f;
|
||||
self.layer.masksToBounds = YES;
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
- (void)initViews {
|
||||
[self addSubview:self.successImageView];
|
||||
[self addSubview:self.textLabel];
|
||||
[self addSubview:self.closeBtn];
|
||||
}
|
||||
|
||||
- (void)initConstraints {
|
||||
[self.successImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(18);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.size.mas_equalTo(CGSizeMake(76, 76));
|
||||
}];
|
||||
|
||||
[self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.successImageView.mas_bottom).offset(7);
|
||||
}];
|
||||
|
||||
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.textLabel.mas_bottom).offset(22);
|
||||
make.height.mas_equalTo(38);
|
||||
make.width.mas_equalTo(124);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark private methods
|
||||
+ (void)showBindSuccessViewWithHandler:(XPBindViewDismissHandler)handler {
|
||||
XPLoginBindSuccessView *bindSuccessView = [[XPLoginBindSuccessView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth - 64, 195)];
|
||||
bindSuccessView.dismissHandler = handler;
|
||||
[TTPopup popupView:bindSuccessView style:TTPopupStyleAlert];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark button click events
|
||||
- (void)closeBtnClickAction:(UIButton *)btn {
|
||||
[TTPopup dismiss];
|
||||
!_dismissHandler ? : _dismissHandler();
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark getter & setter
|
||||
- (UIImageView *)successImageView
|
||||
{
|
||||
if (!_successImageView) {
|
||||
_successImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_bind_phone_success"]];
|
||||
}
|
||||
return _successImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)textLabel
|
||||
{
|
||||
if (!_textLabel) {
|
||||
_textLabel = [[UILabel alloc] init];
|
||||
_textLabel.text = YMLocalizedString(@"XPLoginBindSuccessView0");
|
||||
_textLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_textLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:17];
|
||||
_textLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_textLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _textLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)closeBtn {
|
||||
if (!_closeBtn) {
|
||||
_closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_closeBtn setTitle:YMLocalizedString(@"XPLoginBindSuccessView1") forState:UIControlStateNormal];
|
||||
[_closeBtn setTitleColor:[DJDKMIMOMColor mainTextColor] forState:UIControlStateNormal];
|
||||
[_closeBtn setBackgroundColor:[DJDKMIMOMColor appBackgroundColor]];
|
||||
[_closeBtn.titleLabel setFont:[UIFont systemFontOfSize:15.f]];
|
||||
_closeBtn.layer.masksToBounds = YES;
|
||||
_closeBtn.layer.cornerRadius = 19;
|
||||
[_closeBtn addTarget:self action:@selector(closeBtnClickAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _closeBtn;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// YMLoginBindSuccessView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef void(^XPBindViewDismissHandler)(void);
|
||||
@interface YUMISurmountDilemmaSuccessRegard : UIView
|
||||
@property (nonatomic, copy) XPBindViewDismissHandler disappearHandler;
|
||||
+ (void)EvidenceBindAccomplishmentRegardAboutShankr:(XPBindViewDismissHandler)handler;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,124 +0,0 @@
|
||||
//
|
||||
// YMLoginBindSuccessView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "YUMISurmountDilemmaSuccessRegard.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "MKJPopup.h"
|
||||
|
||||
@interface YUMISurmountDilemmaSuccessRegard ()
|
||||
|
||||
@property (nonatomic, strong) UIImageView *successIndicateRegard;
|
||||
@property (nonatomic, strong) UILabel *textLabel;
|
||||
@property (nonatomic, strong) UIButton *concludeBtuton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountDilemmaSuccessRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self baseUI];
|
||||
[self initRegards];
|
||||
[self initRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark lifeCycle
|
||||
- (void)baseUI {
|
||||
self.layer.cornerRadius = 8.f;
|
||||
self.layer.masksToBounds = YES;
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
- (void)initRegards {
|
||||
[self addSubview:self.successIndicateRegard];
|
||||
[self addSubview:self.textLabel];
|
||||
[self addSubview:self.concludeBtuton];
|
||||
}
|
||||
|
||||
- (void)initRestrictions {
|
||||
[self.successIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(18);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.size.mas_equalTo(CGSizeMake(76, 76));
|
||||
}];
|
||||
|
||||
[self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.successIndicateRegard.mas_bottom).offset(7);
|
||||
}];
|
||||
|
||||
[self.concludeBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.textLabel.mas_bottom).offset(22);
|
||||
make.height.mas_equalTo(38);
|
||||
make.width.mas_equalTo(124);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark private methods
|
||||
+ (void)EvidenceBindAccomplishmentRegardAboutShankr:(XPBindViewDismissHandler)handler {
|
||||
YUMISurmountDilemmaSuccessRegard *bindSuccessView = [[YUMISurmountDilemmaSuccessRegard alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth - 64, 195)];
|
||||
bindSuccessView.disappearHandler = handler;
|
||||
[MKJPopup popupRegard:bindSuccessView style:MKJPopupStyleAlert];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark button click events
|
||||
- (void)concludeBtutonTicktackPerformance:(UIButton *)btn {
|
||||
[MKJPopup dismiss];
|
||||
!_disappearHandler ? : _disappearHandler();
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark getter & setter
|
||||
- (UIImageView *)successIndicateRegard
|
||||
{
|
||||
if (!_successIndicateRegard) {
|
||||
_successIndicateRegard = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yumi_login_bind_phone_success"]];
|
||||
}
|
||||
return _successIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)textLabel
|
||||
{
|
||||
if (!_textLabel) {
|
||||
_textLabel = [[UILabel alloc] init];
|
||||
_textLabel.text = YMLocalizedString(@"XPLoginBindSuccessView0");
|
||||
_textLabel.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_textLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:17];
|
||||
_textLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_textLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _textLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)concludeBtuton {
|
||||
if (!_concludeBtuton) {
|
||||
_concludeBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_concludeBtuton setTitle:YMLocalizedString(@"XPLoginBindSuccessView1") forState:UIControlStateNormal];
|
||||
[_concludeBtuton setTitleColor:[DJDKMIMOMColor mainEssayPrettify] forState:UIControlStateNormal];
|
||||
[_concludeBtuton setBackgroundColor:[DJDKMIMOMColor aplictowardsionEncouragegroundPrettify]];
|
||||
[_concludeBtuton.titleLabel setFont:[UIFont systemFontOfSize:15.f]];
|
||||
_concludeBtuton.layer.masksToBounds = YES;
|
||||
_concludeBtuton.layer.cornerRadius = 19;
|
||||
[_concludeBtuton addTarget:self action:@selector(concludeBtutonTicktackPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _concludeBtuton;
|
||||
}
|
||||
|
||||
@end
|
16
YuMi/Modules/YMLogin/View/LoginBindPhoneViewController.h
Normal file
16
YuMi/Modules/YMLogin/View/LoginBindPhoneViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// LoginBindPhoneViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginBindPhoneViewController : MvpViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
222
YuMi/Modules/YMLogin/View/LoginBindPhoneViewController.m
Normal file
222
YuMi/Modules/YMLogin/View/LoginBindPhoneViewController.m
Normal file
@@ -0,0 +1,222 @@
|
||||
//
|
||||
// LoginBindPhoneViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "LoginBindPhoneViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "NSString+Utils.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
///Tool
|
||||
#import "LoginBindPhonePresent.h"
|
||||
///VC
|
||||
#import "LoginVerifCodeViewController.h"
|
||||
|
||||
@interface LoginBindPhoneViewController ()
|
||||
///提示Label
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
/// 手机号输入框背景
|
||||
@property (nonatomic, strong) UIView *bgView;
|
||||
///86 Label
|
||||
@property (nonatomic, strong) UILabel *countryLabel;
|
||||
///手机号输入框
|
||||
@property (nonatomic, strong) UITextField *phoneTextField;
|
||||
///登录按钮
|
||||
@property (nonatomic, strong) UIButton *loginBtn;
|
||||
///返回按钮 如果点击了返回按钮的话 那就退出登录
|
||||
@property (nonatomic,strong) UIButton *backButton;
|
||||
@end
|
||||
|
||||
@implementation LoginBindPhoneViewController
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
#pragma mark - life cycle
|
||||
- (LoginBindPhonePresent *)createPresenter {
|
||||
return [[LoginBindPhonePresent alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self setUpUI];
|
||||
[self setEvents];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[self showErrorToast:@"第三方登录需绑定手机号喔~"];
|
||||
}
|
||||
|
||||
- (void)setUpUI {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.bgView];//输入框
|
||||
[self.bgView addSubview:self.countryLabel];
|
||||
[self.bgView addSubview:self.phoneTextField];
|
||||
[self.view addSubview:self.loginBtn]; //登录按钮
|
||||
[self.view addSubview:self.backButton];
|
||||
}
|
||||
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.view).offset(150);
|
||||
}];
|
||||
//输入框
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(50);
|
||||
make.width.mas_equalTo(280);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
[self.countryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(10);
|
||||
make.top.mas_equalTo(self.bgView).offset(5);
|
||||
make.width.mas_equalTo(60);
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
[self.phoneTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(70);
|
||||
make.top.mas_equalTo(self.bgView).offset(5);
|
||||
make.width.mas_equalTo(200);
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
//登录按钮
|
||||
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.bgView.mas_bottom).offset(50);
|
||||
make.width.mas_equalTo(60);
|
||||
make.height.mas_equalTo(60);
|
||||
}];
|
||||
|
||||
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(15, 15));
|
||||
make.left.mas_equalTo(self.view).offset(14);
|
||||
make.top.mas_equalTo(self.view).offset(36 + kSafeAreaTopHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setEvents {
|
||||
@weakify(self)
|
||||
// 登录
|
||||
[[RACSignal combineLatest:@[self.phoneTextField.rac_textSignal]
|
||||
reduce:^id(NSString *phone){
|
||||
BOOL enable = phone.length == 11;
|
||||
return @(enable);
|
||||
}] subscribeNext:^(NSNumber *enable) {
|
||||
@strongify(self)
|
||||
self.loginBtn.enabled = [enable boolValue];
|
||||
}];
|
||||
|
||||
|
||||
[[[[self.loginBtn rac_signalForControlEvents:UIControlEventTouchUpInside] doNext:^(id x) {
|
||||
@strongify(self)
|
||||
self.loginBtn.enabled = NO;
|
||||
}] flattenMap:^id (id value) {
|
||||
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
|
||||
if (!self.phoneTextField.text.isPhoneNumber) {
|
||||
[self showErrorToast:YMLocalizedString(@"LoginBindPhoneViewController1")];
|
||||
[subscriber sendNext:@(NO)];
|
||||
}else {
|
||||
[subscriber sendNext:@(YES)];
|
||||
}
|
||||
[subscriber sendCompleted];
|
||||
return nil;
|
||||
}];
|
||||
}] subscribeNext:^(NSNumber *signedIn) {
|
||||
@strongify(self)
|
||||
self.loginBtn.enabled = YES;
|
||||
BOOL success = [signedIn boolValue];
|
||||
if (success) {
|
||||
//跳转去验证码页面
|
||||
LoginVerifCodeViewController *codeVC = [[LoginVerifCodeViewController alloc] init];
|
||||
codeVC.phone = self.phoneTextField.text;
|
||||
codeVC.type = VerifCodeType_BindPhone;
|
||||
[self.navigationController pushViewController:codeVC animated:YES];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)backButtonAction:(UIButton *)sender {
|
||||
///退出登录状态
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
[self.presenter logout];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
_titleLabel.text = YMLocalizedString(@"LoginBindPhoneViewController2");
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)bgView {
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] init];
|
||||
_bgView.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
|
||||
_bgView.layer.cornerRadius = 45/2;
|
||||
_bgView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
|
||||
- (UILabel *)countryLabel{
|
||||
if (!_countryLabel) {
|
||||
_countryLabel = [[UILabel alloc] init];
|
||||
_countryLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
||||
_countryLabel.text = @"+852";
|
||||
_countryLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_countryLabel.backgroundColor = [UIColor clearColor];
|
||||
_countryLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _countryLabel;
|
||||
}
|
||||
|
||||
- (UITextField *)phoneTextField {
|
||||
if (!_phoneTextField) {
|
||||
_phoneTextField = [[UITextField alloc] init];
|
||||
_phoneTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_phoneTextField.backgroundColor = [UIColor clearColor];
|
||||
_phoneTextField.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_phoneTextField.tintColor = [DJDKMIMOMColor appMainColor];
|
||||
_phoneTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
||||
_phoneTextField.textAlignment = NSTextAlignmentLeft;
|
||||
}
|
||||
return _phoneTextField;
|
||||
}
|
||||
|
||||
- (UIButton *)loginBtn {
|
||||
if (!_loginBtn) {
|
||||
_loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_loginBtn.enabled = NO;
|
||||
[_loginBtn setImage:[UIImage imageNamed:@"login_button"] forState:UIControlStateDisabled];
|
||||
[_loginBtn setImage:[UIImage imageNamed:@"login_button_sel"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _loginBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)backButton {
|
||||
if (!_backButton) {
|
||||
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
|
||||
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateSelected];
|
||||
[_backButton setEnlargeEdgeWithTop:15 right:15 bottom:15 left:15];
|
||||
[_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
||||
@end
|
16
YuMi/Modules/YMLogin/View/LoginFullInfoViewController.h
Normal file
16
YuMi/Modules/YMLogin/View/LoginFullInfoViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// LoginFullInfoViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginFullInfoViewController : MvpViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
464
YuMi/Modules/YMLogin/View/LoginFullInfoViewController.m
Normal file
464
YuMi/Modules/YMLogin/View/LoginFullInfoViewController.m
Normal file
@@ -0,0 +1,464 @@
|
||||
//
|
||||
// LoginFullInfoViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "LoginFullInfoViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "StatisticsServiceHelper.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "ThirdUserInfo.h"
|
||||
///P
|
||||
#import "LoginFullInfoPresenter.h"
|
||||
#import "LoginFullInfoProtocol.h"
|
||||
|
||||
UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
|
||||
|
||||
@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;
|
||||
///邀请码
|
||||
@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;
|
||||
///第三方的用户信息
|
||||
@property (nonatomic,strong) ThirdUserInfo *thirdInfo;
|
||||
///目前选择的性别
|
||||
@property (nonatomic,copy) NSString *sexString;
|
||||
@end
|
||||
|
||||
@implementation LoginFullInfoViewController
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (LoginFullInfoPresenter *)createPresenter {
|
||||
return [[LoginFullInfoPresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self initEvents];
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
#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];
|
||||
[self.view addSubview:self.codeLabel];
|
||||
[self.view addSubview:self.codeContainView];
|
||||
[self.view addSubview:self.nextButton];
|
||||
[self.view addSubview:self.limitLabel];
|
||||
[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];
|
||||
|
||||
[self.codeContainView addSubview:self.codeTextField];
|
||||
[self.codeContainView addSubview:self.codeDesLabel];
|
||||
|
||||
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].userName.length > 0) {
|
||||
self.textField.text = [self.presenter getThirdUserInfo].userName;
|
||||
} else {
|
||||
[self.presenter randomRequestNick];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.view).offset(60 + kSafeAreaTopHeight);
|
||||
}];
|
||||
|
||||
[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);
|
||||
}];
|
||||
|
||||
|
||||
[self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.backView);
|
||||
make.top.mas_equalTo(self.backView.mas_bottom).offset(15);
|
||||
}];
|
||||
|
||||
[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);
|
||||
}];
|
||||
|
||||
[self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view).inset(52);
|
||||
make.height.mas_equalTo(45);
|
||||
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);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initEvents {
|
||||
@weakify(self);
|
||||
[[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 {
|
||||
[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];
|
||||
}
|
||||
|
||||
///获取头像 可能是从第三方获取的头像
|
||||
- (NSString *)getAvatarUrl {
|
||||
NSString * avatar;
|
||||
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) {
|
||||
avatar = [self.presenter getThirdUserInfo].avatarUrl;
|
||||
} else {
|
||||
avatar = @"https://image.hfighting.com/morentouxiang.png";
|
||||
}
|
||||
return avatar;
|
||||
}
|
||||
|
||||
- (void)updateNextButton {
|
||||
if (self.textField.text.length > 0 && self.sexString.length > 0) {
|
||||
self.nextButton.enabled = YES;
|
||||
} else {
|
||||
self.nextButton.enabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - LoginFullInfoProtocol
|
||||
- (void)requestRandomNickSuccess:(NSString *)nick {
|
||||
self.textField.text = nick;
|
||||
}
|
||||
|
||||
- (void)complementInfoSuccess {
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginRepariSuccess];
|
||||
///需要重新加载一次 ticket 刷新tabbar的item
|
||||
[[AccountInfoStorage instance] saveTicket:nil];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
NSString * inviteCode = self.codeTextField.text.length > 0 ? self.codeTextField.text : @"";
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kUserCompleteInfoFinishKey object:inviteCode];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)nextButtonAction:(UIButton *)sender {
|
||||
if (self.codeTextField.text.length <= 0) {
|
||||
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
||||
config.title = @"";
|
||||
config.message = YMLocalizedString(@"LoginFullInfoViewController0");
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
[self updateUserInfo];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
} else {
|
||||
[self updateUserInfo];
|
||||
}
|
||||
}
|
||||
|
||||
- (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";
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setSexString:(NSString *)sexString {
|
||||
_sexString = sexString;
|
||||
[self updateNextButton];
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"LoginFullInfoViewController1");
|
||||
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:18];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)remindLabel {
|
||||
if (!_remindLabel) {
|
||||
_remindLabel = [[UILabel alloc] init];
|
||||
_remindLabel.text = YMLocalizedString(@"LoginFullInfoViewController2");
|
||||
_remindLabel.font = [UIFont systemFontOfSize:13];
|
||||
_remindLabel.textColor = [DJDKMIMOMColor 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 = [DJDKMIMOMColor appCellBackgroundColor];
|
||||
_backView.layer.masksToBounds = YES;
|
||||
_backView.layer.cornerRadius = 45/2;
|
||||
}
|
||||
return _backView;
|
||||
}
|
||||
|
||||
- (UILabel *)nameLabel {
|
||||
if (!_nameLabel) {
|
||||
_nameLabel = [[UILabel alloc] init];
|
||||
_nameLabel.text = YMLocalizedString(@"LoginFullInfoViewController3");
|
||||
_nameLabel.font = [UIFont systemFontOfSize:15];
|
||||
_nameLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
[_nameLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
|
||||
}
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
- (UITextField *)textField {
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
||||
_textField.borderStyle = UITextBorderStyleNone;
|
||||
_textField.tintColor = [DJDKMIMOMColor 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];
|
||||
[_refreshButton setEnlargeEdgeWithTop:0 right:0 bottom:0 left:10];
|
||||
[_refreshButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_refreshButton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_refreshButton addTarget:self action:@selector(refreshButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
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];
|
||||
[_maleButton addTarget:self action:@selector(maleButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
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];
|
||||
[_femaleButton addTarget:self action:@selector(femaleButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _femaleButton;
|
||||
}
|
||||
|
||||
- (UIView *)codeContainView {
|
||||
if (!_codeContainView) {
|
||||
_codeContainView = [[UIView alloc] init];
|
||||
_codeContainView.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
|
||||
_codeContainView.layer.masksToBounds= YES;
|
||||
_codeContainView.layer.cornerRadius = 45/2;
|
||||
}
|
||||
return _codeContainView;
|
||||
}
|
||||
|
||||
- (UITextField *)codeTextField {
|
||||
if (!_codeTextField) {
|
||||
_codeTextField = [[UITextField alloc] init];
|
||||
_codeTextField.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_codeTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
||||
_codeTextField.borderStyle = UITextBorderStyleNone;
|
||||
_codeTextField.tintColor = [DJDKMIMOMColor appMainColor];
|
||||
_codeTextField.textAlignment = NSTextAlignmentLeft;
|
||||
_codeTextField.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _codeTextField;
|
||||
}
|
||||
|
||||
- (UILabel *)codeLabel {
|
||||
if (!_codeLabel) {
|
||||
_codeLabel = [[UILabel alloc] init];
|
||||
_codeLabel.text = YMLocalizedString(@"LoginFullInfoViewController4");
|
||||
_codeLabel.font = [UIFont systemFontOfSize:18];
|
||||
_codeLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_codeLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
}
|
||||
return _codeLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)codeDesLabel {
|
||||
if (!_codeDesLabel) {
|
||||
_codeDesLabel = [[UILabel alloc] init];
|
||||
_codeDesLabel.text = @"(选填)";
|
||||
_codeDesLabel.font = [UIFont systemFontOfSize:15];
|
||||
_codeDesLabel.textColor = [DJDKMIMOMColor textThirdColor];
|
||||
[_codeDesLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
return _codeDesLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)nextButton{
|
||||
if (!_nextButton) {
|
||||
_nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_nextButton.layer.masksToBounds = YES;
|
||||
_nextButton.layer.cornerRadius = 45/2.f;
|
||||
[_nextButton setTitle:YMLocalizedString(@"LoginFullInfoViewController6") forState:UIControlStateNormal];
|
||||
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
[_nextButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal];
|
||||
_nextButton.enabled = NO;
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
[_nextButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor disableButtonColor], [DJDKMIMOMColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
|
||||
[_nextButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_nextButton addTarget:self action:@selector(nextButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _nextButton;
|
||||
}
|
||||
|
||||
- (UILabel *)limitLabel {
|
||||
if (!_limitLabel) {
|
||||
_limitLabel = [[UILabel alloc] init];
|
||||
_limitLabel.text = YMLocalizedString(@"LoginFullInfoViewController7");
|
||||
_limitLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_limitLabel.font = [UIFont systemFontOfSize:12];
|
||||
_limitLabel.textColor = [DJDKMIMOMColor textThirdColor];
|
||||
}
|
||||
return _limitLabel;
|
||||
}
|
||||
|
||||
@end
|
28
YuMi/Modules/YMLogin/View/LoginVerifCodeViewController.h
Normal file
28
YuMi/Modules/YMLogin/View/LoginVerifCodeViewController.h
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// LoginVerifCodeViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSUInteger, VerifCodeType){
|
||||
VerifCodeType_Regist, ///注册的时候
|
||||
VerifCodeType_BindPhone,///绑定手机
|
||||
VerifCodeType_Login,///手机登录
|
||||
VerifCodeType_AreaCode,///区号
|
||||
} ;
|
||||
|
||||
|
||||
@interface LoginVerifCodeViewController : MvpViewController
|
||||
|
||||
///输入的手机号
|
||||
@property (nonatomic,copy) NSString *phone;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
///类型
|
||||
@property (nonatomic,assign) VerifCodeType type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
362
YuMi/Modules/YMLogin/View/LoginVerifCodeViewController.m
Normal file
362
YuMi/Modules/YMLogin/View/LoginVerifCodeViewController.m
Normal file
@@ -0,0 +1,362 @@
|
||||
//
|
||||
// LoginVerifCodeViewController.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "LoginVerifCodeViewController.h"
|
||||
///第三方
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "CountDownHelper.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "XNDJTDDLoadingTool.h"
|
||||
#import "UIView+Corner.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
///Presenter
|
||||
#import "LoginVerifCodePresent.h"
|
||||
///Protocole
|
||||
#import "LoginVerifCodeProtocol.h"
|
||||
///View
|
||||
#import "LoginVerifCodeView.h"
|
||||
#import "LoginFullInfoViewController.h"
|
||||
#import "XPLoginPwdViewController.h"
|
||||
|
||||
@interface LoginVerifCodeViewController ()<LoginVerifCodeProtocol, CountDownHelperDelegate>
|
||||
///顶部背景
|
||||
@property (nonatomic,strong) UIImageView *topBackImgView;
|
||||
///内容
|
||||
@property (nonatomic,strong) UIView *contentView;
|
||||
///标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
//背景
|
||||
@property (nonatomic,strong) UIView *bgCodeView;
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *codeStackView;
|
||||
///显示倒计时
|
||||
@property (nonatomic,strong) UILabel *cutdownLabel;
|
||||
///重新获得验证码
|
||||
@property (nonatomic,strong) UIButton *retryCodeButton;
|
||||
///输入密码
|
||||
@property (nonatomic,strong) UITextField *textField;
|
||||
///登录
|
||||
@property (nonatomic,strong) UIButton *loginButton;
|
||||
///返回按钮
|
||||
@property (nonatomic,strong) UIButton *backBtn;
|
||||
///是否验证码登录成功,登录成功后,不能再用验证码登录了,直接走下面的登录流程就可
|
||||
@property (nonatomic,assign) BOOL isLoginSuccess;
|
||||
///成功后登录验证码
|
||||
@property (nonatomic,copy) NSString *code;
|
||||
@end
|
||||
|
||||
@implementation LoginVerifCodeViewController
|
||||
|
||||
- (void)dealloc {
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
}
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (LoginVerifCodePresent *)createPresenter {
|
||||
return [[LoginVerifCodePresent alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
if(self.type != VerifCodeType_AreaCode){
|
||||
self.retryCodeButton.hidden = YES;
|
||||
self.cutdownLabel.hidden = NO;
|
||||
[[CountDownHelper shareHelper] openCountdownWithTime:60];
|
||||
}else{
|
||||
self.textField.keyboardType = UIKeyboardTypeDefault;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:NO];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
|
||||
[self.view addSubview:self.topBackImgView];
|
||||
[self.view addSubview:self.contentView];
|
||||
|
||||
|
||||
if(self.type == VerifCodeType_AreaCode){
|
||||
self.titleLabel.text = YMLocalizedString(@"LoginVerifCodeViewController5");
|
||||
|
||||
}else{
|
||||
[self.topBackImgView addSubview:self.backBtn];
|
||||
[CountDownHelper shareHelper].delegate = self;
|
||||
}
|
||||
|
||||
[self.topBackImgView addSubview:self.titleLabel];
|
||||
|
||||
[self.contentView addSubview:self.bgCodeView];
|
||||
[self.bgCodeView addSubview:self.codeStackView];
|
||||
[self.codeStackView addArrangedSubview:self.textField];
|
||||
[self.codeStackView addArrangedSubview:self.cutdownLabel];
|
||||
[self.codeStackView addArrangedSubview:self.retryCodeButton];
|
||||
[self.contentView addSubview:self.loginButton];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.topBackImgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kGetScaleWidth(333));
|
||||
}];
|
||||
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.mas_equalTo(self.view);
|
||||
make.top.equalTo(self.topBackImgView.mas_bottom).mas_offset(-kGetScaleWidth(30));
|
||||
}];
|
||||
if(self.type != VerifCodeType_AreaCode){
|
||||
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.topBackImgView.mas_top).offset(kSafeAreaTopHeight + kGetScaleWidth(52));
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(20));
|
||||
make.left.mas_equalTo(kGetScaleWidth(15));
|
||||
}];
|
||||
}
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.topBackImgView).offset(kGetScaleWidth(30));
|
||||
make.top.mas_equalTo(self.topBackImgView.mas_top).offset(kSafeAreaTopHeight + kGetScaleWidth(96));
|
||||
}];
|
||||
|
||||
|
||||
[self.bgCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(30));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(33));
|
||||
make.left.mas_equalTo(kGetScaleWidth(33));
|
||||
make.height.mas_equalTo(kGetScaleWidth(63));
|
||||
}];
|
||||
|
||||
[self.codeStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kGetScaleWidth(20));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(20));
|
||||
make.top.bottom.equalTo(self.bgCodeView);
|
||||
}];
|
||||
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_greaterThanOrEqualTo(kGetScaleWidth(190));
|
||||
}];
|
||||
[self.loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.contentView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(63));
|
||||
make.width.mas_equalTo(kGetScaleWidth(165));
|
||||
make.top.equalTo(self.bgCodeView.mas_bottom).mas_offset(kGetScaleWidth(50));
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)httpRequestPhoneSmsCode {
|
||||
[self.presenter phoneSmsCode:[NSString stringWithFormat:@"%@%@",self.phoneAreaCode,self.phone] type:GetSmsType_Regist phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)loginButtonAction{
|
||||
|
||||
[self.view endEditing:YES];
|
||||
self.loginButton.enabled = NO;
|
||||
// if(self.type == VerifCodeType_AreaCode){
|
||||
// [self showLoading];
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
|
||||
if(self.isLoginSuccess == YES && [self.code isEqualToString:self.textField.text]){
|
||||
[XNDJTDDLoadingTool showLoadingInView:self.view];
|
||||
[self loginSuccess];
|
||||
return;
|
||||
}
|
||||
self.isLoginSuccess = NO;
|
||||
[XNDJTDDLoadingTool showLoadingInView:self.view];
|
||||
self.code = self.textField.text;
|
||||
[self.presenter loginWithPhone:[NSString stringWithFormat:@"%@%@",self.phoneAreaCode,self.phone] code:self.textField.text phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)disMissVC {
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
NSMutableArray *vcList = [NSMutableArray array];
|
||||
for (id vc in self.navigationController.viewControllers) {
|
||||
if(![vc isKindOfClass:[XPLoginPwdViewController class]]){
|
||||
[vcList addObject:vc];
|
||||
}
|
||||
}
|
||||
self.navigationController.viewControllers = vcList;
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - LoginVerifCodeProtocol
|
||||
- (void)loginFail:(NSString *)reason{
|
||||
self.loginButton.enabled = YES;
|
||||
[XNDJTDDLoadingTool showLoadingInView:self.view];
|
||||
}
|
||||
- (void)loginSuccess {
|
||||
self.isLoginSuccess = YES;
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
[self disMissVC];
|
||||
self.loginButton.enabled = YES;
|
||||
}
|
||||
|
||||
///绑定手机号成功
|
||||
- (void)bindPhoneSuccess {
|
||||
[self disMissVC];
|
||||
}
|
||||
#pragma mark - LoginProtocol
|
||||
- (void)phoneSmsCodeSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"PKIDLoginViewController11")];
|
||||
self.retryCodeButton.hidden = YES;
|
||||
self.cutdownLabel.hidden = NO;
|
||||
[[CountDownHelper shareHelper] openCountdownWithTime:60];
|
||||
}
|
||||
|
||||
#pragma mark - CountDownHelperDelegate
|
||||
- (void)onCountdownFinish {
|
||||
self.retryCodeButton.hidden = NO;
|
||||
self.cutdownLabel.hidden = YES;
|
||||
}
|
||||
|
||||
- (void)onCountdownOpen:(int)time {
|
||||
self.cutdownLabel.text = [NSString stringWithFormat:@"%dS",time];
|
||||
}
|
||||
-(void)textFieldDidChange:(UITextField *)textField{
|
||||
self.loginButton.enabled = textField.text > 0;
|
||||
}
|
||||
#pragma mark 重新获取验证吗
|
||||
-(void)retryCodeAction{
|
||||
[self httpRequestPhoneSmsCode];
|
||||
}
|
||||
-(void)backAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:40];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_titleLabel.text = YMLocalizedString(@"LoginVerifCodeViewController3");
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (UILabel *)cutdownLabel {
|
||||
if (!_cutdownLabel) {
|
||||
_cutdownLabel = [[UILabel alloc] init];
|
||||
_cutdownLabel.textAlignment = NSTextAlignmentRight;
|
||||
_cutdownLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_cutdownLabel.textColor = UIColorFromRGB(0x9168FA);
|
||||
_cutdownLabel.hidden = NO;
|
||||
}
|
||||
return _cutdownLabel;
|
||||
}
|
||||
-(UIView *)bgCodeView{
|
||||
if (!_bgCodeView){
|
||||
_bgCodeView = [UIView new];
|
||||
_bgCodeView.backgroundColor = UIColorFromRGB(0xF0F5F6);
|
||||
[_bgCodeView setCornerWithLeftTopCorner:kGetScaleWidth(10) rightTopCorner:kGetScaleWidth(10) bottomLeftCorner:kGetScaleWidth(10) bottomRightCorner:kGetScaleWidth(10) size:CGSizeMake(kGetScaleWidth(308), kGetScaleWidth(63))];
|
||||
}
|
||||
return _bgCodeView;
|
||||
}
|
||||
- (UIButton *)retryCodeButton {
|
||||
if (!_retryCodeButton) {
|
||||
_retryCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_retryCodeButton setTitle:YMLocalizedString(@"LoginVerifCodeViewController4") forState:UIControlStateNormal];
|
||||
[_retryCodeButton setTitleColor:[DJDKMIMOMColor colorWithHexString:@"#1F1A4E"] forState:UIControlStateNormal];
|
||||
_retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_retryCodeButton.hidden = YES;
|
||||
[_retryCodeButton addTarget:self action:@selector(retryCodeAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _retryCodeButton;
|
||||
}
|
||||
- (UIImageView *)topBackImgView {
|
||||
if (!_topBackImgView) {
|
||||
_topBackImgView = [[UIImageView alloc] init];
|
||||
_topBackImgView.userInteractionEnabled = YES;
|
||||
_topBackImgView.image = [UIImage imageNamed:@"login_top_bg"];
|
||||
_topBackImgView.layer.masksToBounds = YES;
|
||||
_topBackImgView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _topBackImgView;
|
||||
}
|
||||
-(UITextField *)textField{
|
||||
if (!_textField){
|
||||
_textField = [[UITextField alloc]init];
|
||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_textField.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"];
|
||||
_textField.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
[_textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
|
||||
}
|
||||
return _textField;
|
||||
}
|
||||
- (UIView *)contentView {
|
||||
if (!_contentView) {
|
||||
_contentView = [[UIView alloc] init];
|
||||
_contentView.backgroundColor = [UIColor whiteColor];
|
||||
[_contentView setCornerWithLeftTopCorner:kGetScaleWidth(25) rightTopCorner:kGetScaleWidth(25) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, KScreenHeight - kGetScaleWidth(303))];
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
- (UIButton *)loginButton {
|
||||
if (!_loginButton) {
|
||||
_loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_loginButton setImage:[UIImage imageNamed:@"login_finish"] forState:UIControlStateNormal];
|
||||
[_loginButton addTarget:self action:@selector(loginButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
_loginButton.enabled = NO;
|
||||
}
|
||||
return _loginButton;
|
||||
}
|
||||
|
||||
- (UIStackView *)codeStackView{
|
||||
if (!_codeStackView) {
|
||||
_codeStackView = [[UIStackView alloc] init];
|
||||
_codeStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_codeStackView.distribution = UIStackViewDistributionFillProportionally;
|
||||
_codeStackView.alignment = UIStackViewAlignmentFill;
|
||||
_codeStackView.spacing = 10;
|
||||
}
|
||||
return _codeStackView;
|
||||
}
|
||||
- (UIButton *)backBtn{
|
||||
if (!_backBtn){
|
||||
_backBtn = [UIButton new];
|
||||
[_backBtn setBackgroundImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
|
||||
[_backBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
[_backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backBtn;
|
||||
}
|
||||
@end
|
@@ -5,11 +5,11 @@
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIForgetPwordRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
@interface XPForgetPwdViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
202
YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.m
Normal file
202
YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.m
Normal file
@@ -0,0 +1,202 @@
|
||||
//
|
||||
// YMForgetPwdViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "XPForgetPwdViewController.h"
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
#import "XPLoginInputView.h"
|
||||
|
||||
#import "LoginForgetPasswordPresent.h"
|
||||
#import "LoginForgetPasswordProtocol.h"
|
||||
#import "XPLoginAraeViewController.h"
|
||||
|
||||
@interface XPForgetPwdViewController ()<XPLoginInputViewDelegate, LoginForgetPasswordProtocol, XPLoginAraeViewControllerDelegate>
|
||||
|
||||
/// 标题
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
/// 手机号输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *phoneInputView;
|
||||
/// 验证码输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *codeInputView;
|
||||
/// 密码输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *pwdInputView;
|
||||
/// 确定按钮
|
||||
@property (nonatomic, strong) UIButton *sureBtn;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPForgetPwdViewController
|
||||
|
||||
- (LoginForgetPasswordPresent *)createPresenter {
|
||||
return [[LoginForgetPasswordPresent alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.phoneAreaCode = @"852";
|
||||
self.needEffect = YES;
|
||||
self.needBack = YES;
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
[self racBind];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.phoneInputView];
|
||||
[self.view addSubview:self.codeInputView];
|
||||
[self.view addSubview:self.pwdInputView];
|
||||
[self.view addSubview:self.sureBtn];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(kStatusBarHeight);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
[self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.top.mas_equalTo(139.0/812.0*KScreenHeight);
|
||||
make.height.mas_equalTo(66);
|
||||
}];
|
||||
[self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.phoneInputView);
|
||||
make.right.mas_equalTo(self.phoneInputView);
|
||||
make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.phoneInputView);
|
||||
}];
|
||||
[self.pwdInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.phoneInputView);
|
||||
make.right.mas_equalTo(self.phoneInputView);
|
||||
make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.phoneInputView);
|
||||
}];
|
||||
[self.sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(51);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(96);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)racBind {
|
||||
RAC(self.sureBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode, NSString *password){
|
||||
return @((phone.length == 11) && smsCode.length >= 5 && (password.length >= 6 && password.length <= 16));
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
/// 确认
|
||||
- (void)sureBtnClicked {
|
||||
NSString *phone = self.phoneInputView.inputTextField.text;
|
||||
NSString *smsCode = self.codeInputView.inputTextField.text;
|
||||
NSString *password = self.pwdInputView.inputTextField.text;
|
||||
[self.presenter resetPassword:phone newPwd:password smsCode:smsCode];
|
||||
}
|
||||
|
||||
#pragma mark - XPLoginInputViewDelegate
|
||||
|
||||
- (void)smsCodeAction {
|
||||
NSString *phone = self.phoneInputView.inputTextField.text;
|
||||
if (phone.length != 11 ) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPForgetPwdViewController0")];
|
||||
return;
|
||||
}
|
||||
[self.presenter phoneSmsCode:phone type:GetSmsType_Reset_Password phoneAreaCode:self.phoneAreaCode];
|
||||
|
||||
}
|
||||
|
||||
- (void)areaListAction {
|
||||
XPLoginAraeViewController *codeVC = [XPLoginAraeViewController new];
|
||||
codeVC.delegate = self;
|
||||
[self.navigationController pushViewController:codeVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)chooseAreaCodeSuccess:(NSString *)code {
|
||||
if (code.length > 0) {
|
||||
self.phoneAreaCode = code;
|
||||
[self.phoneInputView.areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", code] forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - LoginForgetPasswordProtocol
|
||||
|
||||
///请求手机号的验证码成功
|
||||
- (void)phoneSmsCodeSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPForgetPwdViewController1")];
|
||||
[self.codeInputView fireTimer];
|
||||
}
|
||||
|
||||
///重置密码成功
|
||||
- (void)resetPasswrodSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPForgetPwdViewController2")];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPForgetPwdViewController3");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)phoneInputView {
|
||||
if (!_phoneInputView) {
|
||||
_phoneInputView = [[XPLoginInputView alloc] init];
|
||||
_phoneInputView.areaStackView.hidden = NO;
|
||||
_phoneInputView.delegate = self;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPForgetPwdViewController4")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_phoneInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _phoneInputView;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)codeInputView {
|
||||
if (!_codeInputView) {
|
||||
_codeInputView = [[XPLoginInputView alloc] init];
|
||||
_codeInputView.smsCodeBtn.hidden = NO;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPForgetPwdViewController5")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_codeInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_codeInputView.delegate = self;
|
||||
}
|
||||
return _codeInputView;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)pwdInputView {
|
||||
if (!_pwdInputView) {
|
||||
_pwdInputView = [[XPLoginInputView alloc] init];
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:@"请输入密码(6-16个字符)"];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_pwdInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_pwdInputView.inputTextField.keyboardType = UIKeyboardTypeAlphabet;
|
||||
_pwdInputView.inputTextField.secureTextEntry = YES;
|
||||
}
|
||||
return _pwdInputView;
|
||||
}
|
||||
|
||||
- (UIButton *)sureBtn {
|
||||
if (!_sureBtn) {
|
||||
_sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_sureBtn setImage:[UIImage imageNamed:@"login_next"] forState:UIControlStateNormal];
|
||||
[_sureBtn setImage:[UIImage imageNamed:@"login_next_disable"] forState:UIControlStateSelected];
|
||||
[_sureBtn addTarget:self action:@selector(sureBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _sureBtn;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// XPLoginAraeViewController.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol XPLoginAraeViewControllerDelegate <NSObject>
|
||||
|
||||
-(void)chooseAreaCodeSuccess:(NSString *)code;
|
||||
|
||||
@end
|
||||
@interface XPLoginAraeViewController : BaseViewController
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPLoginAraeViewControllerDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,79 +1,81 @@
|
||||
//
|
||||
// YUMISurmountAraeRegardGovernancer.m
|
||||
// XPLoginAraeViewController.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "YUMISurmountAraeRegardGovernancer.h"
|
||||
#import "YUMISurmountAreaTabulationRegardElement.h"
|
||||
#import "SurmountAreaMatrix.h"
|
||||
#import "XPLoginAraeViewController.h"
|
||||
///view
|
||||
#import "XPLoginAreaTableViewCell.h"
|
||||
#import "LoginAreaModel.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "Api+Login.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
@interface YUMISurmountAraeRegardGovernancer ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@interface XPLoginAraeViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@property (nonatomic,strong) NSMutableArray *listData;
|
||||
@property (nonatomic,strong) NSMutableArray *championStatement;
|
||||
@property (nonatomic,strong) NSMutableArray *titleList;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountAraeRegardGovernancer
|
||||
@implementation XPLoginAraeViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[Api acquireMobileAreaCryptogramSttowardsement:^(BaseMatrix * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self initSubViewConstraints];
|
||||
[Api getPhoneAreaCodeList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSArray *list = [SurmountAreaMatrix mtowardsrixsAboutGarment:data.data];
|
||||
[self.championStatement removeAllObjects];
|
||||
NSArray *list = [LoginAreaModel modelsWithArray:data.data];
|
||||
[self.titleList removeAllObjects];
|
||||
[self.listData removeAllObjects];
|
||||
[self acquireProvincialPlistAboutSttowardsement:list];
|
||||
[self getLocalPlistWithList:list];
|
||||
}
|
||||
}];
|
||||
}
|
||||
#pragma mark - SurmountVerifCodeCeremony
|
||||
#pragma mark - LoginVerifCodeProtocol
|
||||
|
||||
-(void)acquireMobileAreaCryptogramSttowardsementAccomplishment:(NSArray *)list{
|
||||
[self brakeHUD];
|
||||
[self.championStatement removeAllObjects];
|
||||
-(void)getPhoneAreaCodeListSuccess:(NSArray *)list{
|
||||
[self hideHUD];
|
||||
[self.titleList removeAllObjects];
|
||||
[self.listData removeAllObjects];
|
||||
[self acquireProvincialPlistAboutSttowardsement:list];
|
||||
[self getLocalPlistWithList:list];
|
||||
}
|
||||
-(void)acquireMobileAreaCryptogramSttowardsementFlunk{
|
||||
[self brakeHUD];
|
||||
-(void)getPhoneAreaCodeListFail{
|
||||
[self hideHUD];
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
NSString *file = [bundle pathForResource:@"district" ofType:@"plist"];
|
||||
NSArray *dictArray = [NSArray arrayWithContentsOfFile:file];
|
||||
|
||||
NSArray *list = [SurmountAreaMatrix mtowardsrixsAboutGarment:dictArray];
|
||||
[self acquireProvincialPlistAboutSttowardsement:list];
|
||||
NSArray *list = [LoginAreaModel modelsWithArray:dictArray];
|
||||
[self getLocalPlistWithList:list];
|
||||
}
|
||||
-(void)acquireProvincialPlistAboutSttowardsement:(NSArray *)list{
|
||||
-(void)getLocalPlistWithList:(NSArray *)list{
|
||||
|
||||
NSArray * letterList = @[@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z"];
|
||||
NSMutableArray *otherList = [NSMutableArray array];
|
||||
for (NSString *letter in letterList) {
|
||||
NSMutableArray *matrixStatement = [NSMutableArray array];
|
||||
for (SurmountAreaMatrix *model in list) {
|
||||
NSMutableArray *modelList = [NSMutableArray array];
|
||||
for (LoginAreaModel *model in list) {
|
||||
NSString *fristLetter = [model.name substringWithRange:NSMakeRange(0, 1)];
|
||||
if([letter isEqualToString:fristLetter]){
|
||||
[matrixStatement addObject:model];
|
||||
[modelList addObject:model];
|
||||
}else{
|
||||
if(![letterList containsObject:fristLetter] && ![otherList containsObject:model]){
|
||||
[otherList addObject:model];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(matrixStatement.count > 0){
|
||||
if(modelList.count > 0){
|
||||
|
||||
[self.championStatement addObject:letter];
|
||||
[self.listData addObject:matrixStatement];
|
||||
[self.titleList addObject:letter];
|
||||
[self.listData addObject:modelList];
|
||||
}
|
||||
}
|
||||
[self.listData addObject:otherList];
|
||||
[self.championStatement addObject:@"#"];
|
||||
[self.titleList addObject:@"#"];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate
|
||||
@@ -82,40 +84,40 @@
|
||||
}
|
||||
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
|
||||
|
||||
return self.championStatement[section];
|
||||
return self.titleList[section];
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return [self.listData[section] count];
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView {
|
||||
return self.championStatement;
|
||||
return self.titleList;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
YUMISurmountAreaTabulationRegardElement * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([YUMISurmountAreaTabulationRegardElement class]) forIndexPath:indexPath];
|
||||
XPLoginAreaTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPLoginAreaTableViewCell class]) forIndexPath:indexPath];
|
||||
if(indexPath.section < self.listData.count){
|
||||
NSArray *listMatrix = self.listData[indexPath.section];
|
||||
if(indexPath.row < listMatrix.count){
|
||||
cell.areaMatrix =listMatrix[indexPath.row];
|
||||
NSArray *listModel = self.listData[indexPath.section];
|
||||
if(indexPath.row < listModel.count){
|
||||
cell.areaModel =listModel[indexPath.row];
|
||||
}
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
SurmountAreaMatrix *codeModel = self.listData[indexPath.section][indexPath.row];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(concludeAreaCryptogramAccomplishment:)]){
|
||||
LoginAreaModel *codeModel = self.listData[indexPath.section][indexPath.row];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(chooseAreaCodeSuccess:)]){
|
||||
|
||||
[self.delegate concludeAreaCryptogramAccomplishment:codeModel.phoneAreaCode ?: codeModel.phone_area_code];
|
||||
[self.delegate chooseAreaCodeSuccess:codeModel.phoneAreaCode ?: codeModel.phone_area_code];
|
||||
}
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.title = YMLocalizedString(@"YUMI_Choose_Rrea_Code_VC_0");
|
||||
self.title = YMLocalizedString(@"XPChooseRreaCodeVC0");
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
- (void)initChildLyRestrictions {
|
||||
- (void)initSubViewConstraints {
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
@@ -129,15 +131,15 @@
|
||||
_tableView.rowHeight = kGetScaleWidth(37);
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
[_tableView registerClass:[YUMISurmountAreaTabulationRegardElement class] forCellReuseIdentifier:NSStringFromClass([YUMISurmountAreaTabulationRegardElement class])];
|
||||
[_tableView registerClass:[XPLoginAreaTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPLoginAreaTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
- (NSMutableArray *)championStatement{
|
||||
if (!_championStatement){
|
||||
_championStatement = [NSMutableArray array];
|
||||
- (NSMutableArray *)titleList{
|
||||
if (!_titleList){
|
||||
_titleList = [NSMutableArray array];
|
||||
}
|
||||
return _championStatement;
|
||||
return _titleList;
|
||||
}
|
||||
- (NSMutableArray *)listData{
|
||||
if (!_listData){
|
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// XPLoginAreaTableViewCell.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class LoginAreaModel;
|
||||
@interface XPLoginAreaTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic,strong) LoginAreaModel *areaModel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// XPLoginAreaTableViewCell.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "XPLoginAreaTableViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "LoginAreaModel.h"
|
||||
@interface XPLoginAreaTableViewCell()
|
||||
@property (nonatomic,strong) UILabel *areaVeiw;
|
||||
@property (nonatomic,strong) UILabel *codeView;
|
||||
@end
|
||||
@implementation XPLoginAreaTableViewCell
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.areaVeiw];
|
||||
[self.contentView addSubview:self.codeView];
|
||||
}
|
||||
- (void)initSubViewConstraints {
|
||||
[self.areaVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kGetScaleWidth(15));
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
[self.codeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-kGetScaleWidth(15));
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
- (void)setAreaModel:(LoginAreaModel *)areaModel{
|
||||
_areaModel = areaModel;
|
||||
_areaVeiw.text = _areaModel.name;
|
||||
if(_areaModel.phoneAreaCode == nil){
|
||||
_codeView.text = _areaModel.phone_area_code;
|
||||
return;
|
||||
}
|
||||
_codeView.text = _areaModel.phoneAreaCode;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)areaVeiw {
|
||||
if (!_areaVeiw) {
|
||||
_areaVeiw = [[UILabel alloc] init];
|
||||
_areaVeiw.font = [UIFont systemFontOfSize:14];
|
||||
_areaVeiw.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"];
|
||||
}
|
||||
return _areaVeiw;
|
||||
}
|
||||
|
||||
|
||||
- (UILabel *)codeView {
|
||||
if (!_codeView) {
|
||||
_codeView = [[UILabel alloc] init];
|
||||
_codeView.font = [UIFont systemFontOfSize:14];
|
||||
_codeView.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"];
|
||||
}
|
||||
return _codeView;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// YMLoginBaseViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPLoginBaseViewController : MvpViewController
|
||||
|
||||
/// 是否需要毛玻璃效果
|
||||
@property (nonatomic, assign) BOOL needEffect;
|
||||
/// 是否需要返回按钮
|
||||
@property (nonatomic, assign) BOOL needBack;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
132
YuMi/Modules/YMLogin/View/NewLogin/XPLoginBaseViewController.m
Normal file
132
YuMi/Modules/YMLogin/View/NewLogin/XPLoginBaseViewController.m
Normal file
@@ -0,0 +1,132 @@
|
||||
//
|
||||
// YMLoginBaseViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "XPLoginBaseViewController.h"
|
||||
#import <UIView+VAP.h>
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "XPRoomGiftAnimationParser.h"
|
||||
@interface XPLoginBaseViewController ()<HWDMP4PlayDelegate>
|
||||
|
||||
/// vap背景
|
||||
@property (nonatomic, strong) VAPView *vapView;
|
||||
/// 毛玻璃
|
||||
@property (nonatomic, strong) UIToolbar *toolBar;
|
||||
/// 返回按钮
|
||||
@property (nonatomic, strong) UIButton *backBtn;
|
||||
///VAP动画管理
|
||||
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
|
||||
@end
|
||||
|
||||
@implementation XPLoginBaseViewController
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle {
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self createBaseUI];
|
||||
[self playVAP];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self.vapView resumeHWDMP4];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[self.vapView pauseHWDMP4];
|
||||
}
|
||||
|
||||
- (void)createBaseUI {
|
||||
[self.view addSubview:self.vapView];
|
||||
if (self.needEffect) {
|
||||
[self.view addSubview:self.toolBar];
|
||||
}
|
||||
if (self.needBack) {
|
||||
[self.view addSubview:self.backBtn];
|
||||
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kStatusBarHeight);
|
||||
make.left.mas_equalTo(0);
|
||||
make.width.mas_equalTo(44);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
/// 播放vap
|
||||
- (void)playVAP {
|
||||
// NSString *filePath = [NSString stringWithFormat:@"%@/login_vapbg.mp4", API_Image_URL];
|
||||
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"login_vapbg" ofType:@"mp4"];
|
||||
[self.vapView setMute:YES];
|
||||
[self.vapView playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
// [self.vapParser parseWithURL:filePath completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
// if (videoUrl.length) {
|
||||
// [self.vapView setMute:YES];
|
||||
// [self.vapView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
// }
|
||||
// } failureBlock:^(NSError * _Nullable error) {
|
||||
//
|
||||
// }];
|
||||
}
|
||||
|
||||
/// 返回
|
||||
- (void)backBtnClicked {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (VAPView *)vapView {
|
||||
if (!_vapView) {
|
||||
_vapView = [[VAPView alloc] initWithFrame:self.view.bounds];
|
||||
_vapView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_vapView.hwd_enterBackgroundOP = HWDMP4EBOperationTypeDoNothing;
|
||||
}
|
||||
return _vapView;
|
||||
}
|
||||
|
||||
- (UIToolbar *)toolBar {
|
||||
if (!_toolBar) {
|
||||
_toolBar = [[UIToolbar alloc] initWithFrame:self.view.bounds];
|
||||
_toolBar.barStyle = UIBarStyleBlack;
|
||||
_toolBar.alpha = 0.92;
|
||||
}
|
||||
return _toolBar;
|
||||
}
|
||||
|
||||
- (UIButton *)backBtn {
|
||||
if (!_backBtn) {
|
||||
_backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_backBtn setImage:[UIImage imageNamed:@"home_search_white_back"] forState:UIControlStateNormal];
|
||||
[_backBtn addTarget:self action:@selector(backBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backBtn;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.vapView stopHWDMP4];
|
||||
self.vapView = nil;
|
||||
NSLog(@"%s",__func__);
|
||||
}
|
||||
|
||||
- (XPRoomGiftAnimationParser *)vapParser {
|
||||
if (!_vapParser) {
|
||||
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
|
||||
}
|
||||
return _vapParser;
|
||||
}
|
||||
|
||||
@end
|
37
YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.h
Normal file
37
YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.h
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// YMLoginInputView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPLoginInputViewDelegate <NSObject>
|
||||
|
||||
- (void)smsCodeAction;
|
||||
|
||||
- (void)areaListAction;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPLoginInputView : UIView
|
||||
///
|
||||
@property (nonatomic,strong) UIStackView *areaStackView;
|
||||
/// 区号
|
||||
@property (nonatomic, strong) UIButton *areaCodeBtn;
|
||||
/// 输入框
|
||||
@property (nonatomic, strong) UITextField *inputTextField;
|
||||
/// 验证码
|
||||
@property (nonatomic, strong) UIButton *smsCodeBtn;
|
||||
|
||||
@property (nonatomic, weak) id<XPLoginInputViewDelegate> delegate;
|
||||
|
||||
//开启倒计时
|
||||
- (void)fireTimer;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
161
YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.m
Normal file
161
YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.m
Normal file
@@ -0,0 +1,161 @@
|
||||
//
|
||||
// YMLoginInputView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "XPLoginInputView.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import <Masonry.h>
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
@interface XPLoginInputView()
|
||||
|
||||
@property (nonatomic, strong) dispatch_source_t timer;
|
||||
|
||||
@property (nonatomic,strong) UIImageView *areaImageView;
|
||||
@end
|
||||
|
||||
@implementation XPLoginInputView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.backgroundColor = UIColor.clearColor;
|
||||
self.layer.cornerRadius = 66.0/2.0;
|
||||
self.layer.borderWidth = 1;
|
||||
self.layer.borderColor = [UIColor.whiteColor colorWithAlphaComponent:0.2].CGColor;
|
||||
|
||||
[self createUI];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
UIStackView *stackView = [[UIStackView alloc] init];
|
||||
stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
stackView.distribution = UIStackViewDistributionFill;
|
||||
stackView.alignment = UIStackViewAlignmentCenter;
|
||||
stackView.spacing = 5;
|
||||
[self addSubview:stackView];
|
||||
|
||||
|
||||
UIImageView * areaImageView = [[UIImageView alloc] init];
|
||||
areaImageView.userInteractionEnabled = YES;
|
||||
areaImageView.image = [UIImage imageNamed:@"login_area_arrow"];
|
||||
areaImageView.userInteractionEnabled = NO;
|
||||
|
||||
/// 区号
|
||||
UIButton *areaCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[areaCodeBtn setTitle:@"+852" forState:UIControlStateNormal];
|
||||
[areaCodeBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
areaCodeBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
|
||||
_areaCodeBtn = areaCodeBtn;
|
||||
areaCodeBtn.userInteractionEnabled = NO;
|
||||
|
||||
UIStackView *areaStackView = [[UIStackView alloc] init];
|
||||
areaStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
areaStackView.distribution = UIStackViewDistributionFill;
|
||||
areaStackView.alignment = UIStackViewAlignmentCenter;
|
||||
areaStackView.spacing = 2;
|
||||
|
||||
|
||||
UIButton *areaBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[areaBtn addTarget:self action:@selector(areaChooseClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
[areaStackView addSubview:areaBtn];
|
||||
|
||||
[areaStackView addArrangedSubview:areaCodeBtn];
|
||||
[areaStackView addArrangedSubview:areaImageView];
|
||||
|
||||
[stackView addArrangedSubview:areaStackView];
|
||||
self.areaStackView = areaStackView;
|
||||
|
||||
|
||||
/// 输入框
|
||||
UITextField *inputTextField = [[UITextField alloc] init];
|
||||
inputTextField.textColor = UIColor.whiteColor;
|
||||
inputTextField.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
[stackView addArrangedSubview:inputTextField];
|
||||
self.inputTextField = inputTextField;
|
||||
/// 获取验证码
|
||||
UIButton *smsCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[smsCodeBtn setTitle:YMLocalizedString(@"XPLoginInputView0") forState:UIControlStateNormal];
|
||||
[smsCodeBtn setTitleColor:UIColorFromRGB(0xFB486A) forState:UIControlStateNormal];
|
||||
smsCodeBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
|
||||
[smsCodeBtn addTarget:self action:@selector(smsCodeBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
[stackView addArrangedSubview:smsCodeBtn];
|
||||
self.smsCodeBtn = smsCodeBtn;
|
||||
|
||||
[stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(15);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.top.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
|
||||
[areaImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(18);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
[areaCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(50);
|
||||
make.height.mas_equalTo(stackView);
|
||||
}];
|
||||
[inputTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(stackView);
|
||||
}];
|
||||
[smsCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(80);
|
||||
make.height.mas_equalTo(stackView);
|
||||
}];
|
||||
|
||||
[areaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(areaStackView);
|
||||
}];
|
||||
|
||||
|
||||
self.areaStackView.hidden = YES;
|
||||
self.smsCodeBtn.hidden = YES;
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)smsCodeBtnClicked {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(smsCodeAction)]) {
|
||||
[self.delegate smsCodeAction];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)areaChooseClicked {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(areaListAction)]) {
|
||||
[self.delegate areaListAction];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//开启倒计时
|
||||
- (void)fireTimer {
|
||||
__block NSInteger count = 60;
|
||||
dispatch_queue_t queue = dispatch_get_main_queue();
|
||||
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
|
||||
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
|
||||
@weakify(self);
|
||||
dispatch_source_set_event_handler(timer, ^{
|
||||
@strongify(self);
|
||||
count--;
|
||||
if (count < 0) {
|
||||
[self.smsCodeBtn setTitle:YMLocalizedString(@"XPLoginInputView1") forState:UIControlStateNormal];
|
||||
self.smsCodeBtn.userInteractionEnabled = YES;
|
||||
dispatch_cancel(self.timer);
|
||||
}else{
|
||||
[self.smsCodeBtn setTitle:[NSString stringWithFormat:@"%lds",count] forState:UIControlStateNormal];
|
||||
self.smsCodeBtn.userInteractionEnabled = NO;
|
||||
}
|
||||
});
|
||||
dispatch_resume(timer);
|
||||
self.timer = timer;
|
||||
}
|
||||
|
||||
@end
|
@@ -5,11 +5,11 @@
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountMobileRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
@interface XPLoginPhoneViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
229
YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m
Normal file
229
YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m
Normal file
@@ -0,0 +1,229 @@
|
||||
//
|
||||
// YMLoginPhoneViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "XPLoginPhoneViewController.h"
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
#import "XPLoginInputView.h"
|
||||
|
||||
#import "XPLoginPwdViewController.h"
|
||||
#import "XPLoginAraeViewController.h"
|
||||
#import "LoginVerifCodePresent.h"
|
||||
#import "LoginVerifCodeProtocol.h"
|
||||
|
||||
@interface XPLoginPhoneViewController ()<XPLoginInputViewDelegate, LoginVerifCodeProtocol, XPLoginAraeViewControllerDelegate>
|
||||
|
||||
/// 手机号登录
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
/// 未注册的手机号自动登录
|
||||
@property (nonatomic, strong) UILabel *despLabel;
|
||||
/// 手机号输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *phoneInputView;
|
||||
/// 验证码输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *codeInputView;
|
||||
/// 登录按钮
|
||||
@property (nonatomic, strong) UIButton *loginBtn;
|
||||
/// 密码登录
|
||||
@property (nonatomic, strong) UIButton *pwdLoginBtn;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
@end
|
||||
|
||||
@implementation XPLoginPhoneViewController
|
||||
|
||||
- (LoginVerifCodePresent *)createPresenter {
|
||||
return [[LoginVerifCodePresent alloc] init];
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.needEffect = YES;
|
||||
self.needBack = YES;
|
||||
self.phoneAreaCode = @"852";
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
[self racBind];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.despLabel];
|
||||
[self.view addSubview:self.phoneInputView];
|
||||
[self.view addSubview:self.codeInputView];
|
||||
[self.view addSubview:self.loginBtn];
|
||||
[self.view addSubview:self.pwdLoginBtn];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(146.0/812.0*KScreenHeight);
|
||||
}];
|
||||
[self.despLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(4);
|
||||
}];
|
||||
[self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.top.mas_equalTo(self.despLabel.mas_bottom).offset(23);
|
||||
make.height.mas_equalTo(66);
|
||||
}];
|
||||
[self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.phoneInputView);
|
||||
make.right.mas_equalTo(self.phoneInputView);
|
||||
make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.phoneInputView);
|
||||
}];
|
||||
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(51);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(96);
|
||||
}];
|
||||
[self.pwdLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(24);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)racBind {
|
||||
RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.codeInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode){
|
||||
return @((phone.length > 0) && smsCode.length >= 5);
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
|
||||
/// 登录
|
||||
- (void)loginBtnClicked {
|
||||
NSString *phone = self.phoneInputView.inputTextField.text;
|
||||
NSString *smsCode = self.codeInputView.inputTextField.text;
|
||||
NSString * phoneStr = [NSString stringWithFormat:@"%@%@",self.phoneAreaCode, phone];
|
||||
[self.presenter loginWithPhone:phoneStr code:smsCode phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
/// 密码登录
|
||||
- (void)pwdLoginBtnClicked {
|
||||
XPLoginPwdViewController *pwdVC = [[XPLoginPwdViewController alloc] init];
|
||||
[self.navigationController pushViewController:pwdVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - XPLoginInputViewDelegate
|
||||
|
||||
- (void)smsCodeAction {
|
||||
NSString *phone = self.phoneInputView.inputTextField.text;
|
||||
if (phone.length == 0 ) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPLoginPhoneViewController0")];
|
||||
return;
|
||||
}
|
||||
[self.presenter phoneSmsCode:phone type:GetSmsType_Regist phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)areaListAction {
|
||||
XPLoginAraeViewController *codeVC = [XPLoginAraeViewController new];
|
||||
codeVC.delegate = self;
|
||||
[self.navigationController pushViewController:codeVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)chooseAreaCodeSuccess:(NSString *)code {
|
||||
if (code.length > 0) {
|
||||
self.phoneAreaCode = code;
|
||||
[self.phoneInputView.areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", code] forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - LoginVerifCodeProtocol
|
||||
- (void)loginSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - LoginProtocol
|
||||
- (void)phoneSmsCodeSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController2")];
|
||||
[self.codeInputView fireTimer];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPLoginPhoneViewController3");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)despLabel {
|
||||
if (!_despLabel) {
|
||||
_despLabel = [[UILabel alloc] init];
|
||||
_despLabel.text = YMLocalizedString(@"XPLoginPhoneViewController4");
|
||||
_despLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
|
||||
_despLabel.textColor = [UIColor.whiteColor colorWithAlphaComponent:0.6];
|
||||
}
|
||||
return _despLabel;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)phoneInputView {
|
||||
if (!_phoneInputView) {
|
||||
_phoneInputView = [[XPLoginInputView alloc] init];
|
||||
_phoneInputView.areaStackView.hidden = NO;
|
||||
_phoneInputView.delegate = self;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController5")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_phoneInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _phoneInputView;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)codeInputView {
|
||||
if (!_codeInputView) {
|
||||
_codeInputView = [[XPLoginInputView alloc] init];
|
||||
_codeInputView.smsCodeBtn.hidden = NO;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController6")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_codeInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_codeInputView.delegate = self;
|
||||
}
|
||||
return _codeInputView;
|
||||
}
|
||||
|
||||
- (UIButton *)loginBtn {
|
||||
if (!_loginBtn) {
|
||||
_loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_loginBtn setImage:[UIImage imageNamed:@"login_next"] forState:UIControlStateNormal];
|
||||
[_loginBtn setImage:[UIImage imageNamed:@"login_next_disable"] forState:UIControlStateDisabled];
|
||||
[_loginBtn addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _loginBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)pwdLoginBtn {
|
||||
if (!_pwdLoginBtn) {
|
||||
_pwdLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController7")];
|
||||
[title addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, title.length)];
|
||||
[_pwdLoginBtn setAttributedTitle:title forState:UIControlStateNormal];
|
||||
[_pwdLoginBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_pwdLoginBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
[_pwdLoginBtn addTarget:self action:@selector(pwdLoginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _pwdLoginBtn;
|
||||
}
|
||||
|
||||
@end
|
@@ -5,11 +5,11 @@
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountPwordRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
@interface XPLoginPwdViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
193
YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m
Normal file
193
YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m
Normal file
@@ -0,0 +1,193 @@
|
||||
//
|
||||
// YMLoginPwdViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "XPLoginPwdViewController.h"
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
#import "XPLoginInputView.h"
|
||||
#import "XPLoginPwdViewController.h"
|
||||
#import "XPForgetPwdViewController.h"
|
||||
|
||||
#import "LoginPasswordPresent.h"
|
||||
#import "LoginPasswordProtocol.h"
|
||||
|
||||
@interface XPLoginPwdViewController ()<LoginPasswordProtocol>
|
||||
|
||||
/// 密码登录
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
/// 手机号输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *phoneInputView;
|
||||
/// 密码输入框
|
||||
@property (nonatomic, strong) XPLoginInputView *pwdInputView;
|
||||
/// 登录按钮
|
||||
@property (nonatomic, strong) UIButton *loginBtn;
|
||||
/// 密码登录
|
||||
@property (nonatomic, strong) UIButton *phoneLoginBtn;
|
||||
/// 忘记密码
|
||||
@property (nonatomic, strong) UIButton *forgetBtn;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPLoginPwdViewController
|
||||
|
||||
- (LoginPasswordPresent *)createPresenter {
|
||||
return [[LoginPasswordPresent alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.needEffect = YES;
|
||||
self.needBack = YES;
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
[self racBind];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.phoneInputView];
|
||||
[self.view addSubview:self.pwdInputView];
|
||||
[self.view addSubview:self.loginBtn];
|
||||
[self.view addSubview:self.phoneLoginBtn];
|
||||
[self.view addSubview:self.forgetBtn];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(146.0/812.0*KScreenHeight);
|
||||
}];
|
||||
[self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(41);
|
||||
make.height.mas_equalTo(66);
|
||||
}];
|
||||
[self.pwdInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.phoneInputView);
|
||||
make.right.mas_equalTo(self.phoneInputView);
|
||||
make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.phoneInputView);
|
||||
}];
|
||||
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(51);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(96);
|
||||
}];
|
||||
[self.phoneLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(24);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
}];
|
||||
[self.forgetBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.pwdInputView);
|
||||
make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(10);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)racBind {
|
||||
RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){
|
||||
return @((phone.length ==11 || phone.length == 7) && password.length >= 6);
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
- (void)loginBtnClicked {
|
||||
NSString *phone = self.phoneInputView.inputTextField.text;
|
||||
NSString *password = self.pwdInputView.inputTextField.text;
|
||||
[self.presenter loginWithPhone:phone password:password];
|
||||
}
|
||||
|
||||
- (void)phoneLoginBtnClicked {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)forgetBtnClicked {
|
||||
XPForgetPwdViewController *forgetVC = [[XPForgetPwdViewController alloc] init];
|
||||
[self.navigationController pushViewController:forgetVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - LoginPasswordProtocol
|
||||
- (void)phoneAndPasswordLoginSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginPwdViewController0")];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPLoginPwdViewController1");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)phoneInputView {
|
||||
if (!_phoneInputView) {
|
||||
_phoneInputView = [[XPLoginInputView alloc] init];
|
||||
_phoneInputView.areaStackView.hidden = YES;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController2")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_phoneInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _phoneInputView;
|
||||
}
|
||||
|
||||
- (XPLoginInputView *)pwdInputView {
|
||||
if (!_pwdInputView) {
|
||||
_pwdInputView = [[XPLoginInputView alloc] init];
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController3")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_pwdInputView.inputTextField.attributedPlaceholder = placeholder;
|
||||
_pwdInputView.inputTextField.keyboardType = UIKeyboardTypeAlphabet;
|
||||
_pwdInputView.inputTextField.secureTextEntry = YES;
|
||||
}
|
||||
return _pwdInputView;
|
||||
}
|
||||
|
||||
- (UIButton *)loginBtn {
|
||||
if (!_loginBtn) {
|
||||
_loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_loginBtn setImage:[UIImage imageNamed:@"login_next"] forState:UIControlStateNormal];
|
||||
[_loginBtn setImage:[UIImage imageNamed:@"login_next_disable"] forState:UIControlStateDisabled];
|
||||
[_loginBtn addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _loginBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)phoneLoginBtn {
|
||||
if (!_phoneLoginBtn) {
|
||||
_phoneLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController4")];
|
||||
[title addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, title.length)];
|
||||
[_phoneLoginBtn setAttributedTitle:title forState:UIControlStateNormal];
|
||||
[_phoneLoginBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_phoneLoginBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
[_phoneLoginBtn addTarget:self action:@selector(phoneLoginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _phoneLoginBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)forgetBtn {
|
||||
if (!_forgetBtn) {
|
||||
_forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_forgetBtn setTitle:@"忘记密码?" forState:UIControlStateNormal];
|
||||
[_forgetBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_forgetBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
|
||||
[_forgetBtn addTarget:self action:@selector(forgetBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _forgetBtn;
|
||||
}
|
||||
|
||||
@end
|
@@ -5,11 +5,11 @@
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
@interface XPLoginViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
383
YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m
Normal file
383
YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m
Normal file
@@ -0,0 +1,383 @@
|
||||
//
|
||||
// YMLoginViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "XPLoginViewController.h"
|
||||
#import <Masonry.h>
|
||||
#import <YYText/YYText.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
#import "YUMIHtmlUrl.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import <AuthenticationServices/ASAuthorizationAppleIDButton.h>
|
||||
#import "YUMIConstant.h"
|
||||
#import "GCDHelper.h"
|
||||
#import "TTPopup.h"
|
||||
#import "StatisticsServiceHelper.h"
|
||||
#import "XNDJTDDLoadingTool.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPLoginPhoneViewController.h"
|
||||
#import "UserPrivacyView.h"
|
||||
#import "AESUtils.h"
|
||||
#import "LoginPresenter.h"
|
||||
#import "LoginProtocol.h"
|
||||
|
||||
UIKIT_EXTERN NSString * const kYouMiNumberCountKey;
|
||||
NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
|
||||
@interface XPLoginViewController ()<LoginProtocol>
|
||||
|
||||
/// 一键登录
|
||||
@property (nonatomic, strong) UIButton *quickLoginBtn;
|
||||
/// 同意按钮
|
||||
@property (nonatomic, strong) UIButton *agreeBtn;
|
||||
/// 协议隐私政策
|
||||
@property (nonatomic, strong) YYLabel *protocolLabel;
|
||||
/// 其他登录方式
|
||||
@property (nonatomic, strong) UILabel *otherLabel;
|
||||
/// 勾选隐私政策提示泡泡
|
||||
@property (nonatomic, strong) UIImageView *authBubbleView;
|
||||
/// 泡泡提示内容
|
||||
@property (nonatomic, strong) UILabel *authBubbleLabel;
|
||||
@property (nonatomic, strong) UIStackView *stackView;
|
||||
///手机
|
||||
@property (nonatomic, strong) UIButton *fbButtonView;
|
||||
///wx
|
||||
@property (nonatomic, strong) UIButton *googleButtonView;
|
||||
///qq
|
||||
@property (nonatomic, strong) UIButton *lineButtonView;
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
@property (nonatomic, strong) ASAuthorizationAppleIDButton *appleButton;
|
||||
#endif
|
||||
///谷歌登录配置
|
||||
@property (nonatomic,strong) GIDConfiguration *configuration;
|
||||
@end
|
||||
|
||||
@implementation XPLoginViewController
|
||||
|
||||
- (LoginPresenter *)createPresenter {
|
||||
return [[LoginPresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.needEffect = NO;
|
||||
self.needBack = NO;
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self setConfigPrivacyAlertView];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
[self.view addSubview:self.quickLoginBtn];
|
||||
[self.view addSubview:self.protocolLabel];
|
||||
[self.view addSubview:self.agreeBtn];
|
||||
[self.view addSubview:self.otherLabel];
|
||||
[self.view addSubview:self.stackView];
|
||||
[self.view addSubview:self.authBubbleView];
|
||||
[self.authBubbleView addSubview:self.authBubbleLabel];
|
||||
|
||||
[self.stackView addArrangedSubview:self.fbButtonView];
|
||||
[self.stackView addArrangedSubview:self.googleButtonView];
|
||||
[self.stackView addArrangedSubview:self.lineButtonView];
|
||||
[self.stackView addArrangedSubview:self.appleButton];
|
||||
|
||||
[self.quickLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(45);
|
||||
make.right.mas_equalTo(-45);
|
||||
make.height.mas_equalTo(66);
|
||||
make.centerY.mas_equalTo(self.view);
|
||||
}];
|
||||
[self.protocolLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.quickLoginBtn.mas_bottom).offset(56);
|
||||
make.centerX.mas_equalTo(self.view).offset(10);
|
||||
make.right.mas_lessThanOrEqualTo(-10);
|
||||
make.height.mas_greaterThanOrEqualTo(22);
|
||||
}];
|
||||
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.protocolLabel.mas_left).offset(0);
|
||||
make.top.mas_equalTo(self.protocolLabel.mas_top);
|
||||
make.width.height.mas_equalTo(22);
|
||||
}];
|
||||
[self.otherLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(-169);
|
||||
}];
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.otherLabel.mas_bottom).offset(27);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
[self.authBubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.agreeBtn).mas_offset((-16));
|
||||
make.top.mas_equalTo(self.agreeBtn.mas_bottom);
|
||||
make.width.mas_equalTo(235);
|
||||
make.height.mas_equalTo(29);
|
||||
}];
|
||||
[self.authBubbleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(8);
|
||||
make.bottom.mas_equalTo(self.authBubbleView).mas_offset(-6);
|
||||
}];
|
||||
|
||||
[self.fbButtonView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)setConfigPrivacyAlertView {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *isShow = [defaults objectForKey:kYouMiNumberCountKey];
|
||||
// 隐私协议弹出
|
||||
if (!isShow && isShow.length <= 0) {
|
||||
UserPrivacyView * alertView = [[UserPrivacyView alloc] init];
|
||||
alertView.controller = self;
|
||||
TTPopupService * config = [[TTPopupService alloc] init];
|
||||
config.shouldDismissOnBackgroundTouch = NO;
|
||||
config.contentView = alertView;
|
||||
[TTPopup popupWithConfig:config];
|
||||
};
|
||||
}
|
||||
|
||||
- (void)loginDidClick:(UIButton *)sender {
|
||||
if (self.agreeBtn.selected) {
|
||||
ThirdLoginType type = sender.tag - 1000;
|
||||
if(type == ThirdLoginType_Gmail){
|
||||
[self.presenter thirdLoginByGoogleWithPresentingViewController:self configuration:self.configuration];
|
||||
return;
|
||||
}
|
||||
[self.presenter thirdLoginWithType:type];
|
||||
|
||||
} else {
|
||||
[self showErrorToast:YMLocalizedString(@"PKLoginViewController1")];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// 点击同意
|
||||
- (void)agreeBtnClicked {
|
||||
self.agreeBtn.selected = !self.agreeBtn.selected;
|
||||
if (self.agreeBtn.isSelected) {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:@"hadAgree" forKey:HadAgreePrivacy];
|
||||
[defaults synchronize];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.authBubbleView.alpha = 0.0;
|
||||
}];
|
||||
} else {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString * hadAgree = [defaults stringForKey:HadAgreePrivacy];
|
||||
if (hadAgree.length > 0) {
|
||||
[defaults removeObjectForKey:HadAgreePrivacy];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 点击手机号登录
|
||||
- (void)phoneLoginBtnClicked {
|
||||
if (self.agreeBtn.isSelected) {
|
||||
XPLoginPhoneViewController *phoneVC = [[XPLoginPhoneViewController alloc] init];
|
||||
[self.navigationController pushViewController:phoneVC animated:YES];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginPhoneClick];
|
||||
} else {
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.authBubbleView.alpha = 1.0;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
/// 点击一键登录
|
||||
- (void)quickLoginBtnClicked {
|
||||
if (self.agreeBtn.isSelected) {
|
||||
XPLoginPhoneViewController *phoneVC = [[XPLoginPhoneViewController alloc] init];
|
||||
[self.navigationController pushViewController:phoneVC animated:YES];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginPhoneClick];
|
||||
} else {
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.authBubbleView.alpha = 1.0;
|
||||
}];
|
||||
}
|
||||
}
|
||||
#pragma mark - LoginProtocol
|
||||
- (void)loginSuccess {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginViewController4")];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UIButton *)quickLoginBtn {
|
||||
if (!_quickLoginBtn) {
|
||||
_quickLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_quickLoginBtn.layer.masksToBounds = YES;
|
||||
_quickLoginBtn.layer.cornerRadius = 66.0/2.f;
|
||||
[_quickLoginBtn setTitle:YMLocalizedString(@"XPLoginViewController5") forState:UIControlStateNormal];
|
||||
_quickLoginBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
|
||||
[_quickLoginBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth - 45 * 2, 45)];
|
||||
[_quickLoginBtn setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_quickLoginBtn setImage:[UIImage imageNamed:@"login_phone_white"] forState:UIControlStateNormal];
|
||||
[_quickLoginBtn addTarget:self action:@selector(quickLoginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _quickLoginBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)agreeBtn {
|
||||
if(!_agreeBtn) {
|
||||
_agreeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_agreeBtn setImage:[UIImage imageNamed:@"login_agree"] forState:UIControlStateSelected];
|
||||
[_agreeBtn setImage:[UIImage imageNamed:@"login_disagree"] forState:UIControlStateNormal];
|
||||
[_agreeBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
[_agreeBtn addTarget:self action:@selector(agreeBtnClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *hadAgree = [defaults objectForKey:HadAgreePrivacy];
|
||||
if (hadAgree.length > 0) {
|
||||
_agreeBtn.selected = YES;
|
||||
}
|
||||
}
|
||||
return _agreeBtn;
|
||||
}
|
||||
|
||||
- (YYLabel *)protocolLabel {
|
||||
if (!_protocolLabel) {
|
||||
_protocolLabel = [[YYLabel alloc] init];
|
||||
_protocolLabel.font = [UIFont systemFontOfSize:12];
|
||||
_protocolLabel.numberOfLines = 0;
|
||||
|
||||
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginViewController6")];
|
||||
attString.yy_color = UIColor.whiteColor;
|
||||
NSString *userString = YMLocalizedString(@"XPLoginViewController7");
|
||||
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}];
|
||||
@weakify(self)
|
||||
[userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@strongify(self);
|
||||
// 跳转用户协议
|
||||
XPWebViewController * webVC = [[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kUserProtocalURL);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
} longPressAction:nil];
|
||||
|
||||
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginViewController8")];
|
||||
andString.yy_color = UIColor.whiteColor;
|
||||
NSString *protocolString = YMLocalizedString(@"XPLoginViewController9");
|
||||
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}];
|
||||
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@strongify(self);
|
||||
// 跳转隐私政策
|
||||
XPWebViewController * webVC = [[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kPrivacyURL);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
} longPressAction:nil];
|
||||
[attString appendAttributedString:userAttString];
|
||||
[attString appendAttributedString:andString];
|
||||
[attString appendAttributedString:privateString];
|
||||
|
||||
_protocolLabel.attributedText = attString;
|
||||
}
|
||||
return _protocolLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)otherLabel {
|
||||
if (!_otherLabel) {
|
||||
_otherLabel = [[UILabel alloc] init];
|
||||
_otherLabel.text = YMLocalizedString(@"XPLoginViewController10");
|
||||
_otherLabel.textColor = UIColor.whiteColor;
|
||||
_otherLabel.font = [UIFont systemFontOfSize:12];
|
||||
_otherLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _otherLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)authBubbleView {
|
||||
if (!_authBubbleView) {
|
||||
_authBubbleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_auth_bubble"]];
|
||||
_authBubbleView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_authBubbleView.alpha = 0;
|
||||
}
|
||||
return _authBubbleView;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFillEqually;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 20;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UILabel *)authBubbleLabel {
|
||||
if (!_authBubbleLabel) {
|
||||
_authBubbleLabel = [[UILabel alloc] init];
|
||||
_authBubbleLabel.text = YMLocalizedString(@"XPLoginViewController11");
|
||||
_authBubbleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_authBubbleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _authBubbleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)fbButtonView {
|
||||
if (!_fbButtonView) {
|
||||
_fbButtonView = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_fbButtonView setImage: [UIImage imageNamed:@"login_facebook"] forState:UIControlStateNormal];
|
||||
_fbButtonView.tag = 1000 + ThirdLoginType_FB;
|
||||
[_fbButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _fbButtonView;
|
||||
}
|
||||
|
||||
- (UIButton *)googleButtonView {
|
||||
if (!_googleButtonView) {
|
||||
_googleButtonView = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_googleButtonView setImage: [UIImage imageNamed:@"login_gmail"] forState:UIControlStateNormal];
|
||||
_googleButtonView.tag = 1000 + ThirdLoginType_Gmail;
|
||||
[_googleButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _googleButtonView;
|
||||
}
|
||||
|
||||
- (UIButton *)lineButtonView {
|
||||
if (!_lineButtonView) {
|
||||
_lineButtonView = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_lineButtonView setImage: [UIImage imageNamed:@"login_line"] forState:UIControlStateNormal];
|
||||
_lineButtonView.tag = 1000 + ThirdLoginType_Line;
|
||||
[_lineButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _lineButtonView;
|
||||
}
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
- (ASAuthorizationAppleIDButton *)appleButton API_AVAILABLE(ios(13.0)){
|
||||
if (!_appleButton) {
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_appleButton = [[ASAuthorizationAppleIDButton alloc] initWithAuthorizationButtonType:ASAuthorizationAppleIDButtonTypeSignIn authorizationButtonStyle:ASAuthorizationAppleIDButtonStyleWhite];
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
_appleButton.cornerRadius = 25;
|
||||
_appleButton.tag = 1000 + ThirdLoginType_Apple;
|
||||
[_appleButton addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _appleButton;
|
||||
}
|
||||
#endif
|
||||
- (GIDConfiguration *)configuration{
|
||||
if (!_configuration){
|
||||
NSString * number = [AESUtils aesDecrypt:@"ScLBu7ctIiyGCKPro3Jj6XMdsdCCpNT9L4wyjHEF+bguqubkXNSayFBGMKmoDwe1hjfAc958XSaBdMyEaFXLO38Bwq3xURYVNpgEM4b14zg="];
|
||||
_configuration = [[GIDConfiguration alloc] initWithClientID:number];
|
||||
}
|
||||
return _configuration;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,194 +0,0 @@
|
||||
//
|
||||
// YMForgetPwdViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMIForgetPwordRegardGovernancer.h"
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
#import "YUMISurmountIntrojectionRegard.h"
|
||||
|
||||
#import "SurmountForgetCiphercodeExternalize.h"
|
||||
#import "SurmountForgetCiphercodeCeremony.h"
|
||||
#import "YUMISurmountAraeRegardGovernancer.h"
|
||||
|
||||
@interface YUMIForgetPwordRegardGovernancer ()<FBCSurmountIntrojectionRegardRepresendtation, SurmountForgetCiphercodeCeremony, FBCSurmountAraeRegardGovernancerRepresendtation>
|
||||
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *mobileIntrojectionRegard;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *cryptogramIntrojectionRegard;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *pwordIntrojectionRegard;
|
||||
@property (nonatomic, strong) UIButton *sureBtuton;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMIForgetPwordRegardGovernancer
|
||||
|
||||
- (SurmountForgetCiphercodeExternalize *)producePresimport {
|
||||
return [[SurmountForgetCiphercodeExternalize alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.phoneAreaCode = @"852";
|
||||
self.demandsImpression = YES;
|
||||
self.demandsEncourage = YES;
|
||||
[super viewDidLoad];
|
||||
[self produceUI];
|
||||
[self racBind];
|
||||
}
|
||||
|
||||
- (void)produceUI {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.mobileIntrojectionRegard];
|
||||
[self.view addSubview:self.cryptogramIntrojectionRegard];
|
||||
[self.view addSubview:self.pwordIntrojectionRegard];
|
||||
[self.view addSubview:self.sureBtuton];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(kStatusBarHeight);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
[self.mobileIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.top.mas_equalTo(139.0/812.0*KScreenHeight);
|
||||
make.height.mas_equalTo(66);
|
||||
}];
|
||||
[self.cryptogramIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.right.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.top.mas_equalTo(self.mobileIntrojectionRegard.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
}];
|
||||
[self.pwordIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.right.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.top.mas_equalTo(self.cryptogramIntrojectionRegard.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
}];
|
||||
[self.sureBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.pwordIntrojectionRegard.mas_bottom).offset(51);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(96);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)racBind {
|
||||
RAC(self.sureBtuton, enabled) = [[RACSignal combineLatest:@[self.mobileIntrojectionRegard.introjectionEssayUniverse.rac_textSignal, self.pwordIntrojectionRegard.introjectionEssayUniverse.rac_textSignal, self.pwordIntrojectionRegard.introjectionEssayUniverse.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode, NSString *password){
|
||||
return @((phone.length == 11) && smsCode.length >= 5 && (password.length >= 6 && password.length <= 16));
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
- (void)sureBtutonTicktacked {
|
||||
NSString *phone = self.mobileIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
NSString *smsCode = self.cryptogramIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
NSString *password = self.pwordIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
[self.presimport replacementCiphercryptogram:phone newPwd:password smsCode:smsCode];
|
||||
}
|
||||
|
||||
#pragma mark - FBCSurmountIntrojectionRegardRepresendtation
|
||||
|
||||
- (void)smsCryptogramPerformance {
|
||||
NSString *phone = self.mobileIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
if (phone.length != 11 ) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"YUMI_Forget_Pwd_View_Controller_0")];
|
||||
return;
|
||||
}
|
||||
[self.presimport mobileSmsCryptogram:phone type:GetSmsGenre_Reset_Password phoneAreaCode:self.phoneAreaCode];
|
||||
|
||||
}
|
||||
|
||||
- (void)areaSttowardsementPerformance {
|
||||
YUMISurmountAraeRegardGovernancer *codeVC = [YUMISurmountAraeRegardGovernancer new];
|
||||
codeVC.delegate = self;
|
||||
[self.navigationController pushViewController:codeVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)concludeAreaCryptogramAccomplishment:(NSString *)code {
|
||||
if (code.length > 0) {
|
||||
self.phoneAreaCode = code;
|
||||
[self.mobileIntrojectionRegard.areaCryptogramBtuton setTitle:[NSString stringWithFormat:@"+%@", code] forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - SurmountForgetCiphercodeCeremony
|
||||
|
||||
- (void)mobileSmsCryptogramAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"YUMI_Forget_Pwd_View_Controller_1")];
|
||||
[self.cryptogramIntrojectionRegard fireIntrtowardsemper];
|
||||
}
|
||||
|
||||
- (void)replacementPasswrodAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"YUMI_Forget_Pwd_View_Controller_2")];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"YUMI_Forget_Pwd_View_Controller_3");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)mobileIntrojectionRegard {
|
||||
if (!_mobileIntrojectionRegard) {
|
||||
_mobileIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
_mobileIntrojectionRegard.areaHierarchyRegard.hidden = NO;
|
||||
_mobileIntrojectionRegard.delegate = self;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"YUMI_Forget_Pwd_View_Controller_4")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_mobileIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_mobileIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _mobileIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)cryptogramIntrojectionRegard {
|
||||
if (!_cryptogramIntrojectionRegard) {
|
||||
_cryptogramIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
_cryptogramIntrojectionRegard.smsCryptogramBtuton.hidden = NO;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"YUMI_Forget_Pwd_View_Controller_5")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_cryptogramIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_cryptogramIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_cryptogramIntrojectionRegard.delegate = self;
|
||||
}
|
||||
return _cryptogramIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)pwordIntrojectionRegard {
|
||||
if (!_pwordIntrojectionRegard) {
|
||||
_pwordIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:@"请输入密码(6-16个字符)"];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_pwordIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_pwordIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeAlphabet;
|
||||
_pwordIntrojectionRegard.introjectionEssayUniverse.secureTextEntry = YES;
|
||||
}
|
||||
return _pwordIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)sureBtuton {
|
||||
if (!_sureBtuton) {
|
||||
_sureBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_sureBtuton setImage:[UIImage imageNamed:@"yumi_login_next"] forState:UIControlStateNormal];
|
||||
[_sureBtuton setImage:[UIImage imageNamed:@"yumi_login_next_disable"] forState:UIControlStateSelected];
|
||||
[_sureBtuton addTarget:self action:@selector(sureBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _sureBtuton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// YUMISurmountAraeRegardGovernancer.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "BaseRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol FBCSurmountAraeRegardGovernancerRepresendtation <NSObject>
|
||||
|
||||
-(void)concludeAreaCryptogramAccomplishment:(NSString *)code;
|
||||
|
||||
@end
|
||||
@interface YUMISurmountAraeRegardGovernancer : BaseRegardGovernancer
|
||||
@property (nonatomic,weak) id<FBCSurmountAraeRegardGovernancerRepresendtation> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// YUMISurmountAreaTabulationRegardElement.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class SurmountAreaMatrix;
|
||||
@interface YUMISurmountAreaTabulationRegardElement : UITableViewCell
|
||||
|
||||
@property (nonatomic,strong) SurmountAreaMatrix *areaMatrix;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,72 +0,0 @@
|
||||
//
|
||||
// YUMISurmountAreaTabulationRegardElement.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "YUMISurmountAreaTabulationRegardElement.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "SurmountAreaMatrix.h"
|
||||
@interface YUMISurmountAreaTabulationRegardElement()
|
||||
@property (nonatomic,strong) UILabel *spectrumVeiw;
|
||||
@property (nonatomic,strong) UILabel *cryptogramRegard;
|
||||
@end
|
||||
@implementation YUMISurmountAreaTabulationRegardElement
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.spectrumVeiw];
|
||||
[self.contentView addSubview:self.cryptogramRegard];
|
||||
}
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.spectrumVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kGetScaleWidth(15));
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
[self.cryptogramRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-kGetScaleWidth(15));
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
- (void)setAreaMatrix:(SurmountAreaMatrix *)areaMatrix{
|
||||
_areaMatrix = areaMatrix;
|
||||
_spectrumVeiw.text = _areaMatrix.name;
|
||||
if(_areaMatrix.phoneAreaCode == nil){
|
||||
_cryptogramRegard.text = _areaMatrix.phone_area_code;
|
||||
return;
|
||||
}
|
||||
_cryptogramRegard.text = _areaMatrix.phoneAreaCode;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)spectrumVeiw {
|
||||
if (!_spectrumVeiw) {
|
||||
_spectrumVeiw = [[UILabel alloc] init];
|
||||
_spectrumVeiw.font = [UIFont systemFontOfSize:14];
|
||||
_spectrumVeiw.textColor = [DJDKMIMOMColor colorAboutHexBWSttr:@"#1F1A4E"];
|
||||
}
|
||||
return _spectrumVeiw;
|
||||
}
|
||||
|
||||
|
||||
- (UILabel *)cryptogramRegard {
|
||||
if (!_cryptogramRegard) {
|
||||
_cryptogramRegard = [[UILabel alloc] init];
|
||||
_cryptogramRegard.font = [UIFont systemFontOfSize:14];
|
||||
_cryptogramRegard.textColor = [DJDKMIMOMColor colorAboutHexBWSttr:@"#1F1A4E"];
|
||||
}
|
||||
return _cryptogramRegard;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// YMLoginBaseViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "MvpRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountBaseRegardGovernancer : MvpRegardGovernancer
|
||||
|
||||
@property (nonatomic, assign) BOOL demandsImpression;
|
||||
@property (nonatomic, assign) BOOL demandsEncourage;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,117 +0,0 @@
|
||||
//
|
||||
// YMLoginBaseViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
#import <UIView+VAP.h>
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIChamberPresentBrightnessAnatomiser.h"
|
||||
@interface YUMISurmountBaseRegardGovernancer ()<HWDMP4PlayDelegate>
|
||||
|
||||
@property (nonatomic, strong) VAPView *vapView;
|
||||
@property (nonatomic, strong) UIToolbar *utensilObstacle;
|
||||
@property (nonatomic, strong) UIButton *encourageBtuton;
|
||||
@property (nonatomic, strong) YUMIChamberPresentBrightnessAnatomiser *vepporAnatomiser;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountBaseRegardGovernancer
|
||||
|
||||
- (BOOL)isVeiledNevObstacle {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle {
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self produceBaseUI];
|
||||
[self prohibitiportVAP];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self.vapView resumeHWDMP4];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[self.vapView pauseHWDMP4];
|
||||
}
|
||||
|
||||
- (void)produceBaseUI {
|
||||
[self.view addSubview:self.vapView];
|
||||
if (self.demandsImpression) {
|
||||
[self.view addSubview:self.utensilObstacle];
|
||||
}
|
||||
if (self.demandsEncourage) {
|
||||
[self.view addSubview:self.encourageBtuton];
|
||||
[self.encourageBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kStatusBarHeight);
|
||||
make.left.mas_equalTo(0);
|
||||
make.width.mas_equalTo(44);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prohibitiportVAP {
|
||||
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"login_vapbg" ofType:@"mp4"];
|
||||
[self.vapView setMute:YES];
|
||||
[self.vapView playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
}
|
||||
|
||||
- (void)encourageBtutonTicktacked {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (VAPView *)vapView {
|
||||
if (!_vapView) {
|
||||
_vapView = [[VAPView alloc] initWithFrame:self.view.bounds];
|
||||
_vapView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_vapView.hwd_enterBackgroundOP = HWDMP4EBOperationTypeDoNothing;
|
||||
}
|
||||
return _vapView;
|
||||
}
|
||||
|
||||
- (UIToolbar *)utensilObstacle {
|
||||
if (!_utensilObstacle) {
|
||||
_utensilObstacle = [[UIToolbar alloc] initWithFrame:self.view.bounds];
|
||||
_utensilObstacle.barStyle = UIBarStyleBlack;
|
||||
_utensilObstacle.alpha = 0.92;
|
||||
}
|
||||
return _utensilObstacle;
|
||||
}
|
||||
|
||||
- (UIButton *)encourageBtuton {
|
||||
if (!_encourageBtuton) {
|
||||
_encourageBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_encourageBtuton setImage:[UIImage imageNamed:@"yumi_main_search_white_back"] forState:UIControlStateNormal];
|
||||
[_encourageBtuton addTarget:self action:@selector(encourageBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _encourageBtuton;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.vapView stopHWDMP4];
|
||||
self.vapView = nil;
|
||||
NSLog(@"%s",__func__);
|
||||
}
|
||||
|
||||
- (YUMIChamberPresentBrightnessAnatomiser *)vepporAnatomiser {
|
||||
if (!_vepporAnatomiser) {
|
||||
_vepporAnatomiser = [[YUMIChamberPresentBrightnessAnatomiser alloc] init];
|
||||
}
|
||||
return _vepporAnatomiser;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// YMLoginInputView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol FBCSurmountIntrojectionRegardRepresendtation <NSObject>
|
||||
|
||||
- (void)smsCryptogramPerformance;
|
||||
|
||||
- (void)areaSttowardsementPerformance;
|
||||
|
||||
@end
|
||||
|
||||
@interface YUMISurmountIntrojectionRegard : UIView
|
||||
@property (nonatomic,strong) UIStackView *areaHierarchyRegard;
|
||||
@property (nonatomic, strong) UIButton *areaCryptogramBtuton;
|
||||
@property (nonatomic, strong) UITextField *introjectionEssayUniverse;
|
||||
@property (nonatomic, strong) UIButton *smsCryptogramBtuton;
|
||||
|
||||
@property (nonatomic, weak) id<FBCSurmountIntrojectionRegardRepresendtation> delegate;
|
||||
|
||||
- (void)fireIntrtowardsemper;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,160 +0,0 @@
|
||||
//
|
||||
// YMLoginInputView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountIntrojectionRegard.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import <Masonry.h>
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
@interface YUMISurmountIntrojectionRegard()
|
||||
|
||||
@property (nonatomic, strong) dispatch_source_t timer;
|
||||
|
||||
@property (nonatomic,strong) UIImageView *areaIndicateRegard;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountIntrojectionRegard
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.backgroundColor = UIColor.clearColor;
|
||||
self.layer.cornerRadius = 66.0/2.0;
|
||||
self.layer.borderWidth = 1;
|
||||
self.layer.borderColor = [UIColor.whiteColor colorWithAlphaComponent:0.2].CGColor;
|
||||
|
||||
[self produceUI];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)produceUI {
|
||||
UIStackView *stackView = [[UIStackView alloc] init];
|
||||
stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
stackView.distribution = UIStackViewDistributionFill;
|
||||
stackView.alignment = UIStackViewAlignmentCenter;
|
||||
stackView.spacing = 5;
|
||||
[self addSubview:stackView];
|
||||
|
||||
|
||||
UIImageView * areaIndicateRegard = [[UIImageView alloc] init];
|
||||
areaIndicateRegard.userInteractionEnabled = YES;
|
||||
areaIndicateRegard.image = [UIImage imageNamed:@"yumi_login_area_arrow"];
|
||||
areaIndicateRegard.userInteractionEnabled = NO;
|
||||
|
||||
|
||||
UIButton *areaCryptogramBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[areaCryptogramBtuton setTitle:@"+852" forState:UIControlStateNormal];
|
||||
[areaCryptogramBtuton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
areaCryptogramBtuton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
|
||||
_areaCryptogramBtuton = areaCryptogramBtuton;
|
||||
areaCryptogramBtuton.userInteractionEnabled = NO;
|
||||
|
||||
UIStackView *areaHierarchyRegard = [[UIStackView alloc] init];
|
||||
areaHierarchyRegard.axis = UILayoutConstraintAxisHorizontal;
|
||||
areaHierarchyRegard.distribution = UIStackViewDistributionFill;
|
||||
areaHierarchyRegard.alignment = UIStackViewAlignmentCenter;
|
||||
areaHierarchyRegard.spacing = 2;
|
||||
|
||||
|
||||
UIButton *areaBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[areaBtn addTarget:self action:@selector(areaConcludeTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
[areaHierarchyRegard addSubview:areaBtn];
|
||||
|
||||
[areaHierarchyRegard addArrangedSubview:areaCryptogramBtuton];
|
||||
[areaHierarchyRegard addArrangedSubview:areaIndicateRegard];
|
||||
|
||||
[stackView addArrangedSubview:areaHierarchyRegard];
|
||||
self.areaHierarchyRegard = areaHierarchyRegard;
|
||||
|
||||
|
||||
|
||||
UITextField *introjectionEssayUniverse = [[UITextField alloc] init];
|
||||
introjectionEssayUniverse.textColor = UIColor.whiteColor;
|
||||
introjectionEssayUniverse.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
[stackView addArrangedSubview:introjectionEssayUniverse];
|
||||
self.introjectionEssayUniverse = introjectionEssayUniverse;
|
||||
|
||||
UIButton *smsCryptogramBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[smsCryptogramBtuton setTitle:YMLocalizedString(@"XPLoginInputView0") forState:UIControlStateNormal];
|
||||
[smsCryptogramBtuton setTitleColor:UIColorFromRGB(0xFB486A) forState:UIControlStateNormal];
|
||||
smsCryptogramBtuton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
|
||||
[smsCryptogramBtuton addTarget:self action:@selector(smsCryptogramBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
[stackView addArrangedSubview:smsCryptogramBtuton];
|
||||
self.smsCryptogramBtuton = smsCryptogramBtuton;
|
||||
|
||||
[stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(15);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.top.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
|
||||
[areaIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(18);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
[areaCryptogramBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(50);
|
||||
make.height.mas_equalTo(stackView);
|
||||
}];
|
||||
[introjectionEssayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(stackView);
|
||||
}];
|
||||
[smsCryptogramBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(80);
|
||||
make.height.mas_equalTo(stackView);
|
||||
}];
|
||||
|
||||
[areaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(areaHierarchyRegard);
|
||||
}];
|
||||
|
||||
|
||||
self.areaHierarchyRegard.hidden = YES;
|
||||
self.smsCryptogramBtuton.hidden = YES;
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)smsCryptogramBtutonTicktacked {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(smsCryptogramPerformance)]) {
|
||||
[self.delegate smsCryptogramPerformance];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)areaConcludeTicktacked {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(areaSttowardsementPerformance)]) {
|
||||
[self.delegate areaSttowardsementPerformance];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)fireIntrtowardsemper {
|
||||
__block NSInteger count = 60;
|
||||
dispatch_queue_t queue = dispatch_get_main_queue();
|
||||
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
|
||||
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
|
||||
@weakify(self);
|
||||
dispatch_source_set_event_handler(timer, ^{
|
||||
@strongify(self);
|
||||
count--;
|
||||
if (count < 0) {
|
||||
[self.smsCryptogramBtuton setTitle:YMLocalizedString(@"XPLoginInputView1") forState:UIControlStateNormal];
|
||||
self.smsCryptogramBtuton.userInteractionEnabled = YES;
|
||||
dispatch_cancel(self.timer);
|
||||
}else{
|
||||
[self.smsCryptogramBtuton setTitle:[NSString stringWithFormat:@"%lds",count] forState:UIControlStateNormal];
|
||||
self.smsCryptogramBtuton.userInteractionEnabled = NO;
|
||||
}
|
||||
});
|
||||
dispatch_resume(timer);
|
||||
self.timer = timer;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,221 +0,0 @@
|
||||
//
|
||||
// YMLoginPhoneViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "YUMISurmountMobileRegardGovernancer.h"
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
#import "YUMISurmountIntrojectionRegard.h"
|
||||
|
||||
#import "YUMISurmountPwordRegardGovernancer.h"
|
||||
#import "YUMISurmountAraeRegardGovernancer.h"
|
||||
#import "SurmountValidationCodeExternalize.h"
|
||||
#import "SurmountVerifCodeCeremony.h"
|
||||
|
||||
@interface YUMISurmountMobileRegardGovernancer ()<FBCSurmountIntrojectionRegardRepresendtation, SurmountVerifCodeCeremony, FBCSurmountAraeRegardGovernancerRepresendtation>
|
||||
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UILabel *sequencpSequencignation;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *mobileIntrojectionRegard;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *cryptogramIntrojectionRegard;
|
||||
@property (nonatomic, strong) UIButton *surmountBtuton;
|
||||
@property (nonatomic, strong) UIButton *pwordSurmountBtuton;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountMobileRegardGovernancer
|
||||
|
||||
- (SurmountValidationCodeExternalize *)producePresimport {
|
||||
return [[SurmountValidationCodeExternalize alloc] init];
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.demandsImpression = YES;
|
||||
self.demandsEncourage = YES;
|
||||
self.phoneAreaCode = @"852";
|
||||
[super viewDidLoad];
|
||||
[self produceUI];
|
||||
[self racBind];
|
||||
}
|
||||
|
||||
- (void)produceUI {
|
||||
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.sequencpSequencignation];
|
||||
[self.view addSubview:self.mobileIntrojectionRegard];
|
||||
[self.view addSubview:self.cryptogramIntrojectionRegard];
|
||||
[self.view addSubview:self.surmountBtuton];
|
||||
[self.view addSubview:self.pwordSurmountBtuton];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(146.0/812.0*KScreenHeight);
|
||||
}];
|
||||
[self.sequencpSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(4);
|
||||
}];
|
||||
[self.mobileIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.top.mas_equalTo(self.sequencpSequencignation.mas_bottom).offset(23);
|
||||
make.height.mas_equalTo(66);
|
||||
}];
|
||||
[self.cryptogramIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.right.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.top.mas_equalTo(self.mobileIntrojectionRegard.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
}];
|
||||
[self.surmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.cryptogramIntrojectionRegard.mas_bottom).offset(51);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(96);
|
||||
}];
|
||||
[self.pwordSurmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.surmountBtuton.mas_bottom).offset(24);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)racBind {
|
||||
RAC(self.surmountBtuton, enabled) = [[RACSignal combineLatest:@[self.mobileIntrojectionRegard.introjectionEssayUniverse.rac_textSignal, self.cryptogramIntrojectionRegard.introjectionEssayUniverse.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode){
|
||||
return @((phone.length == 11) && smsCode.length >= 5);
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
|
||||
- (void)surmountBtutonTicktacked {
|
||||
NSString *phone = self.mobileIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
NSString *smsCode = self.cryptogramIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
NSString * phoneStr = [NSString stringWithFormat:@"%@%@",self.phoneAreaCode, phone];
|
||||
[self.presimport surmountAboutMobile:phoneStr code:smsCode phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)pwdSurmountBtutonTicktacked {
|
||||
YUMISurmountPwordRegardGovernancer *pwdVC = [[YUMISurmountPwordRegardGovernancer alloc] init];
|
||||
[self.navigationController pushViewController:pwdVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - FBCSurmountIntrojectionRegardRepresendtation
|
||||
|
||||
- (void)smsCryptogramPerformance {
|
||||
NSString *phone = self.mobileIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
if (phone.length != 11 ) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"XPLoginPhoneViewController0")];
|
||||
return;
|
||||
}
|
||||
[self.presimport mobileSmsCryptogram:phone type:GetSmsGenre_Regist phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)areaSttowardsementPerformance {
|
||||
YUMISurmountAraeRegardGovernancer *codeVC = [YUMISurmountAraeRegardGovernancer new];
|
||||
codeVC.delegate = self;
|
||||
[self.navigationController pushViewController:codeVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)concludeAreaCryptogramAccomplishment:(NSString *)code {
|
||||
if (code.length > 0) {
|
||||
self.phoneAreaCode = code;
|
||||
[self.mobileIntrojectionRegard.areaCryptogramBtuton setTitle:[NSString stringWithFormat:@"+%@", code] forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - SurmountVerifCodeCeremony
|
||||
- (void)surmountAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - SurmountCeremony
|
||||
- (void)mobileSmsCryptogramAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"XPLoginPhoneViewController2")];
|
||||
[self.cryptogramIntrojectionRegard fireIntrtowardsemper];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPLoginPhoneViewController3");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)sequencpSequencignation {
|
||||
if (!_sequencpSequencignation) {
|
||||
_sequencpSequencignation = [[UILabel alloc] init];
|
||||
_sequencpSequencignation.text = YMLocalizedString(@"XPLoginPhoneViewController4");
|
||||
_sequencpSequencignation.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
|
||||
_sequencpSequencignation.textColor = [UIColor.whiteColor colorWithAlphaComponent:0.6];
|
||||
}
|
||||
return _sequencpSequencignation;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)mobileIntrojectionRegard {
|
||||
if (!_mobileIntrojectionRegard) {
|
||||
_mobileIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
_mobileIntrojectionRegard.areaHierarchyRegard.hidden = NO;
|
||||
_mobileIntrojectionRegard.delegate = self;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController5")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_mobileIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_mobileIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _mobileIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)cryptogramIntrojectionRegard {
|
||||
if (!_cryptogramIntrojectionRegard) {
|
||||
_cryptogramIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
_cryptogramIntrojectionRegard.smsCryptogramBtuton.hidden = NO;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController6")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_cryptogramIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_cryptogramIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_cryptogramIntrojectionRegard.delegate = self;
|
||||
}
|
||||
return _cryptogramIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)surmountBtuton {
|
||||
if (!_surmountBtuton) {
|
||||
_surmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"yumi_login_next"] forState:UIControlStateNormal];
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"yumi_login_next_disable"] forState:UIControlStateDisabled];
|
||||
[_surmountBtuton addTarget:self action:@selector(surmountBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _surmountBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)pwordSurmountBtuton {
|
||||
if (!_pwordSurmountBtuton) {
|
||||
_pwordSurmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController7")];
|
||||
[title addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, title.length)];
|
||||
[_pwordSurmountBtuton setAttributedTitle:title forState:UIControlStateNormal];
|
||||
[_pwordSurmountBtuton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_pwordSurmountBtuton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
[_pwordSurmountBtuton addTarget:self action:@selector(pwdSurmountBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _pwordSurmountBtuton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,187 +0,0 @@
|
||||
//
|
||||
// YMLoginPwdViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountPwordRegardGovernancer.h"
|
||||
#import <Masonry.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
|
||||
#import "YUMISurmountIntrojectionRegard.h"
|
||||
#import "YUMISurmountPwordRegardGovernancer.h"
|
||||
#import "YUMIForgetPwordRegardGovernancer.h"
|
||||
|
||||
#import "SurmountCiphercodeExternalize.h"
|
||||
#import "SurmountCiphercodeCeremony.h"
|
||||
|
||||
@interface YUMISurmountPwordRegardGovernancer ()<SurmountCiphercodeCeremony>
|
||||
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *mobileIntrojectionRegard;
|
||||
@property (nonatomic, strong) YUMISurmountIntrojectionRegard *pwordIntrojectionRegard;
|
||||
@property (nonatomic, strong) UIButton *surmountBtuton;
|
||||
@property (nonatomic, strong) UIButton *mobileSurmountBtuton;
|
||||
@property (nonatomic, strong) UIButton *forgetBtuton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountPwordRegardGovernancer
|
||||
|
||||
- (SurmountCiphercodeExternalize *)producePresimport {
|
||||
return [[SurmountCiphercodeExternalize alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.demandsImpression = YES;
|
||||
self.demandsEncourage = YES;
|
||||
[super viewDidLoad];
|
||||
[self produceUI];
|
||||
[self racBind];
|
||||
}
|
||||
|
||||
- (void)produceUI {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.mobileIntrojectionRegard];
|
||||
[self.view addSubview:self.pwordIntrojectionRegard];
|
||||
[self.view addSubview:self.surmountBtuton];
|
||||
[self.view addSubview:self.mobileSurmountBtuton];
|
||||
[self.view addSubview:self.forgetBtuton];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(146.0/812.0*KScreenHeight);
|
||||
}];
|
||||
[self.mobileIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(41);
|
||||
make.height.mas_equalTo(66);
|
||||
}];
|
||||
[self.pwordIntrojectionRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.right.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
make.top.mas_equalTo(self.mobileIntrojectionRegard.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(self.mobileIntrojectionRegard);
|
||||
}];
|
||||
[self.surmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.pwordIntrojectionRegard.mas_bottom).offset(51);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(96);
|
||||
}];
|
||||
[self.mobileSurmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.surmountBtuton.mas_bottom).offset(24);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
}];
|
||||
[self.forgetBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.pwordIntrojectionRegard);
|
||||
make.top.mas_equalTo(self.pwordIntrojectionRegard.mas_bottom).offset(10);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)racBind {
|
||||
RAC(self.surmountBtuton, enabled) = [[RACSignal combineLatest:@[self.mobileIntrojectionRegard.introjectionEssayUniverse.rac_textSignal, self.pwordIntrojectionRegard.introjectionEssayUniverse.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){
|
||||
return @((phone.length ==11 || phone.length == 7) && password.length >= 6);
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
- (void)surmountBtutonTicktacked {
|
||||
NSString *phone = self.mobileIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
NSString *password = self.pwordIntrojectionRegard.introjectionEssayUniverse.text;
|
||||
[self.presimport surmountAboutMobile:phone password:password];
|
||||
}
|
||||
|
||||
- (void)mobileSurmountBtutonTicktacked {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)SpongeoutBtutonTicktacked {
|
||||
YUMIForgetPwordRegardGovernancer *forgetVC = [[YUMIForgetPwordRegardGovernancer alloc] init];
|
||||
[self.navigationController pushViewController:forgetVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - SurmountCiphercodeCeremony
|
||||
- (void)mobileGrantedCiphercryptogramSurmountAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"XPLoginPwdViewController0")];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPLoginPwdViewController1");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)mobileIntrojectionRegard {
|
||||
if (!_mobileIntrojectionRegard) {
|
||||
_mobileIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
_mobileIntrojectionRegard.areaHierarchyRegard.hidden = YES;
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController2")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_mobileIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_mobileIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _mobileIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (YUMISurmountIntrojectionRegard *)pwordIntrojectionRegard {
|
||||
if (!_pwordIntrojectionRegard) {
|
||||
_pwordIntrojectionRegard = [[YUMISurmountIntrojectionRegard alloc] init];
|
||||
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController3")];
|
||||
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
|
||||
_pwordIntrojectionRegard.introjectionEssayUniverse.attributedPlaceholder = placeholder;
|
||||
_pwordIntrojectionRegard.introjectionEssayUniverse.keyboardType = UIKeyboardTypeAlphabet;
|
||||
_pwordIntrojectionRegard.introjectionEssayUniverse.secureTextEntry = YES;
|
||||
}
|
||||
return _pwordIntrojectionRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)surmountBtuton {
|
||||
if (!_surmountBtuton) {
|
||||
_surmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"yumi_login_next"] forState:UIControlStateNormal];
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"yumi_login_next_disable"] forState:UIControlStateDisabled];
|
||||
[_surmountBtuton addTarget:self action:@selector(surmountBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _surmountBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)mobileSurmountBtuton {
|
||||
if (!_mobileSurmountBtuton) {
|
||||
_mobileSurmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController4")];
|
||||
[title addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, title.length)];
|
||||
[_mobileSurmountBtuton setAttributedTitle:title forState:UIControlStateNormal];
|
||||
[_mobileSurmountBtuton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_mobileSurmountBtuton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
[_mobileSurmountBtuton addTarget:self action:@selector(mobileSurmountBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _mobileSurmountBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)forgetBtuton {
|
||||
if (!_forgetBtuton) {
|
||||
_forgetBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_forgetBtuton setTitle:@"忘记密码?" forState:UIControlStateNormal];
|
||||
[_forgetBtuton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_forgetBtuton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
|
||||
[_forgetBtuton addTarget:self action:@selector(SpongeoutBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _forgetBtuton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,370 +0,0 @@
|
||||
//
|
||||
// YMLoginViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "YUMISurmountRegardGovernancer.h"
|
||||
#import <Masonry.h>
|
||||
#import <YYText/YYText.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import <ReactiveObjC.h>
|
||||
#import "YUMIHtmlUrl.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import <AuthenticationServices/ASAuthorizationAppleIDButton.h>
|
||||
#import "YUMIConstant.h"
|
||||
#import "GCDHelper.h"
|
||||
#import "MKJPopup.h"
|
||||
#import "StatsticsticsServingFacilitater.h"
|
||||
#import "XNDJTBWGLoadingTool.h"
|
||||
#import "YUMITissueRegardGovernancer.h"
|
||||
#import "YUMISurmountMobileRegardGovernancer.h"
|
||||
#import "ConsumerPrivacyRegard.h"
|
||||
#import "AESUtils.h"
|
||||
#import "SurmountExternalizer.h"
|
||||
#import "SurmountCeremony.h"
|
||||
|
||||
UIKIT_EXTERN NSString * const kYouMiNumberCountKey;
|
||||
NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
|
||||
@interface YUMISurmountRegardGovernancer ()<SurmountCeremony>
|
||||
|
||||
@property (nonatomic, strong) UIButton *quickSurmountBtuton;
|
||||
@property (nonatomic, strong) UIButton *agreeBtuton;
|
||||
@property (nonatomic, strong) YYLabel *protocolSequencignation;
|
||||
@property (nonatomic, strong) UILabel *separateSequencignation;
|
||||
@property (nonatomic, strong) UIImageView *attestationIntumesceRegard;
|
||||
@property (nonatomic, strong) UILabel *attestationIntumesceSequencignation;
|
||||
@property (nonatomic, strong) UIStackView *stackView;
|
||||
@property (nonatomic, strong) UIButton *fbBtutonRegard;
|
||||
@property (nonatomic, strong) UIButton *googleBtutonRegard;
|
||||
@property (nonatomic, strong) UIButton *burlywoodBtutonRegard;
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
@property (nonatomic, strong) ASAuthorizationAppleIDButton *appleBtuton;
|
||||
#endif
|
||||
@property (nonatomic,strong) GIDConfiguration *configuration;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountRegardGovernancer
|
||||
|
||||
- (SurmountExternalizer *)producePresimport {
|
||||
return [[SurmountExternalizer alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.demandsImpression = NO;
|
||||
self.demandsEncourage = NO;
|
||||
[super viewDidLoad];
|
||||
[self produceUI];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self setDispositionPrivacyPrecautiousRegard];
|
||||
}
|
||||
|
||||
- (void)produceUI {
|
||||
[self.view addSubview:self.quickSurmountBtuton];
|
||||
[self.view addSubview:self.protocolSequencignation];
|
||||
[self.view addSubview:self.agreeBtuton];
|
||||
[self.view addSubview:self.separateSequencignation];
|
||||
[self.view addSubview:self.stackView];
|
||||
[self.view addSubview:self.attestationIntumesceRegard];
|
||||
[self.attestationIntumesceRegard addSubview:self.attestationIntumesceSequencignation];
|
||||
|
||||
[self.stackView addArrangedSubview:self.fbBtutonRegard];
|
||||
[self.stackView addArrangedSubview:self.googleBtutonRegard];
|
||||
[self.stackView addArrangedSubview:self.burlywoodBtutonRegard];
|
||||
[self.stackView addArrangedSubview:self.appleBtuton];
|
||||
|
||||
[self.quickSurmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(45);
|
||||
make.right.mas_equalTo(-45);
|
||||
make.height.mas_equalTo(66);
|
||||
make.centerY.mas_equalTo(self.view);
|
||||
}];
|
||||
[self.protocolSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.quickSurmountBtuton.mas_bottom).offset(56);
|
||||
make.centerX.mas_equalTo(self.view).offset(10);
|
||||
make.right.mas_lessThanOrEqualTo(-10);
|
||||
make.height.mas_greaterThanOrEqualTo(22);
|
||||
}];
|
||||
[self.agreeBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.protocolSequencignation.mas_left).offset(0);
|
||||
make.top.mas_equalTo(self.protocolSequencignation.mas_top);
|
||||
make.width.height.mas_equalTo(22);
|
||||
}];
|
||||
[self.separateSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(-169);
|
||||
}];
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.separateSequencignation.mas_bottom).offset(27);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
[self.attestationIntumesceRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.agreeBtuton).mas_offset((-16));
|
||||
make.top.mas_equalTo(self.agreeBtuton.mas_bottom);
|
||||
make.width.mas_equalTo(235);
|
||||
make.height.mas_equalTo(29);
|
||||
}];
|
||||
[self.attestationIntumesceSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(8);
|
||||
make.bottom.mas_equalTo(self.attestationIntumesceRegard).mas_offset(-6);
|
||||
}];
|
||||
|
||||
[self.fbBtutonRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)setDispositionPrivacyPrecautiousRegard {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *isExhibit = [defaults objectForKey:kYouMiNumberCountKey];
|
||||
|
||||
if (!isExhibit && isExhibit.length <= 0) {
|
||||
ConsumerPrivacyRegard * alertView = [[ConsumerPrivacyRegard alloc] init];
|
||||
alertView.controller = self;
|
||||
MKJPopupServing * config = [[MKJPopupServing alloc] init];
|
||||
config.shouldDismissOnBackgroundTouch = NO;
|
||||
config.contentView = alertView;
|
||||
[MKJPopup popupAboutDisposition:config];
|
||||
};
|
||||
}
|
||||
|
||||
- (void)surmountDidTicktack:(UIButton *)sender {
|
||||
if (self.agreeBtuton.selected) {
|
||||
ThirdLoginGenre type = sender.tag - 1000;
|
||||
if(type == ThirdLoginGenre_Gmail){
|
||||
[self.presimport tertiusSurmountByGoogleAboutPresentingRegardGovernancer:self configuration:self.configuration];
|
||||
return;
|
||||
}
|
||||
[self.presimport tertiusSurmountAboutGenre:type];
|
||||
|
||||
} else {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"PKLoginViewController1")];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)agreeBtutonTicktacked {
|
||||
self.agreeBtuton.selected = !self.agreeBtuton.selected;
|
||||
if (self.agreeBtuton.isSelected) {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:@"hadAgree" forKey:HadAgreePrivacy];
|
||||
[defaults synchronize];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.attestationIntumesceRegard.alpha = 0.0;
|
||||
}];
|
||||
} else {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString * hadAgree = [defaults stringForKey:HadAgreePrivacy];
|
||||
if (hadAgree.length > 0) {
|
||||
[defaults removeObjectForKey:HadAgreePrivacy];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mobileSurmountBtutonTicktacked {
|
||||
if (self.agreeBtuton.isSelected) {
|
||||
YUMISurmountMobileRegardGovernancer *phoneVC = [[YUMISurmountMobileRegardGovernancer alloc] init];
|
||||
[self.navigationController pushViewController:phoneVC animated:YES];
|
||||
[StatsticsticsServingFacilitater trajectoryOccurrenceAboutDigital:StatisticsServiceEventLoginPhoneClick];
|
||||
} else {
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.attestationIntumesceRegard.alpha = 1.0;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)flexibleSurmountBtutonTicktacked {
|
||||
if (self.agreeBtuton.isSelected) {
|
||||
YUMISurmountMobileRegardGovernancer *phoneVC = [[YUMISurmountMobileRegardGovernancer alloc] init];
|
||||
[self.navigationController pushViewController:phoneVC animated:YES];
|
||||
[StatsticsticsServingFacilitater trajectoryOccurrenceAboutDigital:StatisticsServiceEventLoginPhoneClick];
|
||||
} else {
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.attestationIntumesceRegard.alpha = 1.0;
|
||||
}];
|
||||
}
|
||||
}
|
||||
#pragma mark - SurmountCeremony
|
||||
- (void)surmountAccomplishment {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"XPLoginViewController4")];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UIButton *)quickSurmountBtuton {
|
||||
if (!_quickSurmountBtuton) {
|
||||
_quickSurmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_quickSurmountBtuton.layer.masksToBounds = YES;
|
||||
_quickSurmountBtuton.layer.cornerRadius = 66.0/2.f;
|
||||
[_quickSurmountBtuton setTitle:YMLocalizedString(@"XPLoginViewController5") forState:UIControlStateNormal];
|
||||
_quickSurmountBtuton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
|
||||
[_quickSurmountBtuton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor acknowledgementBtutonObliquityInititowardsePrettify],[DJDKMIMOMColor acknowledgementBtutonObliquityConcludePrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(KScreenWidth - 45 * 2, 45)];
|
||||
[_quickSurmountBtuton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_quickSurmountBtuton setImage:[UIImage imageNamed:@"yumi_login_phone_white"] forState:UIControlStateNormal];
|
||||
[_quickSurmountBtuton addTarget:self action:@selector(flexibleSurmountBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _quickSurmountBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)agreeBtuton {
|
||||
if(!_agreeBtuton) {
|
||||
_agreeBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_agreeBtuton setImage:[UIImage imageNamed:@"yumi_login_agree"] forState:UIControlStateSelected];
|
||||
[_agreeBtuton setImage:[UIImage imageNamed:@"yumi_login_disagree"] forState:UIControlStateNormal];
|
||||
[_agreeBtuton setEnlargeEdgeAboutApex:10 right:10 bottom:10 left:10];
|
||||
[_agreeBtuton addTarget:self action:@selector(agreeBtutonTicktacked) forControlEvents:UIControlEventTouchUpInside];
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *hadAgree = [defaults objectForKey:HadAgreePrivacy];
|
||||
if (hadAgree.length > 0) {
|
||||
_agreeBtuton.selected = YES;
|
||||
}
|
||||
}
|
||||
return _agreeBtuton;
|
||||
}
|
||||
|
||||
- (YYLabel *)protocolSequencignation {
|
||||
if (!_protocolSequencignation) {
|
||||
_protocolSequencignation = [[YYLabel alloc] init];
|
||||
_protocolSequencignation.font = [UIFont systemFontOfSize:12];
|
||||
_protocolSequencignation.numberOfLines = 0;
|
||||
|
||||
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginViewController6")];
|
||||
attString.yy_color = UIColor.whiteColor;
|
||||
NSString *userString = YMLocalizedString(@"XPLoginViewController7");
|
||||
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor aplictowardsionMainPrettify]}];
|
||||
@weakify(self)
|
||||
[userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@strongify(self);
|
||||
|
||||
YUMITissueRegardGovernancer * webVewC = [[YUMITissueRegardGovernancer alloc] init];
|
||||
webVewC.url = URLWithType(kUserProtocalURL);
|
||||
[self.navigationController pushViewController:webVewC animated:YES];
|
||||
} longPressAction:nil];
|
||||
|
||||
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginViewController8")];
|
||||
andString.yy_color = UIColor.whiteColor;
|
||||
NSString *protocolString = YMLocalizedString(@"XPLoginViewController9");
|
||||
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor aplictowardsionMainPrettify]}];
|
||||
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
@strongify(self);
|
||||
|
||||
YUMITissueRegardGovernancer * webVewC = [[YUMITissueRegardGovernancer alloc] init];
|
||||
webVewC.url = URLWithType(kPrivacyURL);
|
||||
[self.navigationController pushViewController:webVewC animated:YES];
|
||||
} longPressAction:nil];
|
||||
[attString appendAttributedString:userAttString];
|
||||
[attString appendAttributedString:andString];
|
||||
[attString appendAttributedString:privateString];
|
||||
|
||||
_protocolSequencignation.attributedText = attString;
|
||||
}
|
||||
return _protocolSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)separateSequencignation {
|
||||
if (!_separateSequencignation) {
|
||||
_separateSequencignation = [[UILabel alloc] init];
|
||||
_separateSequencignation.text = YMLocalizedString(@"XPLoginViewController10");
|
||||
_separateSequencignation.textColor = UIColor.whiteColor;
|
||||
_separateSequencignation.font = [UIFont systemFontOfSize:12];
|
||||
_separateSequencignation.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _separateSequencignation;
|
||||
}
|
||||
|
||||
- (UIImageView *)attestationIntumesceRegard {
|
||||
if (!_attestationIntumesceRegard) {
|
||||
_attestationIntumesceRegard = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yumi_login_auth_bubble"]];
|
||||
_attestationIntumesceRegard.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_attestationIntumesceRegard.alpha = 0;
|
||||
}
|
||||
return _attestationIntumesceRegard;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFillEqually;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 20;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UILabel *)attestationIntumesceSequencignation {
|
||||
if (!_attestationIntumesceSequencignation) {
|
||||
_attestationIntumesceSequencignation = [[UILabel alloc] init];
|
||||
_attestationIntumesceSequencignation.text = YMLocalizedString(@"XPLoginViewController11");
|
||||
_attestationIntumesceSequencignation.font = [UIFont systemFontOfSize:10];
|
||||
_attestationIntumesceSequencignation.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _attestationIntumesceSequencignation;
|
||||
}
|
||||
|
||||
- (UIButton *)fbBtutonRegard {
|
||||
if (!_fbBtutonRegard) {
|
||||
_fbBtutonRegard = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_fbBtutonRegard setImage: [UIImage imageNamed:@"yumi_login_facebook"] forState:UIControlStateNormal];
|
||||
_fbBtutonRegard.tag = 1000 + ThirdLoginGenre_FB;
|
||||
[_fbBtutonRegard addTarget:self action:@selector(surmountDidTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _fbBtutonRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)googleBtutonRegard {
|
||||
if (!_googleBtutonRegard) {
|
||||
_googleBtutonRegard = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_googleBtutonRegard setImage: [UIImage imageNamed:@"yumi_login_gmail"] forState:UIControlStateNormal];
|
||||
_googleBtutonRegard.tag = 1000 + ThirdLoginGenre_Gmail;
|
||||
[_googleBtutonRegard addTarget:self action:@selector(surmountDidTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _googleBtutonRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)burlywoodBtutonRegard {
|
||||
if (!_burlywoodBtutonRegard) {
|
||||
_burlywoodBtutonRegard = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_burlywoodBtutonRegard setImage: [UIImage imageNamed:@"yumi_login_line"] forState:UIControlStateNormal];
|
||||
_burlywoodBtutonRegard.tag = 1000 + ThirdLoginGenre_Line;
|
||||
[_burlywoodBtutonRegard addTarget:self action:@selector(surmountDidTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _burlywoodBtutonRegard;
|
||||
}
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
- (ASAuthorizationAppleIDButton *)appleBtuton API_AVAILABLE(ios(13.0)){
|
||||
if (!_appleBtuton) {
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_appleBtuton = [[ASAuthorizationAppleIDButton alloc] initWithAuthorizationButtonType:ASAuthorizationAppleIDButtonTypeSignIn authorizationButtonStyle:ASAuthorizationAppleIDButtonStyleWhite];
|
||||
} else {
|
||||
|
||||
}
|
||||
_appleBtuton.cornerRadius = 25;
|
||||
_appleBtuton.tag = 1000 + ThirdLoginGenre_Apple;
|
||||
[_appleBtuton addTarget:self action:@selector(surmountDidTicktack:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _appleBtuton;
|
||||
}
|
||||
#endif
|
||||
- (GIDConfiguration *)configuration{
|
||||
if (!_configuration){
|
||||
NSString * number = [AESUtils aesDecrypt:@"ScLBu7ctIiyGCKPro3Jj6XMdsdCCpNT9L4wyjHEF+bguqubkXNSayFBGMKmoDwe1hjfAc958XSaBdMyEaFXLO38Bwq3xURYVNpgEM4b14zg="];
|
||||
_configuration = [[GIDConfiguration alloc] initWithClientID:number];
|
||||
}
|
||||
return _configuration;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// SurmountDilemmaMobileRegardGovernancer.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "MvpRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountDilemmaMobileRegardGovernancer : MvpRegardGovernancer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,212 +0,0 @@
|
||||
//
|
||||
// SurmountDilemmaMobileRegardGovernancer.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "SurmountDilemmaMobileRegardGovernancer.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "NSString+Utils.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "SurmountDilemmaMobileExternalize.h"
|
||||
#import "SurmountValidationCodeRegardGovernancer.h"
|
||||
|
||||
@interface SurmountDilemmaMobileRegardGovernancer ()
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UIView *backgroundRegard;
|
||||
@property (nonatomic, strong) UILabel *computationrySequencignation;
|
||||
@property (nonatomic, strong) UITextField *mobileEssayUniverse;
|
||||
@property (nonatomic, strong) UIButton *surmountBtuton;
|
||||
@property (nonatomic,strong) UIButton *backButton;
|
||||
@end
|
||||
|
||||
@implementation SurmountDilemmaMobileRegardGovernancer
|
||||
- (BOOL)isVeiledNevObstacle {
|
||||
return YES;
|
||||
}
|
||||
#pragma mark - life cycle
|
||||
- (SurmountDilemmaMobileExternalize *)producePresimport {
|
||||
return [[SurmountDilemmaMobileExternalize alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self setUpwardsUI];
|
||||
[self setEvents];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[self EvidenceMistakeToast:@"第三方登录需绑定手机号喔~"];
|
||||
}
|
||||
|
||||
- (void)setUpwardsUI {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.backgroundRegard];
|
||||
[self.backgroundRegard addSubview:self.computationrySequencignation];
|
||||
[self.backgroundRegard addSubview:self.mobileEssayUniverse];
|
||||
[self.view addSubview:self.surmountBtuton];
|
||||
[self.view addSubview:self.backButton];
|
||||
}
|
||||
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.view).offset(150);
|
||||
}];
|
||||
|
||||
[self.backgroundRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(50);
|
||||
make.width.mas_equalTo(280);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
[self.computationrySequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(10);
|
||||
make.top.mas_equalTo(self.backgroundRegard).offset(5);
|
||||
make.width.mas_equalTo(60);
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
[self.mobileEssayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(70);
|
||||
make.top.mas_equalTo(self.backgroundRegard).offset(5);
|
||||
make.width.mas_equalTo(200);
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
|
||||
[self.surmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.backgroundRegard.mas_bottom).offset(50);
|
||||
make.width.mas_equalTo(60);
|
||||
make.height.mas_equalTo(60);
|
||||
}];
|
||||
|
||||
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(15, 15));
|
||||
make.left.mas_equalTo(self.view).offset(14);
|
||||
make.top.mas_equalTo(self.view).offset(36 + kSafeAreaTopHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setEvents {
|
||||
@weakify(self)
|
||||
|
||||
[[RACSignal combineLatest:@[self.mobileEssayUniverse.rac_textSignal]
|
||||
reduce:^id(NSString *phone){
|
||||
BOOL enable = phone.length == 11;
|
||||
return @(enable);
|
||||
}] subscribeNext:^(NSNumber *enable) {
|
||||
@strongify(self)
|
||||
self.surmountBtuton.enabled = [enable boolValue];
|
||||
}];
|
||||
|
||||
|
||||
[[[[self.surmountBtuton rac_signalForControlEvents:UIControlEventTouchUpInside] doNext:^(id x) {
|
||||
@strongify(self)
|
||||
self.surmountBtuton.enabled = NO;
|
||||
}] flattenMap:^id (id value) {
|
||||
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
|
||||
if (!self.mobileEssayUniverse.text.isMobileDigital) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"LoginBindPhoneViewController1")];
|
||||
[subscriber sendNext:@(NO)];
|
||||
}else {
|
||||
[subscriber sendNext:@(YES)];
|
||||
}
|
||||
[subscriber sendCompleted];
|
||||
return nil;
|
||||
}];
|
||||
}] subscribeNext:^(NSNumber *signedIn) {
|
||||
@strongify(self)
|
||||
self.surmountBtuton.enabled = YES;
|
||||
BOOL success = [signedIn boolValue];
|
||||
if (success) {
|
||||
|
||||
SurmountValidationCodeRegardGovernancer *codeVC = [[SurmountValidationCodeRegardGovernancer alloc] init];
|
||||
codeVC.phone = self.mobileEssayUniverse.text;
|
||||
codeVC.type = VerifCodeGenre_BindPhone;
|
||||
[self.navigationController pushViewController:codeVC animated:YES];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)encourageBtutonPerformance:(UIButton *)sender {
|
||||
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
[self.presimport logout];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
_titleLabel.text = YMLocalizedString(@"LoginBindPhoneViewController2");
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)backgroundRegard {
|
||||
if (!_backgroundRegard) {
|
||||
_backgroundRegard = [[UIView alloc] init];
|
||||
_backgroundRegard.backgroundColor = [DJDKMIMOMColor aplictowardsionElementEncouragegroundPrettify];
|
||||
_backgroundRegard.layer.cornerRadius = 45/2;
|
||||
_backgroundRegard.layer.masksToBounds = YES;
|
||||
}
|
||||
return _backgroundRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)computationrySequencignation{
|
||||
if (!_computationrySequencignation) {
|
||||
_computationrySequencignation = [[UILabel alloc] init];
|
||||
_computationrySequencignation.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
||||
_computationrySequencignation.text = @"+852";
|
||||
_computationrySequencignation.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_computationrySequencignation.backgroundColor = [UIColor clearColor];
|
||||
_computationrySequencignation.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _computationrySequencignation;
|
||||
}
|
||||
|
||||
- (UITextField *)mobileEssayUniverse {
|
||||
if (!_mobileEssayUniverse) {
|
||||
_mobileEssayUniverse = [[UITextField alloc] init];
|
||||
_mobileEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_mobileEssayUniverse.backgroundColor = [UIColor clearColor];
|
||||
_mobileEssayUniverse.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_mobileEssayUniverse.tintColor = [DJDKMIMOMColor aplictowardsionMainPrettify];
|
||||
_mobileEssayUniverse.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
|
||||
_mobileEssayUniverse.textAlignment = NSTextAlignmentLeft;
|
||||
}
|
||||
return _mobileEssayUniverse;
|
||||
}
|
||||
|
||||
- (UIButton *)surmountBtuton {
|
||||
if (!_surmountBtuton) {
|
||||
_surmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_surmountBtuton.enabled = NO;
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"yumi_login_button"] forState:UIControlStateDisabled];
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"yumi_login_button_sel"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _surmountBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)backButton {
|
||||
if (!_backButton) {
|
||||
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_backButton setImage:[UIImage imageNamed:@"yumi_same_title_back"] forState:UIControlStateNormal];
|
||||
[_backButton setImage:[UIImage imageNamed:@"yumi_same_title_back"] forState:UIControlStateSelected];
|
||||
[_backButton setEnlargeEdgeAboutApex:15 right:15 bottom:15 left:15];
|
||||
[_backButton addTarget:self action:@selector(encourageBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// SurmountFullAbstractRegardGovernancer.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "MvpRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountFullAbstractRegardGovernancer : MvpRegardGovernancer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,440 +0,0 @@
|
||||
//
|
||||
// SurmountFullAbstractRegardGovernancer.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "SurmountFullAbstractRegardGovernancer.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "StatsticsticsServingFacilitater.h"
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "MKJPopup.h"
|
||||
#import "ThirdConsumerAbstract.h"
|
||||
#import "SurmountFullAbstractExternalizer.h"
|
||||
#import "SurmountFullAbstractCeremony.h"
|
||||
|
||||
UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
|
||||
|
||||
@interface SurmountFullAbstractRegardGovernancer ()<SurmountFullAbstractCeremony>
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@property (nonatomic,strong) UILabel *remindSequencignation;
|
||||
@property (nonatomic,strong) UIView * encourageRegard;
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
@property (nonatomic,strong) UILabel *constituteSequencignation;
|
||||
@property (nonatomic,strong) UITextField *essayUniverse;
|
||||
@property (nonatomic,strong) UIButton *refreshBtuton;
|
||||
@property (nonatomic,strong) UIStackView *seaxualityHierarchyRegard;
|
||||
@property (nonatomic,strong) UIButton *maleBtuton;
|
||||
@property (nonatomic,strong) UIButton *femaleBtuton;
|
||||
@property (nonatomic,strong) UIButton *nextBtuton;
|
||||
@property (nonatomic,strong) UILabel *cryptogramSequencignation;
|
||||
@property (nonatomic,strong) UIView *cryptogramAccommoengagementRegard;
|
||||
@property (nonatomic,strong) UITextField *cryptogramEssayUniverse;
|
||||
@property (nonatomic,strong) UILabel *cryptogramSequencSequencignation;
|
||||
@property (nonatomic,strong) UILabel *restrictionSequencignation;
|
||||
@property (nonatomic,strong) ThirdConsumerAbstract *tertiusAbstract;
|
||||
@property (nonatomic,copy) NSString *seualityBWSttr;
|
||||
@end
|
||||
|
||||
@implementation SurmountFullAbstractRegardGovernancer
|
||||
|
||||
- (BOOL)isVeiledNevObstacle {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (SurmountFullAbstractExternalizer *)producePresimport {
|
||||
return [[SurmountFullAbstractExternalizer alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[self initOccurrences];
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.remindSequencignation];
|
||||
[self.view addSubview:self.encourageRegard];
|
||||
[self.view addSubview:self.seaxualityHierarchyRegard];
|
||||
[self.view addSubview:self.cryptogramSequencignation];
|
||||
[self.view addSubview:self.cryptogramAccommoengagementRegard];
|
||||
[self.view addSubview:self.nextBtuton];
|
||||
[self.view addSubview:self.restrictionSequencignation];
|
||||
[self.encourageRegard addSubview:self.stackView];
|
||||
[self.stackView addArrangedSubview:self.constituteSequencignation];
|
||||
[self.stackView addArrangedSubview:self.essayUniverse];
|
||||
[self.stackView addArrangedSubview:self.refreshBtuton];
|
||||
|
||||
[self.seaxualityHierarchyRegard addArrangedSubview:self.maleBtuton];
|
||||
[self.seaxualityHierarchyRegard addArrangedSubview:self.femaleBtuton];
|
||||
|
||||
[self.cryptogramAccommoengagementRegard addSubview:self.cryptogramEssayUniverse];
|
||||
[self.cryptogramAccommoengagementRegard addSubview:self.cryptogramSequencSequencignation];
|
||||
|
||||
if ([self.presimport acquireTertiusConsumerAbstract] && [self.presimport acquireTertiusConsumerAbstract].userName.length > 0) {
|
||||
self.essayUniverse.text = [self.presimport acquireTertiusConsumerAbstract].userName;
|
||||
} else {
|
||||
[self.presimport arbitraryDemandMonicer];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.view).offset(60 + kSafeAreaTopHeight);
|
||||
}];
|
||||
|
||||
[self.remindSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(8);
|
||||
}];
|
||||
|
||||
[self.encourageRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view).inset(52);
|
||||
make.height.mas_equalTo(45);
|
||||
make.top.mas_equalTo(self.remindSequencignation.mas_bottom).offset(49);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.encourageRegard).inset(25);
|
||||
make.top.bottom.mas_equalTo(self.encourageRegard);
|
||||
}];
|
||||
|
||||
|
||||
[self.seaxualityHierarchyRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.encourageRegard);
|
||||
make.top.mas_equalTo(self.encourageRegard.mas_bottom).offset(15);
|
||||
}];
|
||||
|
||||
[self.cryptogramSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.seaxualityHierarchyRegard.mas_bottom).offset(20);
|
||||
}];
|
||||
|
||||
[self.cryptogramAccommoengagementRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.height.mas_equalTo(self.encourageRegard);
|
||||
make.top.mas_equalTo(self.cryptogramSequencignation.mas_bottom).offset(11);
|
||||
}];
|
||||
|
||||
[self.cryptogramEssayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.cryptogramAccommoengagementRegard).offset(10);
|
||||
make.top.bottom.mas_equalTo(self.cryptogramAccommoengagementRegard);
|
||||
make.right.mas_equalTo(self.cryptogramSequencSequencignation.mas_left).offset(-5);
|
||||
}];
|
||||
|
||||
[self.cryptogramSequencSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.cryptogramAccommoengagementRegard).offset(-25);
|
||||
make.centerY.mas_equalTo(self.cryptogramAccommoengagementRegard);
|
||||
}];
|
||||
|
||||
[self.nextBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view).inset(52);
|
||||
make.height.mas_equalTo(45);
|
||||
make.top.mas_equalTo(self.cryptogramAccommoengagementRegard.mas_bottom).offset(75);
|
||||
}];
|
||||
|
||||
[self.restrictionSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(self.view.mas_bottom).offset(-15);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initOccurrences {
|
||||
@weakify(self);
|
||||
[[self.essayUniverse.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.essayUniverse.text = x;
|
||||
[self refurbishLtowardsterBtuton];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)refurbishConsumerAbstract {
|
||||
[self.presimport complectionAbstractAboutIntelligenceportrait:[self acquireIntelligenceportraitWeebsite] gender:self.maleBtuton.selected ? @"1":@"2" nick:self.essayUniverse.text centiretyforCryptogram:self.cryptogramEssayUniverse.text roomUid:nil shareUid:nil shareChannel:nil];
|
||||
}
|
||||
|
||||
- (NSString *)acquireIntelligenceportraitWeebsite {
|
||||
NSString * avatar;
|
||||
if ([self.presimport acquireTertiusConsumerAbstract] && [self.presimport acquireTertiusConsumerAbstract].avatarUrl.length > 0) {
|
||||
avatar = [self.presimport acquireTertiusConsumerAbstract].avatarUrl;
|
||||
} else {
|
||||
avatar = @"https://image.hfighting.com/morentouxiang.png";
|
||||
}
|
||||
return avatar;
|
||||
}
|
||||
|
||||
- (void)refurbishLtowardsterBtuton {
|
||||
if (self.essayUniverse.text.length > 0 && self.seualityBWSttr.length > 0) {
|
||||
self.nextBtuton.enabled = YES;
|
||||
} else {
|
||||
self.nextBtuton.enabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - SurmountFullAbstractCeremony
|
||||
- (void)requisitionArbitraryMonicerAccomplishment:(NSString *)nick {
|
||||
self.essayUniverse.text = nick;
|
||||
}
|
||||
|
||||
- (void)complementAbstractAccomplishment {
|
||||
[StatsticsticsServingFacilitater trajectoryOccurrenceAboutDigital:StatisticsServiceEventLoginRepariSuccess];
|
||||
|
||||
[[AccountAbstractStorage instance] preserveTicket:nil];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
NSString * centiretyforCryptogram = self.cryptogramEssayUniverse.text.length > 0 ? self.cryptogramEssayUniverse.text : @"";
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kUserCompleteInfoFinishKey object:centiretyforCryptogram];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)ltowardsterBtutonPerformance:(UIButton *)sender {
|
||||
if (self.cryptogramEssayUniverse.text.length <= 0) {
|
||||
MKJPrecautiousDisposition * config = [[MKJPrecautiousDisposition alloc] init];
|
||||
config.title = @"";
|
||||
config.message = YMLocalizedString(@"LoginFullInfoViewController0");
|
||||
[MKJPopup precautiousAboutDisposition:config acknowledgementHandler:^{
|
||||
[self refurbishConsumerAbstract];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
} else {
|
||||
[self refurbishConsumerAbstract];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)renovtowardseBtutonPerformance:(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.presimport arbitraryDemandMonicer];
|
||||
}
|
||||
|
||||
- (void)maleBtutonPerformance:(UIButton *)sender {
|
||||
self.femaleBtuton.selected = NO;
|
||||
sender.selected = YES;
|
||||
self.seualityBWSttr = @"1";
|
||||
}
|
||||
|
||||
- (void)femaleBtutonPerformance:(UIButton *)sender {
|
||||
sender.selected = YES;
|
||||
self.maleBtuton.selected = NO;
|
||||
self.seualityBWSttr = @"2";
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setSeualityBWSttr:(NSString *)seualityBWSttr {
|
||||
_seualityBWSttr = seualityBWSttr;
|
||||
[self refurbishLtowardsterBtuton];
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"LoginFullInfoViewController1");
|
||||
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:18];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)remindSequencignation {
|
||||
if (!_remindSequencignation) {
|
||||
_remindSequencignation = [[UILabel alloc] init];
|
||||
_remindSequencignation.text = YMLocalizedString(@"LoginFullInfoViewController2");
|
||||
_remindSequencignation.font = [UIFont systemFontOfSize:13];
|
||||
_remindSequencignation.textColor = [DJDKMIMOMColor instantEssayPrettify];
|
||||
}
|
||||
return _remindSequencignation;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 10;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UIView *)encourageRegard {
|
||||
if (!_encourageRegard) {
|
||||
_encourageRegard = [[UIView alloc] init];
|
||||
_encourageRegard.backgroundColor = [DJDKMIMOMColor aplictowardsionElementEncouragegroundPrettify];
|
||||
_encourageRegard.layer.masksToBounds = YES;
|
||||
_encourageRegard.layer.cornerRadius = 45/2;
|
||||
}
|
||||
return _encourageRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)constituteSequencignation {
|
||||
if (!_constituteSequencignation) {
|
||||
_constituteSequencignation = [[UILabel alloc] init];
|
||||
_constituteSequencignation.text = YMLocalizedString(@"LoginFullInfoViewController3");
|
||||
_constituteSequencignation.font = [UIFont systemFontOfSize:15];
|
||||
_constituteSequencignation.textColor = [DJDKMIMOMColor instantEssayPrettify];
|
||||
[_constituteSequencignation setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_constituteSequencignation setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
|
||||
}
|
||||
return _constituteSequencignation;
|
||||
}
|
||||
|
||||
- (UITextField *)essayUniverse {
|
||||
if (!_essayUniverse) {
|
||||
_essayUniverse = [[UITextField alloc] init];
|
||||
_essayUniverse.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_essayUniverse.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
||||
_essayUniverse.borderStyle = UITextBorderStyleNone;
|
||||
_essayUniverse.tintColor = [DJDKMIMOMColor aplictowardsionMainPrettify];
|
||||
_essayUniverse.textAlignment = NSTextAlignmentRight;
|
||||
_essayUniverse.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _essayUniverse;
|
||||
}
|
||||
|
||||
- (UIButton *)refreshBtuton {
|
||||
if (!_refreshBtuton) {
|
||||
_refreshBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_refreshBtuton setImage:[UIImage imageNamed:@"yumi_login_full_gen_refresh"] forState:UIControlStateNormal];
|
||||
[_refreshBtuton setImage:[UIImage imageNamed:@"yumi_login_full_gen_refresh"] forState:UIControlStateSelected];
|
||||
[_refreshBtuton setEnlargeEdgeAboutApex:0 right:0 bottom:0 left:10];
|
||||
[_refreshBtuton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_refreshBtuton setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_refreshBtuton addTarget:self action:@selector(renovtowardseBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _refreshBtuton;
|
||||
}
|
||||
|
||||
- (UIStackView *)seaxualityHierarchyRegard {
|
||||
if (!_seaxualityHierarchyRegard) {
|
||||
_seaxualityHierarchyRegard = [[UIStackView alloc] init];
|
||||
_seaxualityHierarchyRegard.axis = UILayoutConstraintAxisHorizontal;
|
||||
_seaxualityHierarchyRegard.distribution = UIStackViewDistributionFill;
|
||||
_seaxualityHierarchyRegard.alignment = UIStackViewAlignmentCenter;
|
||||
_seaxualityHierarchyRegard.spacing = 15;
|
||||
}
|
||||
return _seaxualityHierarchyRegard;
|
||||
}
|
||||
|
||||
- (UIButton *)maleBtuton {
|
||||
if (!_maleBtuton) {
|
||||
_maleBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_maleBtuton setImage:[UIImage imageNamed:@"yumi_login_full_gen_male_normal"] forState:UIControlStateNormal];
|
||||
[_maleBtuton setImage:[UIImage imageNamed:@"yumi_login_full_gen_male_select"] forState:UIControlStateSelected];
|
||||
[_maleBtuton addTarget:self action:@selector(maleBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _maleBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)femaleBtuton {
|
||||
if (!_femaleBtuton) {
|
||||
_femaleBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_femaleBtuton setImage:[UIImage imageNamed:@"yumi_login_full_gen_female_normal"] forState:UIControlStateNormal];
|
||||
[_femaleBtuton setImage:[UIImage imageNamed:@"yumi_login_full_gen_female_select"] forState:UIControlStateSelected];
|
||||
[_femaleBtuton addTarget:self action:@selector(femaleBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _femaleBtuton;
|
||||
}
|
||||
|
||||
- (UIView *)cryptogramAccommoengagementRegard {
|
||||
if (!_cryptogramAccommoengagementRegard) {
|
||||
_cryptogramAccommoengagementRegard = [[UIView alloc] init];
|
||||
_cryptogramAccommoengagementRegard.backgroundColor = [DJDKMIMOMColor aplictowardsionElementEncouragegroundPrettify];
|
||||
_cryptogramAccommoengagementRegard.layer.masksToBounds= YES;
|
||||
_cryptogramAccommoengagementRegard.layer.cornerRadius = 45/2;
|
||||
}
|
||||
return _cryptogramAccommoengagementRegard;
|
||||
}
|
||||
|
||||
- (UITextField *)cryptogramEssayUniverse {
|
||||
if (!_cryptogramEssayUniverse) {
|
||||
_cryptogramEssayUniverse = [[UITextField alloc] init];
|
||||
_cryptogramEssayUniverse.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_cryptogramEssayUniverse.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
||||
_cryptogramEssayUniverse.borderStyle = UITextBorderStyleNone;
|
||||
_cryptogramEssayUniverse.tintColor = [DJDKMIMOMColor aplictowardsionMainPrettify];
|
||||
_cryptogramEssayUniverse.textAlignment = NSTextAlignmentLeft;
|
||||
_cryptogramEssayUniverse.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _cryptogramEssayUniverse;
|
||||
}
|
||||
|
||||
- (UILabel *)cryptogramSequencignation {
|
||||
if (!_cryptogramSequencignation) {
|
||||
_cryptogramSequencignation = [[UILabel alloc] init];
|
||||
_cryptogramSequencignation.text = YMLocalizedString(@"LoginFullInfoViewController4");
|
||||
_cryptogramSequencignation.font = [UIFont systemFontOfSize:18];
|
||||
_cryptogramSequencignation.textAlignment = NSTextAlignmentCenter;
|
||||
_cryptogramSequencignation.textColor = [DJDKMIMOMColor instantEssayPrettify];
|
||||
}
|
||||
return _cryptogramSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)cryptogramSequencSequencignation {
|
||||
if (!_cryptogramSequencSequencignation) {
|
||||
_cryptogramSequencSequencignation = [[UILabel alloc] init];
|
||||
_cryptogramSequencSequencignation.text = @"(选填)";
|
||||
_cryptogramSequencSequencignation.font = [UIFont systemFontOfSize:15];
|
||||
_cryptogramSequencSequencignation.textColor = [DJDKMIMOMColor essayTertiusPrettify];
|
||||
[_cryptogramSequencSequencignation setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
return _cryptogramSequencSequencignation;
|
||||
}
|
||||
|
||||
- (UIButton *)nextBtuton{
|
||||
if (!_nextBtuton) {
|
||||
_nextBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_nextBtuton.layer.masksToBounds = YES;
|
||||
_nextBtuton.layer.cornerRadius = 45/2.f;
|
||||
[_nextBtuton setTitle:YMLocalizedString(@"LoginFullInfoViewController6") forState:UIControlStateNormal];
|
||||
_nextBtuton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
[_nextBtuton setTitleColor:[DJDKMIMOMColor acknowledgementBtutonEssayPrettify] forState:UIControlStateNormal];
|
||||
_nextBtuton.enabled = NO;
|
||||
UIImage *image = [UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor acknowledgementBtutonObliquityInititowardsePrettify], [DJDKMIMOMColor acknowledgementBtutonObliquityConcludePrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
[_nextBtuton setBackgroundImage:[UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor prohibitionBtutonPrettify], [DJDKMIMOMColor prohibitionBtutonPrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
|
||||
[_nextBtuton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_nextBtuton addTarget:self action:@selector(ltowardsterBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _nextBtuton;
|
||||
}
|
||||
|
||||
- (UILabel *)restrictionSequencignation {
|
||||
if (!_restrictionSequencignation) {
|
||||
_restrictionSequencignation = [[UILabel alloc] init];
|
||||
_restrictionSequencignation.text = YMLocalizedString(@"LoginFullInfoViewController7");
|
||||
_restrictionSequencignation.textAlignment = NSTextAlignmentCenter;
|
||||
_restrictionSequencignation.font = [UIFont systemFontOfSize:12];
|
||||
_restrictionSequencignation.textColor = [DJDKMIMOMColor essayTertiusPrettify];
|
||||
}
|
||||
return _restrictionSequencignation;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// SurmountValidationCodeRegardGovernancer.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "MvpRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSUInteger, VerifCodeGenre){
|
||||
VerifCodeGenre_Regist,
|
||||
VerifCodeGenre_BindPhone,
|
||||
VerifCodeGenre_Login,
|
||||
VerifCodeGenre_AreaCode,
|
||||
} ;
|
||||
|
||||
|
||||
@interface SurmountValidationCodeRegardGovernancer : MvpRegardGovernancer
|
||||
|
||||
@property (nonatomic,copy) NSString *phone;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
@property (nonatomic,assign) VerifCodeGenre type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,339 +0,0 @@
|
||||
//
|
||||
// SurmountValidationCodeRegardGovernancer.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "SurmountValidationCodeRegardGovernancer.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "ComputationDownFacilitater.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "XNDJTBWGLoadingTool.h"
|
||||
#import "UIView+Corner.h"
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "SurmountValidationCodeExternalize.h"
|
||||
#import "SurmountVerifCodeCeremony.h"
|
||||
#import "SurmountValidationCodeRegard.h"
|
||||
#import "SurmountFullAbstractRegardGovernancer.h"
|
||||
#import "YUMISurmountPwordRegardGovernancer.h"
|
||||
|
||||
@interface SurmountValidationCodeRegardGovernancer ()<SurmountVerifCodeCeremony, CountDownHelperRepresendtation>
|
||||
@property (nonatomic,strong) UIImageView *apexEncourageIndiRegard;
|
||||
@property (nonatomic,strong) UIView *contentView;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@property (nonatomic,strong) UIView *backgroundCryptogramRegard;
|
||||
@property (nonatomic,strong) UIStackView *cryptogramHierarchyRegard;
|
||||
@property (nonatomic,strong) UILabel *cutdownSequencignation;
|
||||
@property (nonatomic,strong) UIButton *retrialCryptogramBtuton;
|
||||
@property (nonatomic,strong) UITextField *essayUniverse;
|
||||
@property (nonatomic,strong) UIButton *surmountBtuton;
|
||||
@property (nonatomic,strong) UIButton *encourageBtuton;
|
||||
@property (nonatomic,assign) BOOL isSurmountSuccess;
|
||||
@property (nonatomic,copy) NSString *code;
|
||||
@end
|
||||
|
||||
@implementation SurmountValidationCodeRegardGovernancer
|
||||
|
||||
- (void)dealloc {
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
}
|
||||
|
||||
- (BOOL)isVeiledNevObstacle {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (SurmountValidationCodeExternalize *)producePresimport {
|
||||
return [[SurmountValidationCodeExternalize alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
if(self.type != VerifCodeGenre_AreaCode){
|
||||
self.retrialCryptogramBtuton.hidden = YES;
|
||||
self.cutdownSequencignation.hidden = NO;
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] unfoildComputtowardsiondownAboutIntrtowardsemporal:60];
|
||||
}else{
|
||||
self.essayUniverse.keyboardType = UIKeyboardTypeDefault;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:NO];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
|
||||
[self.view addSubview:self.apexEncourageIndiRegard];
|
||||
[self.view addSubview:self.contentView];
|
||||
|
||||
|
||||
if(self.type == VerifCodeGenre_AreaCode){
|
||||
self.titleLabel.text = YMLocalizedString(@"LoginVerifCodeViewController5");
|
||||
|
||||
}else{
|
||||
[self.apexEncourageIndiRegard addSubview:self.encourageBtuton];
|
||||
[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer].delegate = self;
|
||||
}
|
||||
|
||||
[self.apexEncourageIndiRegard addSubview:self.titleLabel];
|
||||
|
||||
[self.contentView addSubview:self.backgroundCryptogramRegard];
|
||||
[self.backgroundCryptogramRegard addSubview:self.cryptogramHierarchyRegard];
|
||||
[self.cryptogramHierarchyRegard addArrangedSubview:self.essayUniverse];
|
||||
[self.cryptogramHierarchyRegard addArrangedSubview:self.cutdownSequencignation];
|
||||
[self.cryptogramHierarchyRegard addArrangedSubview:self.retrialCryptogramBtuton];
|
||||
[self.contentView addSubview:self.surmountBtuton];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.apexEncourageIndiRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kGetScaleWidth(333));
|
||||
}];
|
||||
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.mas_equalTo(self.view);
|
||||
make.top.equalTo(self.apexEncourageIndiRegard.mas_bottom).mas_offset(-kGetScaleWidth(30));
|
||||
}];
|
||||
if(self.type != VerifCodeGenre_AreaCode){
|
||||
[self.encourageBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.apexEncourageIndiRegard.mas_top).offset(kSafeAreaTopHeight + kGetScaleWidth(52));
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(20));
|
||||
make.left.mas_equalTo(kGetScaleWidth(15));
|
||||
}];
|
||||
}
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.apexEncourageIndiRegard).offset(kGetScaleWidth(30));
|
||||
make.top.mas_equalTo(self.apexEncourageIndiRegard.mas_top).offset(kSafeAreaTopHeight + kGetScaleWidth(96));
|
||||
}];
|
||||
|
||||
|
||||
[self.backgroundCryptogramRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(30));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(33));
|
||||
make.left.mas_equalTo(kGetScaleWidth(33));
|
||||
make.height.mas_equalTo(kGetScaleWidth(63));
|
||||
}];
|
||||
|
||||
[self.cryptogramHierarchyRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kGetScaleWidth(20));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(20));
|
||||
make.top.bottom.equalTo(self.backgroundCryptogramRegard);
|
||||
}];
|
||||
[self.essayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_greaterThanOrEqualTo(kGetScaleWidth(190));
|
||||
}];
|
||||
[self.surmountBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.contentView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(63));
|
||||
make.width.mas_equalTo(kGetScaleWidth(165));
|
||||
make.top.equalTo(self.backgroundCryptogramRegard.mas_bottom).mas_offset(kGetScaleWidth(50));
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)httpDemandMobileSmsCryptogram {
|
||||
[self.presimport mobileSmsCryptogram:[NSString stringWithFormat:@"%@%@",self.phoneAreaCode,self.phone] type:GetSmsGenre_Regist phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)surmountBtutonPerformance{
|
||||
|
||||
[self.view endEditing:YES];
|
||||
self.surmountBtuton.enabled = NO;
|
||||
|
||||
if(self.isSurmountSuccess == YES && [self.code isEqualToString:self.essayUniverse.text]){
|
||||
[XNDJTBWGLoadingTool EvidenceChamberingInRegard:self.view];
|
||||
[self surmountAccomplishment];
|
||||
return;
|
||||
}
|
||||
self.isSurmountSuccess = NO;
|
||||
[XNDJTBWGLoadingTool EvidenceChamberingInRegard:self.view];
|
||||
self.code = self.essayUniverse.text;
|
||||
[self.presimport surmountAboutMobile:[NSString stringWithFormat:@"%@%@",self.phoneAreaCode,self.phone] code:self.essayUniverse.text phoneAreaCode:self.phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)prohibitiaplictowardsionarVewC {
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
NSMutableArray *vcList = [NSMutableArray array];
|
||||
for (id vc in self.navigationController.viewControllers) {
|
||||
if(![vc isKindOfClass:[YUMISurmountPwordRegardGovernancer class]]){
|
||||
[vcList addObject:vc];
|
||||
}
|
||||
}
|
||||
self.navigationController.viewControllers = vcList;
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - SurmountVerifCodeCeremony
|
||||
- (void)surmountFlunk:(NSString *)reason{
|
||||
self.surmountBtuton.enabled = YES;
|
||||
[XNDJTBWGLoadingTool EvidenceChamberingInRegard:self.view];
|
||||
}
|
||||
- (void)surmountAccomplishment {
|
||||
self.isSurmountSuccess = YES;
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
[self prohibitiaplictowardsionarVewC];
|
||||
self.surmountBtuton.enabled = YES;
|
||||
}
|
||||
|
||||
- (void)dilemmaMobileAccomplishment {
|
||||
[self prohibitiaplictowardsionarVewC];
|
||||
}
|
||||
#pragma mark - SurmountCeremony
|
||||
- (void)mobileSmsCryptogramAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"PKIDLoginViewController11")];
|
||||
self.retrialCryptogramBtuton.hidden = YES;
|
||||
self.cutdownSequencignation.hidden = NO;
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] unfoildComputtowardsiondownAboutIntrtowardsemporal:60];
|
||||
}
|
||||
|
||||
#pragma mark - CountDownHelperRepresendtation
|
||||
- (void)onComputtowardsiondownAccomplish {
|
||||
self.retrialCryptogramBtuton.hidden = NO;
|
||||
self.cutdownSequencignation.hidden = YES;
|
||||
}
|
||||
|
||||
- (void)onComputtowardsiondownUnfoild:(int)time {
|
||||
self.cutdownSequencignation.text = [NSString stringWithFormat:@"%dS",time];
|
||||
}
|
||||
-(void)essayUniverseDidDiversifictowardsion:(UITextField *)essayUniverse{
|
||||
self.surmountBtuton.enabled = essayUniverse.text > 0;
|
||||
}
|
||||
#pragma mark 重新获取验证吗
|
||||
-(void)retrialCryptogramPerformance{
|
||||
[self httpDemandMobileSmsCryptogram];
|
||||
}
|
||||
-(void)backAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:40];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_titleLabel.text = YMLocalizedString(@"LoginVerifCodeViewController3");
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (UILabel *)cutdownSequencignation {
|
||||
if (!_cutdownSequencignation) {
|
||||
_cutdownSequencignation = [[UILabel alloc] init];
|
||||
_cutdownSequencignation.textAlignment = NSTextAlignmentRight;
|
||||
_cutdownSequencignation.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_cutdownSequencignation.textColor = UIColorFromRGB(0x9168FA);
|
||||
_cutdownSequencignation.hidden = NO;
|
||||
}
|
||||
return _cutdownSequencignation;
|
||||
}
|
||||
-(UIView *)backgroundCryptogramRegard{
|
||||
if (!_backgroundCryptogramRegard){
|
||||
_backgroundCryptogramRegard = [UIView new];
|
||||
_backgroundCryptogramRegard.backgroundColor = UIColorFromRGB(0xF0F5F6);
|
||||
[_backgroundCryptogramRegard setMonopolizeAboutContraryApexMonopolize:kGetScaleWidth(10) rightTopCorner:kGetScaleWidth(10) bottomLeftCorner:kGetScaleWidth(10) bottomRightCorner:kGetScaleWidth(10) size:CGSizeMake(kGetScaleWidth(308), kGetScaleWidth(63))];
|
||||
}
|
||||
return _backgroundCryptogramRegard;
|
||||
}
|
||||
- (UIButton *)retrialCryptogramBtuton {
|
||||
if (!_retrialCryptogramBtuton) {
|
||||
_retrialCryptogramBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_retrialCryptogramBtuton setTitle:YMLocalizedString(@"LoginVerifCodeViewController4") forState:UIControlStateNormal];
|
||||
[_retrialCryptogramBtuton setTitleColor:[DJDKMIMOMColor colorAboutHexBWSttr:@"#1F1A4E"] forState:UIControlStateNormal];
|
||||
_retrialCryptogramBtuton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_retrialCryptogramBtuton.hidden = YES;
|
||||
[_retrialCryptogramBtuton addTarget:self action:@selector(retrialCryptogramPerformance) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _retrialCryptogramBtuton;
|
||||
}
|
||||
- (UIImageView *)apexEncourageIndiRegard {
|
||||
if (!_apexEncourageIndiRegard) {
|
||||
_apexEncourageIndiRegard = [[UIImageView alloc] init];
|
||||
_apexEncourageIndiRegard.userInteractionEnabled = YES;
|
||||
_apexEncourageIndiRegard.image = [UIImage imageNamed:@"login_top_bg"];
|
||||
_apexEncourageIndiRegard.layer.masksToBounds = YES;
|
||||
_apexEncourageIndiRegard.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _apexEncourageIndiRegard;
|
||||
}
|
||||
-(UITextField *)essayUniverse{
|
||||
if (!_essayUniverse){
|
||||
_essayUniverse = [[UITextField alloc]init];
|
||||
_essayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_essayUniverse.textColor = [DJDKMIMOMColor colorAboutHexBWSttr:@"#1F1A4E"];
|
||||
_essayUniverse.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
[_essayUniverse addTarget:self action:@selector(essayUniverseDidDiversifictowardsion:) forControlEvents:UIControlEventEditingChanged];
|
||||
|
||||
}
|
||||
return _essayUniverse;
|
||||
}
|
||||
- (UIView *)contentView {
|
||||
if (!_contentView) {
|
||||
_contentView = [[UIView alloc] init];
|
||||
_contentView.backgroundColor = [UIColor whiteColor];
|
||||
[_contentView setMonopolizeAboutContraryApexMonopolize:kGetScaleWidth(25) rightTopCorner:kGetScaleWidth(25) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, KScreenHeight - kGetScaleWidth(303))];
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
- (UIButton *)surmountBtuton {
|
||||
if (!_surmountBtuton) {
|
||||
_surmountBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_surmountBtuton setImage:[UIImage imageNamed:@"login_finish"] forState:UIControlStateNormal];
|
||||
[_surmountBtuton addTarget:self action:@selector(surmountBtutonPerformance) forControlEvents:UIControlEventTouchUpInside];
|
||||
_surmountBtuton.enabled = NO;
|
||||
}
|
||||
return _surmountBtuton;
|
||||
}
|
||||
|
||||
- (UIStackView *)cryptogramHierarchyRegard{
|
||||
if (!_cryptogramHierarchyRegard) {
|
||||
_cryptogramHierarchyRegard = [[UIStackView alloc] init];
|
||||
_cryptogramHierarchyRegard.axis = UILayoutConstraintAxisHorizontal;
|
||||
_cryptogramHierarchyRegard.distribution = UIStackViewDistributionFillProportionally;
|
||||
_cryptogramHierarchyRegard.alignment = UIStackViewAlignmentFill;
|
||||
_cryptogramHierarchyRegard.spacing = 10;
|
||||
}
|
||||
return _cryptogramHierarchyRegard;
|
||||
}
|
||||
- (UIButton *)encourageBtuton{
|
||||
if (!_encourageBtuton){
|
||||
_encourageBtuton = [UIButton new];
|
||||
[_encourageBtuton setBackgroundImage:[UIImage imageNamed:@"yumi_same_title_back"] forState:UIControlStateNormal];
|
||||
[_encourageBtuton setEnlargeEdgeAboutApex:10 right:10 bottom:10 left:10];
|
||||
[_encourageBtuton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _encourageBtuton;
|
||||
}
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YMLoginBindPhoneResultViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/17.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class UserInfoModel;
|
||||
@interface XPLoginBindPhoneResultViewController : BaseViewController
|
||||
@property (nonatomic, strong) UserInfoModel *userInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
144
YuMi/Modules/YMLogin/View/XPLoginBindPhoneResultViewController.m
Normal file
144
YuMi/Modules/YMLogin/View/XPLoginBindPhoneResultViewController.m
Normal file
@@ -0,0 +1,144 @@
|
||||
//
|
||||
// YMLoginBindPhoneResultViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/17.
|
||||
//
|
||||
|
||||
#import "XPLoginBindPhoneResultViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
///VC
|
||||
#import "XPLoginVerifBindPhoneViewController.h"
|
||||
@interface XPLoginBindPhoneResultViewController ()
|
||||
|
||||
@property (nonatomic, strong) UIView *containerView;
|
||||
@property (nonatomic, strong) UIImageView *iconImageView;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UILabel *phoneLabel;
|
||||
@property (nonatomic, strong) UIButton *changePhoneBtn;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPLoginBindPhoneResultViewController
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initViews];
|
||||
[self setUpConstraints];
|
||||
[self setConfigs];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initViews {
|
||||
[self.view addSubview:self.containerView];
|
||||
[self.containerView addSubview:self.iconImageView];
|
||||
[self.containerView addSubview:self.titleLabel];
|
||||
[self.containerView addSubview:self.phoneLabel];
|
||||
[self.containerView addSubview:self.changePhoneBtn];
|
||||
}
|
||||
|
||||
- (void)setConfigs {
|
||||
self.title = YMLocalizedString(@"XPLoginBindPhoneResultViewController0");
|
||||
self.phoneLabel.text = self.userInfo.phone;
|
||||
}
|
||||
|
||||
- (void)setUpConstraints {
|
||||
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(49);
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(50);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.size.mas_equalTo(CGSizeMake(135, 130));
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.iconImageView.mas_bottom).offset(39);
|
||||
}];
|
||||
|
||||
[self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(11);
|
||||
}];
|
||||
|
||||
[self.changePhoneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.phoneLabel.mas_bottom).offset(41);
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)changePhoneBtnAction:(UIButton *)sender {
|
||||
XPLoginVerifBindPhoneViewController *vc = [[XPLoginVerifBindPhoneViewController alloc] init];
|
||||
vc.userInfo = self.userInfo;
|
||||
vc.bindingPhoneNumType = XPBindingPhoneNumTypeConfirm;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)containerView{
|
||||
if (!_containerView) {
|
||||
_containerView = [[UIView alloc] init];
|
||||
_containerView.backgroundColor = [DJDKMIMOMColor appBackgroundColor];
|
||||
}
|
||||
return _containerView;
|
||||
}
|
||||
|
||||
- (UIImageView *)iconImageView{
|
||||
if (!_iconImageView) {
|
||||
_iconImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_bind_phone_bg"]];
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPLoginBindPhoneResultViewController1");
|
||||
_titleLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
_titleLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)phoneLabel{
|
||||
if (!_phoneLabel) {
|
||||
_phoneLabel = [[UILabel alloc] init];
|
||||
_phoneLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_phoneLabel.font = [UIFont boldSystemFontOfSize:18.f];
|
||||
_phoneLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_phoneLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _phoneLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)changePhoneBtn {
|
||||
if (!_changePhoneBtn) {
|
||||
_changePhoneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_changePhoneBtn setTitle:YMLocalizedString(@"XPLoginBindPhoneResultViewController2") forState:UIControlStateNormal];
|
||||
[_changePhoneBtn setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal];
|
||||
[_changePhoneBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]];
|
||||
[_changePhoneBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
_changePhoneBtn.layer.masksToBounds = YES;
|
||||
_changePhoneBtn.layer.cornerRadius = 22.5;
|
||||
[_changePhoneBtn addTarget:self action:@selector(changePhoneBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _changePhoneBtn;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// YMLoginVerifBindPhoneViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
手机号绑定的类型
|
||||
- TTBindingPhoneNumTypeNormal: 普通状态,首次绑定
|
||||
- TTBindingPhoneNumTypeConfirm : 验证状态:验证已绑定的手机
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, TTBindingPhoneNumType) {
|
||||
XPBindingPhoneNumTypeNormal = 0,
|
||||
XPBindingPhoneNumTypeEdit = 1,
|
||||
XPBindingPhoneNumTypeConfirm = 2,
|
||||
};
|
||||
@class UserInfoModel;
|
||||
@interface XPLoginVerifBindPhoneViewController : MvpViewController
|
||||
@property (nonatomic, assign) TTBindingPhoneNumType bindingPhoneNumType;
|
||||
///用户信息
|
||||
@property (nonatomic, strong) UserInfoModel *userInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
433
YuMi/Modules/YMLogin/View/XPLoginVerifBindPhoneViewController.m
Normal file
433
YuMi/Modules/YMLogin/View/XPLoginVerifBindPhoneViewController.m
Normal file
@@ -0,0 +1,433 @@
|
||||
//
|
||||
// YMLoginVerifBindPhoneViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "XPLoginVerifBindPhoneViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "CountDownHelper.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
///P
|
||||
#import "XPLoginVerifBindPhoneProtocol.h"
|
||||
#import "XPLoginVerifBindPhonePresenter.h"
|
||||
///VC
|
||||
#import "LoginBindPhoneViewController.h"
|
||||
#import "XPMineSettingViewController.h"
|
||||
///View
|
||||
#import "XPLoginBindSuccessView.h"
|
||||
|
||||
@interface XPLoginVerifBindPhoneViewController ()<XPLoginVerifBindPhoneProtocol, CountDownHelperDelegate>
|
||||
@property (nonatomic, strong) UIView *containerView;
|
||||
@property (nonatomic, strong) UILabel *areaLabel;
|
||||
@property (nonatomic, strong) UIButton *countryBtn;
|
||||
@property (nonatomic, strong) UIView *areaLineView;
|
||||
|
||||
@property (nonatomic, strong) UIView *phoneLineView;
|
||||
@property (nonatomic, strong) UIView *authLineView;
|
||||
@property (nonatomic, strong) UILabel *areaCodeLabel;
|
||||
|
||||
@property (nonatomic, strong) UIButton *authCodeBtn;
|
||||
@property (nonatomic, strong) UITextField *phoneNumTextField;
|
||||
@property (nonatomic, strong) UITextField *authCodeTextField;
|
||||
|
||||
@property (nonatomic, strong) UIButton *confirmBtn; // 确认按钮
|
||||
|
||||
@property (nonatomic, strong) UILabel *tipsLabel; // 手机号丢失
|
||||
@property (nonatomic, assign) BOOL isResetPhone; // 重新绑定手机
|
||||
@end
|
||||
|
||||
@implementation XPLoginVerifBindPhoneViewController
|
||||
|
||||
- (void)dealloc {
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
}
|
||||
|
||||
- (XPLoginVerifBindPhonePresenter *)createPresenter {
|
||||
return [[XPLoginVerifBindPhonePresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self setConfigs];
|
||||
[self setEvents];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[CountDownHelper shareHelper].delegate = self;
|
||||
[self.view addSubview:self.containerView];
|
||||
[self.containerView addSubview:self.areaLabel];
|
||||
[self.containerView addSubview:self.countryBtn];
|
||||
|
||||
[self.containerView addSubview:self.areaLineView];
|
||||
[self.containerView addSubview:self.areaCodeLabel];
|
||||
[self.containerView addSubview:self.phoneNumTextField];
|
||||
[self.containerView addSubview:self.phoneLineView];
|
||||
|
||||
[self.containerView addSubview:self.authCodeBtn];
|
||||
[self.containerView addSubview:self.authCodeTextField];
|
||||
[self.containerView addSubview:self.authLineView];
|
||||
|
||||
[self.containerView addSubview:self.confirmBtn];
|
||||
[self.containerView addSubview:self.tipsLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.areaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(32);
|
||||
make.top.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.countryBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-32);
|
||||
make.centerY.mas_equalTo(self.areaLabel);
|
||||
}];
|
||||
|
||||
[self.areaLineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.areaLabel.mas_bottom).offset(18);
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.height.mas_equalTo(1);
|
||||
}];
|
||||
|
||||
[self.areaCodeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.areaLineView.mas_bottom).offset(18);
|
||||
make.left.mas_equalTo(self.areaLabel);
|
||||
}];
|
||||
|
||||
[self.phoneNumTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(80);
|
||||
make.centerY.mas_equalTo(self.areaCodeLabel);
|
||||
make.right.mas_equalTo(self.authCodeBtn.mas_left).offset(-20);
|
||||
}];
|
||||
|
||||
[self.authCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-32);
|
||||
make.centerY.mas_equalTo(self.areaCodeLabel);
|
||||
}];
|
||||
|
||||
[self.phoneLineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.height.mas_equalTo(self.areaLineView);
|
||||
make.top.mas_equalTo(self.areaCodeLabel.mas_bottom).offset(18);
|
||||
}];
|
||||
|
||||
[self.authCodeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.height.mas_equalTo(48);
|
||||
make.top.mas_equalTo(self.phoneLineView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.authLineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.left.right.mas_equalTo(self.areaLineView);
|
||||
make.top.mas_equalTo(self.authCodeTextField.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.top.mas_equalTo(self.authLineView.mas_bottom).offset(70);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
|
||||
[self.tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.confirmBtn.mas_bottom).offset(36);
|
||||
make.centerX.mas_equalTo(0);
|
||||
}];
|
||||
}
|
||||
#pragma mark -配置
|
||||
- (void)setConfigs {
|
||||
switch (self.bindingPhoneNumType) {
|
||||
case XPBindingPhoneNumTypeEdit:{
|
||||
self.navigationItem.title = YMLocalizedString(@"XPLoginVerifBindPhoneViewController0");
|
||||
}
|
||||
break;
|
||||
case XPBindingPhoneNumTypeNormal:{
|
||||
self.navigationItem.title = YMLocalizedString(@"XPLoginVerifBindPhoneViewController1");
|
||||
}
|
||||
break;
|
||||
case XPBindingPhoneNumTypeConfirm:{
|
||||
self.tipsLabel.hidden = NO;
|
||||
self.navigationItem.title = YMLocalizedString(@"XPLoginVerifBindPhoneViewController2");
|
||||
[self.confirmBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController3") forState:UIControlStateNormal];
|
||||
if (self.userInfo.isBindPhone) {
|
||||
self.phoneNumTextField.enabled = NO;
|
||||
self.phoneNumTextField.text = self.userInfo.phone;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
RAC(self.confirmBtn,enabled) = [RACSignal combineLatest:@[self.phoneNumTextField.rac_textSignal,self.authCodeTextField.rac_textSignal] reduce:^(NSString *phone,NSString *code){
|
||||
return @(phone.length == 11 && code.length == 5);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark 交互事件
|
||||
- (void)setEvents {
|
||||
@weakify(self)
|
||||
// 获取验证码点击事件
|
||||
[[[self.authCodeBtn rac_signalForControlEvents:UIControlEventTouchUpInside] filter:^BOOL(__kindof UIControl * _Nullable value) {
|
||||
// 获取验证码
|
||||
if (self.phoneNumTextField.text.length == 0) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController4")];
|
||||
return NO;
|
||||
}else if (self.phoneNumTextField.text.length < 11) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController5")];
|
||||
return NO;
|
||||
}else {
|
||||
return YES;
|
||||
}
|
||||
}] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self);
|
||||
[self.presenter phoneSmsCode:self.phoneNumTextField.text type:self.bindingPhoneNumType == XPBindingPhoneNumTypeConfirm ? GetSmsType_Unbind_Phone : GetSmsType_Bind_Phone phoneAreaCode:@""];
|
||||
}];
|
||||
|
||||
|
||||
// 绑定和验证
|
||||
[[[self.confirmBtn rac_signalForControlEvents:UIControlEventTouchUpInside] filter:^BOOL(__kindof UIControl * _Nullable value) {
|
||||
@strongify(self)
|
||||
// 确认绑定手机号
|
||||
if (self.phoneNumTextField.text.length == 0) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController6")];
|
||||
return NO;
|
||||
}else if (self.authCodeTextField.text.length == 0) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController7")];
|
||||
return NO;
|
||||
}else {
|
||||
return YES;
|
||||
}
|
||||
}] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self)
|
||||
if (self.bindingPhoneNumType == XPBindingPhoneNumTypeConfirm) {
|
||||
[self.presenter checkMoblieCodeWithMoblie:self.phoneNumTextField.text code:self.authCodeTextField.text];
|
||||
} else {
|
||||
[self.presenter bindkMoblieCodeWithMoblie:self.phoneNumTextField.text code:self.authCodeTextField.text];
|
||||
}
|
||||
} error:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPLoginVerifBindPhoneProtocol
|
||||
- (void)phoneSmsCodeSuccess {
|
||||
self.authCodeBtn.enabled = NO;
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController8")];
|
||||
[[CountDownHelper shareHelper] openCountdownWithTime:60];
|
||||
}
|
||||
|
||||
- (void)checkMoblieCodeWithMoblieSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController9")];
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
XPLoginVerifBindPhoneViewController *vc = [[XPLoginVerifBindPhoneViewController alloc] init];
|
||||
vc.bindingPhoneNumType = XPBindingPhoneNumTypeEdit;
|
||||
vc.userInfo = self.userInfo;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)bindMoblieCodeWithMoblieSuccess {
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
// 修改绑定信息
|
||||
if (self.bindingPhoneNumType == XPBindingPhoneNumTypeEdit) {
|
||||
@weakify(self);
|
||||
[XPLoginBindSuccessView showBindSuccessViewWithHandler:^{
|
||||
@strongify(self);
|
||||
// 返回设置页面
|
||||
__block __kindof UIViewController *vc;
|
||||
[self.navigationController.childViewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:[XPMineSettingViewController class]]) {
|
||||
vc = obj; // 导航控制器中有设置VC
|
||||
}
|
||||
}];
|
||||
|
||||
if ([self.navigationController.childViewControllers containsObject:vc]) {
|
||||
[self.navigationController popToViewController:vc animated:YES];
|
||||
} else {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}];
|
||||
} else if (self.bindingPhoneNumType == XPBindingPhoneNumTypeNormal) {
|
||||
@weakify(self);
|
||||
[XPLoginBindSuccessView showBindSuccessViewWithHandler:^{
|
||||
@strongify(self);
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}];
|
||||
}
|
||||
self.confirmBtn.enabled = YES; // 打开交互
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - CountDownHelperDelegate
|
||||
///倒计时进行中
|
||||
- (void)onCountdownOpen:(int)time {
|
||||
[self.authCodeBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPLoginVerifBindPhoneViewController10"), time] forState:UIControlStateDisabled];
|
||||
}
|
||||
///倒计时结束
|
||||
- (void)onCountdownFinish {
|
||||
self.authCodeBtn.enabled= YES;
|
||||
[self.authCodeBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController11") forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)containerView{
|
||||
if (!_containerView) {
|
||||
_containerView = [[UIView alloc] init];
|
||||
_containerView.backgroundColor = [DJDKMIMOMColor appBackgroundColor];
|
||||
}
|
||||
return _containerView;
|
||||
}
|
||||
|
||||
- (UILabel *)areaLabel{
|
||||
if (!_areaLabel) {
|
||||
_areaLabel = [[UILabel alloc] init];
|
||||
_areaLabel.text = YMLocalizedString(@"XPLoginVerifBindPhoneViewController12");
|
||||
_areaLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
_areaLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
_areaLabel.adjustsFontSizeToFitWidth = YES;
|
||||
}
|
||||
return _areaLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)areaCodeLabel{
|
||||
if (!_areaCodeLabel) {
|
||||
_areaCodeLabel = [[UILabel alloc] init];
|
||||
_areaCodeLabel.text = @"+852";
|
||||
_areaCodeLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
_areaCodeLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
_areaCodeLabel.adjustsFontSizeToFitWidth = YES;
|
||||
}
|
||||
return _areaCodeLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)countryBtn {
|
||||
if (!_countryBtn) {
|
||||
_countryBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_countryBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController13") forState:UIControlStateNormal];
|
||||
[_countryBtn setImage:[UIImage imageNamed:@"mine_item_arrow"] forState:UIControlStateNormal];
|
||||
_countryBtn.transform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
_countryBtn.titleLabel.transform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
_countryBtn.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
_countryBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
|
||||
[_countryBtn setTitleColor:[DJDKMIMOMColor secondTextColor] forState:UIControlStateNormal];
|
||||
[_countryBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
|
||||
}
|
||||
return _countryBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)confirmBtn {
|
||||
if (!_confirmBtn) {
|
||||
_confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_confirmBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController14") forState:UIControlStateNormal];
|
||||
[_confirmBtn setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal];
|
||||
[_confirmBtn setTitleColor:[DJDKMIMOMColor disableButtonTextColor] forState:UIControlStateDisabled];
|
||||
[_confirmBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]];
|
||||
_confirmBtn.layer.cornerRadius = 22.5f;
|
||||
_confirmBtn.layer.masksToBounds = YES;
|
||||
_confirmBtn.enabled = NO;
|
||||
[_confirmBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
[_confirmBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor disableButtonColor], [DJDKMIMOMColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
|
||||
}
|
||||
return _confirmBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)authCodeBtn {
|
||||
if (!_authCodeBtn) {
|
||||
_authCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_authCodeBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController15") forState:UIControlStateNormal];
|
||||
[_authCodeBtn setTitleColor:[DJDKMIMOMColor appMainColor] forState:UIControlStateNormal];
|
||||
[_authCodeBtn setTitleColor:[DJDKMIMOMColor secondTextColor] forState:UIControlStateDisabled];
|
||||
[_authCodeBtn.titleLabel setFont:[UIFont systemFontOfSize:12.f]];
|
||||
}
|
||||
return _authCodeBtn;
|
||||
}
|
||||
|
||||
- (UITextField *)phoneNumTextField {
|
||||
if (!_phoneNumTextField) {
|
||||
_phoneNumTextField = [[UITextField alloc] init];
|
||||
_phoneNumTextField.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_phoneNumTextField.font = [UIFont systemFontOfSize:14.f];
|
||||
_phoneNumTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginVerifBindPhoneViewController16")attributes:@{NSForegroundColorAttributeName: [DJDKMIMOMColor secondTextColor]}];
|
||||
_phoneNumTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
_phoneNumTextField.borderStyle = UITextBorderStyleNone;
|
||||
_phoneNumTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_phoneNumTextField.tintColor = [DJDKMIMOMColor mainTextColor];
|
||||
}
|
||||
return _phoneNumTextField;
|
||||
}
|
||||
|
||||
|
||||
- (UITextField *)authCodeTextField {
|
||||
if (!_authCodeTextField) {
|
||||
_authCodeTextField = [[UITextField alloc] init];
|
||||
_authCodeTextField.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_authCodeTextField.font = [UIFont systemFontOfSize:14.f];
|
||||
_authCodeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginVerifBindPhoneViewController17")attributes:@{NSForegroundColorAttributeName: [DJDKMIMOMColor secondTextColor]}];
|
||||
_authCodeTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
_authCodeTextField.borderStyle = UITextBorderStyleNone;
|
||||
_authCodeTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_authCodeTextField.tintColor = [DJDKMIMOMColor mainTextColor];
|
||||
}
|
||||
return _authCodeTextField;
|
||||
}
|
||||
|
||||
- (UIView *)areaLineView {
|
||||
if (!_areaLineView) {
|
||||
_areaLineView = [[UIView alloc] init];
|
||||
_areaLineView.backgroundColor = [DJDKMIMOMColor dividerColor];
|
||||
}
|
||||
return _areaLineView;
|
||||
}
|
||||
|
||||
- (UIView *)phoneLineView {
|
||||
if (!_phoneLineView) {
|
||||
_phoneLineView = [[UIView alloc] init];
|
||||
_phoneLineView.backgroundColor = [DJDKMIMOMColor dividerColor];
|
||||
}
|
||||
return _phoneLineView;
|
||||
}
|
||||
|
||||
- (UIView *)authLineView {
|
||||
if (!_authLineView) {
|
||||
_authLineView = [[UIView alloc] init];
|
||||
_authLineView.backgroundColor = [DJDKMIMOMColor dividerColor];
|
||||
}
|
||||
return _authLineView;
|
||||
}
|
||||
|
||||
- (UILabel *)tipsLabel{
|
||||
if (!_tipsLabel) {
|
||||
_tipsLabel = [[UILabel alloc] init];
|
||||
_tipsLabel.text = [NSString stringWithFormat:@"如果您的手机号已丢失\n请咨询客服,ID:%@", @"88001"];
|
||||
_tipsLabel.textColor = [DJDKMIMOMColor textThirdColor];
|
||||
_tipsLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
_tipsLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_tipsLabel.numberOfLines = 0;
|
||||
_tipsLabel.hidden = YES;
|
||||
}
|
||||
return _tipsLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// YMLoginBindPhoneResultViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/17.
|
||||
//
|
||||
|
||||
#import "BaseRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class ConsumerAbstractMatrix;
|
||||
@interface YUMISurmountDilemmaMobileConsequentRegardGovernancer : BaseRegardGovernancer
|
||||
@property (nonatomic, strong) ConsumerAbstractMatrix *userInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,140 +0,0 @@
|
||||
//
|
||||
// YMLoginBindPhoneResultViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/17.
|
||||
//
|
||||
|
||||
#import "YUMISurmountDilemmaMobileConsequentRegardGovernancer.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "ConsumerAbstractMatrix.h"
|
||||
#import "YUMISurmountValidationDilemmaMobileRegardGovernancer.h"
|
||||
@interface YUMISurmountDilemmaMobileConsequentRegardGovernancer ()
|
||||
|
||||
@property (nonatomic, strong) UIView *containerView;
|
||||
@property (nonatomic, strong) UIImageView *figureIndicateRegard;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UILabel *mobileSequencignation;
|
||||
@property (nonatomic, strong) UIButton *diversificationMobileBtuton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountDilemmaMobileConsequentRegardGovernancer
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initRegards];
|
||||
[self setUpwardsRestrictions];
|
||||
[self setDispositions];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initRegards {
|
||||
[self.view addSubview:self.containerView];
|
||||
[self.containerView addSubview:self.figureIndicateRegard];
|
||||
[self.containerView addSubview:self.titleLabel];
|
||||
[self.containerView addSubview:self.mobileSequencignation];
|
||||
[self.containerView addSubview:self.diversificationMobileBtuton];
|
||||
}
|
||||
|
||||
- (void)setDispositions {
|
||||
self.title = YMLocalizedString(@"XPLoginBindPhoneResultViewController0");
|
||||
self.mobileSequencignation.text = self.userInfo.phone;
|
||||
}
|
||||
|
||||
- (void)setUpwardsRestrictions {
|
||||
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(49);
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.figureIndicateRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(50);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.size.mas_equalTo(CGSizeMake(135, 130));
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.figureIndicateRegard.mas_bottom).offset(39);
|
||||
}];
|
||||
|
||||
[self.mobileSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(11);
|
||||
}];
|
||||
|
||||
[self.diversificationMobileBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.mobileSequencignation.mas_bottom).offset(41);
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)diversifictowardsionMobileBtutonPerformance:(UIButton *)sender {
|
||||
YUMISurmountValidationDilemmaMobileRegardGovernancer *vc = [[YUMISurmountValidationDilemmaMobileRegardGovernancer alloc] init];
|
||||
vc.userInfo = self.userInfo;
|
||||
vc.bindingMobileFigureGenre = XPBindingPhoneNumTypeConfirm;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)containerView{
|
||||
if (!_containerView) {
|
||||
_containerView = [[UIView alloc] init];
|
||||
_containerView.backgroundColor = [DJDKMIMOMColor aplictowardsionEncouragegroundPrettify];
|
||||
}
|
||||
return _containerView;
|
||||
}
|
||||
|
||||
- (UIImageView *)figureIndicateRegard{
|
||||
if (!_figureIndicateRegard) {
|
||||
_figureIndicateRegard = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yumi_login_bind_phone_background"]];
|
||||
}
|
||||
return _figureIndicateRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPLoginBindPhoneResultViewController1");
|
||||
_titleLabel.textColor = [DJDKMIMOMColor instantEssayPrettify];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
_titleLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)mobileSequencignation{
|
||||
if (!_mobileSequencignation) {
|
||||
_mobileSequencignation = [[UILabel alloc] init];
|
||||
_mobileSequencignation.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_mobileSequencignation.font = [UIFont boldSystemFontOfSize:18.f];
|
||||
_mobileSequencignation.adjustsFontSizeToFitWidth = YES;
|
||||
_mobileSequencignation.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _mobileSequencignation;
|
||||
}
|
||||
|
||||
- (UIButton *)diversificationMobileBtuton {
|
||||
if (!_diversificationMobileBtuton) {
|
||||
_diversificationMobileBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_diversificationMobileBtuton setTitle:YMLocalizedString(@"XPLoginBindPhoneResultViewController2") forState:UIControlStateNormal];
|
||||
[_diversificationMobileBtuton setTitleColor:[DJDKMIMOMColor acknowledgementBtutonEssayPrettify] forState:UIControlStateNormal];
|
||||
[_diversificationMobileBtuton.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]];
|
||||
[_diversificationMobileBtuton setBackgroundImage:[UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor acknowledgementBtutonObliquityInititowardsePrettify], [DJDKMIMOMColor acknowledgementBtutonObliquityConcludePrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
_diversificationMobileBtuton.layer.masksToBounds = YES;
|
||||
_diversificationMobileBtuton.layer.cornerRadius = 22.5;
|
||||
[_diversificationMobileBtuton addTarget:self action:@selector(diversifictowardsionMobileBtutonPerformance:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _diversificationMobileBtuton;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// YMLoginVerifBindPhoneViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "MvpRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef NS_ENUM(NSUInteger, MKJBindingPhoneNumGenre) {
|
||||
XPBindingPhoneNumTypeNormal = 0,
|
||||
XPBindingPhoneNumTypeEdit = 1,
|
||||
XPBindingPhoneNumTypeConfirm = 2,
|
||||
};
|
||||
@class ConsumerAbstractMatrix;
|
||||
@interface YUMISurmountValidationDilemmaMobileRegardGovernancer : MvpRegardGovernancer
|
||||
@property (nonatomic, assign) MKJBindingPhoneNumGenre bindingMobileFigureGenre;
|
||||
@property (nonatomic, strong) ConsumerAbstractMatrix *userInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,425 +0,0 @@
|
||||
//
|
||||
// YMLoginVerifBindPhoneViewController.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "YUMISurmountValidationDilemmaMobileRegardGovernancer.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "ComputationDownFacilitater.h"
|
||||
#import "ConsumerAbstractMatrix.h"
|
||||
#import "FBCSurmountVerifBindPhoneCeremony.h"
|
||||
#import "YUMISurmountValidationDilemmaMobileExternalizer.h"
|
||||
#import "SurmountDilemmaMobileRegardGovernancer.h"
|
||||
#import "YUMIManeInstanllingRegardGovernancer.h"
|
||||
#import "YUMISurmountDilemmaSuccessRegard.h"
|
||||
|
||||
@interface YUMISurmountValidationDilemmaMobileRegardGovernancer ()<FBCSurmountVerifBindPhoneCeremony, CountDownHelperRepresendtation>
|
||||
@property (nonatomic, strong) UIView *containerView;
|
||||
@property (nonatomic, strong) UILabel *spectrumSequencignation;
|
||||
@property (nonatomic, strong) UIButton *computationryBtuton;
|
||||
@property (nonatomic, strong) UIView *spectrumBurlywoodRegard;
|
||||
|
||||
@property (nonatomic, strong) UIView *mobileBurlywoodRegard;
|
||||
@property (nonatomic, strong) UIView *attestationBurlywoodRegard;
|
||||
@property (nonatomic, strong) UILabel *spectrumCryptogramSequencignation;
|
||||
|
||||
@property (nonatomic, strong) UIButton *attestationCryptogramBtuton;
|
||||
@property (nonatomic, strong) UITextField *mobileFigureEssayUniverse;
|
||||
@property (nonatomic, strong) UITextField *attestationCryptogramEssayUniverse;
|
||||
|
||||
@property (nonatomic, strong) UIButton *confirmBtn;
|
||||
|
||||
@property (nonatomic, strong) UILabel *promptsSequencignation;
|
||||
@property (nonatomic, assign) BOOL isResetMobile;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountValidationDilemmaMobileRegardGovernancer
|
||||
|
||||
- (void)dealloc {
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
}
|
||||
|
||||
- (YUMISurmountValidationDilemmaMobileExternalizer *)producePresimport {
|
||||
return [[YUMISurmountValidationDilemmaMobileExternalizer alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[self setDispositions];
|
||||
[self setEvents];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer].delegate = self;
|
||||
[self.view addSubview:self.containerView];
|
||||
[self.containerView addSubview:self.spectrumSequencignation];
|
||||
[self.containerView addSubview:self.computationryBtuton];
|
||||
|
||||
[self.containerView addSubview:self.spectrumBurlywoodRegard];
|
||||
[self.containerView addSubview:self.spectrumCryptogramSequencignation];
|
||||
[self.containerView addSubview:self.mobileFigureEssayUniverse];
|
||||
[self.containerView addSubview:self.mobileBurlywoodRegard];
|
||||
|
||||
[self.containerView addSubview:self.attestationCryptogramBtuton];
|
||||
[self.containerView addSubview:self.attestationCryptogramEssayUniverse];
|
||||
[self.containerView addSubview:self.attestationBurlywoodRegard];
|
||||
|
||||
[self.containerView addSubview:self.confirmBtn];
|
||||
[self.containerView addSubview:self.promptsSequencignation];
|
||||
}
|
||||
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.spectrumSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(32);
|
||||
make.top.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.computationryBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-32);
|
||||
make.centerY.mas_equalTo(self.spectrumSequencignation);
|
||||
}];
|
||||
|
||||
[self.spectrumBurlywoodRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.spectrumSequencignation.mas_bottom).offset(18);
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.height.mas_equalTo(1);
|
||||
}];
|
||||
|
||||
[self.spectrumCryptogramSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.spectrumBurlywoodRegard.mas_bottom).offset(18);
|
||||
make.left.mas_equalTo(self.spectrumSequencignation);
|
||||
}];
|
||||
|
||||
[self.mobileFigureEssayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(80);
|
||||
make.centerY.mas_equalTo(self.spectrumCryptogramSequencignation);
|
||||
make.right.mas_equalTo(self.attestationCryptogramBtuton.mas_left).offset(-20);
|
||||
}];
|
||||
|
||||
[self.attestationCryptogramBtuton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-32);
|
||||
make.centerY.mas_equalTo(self.spectrumCryptogramSequencignation);
|
||||
}];
|
||||
|
||||
[self.mobileBurlywoodRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.height.mas_equalTo(self.spectrumBurlywoodRegard);
|
||||
make.top.mas_equalTo(self.spectrumCryptogramSequencignation.mas_bottom).offset(18);
|
||||
}];
|
||||
|
||||
[self.attestationCryptogramEssayUniverse mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.height.mas_equalTo(48);
|
||||
make.top.mas_equalTo(self.mobileBurlywoodRegard.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.attestationBurlywoodRegard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.left.right.mas_equalTo(self.spectrumBurlywoodRegard);
|
||||
make.top.mas_equalTo(self.attestationCryptogramEssayUniverse.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(0).inset(32);
|
||||
make.top.mas_equalTo(self.attestationBurlywoodRegard.mas_bottom).offset(70);
|
||||
make.height.mas_equalTo(45);
|
||||
}];
|
||||
|
||||
[self.promptsSequencignation mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.confirmBtn.mas_bottom).offset(36);
|
||||
make.centerX.mas_equalTo(0);
|
||||
}];
|
||||
}
|
||||
#pragma mark -配置
|
||||
- (void)setDispositions {
|
||||
switch (self.bindingMobileFigureGenre) {
|
||||
case XPBindingPhoneNumTypeEdit:{
|
||||
self.navigationItem.title = YMLocalizedString(@"XPLoginVerifBindPhoneViewController0");
|
||||
}
|
||||
break;
|
||||
case XPBindingPhoneNumTypeNormal:{
|
||||
self.navigationItem.title = YMLocalizedString(@"XPLoginVerifBindPhoneViewController1");
|
||||
}
|
||||
break;
|
||||
case XPBindingPhoneNumTypeConfirm:{
|
||||
self.promptsSequencignation.hidden = NO;
|
||||
self.navigationItem.title = YMLocalizedString(@"XPLoginVerifBindPhoneViewController2");
|
||||
[self.confirmBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController3") forState:UIControlStateNormal];
|
||||
if (self.userInfo.isBindPhone) {
|
||||
self.mobileFigureEssayUniverse.enabled = NO;
|
||||
self.mobileFigureEssayUniverse.text = self.userInfo.phone;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
RAC(self.confirmBtn,enabled) = [RACSignal combineLatest:@[self.mobileFigureEssayUniverse.rac_textSignal,self.attestationCryptogramEssayUniverse.rac_textSignal] reduce:^(NSString *phone,NSString *code){
|
||||
return @(phone.length == 11 && code.length == 5);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark 交互事件
|
||||
- (void)setEvents {
|
||||
@weakify(self)
|
||||
|
||||
[[[self.attestationCryptogramBtuton rac_signalForControlEvents:UIControlEventTouchUpInside] filter:^BOOL(__kindof UIControl * _Nullable value) {
|
||||
|
||||
if (self.mobileFigureEssayUniverse.text.length == 0) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController4")];
|
||||
return NO;
|
||||
}else if (self.mobileFigureEssayUniverse.text.length < 11) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController5")];
|
||||
return NO;
|
||||
}else {
|
||||
return YES;
|
||||
}
|
||||
}] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self);
|
||||
[self.presimport mobileSmsCryptogram:self.mobileFigureEssayUniverse.text type:self.bindingMobileFigureGenre == XPBindingPhoneNumTypeConfirm ? GetSmsGenre_Unbind_Phone : GetSmsGenre_Bind_Phone phoneAreaCode:@""];
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[[[self.confirmBtn rac_signalForControlEvents:UIControlEventTouchUpInside] filter:^BOOL(__kindof UIControl * _Nullable value) {
|
||||
@strongify(self)
|
||||
|
||||
if (self.mobileFigureEssayUniverse.text.length == 0) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController6")];
|
||||
return NO;
|
||||
}else if (self.attestationCryptogramEssayUniverse.text.length == 0) {
|
||||
[self EvidenceMistakeToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController7")];
|
||||
return NO;
|
||||
}else {
|
||||
return YES;
|
||||
}
|
||||
}] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self)
|
||||
if (self.bindingMobileFigureGenre == XPBindingPhoneNumTypeConfirm) {
|
||||
[self.presimport examineAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsus:self.mobileFigureEssayUniverse.text code:self.attestationCryptogramEssayUniverse.text];
|
||||
} else {
|
||||
[self.presimport dilemmakAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsus:self.mobileFigureEssayUniverse.text code:self.attestationCryptogramEssayUniverse.text];
|
||||
}
|
||||
} error:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - FBCSurmountVerifBindPhoneCeremony
|
||||
- (void)mobileSmsCryptogramAccomplishment {
|
||||
self.attestationCryptogramBtuton.enabled = NO;
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController8")];
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] unfoildComputtowardsiondownAboutIntrtowardsemporal:60];
|
||||
}
|
||||
|
||||
- (void)examineAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsusAccomplishment {
|
||||
[self EvidenceAccomplishmentToast:YMLocalizedString(@"XPLoginVerifBindPhoneViewController9")];
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
YUMISurmountValidationDilemmaMobileRegardGovernancer *vc = [[YUMISurmountValidationDilemmaMobileRegardGovernancer alloc] init];
|
||||
vc.bindingMobileFigureGenre = XPBindingPhoneNumTypeEdit;
|
||||
vc.userInfo = self.userInfo;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)dilemmaAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsusAccomplishment {
|
||||
[[ComputationDownFacilitater partowardsiciptowardsionFacilittowardseer] suspeindComputtowardsionPubescence];
|
||||
|
||||
if (self.bindingMobileFigureGenre == XPBindingPhoneNumTypeEdit) {
|
||||
@weakify(self);
|
||||
[YUMISurmountDilemmaSuccessRegard EvidenceBindAccomplishmentRegardAboutShankr:^{
|
||||
@strongify(self);
|
||||
|
||||
__block __kindof UIViewController *vc;
|
||||
[self.navigationController.childViewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:[YUMIManeInstanllingRegardGovernancer class]]) {
|
||||
vc = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if ([self.navigationController.childViewControllers containsObject:vc]) {
|
||||
[self.navigationController popToViewController:vc animated:YES];
|
||||
} else {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}];
|
||||
} else if (self.bindingMobileFigureGenre == XPBindingPhoneNumTypeNormal) {
|
||||
@weakify(self);
|
||||
[YUMISurmountDilemmaSuccessRegard EvidenceBindAccomplishmentRegardAboutShankr:^{
|
||||
@strongify(self);
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}];
|
||||
}
|
||||
self.confirmBtn.enabled = YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - CountDownHelperRepresendtation
|
||||
- (void)onComputtowardsiondownUnfoild:(int)time {
|
||||
[self.attestationCryptogramBtuton setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPLoginVerifBindPhoneViewController10"), time] forState:UIControlStateDisabled];
|
||||
}
|
||||
- (void)onComputtowardsiondownAccomplish {
|
||||
self.attestationCryptogramBtuton.enabled= YES;
|
||||
[self.attestationCryptogramBtuton setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController11") forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)containerView{
|
||||
if (!_containerView) {
|
||||
_containerView = [[UIView alloc] init];
|
||||
_containerView.backgroundColor = [DJDKMIMOMColor aplictowardsionEncouragegroundPrettify];
|
||||
}
|
||||
return _containerView;
|
||||
}
|
||||
|
||||
- (UILabel *)spectrumSequencignation{
|
||||
if (!_spectrumSequencignation) {
|
||||
_spectrumSequencignation = [[UILabel alloc] init];
|
||||
_spectrumSequencignation.text = YMLocalizedString(@"XPLoginVerifBindPhoneViewController12");
|
||||
_spectrumSequencignation.textColor = [DJDKMIMOMColor instantEssayPrettify];
|
||||
_spectrumSequencignation.font = [UIFont systemFontOfSize:14.f];
|
||||
_spectrumSequencignation.adjustsFontSizeToFitWidth = YES;
|
||||
}
|
||||
return _spectrumSequencignation;
|
||||
}
|
||||
|
||||
- (UILabel *)spectrumCryptogramSequencignation{
|
||||
if (!_spectrumCryptogramSequencignation) {
|
||||
_spectrumCryptogramSequencignation = [[UILabel alloc] init];
|
||||
_spectrumCryptogramSequencignation.text = @"+852";
|
||||
_spectrumCryptogramSequencignation.textColor = [DJDKMIMOMColor instantEssayPrettify];
|
||||
_spectrumCryptogramSequencignation.font = [UIFont systemFontOfSize:14.f];
|
||||
_spectrumCryptogramSequencignation.adjustsFontSizeToFitWidth = YES;
|
||||
}
|
||||
return _spectrumCryptogramSequencignation;
|
||||
}
|
||||
|
||||
- (UIButton *)computationryBtuton {
|
||||
if (!_computationryBtuton) {
|
||||
_computationryBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_computationryBtuton setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController13") forState:UIControlStateNormal];
|
||||
[_computationryBtuton setImage:[UIImage imageNamed:@"yumi_center_item_arrow"] forState:UIControlStateNormal];
|
||||
_computationryBtuton.transform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
_computationryBtuton.titleLabel.transform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
_computationryBtuton.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
_computationryBtuton.imageEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
|
||||
[_computationryBtuton setTitleColor:[DJDKMIMOMColor instantEssayPrettify] forState:UIControlStateNormal];
|
||||
[_computationryBtuton.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
|
||||
}
|
||||
return _computationryBtuton;
|
||||
}
|
||||
|
||||
- (UIButton *)confirmBtn {
|
||||
if (!_confirmBtn) {
|
||||
_confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_confirmBtn setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController14") forState:UIControlStateNormal];
|
||||
[_confirmBtn setTitleColor:[DJDKMIMOMColor acknowledgementBtutonEssayPrettify] forState:UIControlStateNormal];
|
||||
[_confirmBtn setTitleColor:[DJDKMIMOMColor prohibitionBtutonEssayPrettify] forState:UIControlStateDisabled];
|
||||
[_confirmBtn.titleLabel setFont:[UIFont fontWithName:@"PingFang-SC-Medium" size:18]];
|
||||
_confirmBtn.layer.cornerRadius = 22.5f;
|
||||
_confirmBtn.layer.masksToBounds = YES;
|
||||
_confirmBtn.enabled = NO;
|
||||
[_confirmBtn setBackgroundImage:[UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor acknowledgementBtutonObliquityInititowardsePrettify], [DJDKMIMOMColor acknowledgementBtutonObliquityConcludePrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
[_confirmBtn setBackgroundImage:[UIImage gradientPrettifyIndictowardseByvirtueofPrettifys:@[[DJDKMIMOMColor prohibitionBtutonPrettify], [DJDKMIMOMColor prohibitionBtutonPrettify]] gradientType:GradientGenreLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
|
||||
}
|
||||
return _confirmBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)attestationCryptogramBtuton {
|
||||
if (!_attestationCryptogramBtuton) {
|
||||
_attestationCryptogramBtuton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_attestationCryptogramBtuton setTitle:YMLocalizedString(@"XPLoginVerifBindPhoneViewController15") forState:UIControlStateNormal];
|
||||
[_attestationCryptogramBtuton setTitleColor:[DJDKMIMOMColor aplictowardsionMainPrettify] forState:UIControlStateNormal];
|
||||
[_attestationCryptogramBtuton setTitleColor:[DJDKMIMOMColor instantEssayPrettify] forState:UIControlStateDisabled];
|
||||
[_attestationCryptogramBtuton.titleLabel setFont:[UIFont systemFontOfSize:12.f]];
|
||||
}
|
||||
return _attestationCryptogramBtuton;
|
||||
}
|
||||
|
||||
- (UITextField *)mobileFigureEssayUniverse {
|
||||
if (!_mobileFigureEssayUniverse) {
|
||||
_mobileFigureEssayUniverse = [[UITextField alloc] init];
|
||||
_mobileFigureEssayUniverse.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_mobileFigureEssayUniverse.font = [UIFont systemFontOfSize:14.f];
|
||||
_mobileFigureEssayUniverse.attributedPlaceholder = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginVerifBindPhoneViewController16")attributes:@{NSForegroundColorAttributeName: [DJDKMIMOMColor instantEssayPrettify]}];
|
||||
_mobileFigureEssayUniverse.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
_mobileFigureEssayUniverse.borderStyle = UITextBorderStyleNone;
|
||||
_mobileFigureEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_mobileFigureEssayUniverse.tintColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
}
|
||||
return _mobileFigureEssayUniverse;
|
||||
}
|
||||
|
||||
|
||||
- (UITextField *)attestationCryptogramEssayUniverse {
|
||||
if (!_attestationCryptogramEssayUniverse) {
|
||||
_attestationCryptogramEssayUniverse = [[UITextField alloc] init];
|
||||
_attestationCryptogramEssayUniverse.textColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
_attestationCryptogramEssayUniverse.font = [UIFont systemFontOfSize:14.f];
|
||||
_attestationCryptogramEssayUniverse.attributedPlaceholder = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginVerifBindPhoneViewController17")attributes:@{NSForegroundColorAttributeName: [DJDKMIMOMColor instantEssayPrettify]}];
|
||||
_attestationCryptogramEssayUniverse.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
_attestationCryptogramEssayUniverse.borderStyle = UITextBorderStyleNone;
|
||||
_attestationCryptogramEssayUniverse.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_attestationCryptogramEssayUniverse.tintColor = [DJDKMIMOMColor mainEssayPrettify];
|
||||
}
|
||||
return _attestationCryptogramEssayUniverse;
|
||||
}
|
||||
|
||||
- (UIView *)spectrumBurlywoodRegard {
|
||||
if (!_spectrumBurlywoodRegard) {
|
||||
_spectrumBurlywoodRegard = [[UIView alloc] init];
|
||||
_spectrumBurlywoodRegard.backgroundColor = [DJDKMIMOMColor dividerPrettify];
|
||||
}
|
||||
return _spectrumBurlywoodRegard;
|
||||
}
|
||||
|
||||
- (UIView *)mobileBurlywoodRegard {
|
||||
if (!_mobileBurlywoodRegard) {
|
||||
_mobileBurlywoodRegard = [[UIView alloc] init];
|
||||
_mobileBurlywoodRegard.backgroundColor = [DJDKMIMOMColor dividerPrettify];
|
||||
}
|
||||
return _mobileBurlywoodRegard;
|
||||
}
|
||||
|
||||
- (UIView *)attestationBurlywoodRegard {
|
||||
if (!_attestationBurlywoodRegard) {
|
||||
_attestationBurlywoodRegard = [[UIView alloc] init];
|
||||
_attestationBurlywoodRegard.backgroundColor = [DJDKMIMOMColor dividerPrettify];
|
||||
}
|
||||
return _attestationBurlywoodRegard;
|
||||
}
|
||||
|
||||
- (UILabel *)promptsSequencignation{
|
||||
if (!_promptsSequencignation) {
|
||||
_promptsSequencignation = [[UILabel alloc] init];
|
||||
_promptsSequencignation.text = [NSString stringWithFormat:@"如果您的手机号已丢失\n请咨询客服,ID:%@", @"88001"];
|
||||
_promptsSequencignation.textColor = [DJDKMIMOMColor essayTertiusPrettify];
|
||||
_promptsSequencignation.font = [UIFont systemFontOfSize:14.f];
|
||||
_promptsSequencignation.adjustsFontSizeToFitWidth = YES;
|
||||
_promptsSequencignation.numberOfLines = 0;
|
||||
_promptsSequencignation.hidden = YES;
|
||||
}
|
||||
return _promptsSequencignation;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user