更换项目
This commit is contained in:
@@ -10,10 +10,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api (Login)
|
||||
|
||||
+ (void)mobileFlexibleSurmount:(HttpRequestHelperCompletion)completion
|
||||
+ (void)phoneQuickLogin:(HttpRequestHelperCompletion)completion
|
||||
accessToken:(NSString *)accessToken
|
||||
token:(NSString *)token;
|
||||
+ (void)surmountAboutCryptogram:(HttpRequestHelperCompletion)completion
|
||||
/// 手机验证码登录
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
+ (void)loginWithCode:(HttpRequestHelperCompletion)completion
|
||||
phone:(NSString *)phone
|
||||
code:(NSString *)code
|
||||
client_secret:(NSString *)client_secret
|
||||
@@ -22,7 +26,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
grant_type:(NSString *)grant_type
|
||||
phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
+ (void)surmountAboutCiphercryptogram:(HttpRequestHelperCompletion)completion
|
||||
/// 手机密码登录
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param password 验证码
|
||||
+ (void)loginWithPassword:(HttpRequestHelperCompletion)completion
|
||||
phone:(NSString *)phone
|
||||
password:(NSString *)password
|
||||
client_secret:(NSString *)client_secret
|
||||
@@ -30,25 +38,43 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
client_id:(NSString *)client_id
|
||||
grant_type:(NSString *)grant_type;
|
||||
|
||||
+ (void)replacementCiphercryptogramAboutMobile:(HttpRequestHelperCompletion)complction
|
||||
/// 充值密码 没有登录的时候
|
||||
/// @param complction 完成
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param smsCode 验证码
|
||||
+ (void)resetPasswordWithPhone:(HttpRequestHelperCompletion)complction
|
||||
phone:(NSString *)phone
|
||||
newPwd:(NSString *)newPwd
|
||||
smsCode:(NSString *)smsCode;
|
||||
|
||||
+ (void)surmountAboutTertiusPart:(HttpRequestHelperCompletion)complction
|
||||
/// 第三方登录
|
||||
/// @param complction 完成
|
||||
/// @param openid 唯一标识符
|
||||
/// @param unionid unionid
|
||||
/// @param access_token access_token
|
||||
/// @param type 第三方登录的类型
|
||||
+ (void)loginWithThirdPart:(HttpRequestHelperCompletion)complction
|
||||
openid:(NSString *)openid
|
||||
unionid:(NSString *)unionid
|
||||
access_token:(NSString *)access_token
|
||||
type:(NSString *)type;
|
||||
|
||||
+ (void)arbitraryMonicer:(HttpRequestHelperCompletion)completion;
|
||||
/// 随机获取一个昵称
|
||||
/// @param completion 完成
|
||||
+ (void)randomNick:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
+ (void)dilemmaAplictowardsionartowardsusCryptogram:(HttpRequestHelperCompletion)complection
|
||||
/// 绑定手机号码
|
||||
/// @param complection 完成
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
/// @param ticket ticket
|
||||
+ (void)bindMoblieCode:(HttpRequestHelperCompletion)complection
|
||||
phone:(NSString *)phone
|
||||
code:(NSString *)code
|
||||
ticket:(NSString *)ticket;
|
||||
|
||||
+(void)acquireMobileAreaCryptogramSttowardsement:(HttpRequestHelperCompletion)complection;
|
||||
+(void)getPhoneAreaCodeList:(HttpRequestHelperCompletion)complection;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -9,48 +9,74 @@
|
||||
#import <Base64/MF_Base64Additions.h>
|
||||
@implementation Api (Login)
|
||||
|
||||
+ (void)mobileFlexibleSurmount:(HttpRequestHelperCompletion)completion accessToken:(NSString *)accessToken token:(NSString *)token {
|
||||
NSString * fang = [NSString stringFromBase64String:@"YWNjL29uZWNsaWNrL2xvZ2lu"];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, token, nil];
|
||||
+ (void)phoneQuickLogin:(HttpRequestHelperCompletion)completion accessToken:(NSString *)accessToken token:(NSString *)token {
|
||||
NSString * fang = [NSString stringFromBase64String:@"YWNjL29uZWNsaWNrL2xvZ2lu"];///acc/oneclick/login
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, token, nil];
|
||||
}
|
||||
|
||||
+ (void)surmountAboutCryptogram:(HttpRequestHelperCompletion)completion phone:(NSString *)phone code:(NSString *)code client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdG9rZW4="];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,code,client_secret,version, client_id, grant_type,phoneAreaCode, nil];
|
||||
/// 手机验证码登录
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
+ (void)loginWithCode:(HttpRequestHelperCompletion)completion phone:(NSString *)phone code:(NSString *)code client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdG9rZW4="];///oauth/token
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,code,client_secret,version, client_id, grant_type,phoneAreaCode, nil];
|
||||
}
|
||||
|
||||
+ (void)surmountAboutCiphercryptogram:(HttpRequestHelperCompletion)completion phone:(NSString *)phone password:(NSString *)password client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type {
|
||||
NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdG9rZW4="];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,password,client_secret,version, client_id, grant_type, nil];
|
||||
/// 手机密码登录
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param password 验证码
|
||||
+ (void)loginWithPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone password:(NSString *)password client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type {
|
||||
NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdG9rZW4="];///oauth/token
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,password,client_secret,version, client_id, grant_type, nil];
|
||||
}
|
||||
|
||||
+ (void)replacementCiphercryptogramAboutMobile:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
NSString * fang = [NSString stringFromBase64String:@"YWNjL3B3ZC9yZXNldA=="];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, smsCode, nil];
|
||||
/// 充值密码 没有登录的时候
|
||||
/// @param completion 完成
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param smsCode 验证码
|
||||
+ (void)resetPasswordWithPhone:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
NSString * fang = [NSString stringFromBase64String:@"YWNjL3B3ZC9yZXNldA=="];/// acc/pwd/reset
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, smsCode, nil];
|
||||
}
|
||||
|
||||
|
||||
+ (void)surmountAboutTertiusPart:(HttpRequestHelperCompletion)completion openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type {
|
||||
NSString * fang = [NSString stringFromBase64String:@"YWNjL3RoaXJkL2xvZ2lu"];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil];
|
||||
/// 第三方登录
|
||||
/// @param completion 完成
|
||||
/// @param openid 唯一标识符
|
||||
/// @param unionid unionid
|
||||
/// @param access_token access_token
|
||||
/// @param type 第三方登录的类型
|
||||
+ (void)loginWithThirdPart:(HttpRequestHelperCompletion)completion openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type {
|
||||
NSString * fang = [NSString stringFromBase64String:@"YWNjL3RoaXJkL2xvZ2lu"];///acc/third/login
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil];
|
||||
}
|
||||
|
||||
+ (void)arbitraryMonicer:(HttpRequestHelperCompletion)completion {
|
||||
NSString * fang = [NSString stringFromBase64String:@"cmFuZG9tL25pY2svZ2V0"];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil];
|
||||
/// 随机获取一个昵称
|
||||
/// @param completion 完成
|
||||
+ (void)randomNick:(HttpRequestHelperCompletion)completion {
|
||||
NSString * fang = [NSString stringFromBase64String:@"cmFuZG9tL25pY2svZ2V0"];///random/nick/get
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
+ (void)dilemmaAplictowardsionartowardsusCryptogram:(HttpRequestHelperCompletion)complection
|
||||
/// 绑定手机号码
|
||||
/// @param complection 完成
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
/// @param ticket ticket
|
||||
+ (void)bindMoblieCode:(HttpRequestHelperCompletion)complection
|
||||
phone:(NSString *)phone
|
||||
code:(NSString *)code
|
||||
ticket:(NSString *)ticket {
|
||||
NSString * fang = [NSString stringFromBase64String:@"d2l0aERyYXcvcGhvbmU="];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, phone, code, ticket, nil];
|
||||
NSString * fang = [NSString stringFromBase64String:@"d2l0aERyYXcvcGhvbmU="];///withDraw/phone
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, phone, code, ticket, nil];
|
||||
}
|
||||
|
||||
+(void)acquireMobileAreaCryptogramSttowardsement:(HttpRequestHelperCompletion)complection{
|
||||
NSString * fang = [NSString stringFromBase64String:@"YXJlYUluZm8vbGlzdA=="];
|
||||
[self manufactureDemand:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,nil];
|
||||
+(void)getPhoneAreaCodeList:(HttpRequestHelperCompletion)complection{
|
||||
NSString * fang = [NSString stringFromBase64String:@"YXJlYUluZm8vbGlzdA=="];///areaInfo/list
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
25
YuMi/Modules/YMLogin/Model/LoginAreaModel.h
Normal file
25
YuMi/Modules/YMLogin/Model/LoginAreaModel.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// LoginAreaModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginAreaModel : NSObject
|
||||
@property (nonatomic,copy) NSString *codeId;
|
||||
@property (nonatomic,copy) NSString *name;
|
||||
@property (nonatomic,copy) NSString *abbr;
|
||||
@property (nonatomic,copy) NSString *phone_area_code;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
@property (nonatomic,copy) NSString *seq;
|
||||
@property (nonatomic,copy) NSString *status;
|
||||
@property (nonatomic,copy) NSString *region;
|
||||
@property (nonatomic,copy) NSString *create_time;
|
||||
@property (nonatomic,copy) NSString *update_time;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
YuMi/Modules/YMLogin/Model/LoginAreaModel.m
Normal file
12
YuMi/Modules/YMLogin/Model/LoginAreaModel.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// LoginAreaModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "LoginAreaModel.h"
|
||||
|
||||
@implementation LoginAreaModel
|
||||
|
||||
@end
|
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// SurmountAreaMatrix.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountAreaMatrix : NSObject
|
||||
@property (nonatomic,copy) NSString *codeId;
|
||||
@property (nonatomic,copy) NSString *name;
|
||||
@property (nonatomic,copy) NSString *abbr;
|
||||
@property (nonatomic,copy) NSString *phone_area_code;
|
||||
@property (nonatomic,copy) NSString *phoneAreaCode;
|
||||
@property (nonatomic,copy) NSString *seq;
|
||||
@property (nonatomic,copy) NSString *status;
|
||||
@property (nonatomic,copy) NSString *region;
|
||||
@property (nonatomic,copy) NSString *create_time;
|
||||
@property (nonatomic,copy) NSString *update_time;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// SurmountAreaMatrix.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "SurmountAreaMatrix.h"
|
||||
|
||||
@implementation SurmountAreaMatrix
|
||||
|
||||
@end
|
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// ThirdConsumerAbstract.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/13.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ThirdConsumerAbstract : NSObject
|
||||
@property (nonatomic,copy) NSString *userName;
|
||||
@property (nonatomic,copy) NSString *avatarUrl;
|
||||
@property (nonatomic,copy) NSString * openid;
|
||||
|
||||
@property (nonatomic,copy) NSString * access_token;
|
||||
|
||||
@property (nonatomic,copy) NSString * unionid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// ThirdConsumerAbstract.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/13.
|
||||
//保存第三方请求的 用户信息
|
||||
|
||||
#import "ThirdConsumerAbstract.h"
|
||||
|
||||
@implementation ThirdConsumerAbstract
|
||||
|
||||
@end
|
24
YuMi/Modules/YMLogin/Model/ThirdUserInfo.h
Normal file
24
YuMi/Modules/YMLogin/Model/ThirdUserInfo.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// ThirdUserInfo.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/13.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ThirdUserInfo : NSObject
|
||||
///用户名
|
||||
@property (nonatomic,copy) NSString *userName;
|
||||
///头像的地址
|
||||
@property (nonatomic,copy) NSString *avatarUrl;
|
||||
@property (nonatomic,copy) NSString * openid;
|
||||
|
||||
@property (nonatomic,copy) NSString * access_token;
|
||||
|
||||
@property (nonatomic,copy) NSString * unionid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
YuMi/Modules/YMLogin/Model/ThirdUserInfo.m
Normal file
12
YuMi/Modules/YMLogin/Model/ThirdUserInfo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// ThirdUserInfo.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/13.
|
||||
//保存第三方请求的 用户信息
|
||||
|
||||
#import "ThirdUserInfo.h"
|
||||
|
||||
@implementation ThirdUserInfo
|
||||
|
||||
@end
|
16
YuMi/Modules/YMLogin/Presenter/LoginBindPhonePresent.h
Normal file
16
YuMi/Modules/YMLogin/Presenter/LoginBindPhonePresent.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// LoginBindPhonePresent.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/15.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginBindPhonePresent : BaseMvpPresenter
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
YuMi/Modules/YMLogin/Presenter/LoginBindPhonePresent.m
Normal file
17
YuMi/Modules/YMLogin/Presenter/LoginBindPhonePresent.m
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// LoginBindPhonePresent.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/15.
|
||||
//
|
||||
|
||||
#import "LoginBindPhonePresent.h"
|
||||
#import "BaseMvpProtocol.h"
|
||||
|
||||
@implementation LoginBindPhonePresent
|
||||
|
||||
- (id<BaseMvpProtocol>)getView {
|
||||
return ((id<BaseMvpProtocol>) [super getView]);
|
||||
}
|
||||
|
||||
@end
|
25
YuMi/Modules/YMLogin/Presenter/LoginForgetPasswordPresent.h
Normal file
25
YuMi/Modules/YMLogin/Presenter/LoginForgetPasswordPresent.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// LoginForgetPasswordPresent.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "YUMINNNN.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginForgetPasswordPresent : BaseMvpPresenter
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
/// 没有登录的时候 重置密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param smsCode 验证码
|
||||
- (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
49
YuMi/Modules/YMLogin/Presenter/LoginForgetPasswordPresent.m
Normal file
49
YuMi/Modules/YMLogin/Presenter/LoginForgetPasswordPresent.m
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// LoginForgetPasswordPresent.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
|
||||
#import "LoginForgetPasswordPresent.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
///Api
|
||||
#import "Api+Login.h"
|
||||
///Presenter
|
||||
#import "LoginForgetPasswordPresent.h"
|
||||
///Protocol
|
||||
#import "LoginForgetPasswordProtocol.h"
|
||||
|
||||
@implementation LoginForgetPasswordPresent
|
||||
|
||||
- (id<LoginForgetPasswordProtocol>)getView {
|
||||
return ((id<LoginForgetPasswordProtocol>) [super getView]);
|
||||
}
|
||||
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
|
||||
[[self getView] phoneSmsCodeSuccess];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
|
||||
/// 没有登录的时候 重置密码
|
||||
/// @param phone 手机号
|
||||
/// @param newPwd 新的密码
|
||||
/// @param smsCode 验证码
|
||||
- (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] resetPasswrodSuccess];
|
||||
} showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode];
|
||||
}
|
||||
|
||||
@end
|
38
YuMi/Modules/YMLogin/Presenter/LoginFullInfoPresenter.h
Normal file
38
YuMi/Modules/YMLogin/Presenter/LoginFullInfoPresenter.h
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// LoginFullInfoPresenter.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class ThirdUserInfo;
|
||||
@interface LoginFullInfoPresenter : BaseMvpPresenter
|
||||
|
||||
/// 获取保存的第三方的数据模型
|
||||
- (ThirdUserInfo *)getThirdUserInfo;
|
||||
|
||||
/// 随机获取昵称
|
||||
- (void)randomRequestNick;
|
||||
|
||||
/// 补全资料
|
||||
/// @param avatar 头像
|
||||
/// @param gender 性别
|
||||
/// @param nick 昵称
|
||||
/// @param inviteCode 邀请码
|
||||
/// @param roomUid 邀请的那个房间的uid
|
||||
/// @param shareUid 邀请人的uid
|
||||
/// @param shareChannel 邀请的渠道
|
||||
- (void)complectionInfoWithAvatar:(NSString *)avatar
|
||||
gender:(NSString *)gender
|
||||
nick:(NSString *)nick
|
||||
inviteCode:(NSString * __nullable)inviteCode
|
||||
roomUid:(NSString * __nullable)roomUid
|
||||
shareUid:(NSString * __nullable)shareUid
|
||||
shareChannel:(NSString * __nullable)shareChannel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
84
YuMi/Modules/YMLogin/Presenter/LoginFullInfoPresenter.m
Normal file
84
YuMi/Modules/YMLogin/Presenter/LoginFullInfoPresenter.m
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// LoginFullInfoPresenter.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "LoginFullInfoPresenter.h"
|
||||
///Api
|
||||
#import "Api+Login.h"
|
||||
#import "LoginFullInfoProtocol.h"
|
||||
#import "NSMutableDictionary+Saft.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
///Model
|
||||
#import "ThirdUserInfo.h"
|
||||
|
||||
@implementation LoginFullInfoPresenter
|
||||
|
||||
- (id<LoginFullInfoProtocol>)getView {
|
||||
return ((id<LoginFullInfoProtocol>) [super getView]);
|
||||
}
|
||||
|
||||
|
||||
/// 获取保存的第三方的数据模型
|
||||
- (ThirdUserInfo *)getThirdUserInfo {
|
||||
if ([AccountInfoStorage instance].thirdUserInfo) {
|
||||
return [AccountInfoStorage instance].thirdUserInfo;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
/// 随机获取昵称
|
||||
- (void)randomRequestNick {
|
||||
[Api randomNick:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] requestRandomNickSuccess:data.data];
|
||||
}]];
|
||||
}
|
||||
|
||||
|
||||
/// 补全资料
|
||||
/// @param avatar 头像
|
||||
/// @param gender 性别
|
||||
/// @param nick 昵称
|
||||
/// @param inviteCode 邀请码
|
||||
/// @param roomUid 邀请的那个房间的uid
|
||||
/// @param shareUid 邀请人的uid
|
||||
/// @param shareChannel 邀请的渠道
|
||||
- (void)complectionInfoWithAvatar:(NSString *)avatar
|
||||
gender:(NSString *)gender
|
||||
nick:(NSString *)nick
|
||||
inviteCode:(NSString * __nullable)inviteCode
|
||||
roomUid:(NSString * __nullable)roomUid
|
||||
shareUid:(NSString * __nullable)shareUid
|
||||
shareChannel:(NSString * __nullable)shareChannel {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
||||
[params safeSetObject:avatar forKey:@"avatar"];
|
||||
[params safeSetObject:gender forKey:@"gender"];
|
||||
[params safeSetObject:nick forKey:@"nick"];
|
||||
[params safeSetObject:uid forKey:@"uid"];
|
||||
[params safeSetObject:ticket forKey:@"ticket"];
|
||||
if (inviteCode.length > 0) {
|
||||
[params safeSetObject:inviteCode forKey:@"inviteCode"];
|
||||
}
|
||||
|
||||
if (roomUid.length > 0) {
|
||||
[params safeSetObject:roomUid forKey:@"roomUid"];
|
||||
}
|
||||
|
||||
if (shareUid.length > 0) {
|
||||
[params safeSetObject:shareUid forKey:@"shareUid"];
|
||||
}
|
||||
|
||||
if (shareChannel.length > 0) {
|
||||
[params safeSetObject:shareChannel forKey:@"shareChannel"];
|
||||
}
|
||||
[Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] complementInfoSuccess];
|
||||
}] userInfo:params];
|
||||
}
|
||||
|
||||
@end
|
19
YuMi/Modules/YMLogin/Presenter/LoginPasswordPresent.h
Normal file
19
YuMi/Modules/YMLogin/Presenter/LoginPasswordPresent.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// LoginPasswordPresent.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginPasswordPresent : BaseMvpPresenter
|
||||
/// 使用手机号和密码登录
|
||||
/// @param phone 手机号
|
||||
/// @param password 验证码
|
||||
- (void)loginWithPhone:(NSString *)phone password:(NSString *)password;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
42
YuMi/Modules/YMLogin/Presenter/LoginPasswordPresent.m
Normal file
42
YuMi/Modules/YMLogin/Presenter/LoginPasswordPresent.m
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// LoginPasswordPresent.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "LoginPasswordPresent.h"
|
||||
///Http
|
||||
#import "Api+Login.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
///Model
|
||||
#import "AccountModel.h"
|
||||
///Protocol
|
||||
#import "LoginPasswordProtocol.h"
|
||||
|
||||
|
||||
@implementation LoginPasswordPresent
|
||||
|
||||
- (id<LoginPasswordProtocol>)getView {
|
||||
return ((id<LoginPasswordProtocol>) [super getView]);
|
||||
}
|
||||
|
||||
/// 使用手机号和密码登录
|
||||
/// @param phone 手机号
|
||||
/// @param password 验证码
|
||||
- (void)loginWithPhone:(NSString *)phone password:(NSString *)password {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api loginWithPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
AccountModel * accountModel = [AccountModel modelWithDictionary:data.data];
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
||||
}
|
||||
[[self getView] phoneAndPasswordLoginSuccess];
|
||||
} showLoading:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
}
|
||||
|
||||
@end
|
28
YuMi/Modules/YMLogin/Presenter/LoginPresenter.h
Normal file
28
YuMi/Modules/YMLogin/Presenter/LoginPresenter.h
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// LoginPresenter.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/1.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "YUMINNNN.h"
|
||||
#import <GoogleSignIn/GoogleSignIn.h>
|
||||
#import <GoogleSignIn/GIDGoogleUser.h>
|
||||
#import <GoogleSignIn/GIDAuthentication.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginPresenter : BaseMvpPresenter
|
||||
|
||||
- (void)phoneQuickLogin:(NSString *)accessToken token:(NSString*) token;
|
||||
|
||||
|
||||
/// 第三方登录
|
||||
/// @param type 登录的类型
|
||||
- (void)thirdLoginWithType:(ThirdLoginType)type;
|
||||
|
||||
///第三方登录,谷歌登录
|
||||
-(void)thirdLoginByGoogleWithPresentingViewController:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
175
YuMi/Modules/YMLogin/Presenter/LoginPresenter.m
Normal file
175
YuMi/Modules/YMLogin/Presenter/LoginPresenter.m
Normal file
@@ -0,0 +1,175 @@
|
||||
//
|
||||
// LoginPresenter.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/1.
|
||||
//
|
||||
|
||||
#import "LoginPresenter.h"
|
||||
///Third
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import <ShareSDK/ShareSDK.h>
|
||||
///APi
|
||||
#import "Api+Login.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "XNDJTDDLoadingTool.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
///P
|
||||
#import "LoginProtocol.h"
|
||||
///Model
|
||||
#import "ThirdUserInfo.h"
|
||||
#import "AccountModel.h"
|
||||
|
||||
|
||||
|
||||
@implementation LoginPresenter
|
||||
|
||||
- (id<LoginProtocol>)getView {
|
||||
return ((id<LoginProtocol>) [super getView]);
|
||||
}
|
||||
|
||||
- (void)phoneQuickLogin:(NSString *)accessToken token:(NSString *)token {
|
||||
[Api phoneQuickLogin:[self createHttpCompletion:^(BaseModel *data) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:[AccountModel modelWithDictionary:data.data]];
|
||||
[[self getView] loginSuccess];
|
||||
} showLoading:YES] accessToken:accessToken token:token];
|
||||
}
|
||||
|
||||
|
||||
/// 第三方登录
|
||||
/// @param type 登录的类型
|
||||
- (void)thirdLoginWithType:(ThirdLoginType)type{
|
||||
|
||||
SSDKPlatformType platformType;
|
||||
switch (type) {
|
||||
case ThirdLoginType_FB:
|
||||
platformType = SSDKPlatformTypeFacebook;
|
||||
break;
|
||||
case ThirdLoginType_Line:
|
||||
platformType = SSDKPlatformTypeLine;
|
||||
break;
|
||||
case ThirdLoginType_Apple:
|
||||
platformType = SSDKPlatformTypeAppleAccount;
|
||||
break;
|
||||
case ThirdLoginType_Gmail:
|
||||
platformType = SSDKPlatformTypeGooglePlus;
|
||||
break;
|
||||
default:
|
||||
platformType = SSDKPlatformTypeAppleAccount;
|
||||
break;
|
||||
}
|
||||
NSDictionary * settings;
|
||||
if (type == SSDKPlatformTypeFacebook) {
|
||||
settings = @{@"isBrowser":@(YES)};
|
||||
}
|
||||
|
||||
[ShareSDK cancelAuthorize:platformType result:nil];
|
||||
[ShareSDK authorize:platformType settings:settings onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error) {
|
||||
if (state == SSDKResponseStateSuccess) {///成功
|
||||
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
|
||||
NSString * openid = @"";
|
||||
NSString * access_token = user.credential.token.length > 0 ? user.credential.token : @"";
|
||||
NSString * unionid = @"";
|
||||
if (platformType == SSDKPlatformTypeLine) {
|
||||
openid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;
|
||||
unionid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;
|
||||
userInfo.userName = user.nickname;
|
||||
userInfo.avatarUrl = user.icon;
|
||||
} else if (platformType == SSDKPlatformTypeFacebook) { //微信登录
|
||||
openid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;;
|
||||
unionid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;;
|
||||
userInfo.userName = user.nickname;
|
||||
userInfo.avatarUrl = user.icon;
|
||||
} else if (platformType == SSDKPlatformTypeAppleAccount) { //苹果登录
|
||||
// openid = user.credential.token;
|
||||
unionid = [user.credential rawData][@"user"];
|
||||
NSString * familyName = [user.credential rawData][@"fullName"][@"familyName"];
|
||||
NSString * givenName = [user.credential rawData][@"fullName"][@"givenName"];
|
||||
if (familyName.length > 0 && givenName.length> 0) {
|
||||
userInfo.userName = [NSString stringWithFormat:@"%@%@", familyName, givenName];
|
||||
}
|
||||
}
|
||||
if (unionid == nil) {
|
||||
unionid = @"";
|
||||
}
|
||||
openid = unionid;
|
||||
userInfo.openid = openid;
|
||||
userInfo.access_token = access_token;
|
||||
userInfo.unionid = unionid;
|
||||
///保存一下第三方的值
|
||||
[AccountInfoStorage instance].thirdUserInfo = userInfo;
|
||||
[self loginWithThirdPartWithType:type];
|
||||
} else if(state == SSDKResponseStateCancel) {///取消
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
|
||||
} else if (state == SSDKResponseStateFail) {///失败
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)loginWithThirdPartWithType:(ThirdLoginType)type{
|
||||
NSString * openid = [AccountInfoStorage instance].thirdUserInfo.openid;
|
||||
NSString * access_token = [AccountInfoStorage instance].thirdUserInfo.access_token;
|
||||
NSString * unionid = [AccountInfoStorage instance].thirdUserInfo.unionid;
|
||||
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
AccountModel * model = [AccountModel modelWithDictionary:data.data];
|
||||
if (model != nil) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||
[[self getView] loginSuccess];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
} showLoading:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)thirdLoginByGoogleWithPresentingViewController:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration{
|
||||
|
||||
[GIDSignIn.sharedInstance signInWithConfiguration:configuration
|
||||
presentingViewController:presentingViewController
|
||||
callback:^(GIDGoogleUser * _Nullable user,
|
||||
NSError * _Nullable error) {
|
||||
if (error != nil) {
|
||||
if (error.code == kGIDSignInErrorCodeCanceled){
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
}else{
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
}
|
||||
} else {
|
||||
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
|
||||
NSString * openid = user.userID;
|
||||
NSString * access_token = user.authentication.idToken.length > 0 ? user.authentication.idToken : @"";
|
||||
NSString * unionid = user.userID;
|
||||
userInfo.userName = user.profile.name;
|
||||
userInfo.avatarUrl = [[user.profile imageURLWithDimension:60] absoluteString];
|
||||
userInfo.openid = openid;
|
||||
userInfo.access_token = access_token;
|
||||
userInfo.unionid = unionid;
|
||||
///保存一下第三方的值
|
||||
[AccountInfoStorage instance].thirdUserInfo = userInfo;
|
||||
[self loginWithThirdGoogle];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)loginWithThirdGoogle{
|
||||
NSString * openid = [AccountInfoStorage instance].thirdUserInfo.openid;
|
||||
NSString * access_token = [AccountInfoStorage instance].thirdUserInfo.access_token;
|
||||
NSString * unionid = [AccountInfoStorage instance].thirdUserInfo.unionid;
|
||||
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
AccountModel * model = [AccountModel modelWithDictionary:data.data];
|
||||
if (model != nil) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||
[[self getView] loginSuccess];
|
||||
}
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[super getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
} showLoading:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)ThirdLoginType_Gmail]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
31
YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.h
Normal file
31
YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// LoginVerifCodePresent.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "YUMINNNN.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginVerifCodePresent : BaseMvpPresenter
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
/// 使用手机号和验证码登录
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
- (void)loginWithPhone:(NSString *)phone code:(NSString *)code phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
/// 绑定手机号
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
- (void)bindWithPhone:(NSString *)phone code:(NSString *)code;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
66
YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.m
Normal file
66
YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.m
Normal file
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// LoginVerifCodePresent.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "LoginVerifCodePresent.h"
|
||||
///第三方
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
///Api
|
||||
#import "Api+Login.h"
|
||||
///Presenter
|
||||
#import "LoginVerifCodePresent.h"
|
||||
///Protocol
|
||||
#import "LoginVerifCodeProtocol.h"
|
||||
///Model
|
||||
#import "AccountModel.h"
|
||||
|
||||
@implementation LoginVerifCodePresent
|
||||
|
||||
- (id<LoginVerifCodeProtocol>)getView {
|
||||
return ((id<LoginVerifCodeProtocol>) [super getView]);
|
||||
}
|
||||
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode {
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) {
|
||||
[[self getView] phoneSmsCodeSuccess];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
/// 使用手机号和验证码登录
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
- (void)loginWithPhone:(NSString *)phone code:(NSString *)code phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api loginWithCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
AccountModel * accountModel = [AccountModel modelWithDictionary:data.data];
|
||||
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
||||
}
|
||||
[[self getView] loginSuccess];
|
||||
} showLoading:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password" phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
/// 绑定手机号
|
||||
/// @param phone 手机号
|
||||
/// @param code 验证码
|
||||
- (void)bindWithPhone:(NSString *)phone code:(NSString *)code {
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api bindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] bindPhoneSuccess];
|
||||
} showLoading:YES] phone:desPhone code:code ticket:ticket];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// SurmountCiphercodeExternalize.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpExternalizer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountCiphercodeExternalize : BaseMvpExternalizer
|
||||
- (void)surmountAboutMobile:(NSString *)phone password:(NSString *)password;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,35 +0,0 @@
|
||||
//
|
||||
// SurmountCiphercodeExternalize.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "SurmountCiphercodeExternalize.h"
|
||||
#import "Api+Login.h"
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "AccountMatrix.h"
|
||||
#import "SurmountCiphercodeCeremony.h"
|
||||
|
||||
|
||||
@implementation SurmountCiphercodeExternalize
|
||||
|
||||
- (id<SurmountCiphercodeCeremony>)acquireRegard {
|
||||
return ((id<SurmountCiphercodeCeremony>) [super acquireRegard]);
|
||||
}
|
||||
|
||||
- (void)surmountAboutMobile:(NSString *)phone password:(NSString *)password {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api surmountAboutCiphercryptogram:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
AccountMatrix * accountModel = [AccountMatrix mtowardsrixAboutImpactbasket:data.data];
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[AccountAbstractStorage instance] preserveSequenceriptionAbstract:accountModel];
|
||||
}
|
||||
[[self acquireRegard] mobileGrantedCiphercryptogramSurmountAccomplishment];
|
||||
} EvidenceChambering:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// SurmountDilemmaMobileExternalize.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/15.
|
||||
//
|
||||
|
||||
#import "BaseMvpExternalizer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountDilemmaMobileExternalize : BaseMvpExternalizer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// SurmountDilemmaMobileExternalize.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/15.
|
||||
//
|
||||
|
||||
#import "SurmountDilemmaMobileExternalize.h"
|
||||
#import "BaseMvpCeremony.h"
|
||||
|
||||
@implementation SurmountDilemmaMobileExternalize
|
||||
|
||||
- (id<BaseMvpCeremony>)acquireRegard {
|
||||
return ((id<BaseMvpCeremony>) [super acquireRegard]);
|
||||
}
|
||||
|
||||
@end
|
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// SurmountExternalizer.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/1.
|
||||
//
|
||||
|
||||
#import "BaseMvpExternalizer.h"
|
||||
#import "YUMINNNN.h"
|
||||
#import <GoogleSignIn/GoogleSignIn.h>
|
||||
#import <GoogleSignIn/GIDGoogleUser.h>
|
||||
#import <GoogleSignIn/GIDAuthentication.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountExternalizer : BaseMvpExternalizer
|
||||
|
||||
- (void)mobileFlexibleSurmount:(NSString *)accessToken token:(NSString*) token;
|
||||
|
||||
|
||||
- (void)tertiusSurmountAboutGenre:(ThirdLoginGenre)type;
|
||||
|
||||
-(void)tertiusSurmountByGoogleAboutPresentingRegardGovernancer:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,168 +0,0 @@
|
||||
//
|
||||
// SurmountExternalizer.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/1.
|
||||
//
|
||||
|
||||
#import "SurmountExternalizer.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import <ShareSDK/ShareSDK.h>
|
||||
#import "Api+Login.h"
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "XNDJTBWGLoadingTool.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "SurmountCeremony.h"
|
||||
#import "ThirdConsumerAbstract.h"
|
||||
#import "AccountMatrix.h"
|
||||
|
||||
|
||||
|
||||
@implementation SurmountExternalizer
|
||||
|
||||
- (id<SurmountCeremony>)acquireRegard {
|
||||
return ((id<SurmountCeremony>) [super acquireRegard]);
|
||||
}
|
||||
|
||||
- (void)mobileFlexibleSurmount:(NSString *)accessToken token:(NSString *)token {
|
||||
[Api mobileFlexibleSurmount:[self produceHyperessayImplementtowardsion:^(BaseMatrix *data) {
|
||||
[[AccountAbstractStorage instance] preserveSequenceriptionAbstract:[AccountMatrix mtowardsrixAboutImpactbasket:data.data]];
|
||||
[[self acquireRegard] surmountAccomplishment];
|
||||
} EvidenceChambering:YES] accessToken:accessToken token:token];
|
||||
}
|
||||
|
||||
|
||||
- (void)tertiusSurmountAboutGenre:(ThirdLoginGenre)type{
|
||||
|
||||
SSDKPlatformType platformType;
|
||||
switch (type) {
|
||||
case ThirdLoginGenre_FB:
|
||||
platformType = SSDKPlatformTypeFacebook;
|
||||
break;
|
||||
case ThirdLoginGenre_Line:
|
||||
platformType = SSDKPlatformTypeLine;
|
||||
break;
|
||||
case ThirdLoginGenre_Apple:
|
||||
platformType = SSDKPlatformTypeAppleAccount;
|
||||
break;
|
||||
case ThirdLoginGenre_Gmail:
|
||||
platformType = SSDKPlatformTypeGooglePlus;
|
||||
break;
|
||||
default:
|
||||
platformType = SSDKPlatformTypeAppleAccount;
|
||||
break;
|
||||
}
|
||||
NSDictionary * settings;
|
||||
if (type == SSDKPlatformTypeFacebook) {
|
||||
settings = @{@"isBrowser":@(YES)};
|
||||
}
|
||||
|
||||
[ShareSDK cancelAuthorize:platformType result:nil];
|
||||
[ShareSDK authorize:platformType settings:settings onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error) {
|
||||
if (state == SSDKResponseStateSuccess) {
|
||||
ThirdConsumerAbstract * userInfo = [[ThirdConsumerAbstract alloc] init];
|
||||
NSString * openid = @"";
|
||||
NSString * access_token = user.credential.token.length > 0 ? user.credential.token : @"";
|
||||
NSString * unionid = @"";
|
||||
if (platformType == SSDKPlatformTypeLine) {
|
||||
openid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;
|
||||
unionid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;
|
||||
userInfo.userName = user.nickname;
|
||||
userInfo.avatarUrl = user.icon;
|
||||
} else if (platformType == SSDKPlatformTypeFacebook) {
|
||||
openid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;;
|
||||
unionid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;;
|
||||
userInfo.userName = user.nickname;
|
||||
userInfo.avatarUrl = user.icon;
|
||||
} else if (platformType == SSDKPlatformTypeAppleAccount) {
|
||||
|
||||
unionid = [user.credential rawData][@"user"];
|
||||
NSString * familyName = [user.credential rawData][@"fullName"][@"familyName"];
|
||||
NSString * givenName = [user.credential rawData][@"fullName"][@"givenName"];
|
||||
if (familyName.length > 0 && givenName.length> 0) {
|
||||
userInfo.userName = [NSString stringWithFormat:@"%@%@", familyName, givenName];
|
||||
}
|
||||
}
|
||||
if (unionid == nil) {
|
||||
unionid = @"";
|
||||
}
|
||||
openid = unionid;
|
||||
userInfo.openid = openid;
|
||||
userInfo.access_token = access_token;
|
||||
userInfo.unionid = unionid;
|
||||
|
||||
[AccountAbstractStorage instance].thirdUserInfo = userInfo;
|
||||
[self surmountAboutTertiusPartAboutGenre:type];
|
||||
} else if(state == SSDKResponseStateCancel) {
|
||||
[[self acquireRegard] EvidenceMistakeToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
|
||||
} else if (state == SSDKResponseStateFail) {
|
||||
[[self acquireRegard] EvidenceMistakeToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)surmountAboutTertiusPartAboutGenre:(ThirdLoginGenre)type{
|
||||
NSString * openid = [AccountAbstractStorage instance].thirdUserInfo.openid;
|
||||
NSString * access_token = [AccountAbstractStorage instance].thirdUserInfo.access_token;
|
||||
NSString * unionid = [AccountAbstractStorage instance].thirdUserInfo.unionid;
|
||||
[Api surmountAboutTertiusPart:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
AccountMatrix * model = [AccountMatrix mtowardsrixAboutImpactbasket:data.data];
|
||||
if (model != nil) {
|
||||
[[AccountAbstractStorage instance] preserveSequenceriptionAbstract:model];
|
||||
[[self acquireRegard] surmountAccomplishment];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self acquireRegard] EvidenceMistakeToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
} EvidenceChambering:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)tertiusSurmountByGoogleAboutPresentingRegardGovernancer:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration{
|
||||
|
||||
[GIDSignIn.sharedInstance signInWithConfiguration:configuration
|
||||
presentingViewController:presentingViewController
|
||||
callback:^(GIDGoogleUser * _Nullable user,
|
||||
NSError * _Nullable error) {
|
||||
if (error != nil) {
|
||||
if (error.code == kGIDSignInErrorCodeCanceled){
|
||||
[[self acquireRegard] EvidenceMistakeToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
}else{
|
||||
[[self acquireRegard] EvidenceMistakeToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
}
|
||||
} else {
|
||||
ThirdConsumerAbstract * userInfo = [[ThirdConsumerAbstract alloc] init];
|
||||
NSString * openid = user.userID;
|
||||
NSString * access_token = user.authentication.idToken.length > 0 ? user.authentication.idToken : @"";
|
||||
NSString * unionid = user.userID;
|
||||
userInfo.userName = user.profile.name;
|
||||
userInfo.avatarUrl = [[user.profile imageURLWithDimension:60] absoluteString];
|
||||
userInfo.openid = openid;
|
||||
userInfo.access_token = access_token;
|
||||
userInfo.unionid = unionid;
|
||||
|
||||
[AccountAbstractStorage instance].thirdUserInfo = userInfo;
|
||||
[self surmountAboutTertiusGoogle];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)surmountAboutTertiusGoogle{
|
||||
NSString * openid = [AccountAbstractStorage instance].thirdUserInfo.openid;
|
||||
NSString * access_token = [AccountAbstractStorage instance].thirdUserInfo.access_token;
|
||||
NSString * unionid = [AccountAbstractStorage instance].thirdUserInfo.unionid;
|
||||
[Api surmountAboutTertiusPart:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
AccountMatrix * model = [AccountMatrix mtowardsrixAboutImpactbasket:data.data];
|
||||
if (model != nil) {
|
||||
[[AccountAbstractStorage instance] preserveSequenceriptionAbstract:model];
|
||||
[[self acquireRegard] surmountAccomplishment];
|
||||
}
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[super acquireRegard] EvidenceMistakeToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
} EvidenceChambering:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)ThirdLoginGenre_Gmail]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// SurmountForgetCiphercodeExternalize.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
|
||||
#import "BaseMvpExternalizer.h"
|
||||
#import "YUMINNNN.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountForgetCiphercodeExternalize : BaseMvpExternalizer
|
||||
- (void)mobileSmsCryptogram:(NSString *)phone type:(GetSmsGenre)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
- (void)replacementCiphercryptogram:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// SurmountForgetCiphercodeExternalize.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
|
||||
#import "SurmountForgetCiphercodeExternalize.h"
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "Api+Login.h"
|
||||
#import "SurmountForgetCiphercodeExternalize.h"
|
||||
#import "SurmountForgetCiphercodeCeremony.h"
|
||||
|
||||
@implementation SurmountForgetCiphercodeExternalize
|
||||
|
||||
- (id<SurmountForgetCiphercodeCeremony>)acquireRegard {
|
||||
return ((id<SurmountForgetCiphercodeCeremony>) [super acquireRegard]);
|
||||
}
|
||||
|
||||
- (void)mobileSmsCryptogram:(NSString *)phone type:(GetSmsGenre)type phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api mobileSmsCryptogram:[self produceHyperessayImplementtowardsion:^(id _Nonnull data) {
|
||||
[[self acquireRegard] mobileSmsCryptogramAccomplishment];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
|
||||
- (void)replacementCiphercryptogram:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode {
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api replacementCiphercryptogramAboutMobile:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] replacementPasswrodAccomplishment];
|
||||
} EvidenceChambering:YES] phone:desPhone newPwd:desPassword smsCode:smsCode];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// SurmountFullAbstractExternalizer.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "BaseMvpExternalizer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class ThirdConsumerAbstract;
|
||||
@interface SurmountFullAbstractExternalizer : BaseMvpExternalizer
|
||||
|
||||
- (ThirdConsumerAbstract *)acquireTertiusConsumerAbstract;
|
||||
|
||||
- (void)arbitraryDemandMonicer;
|
||||
|
||||
- (void)complectionAbstractAboutIntelligenceportrait:(NSString *)avatar
|
||||
gender:(NSString *)gender
|
||||
nick:(NSString *)nick
|
||||
centiretyforCryptogram:(NSString * __nullable)centiretyforCryptogram
|
||||
roomUid:(NSString * __nullable)roomUid
|
||||
shareUid:(NSString * __nullable)shareUid
|
||||
shareChannel:(NSString * __nullable)shareChannel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,71 +0,0 @@
|
||||
//
|
||||
// SurmountFullAbstractExternalizer.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "SurmountFullAbstractExternalizer.h"
|
||||
#import "Api+Login.h"
|
||||
#import "SurmountFullAbstractCeremony.h"
|
||||
#import "NSMutableDictionary+Saft.h"
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "ThirdConsumerAbstract.h"
|
||||
|
||||
@implementation SurmountFullAbstractExternalizer
|
||||
|
||||
- (id<SurmountFullAbstractCeremony>)acquireRegard {
|
||||
return ((id<SurmountFullAbstractCeremony>) [super acquireRegard]);
|
||||
}
|
||||
|
||||
|
||||
- (ThirdConsumerAbstract *)acquireTertiusConsumerAbstract {
|
||||
if ([AccountAbstractStorage instance].thirdUserInfo) {
|
||||
return [AccountAbstractStorage instance].thirdUserInfo;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)arbitraryDemandMonicer {
|
||||
[Api arbitraryMonicer:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] requisitionArbitraryMonicerAccomplishment:data.data];
|
||||
}]];
|
||||
}
|
||||
|
||||
|
||||
- (void)complectionAbstractAboutIntelligenceportrait:(NSString *)avatar
|
||||
gender:(NSString *)gender
|
||||
nick:(NSString *)nick
|
||||
centiretyforCryptogram:(NSString * __nullable)centiretyforCryptogram
|
||||
roomUid:(NSString * __nullable)roomUid
|
||||
shareUid:(NSString * __nullable)shareUid
|
||||
shareChannel:(NSString * __nullable)shareChannel {
|
||||
NSString * uid = [[AccountAbstractStorage instance] acquireCid];
|
||||
NSString * ticket = [[AccountAbstractStorage instance] acquireTicket];
|
||||
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
||||
[params secureSetGroal:avatar forKey:@"avatar"];
|
||||
[params secureSetGroal:gender forKey:@"gender"];
|
||||
[params secureSetGroal:nick forKey:@"nick"];
|
||||
[params secureSetGroal:uid forKey:@"uid"];
|
||||
[params secureSetGroal:ticket forKey:@"ticket"];
|
||||
if (centiretyforCryptogram.length > 0) {
|
||||
[params secureSetGroal:centiretyforCryptogram forKey:@"inviteCode"];
|
||||
}
|
||||
|
||||
if (roomUid.length > 0) {
|
||||
[params secureSetGroal:roomUid forKey:@"roomUid"];
|
||||
}
|
||||
|
||||
if (shareUid.length > 0) {
|
||||
[params secureSetGroal:shareUid forKey:@"shareUid"];
|
||||
}
|
||||
|
||||
if (shareChannel.length > 0) {
|
||||
[params secureSetGroal:shareChannel forKey:@"shareChannel"];
|
||||
}
|
||||
[Api accomplishConsumerAbstract:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] complementAbstractAccomplishment];
|
||||
}] userInfo:params];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// SurmountValidationCodeExternalize.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpExternalizer.h"
|
||||
#import "YUMINNNN.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SurmountValidationCodeExternalize : BaseMvpExternalizer
|
||||
- (void)mobileSmsCryptogram:(NSString *)phone type:(GetSmsGenre)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
- (void)surmountAboutMobile:(NSString *)phone code:(NSString *)code phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
- (void)dilemmaAboutMobile:(NSString *)phone code:(NSString *)code;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,51 +0,0 @@
|
||||
//
|
||||
// SurmountValidationCodeExternalize.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import "SurmountValidationCodeExternalize.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "Api+Login.h"
|
||||
#import "SurmountValidationCodeExternalize.h"
|
||||
#import "SurmountVerifCodeCeremony.h"
|
||||
#import "AccountMatrix.h"
|
||||
|
||||
@implementation SurmountValidationCodeExternalize
|
||||
|
||||
- (id<SurmountVerifCodeCeremony>)acquireRegard {
|
||||
return ((id<SurmountVerifCodeCeremony>) [super acquireRegard]);
|
||||
}
|
||||
|
||||
- (void)mobileSmsCryptogram:(NSString *)phone type:(GetSmsGenre)type phoneAreaCode:(NSString *)phoneAreaCode {
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api mobileSmsCryptogram:[self produceHyperessayImplementtowardsion:^(id _Nonnull data) {
|
||||
[[self acquireRegard] mobileSmsCryptogramAccomplishment];
|
||||
}] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)surmountAboutMobile:(NSString *)phone code:(NSString *)code phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api surmountAboutCryptogram:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
AccountMatrix * accountModel = [AccountMatrix mtowardsrixAboutImpactbasket:data.data];
|
||||
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[AccountAbstractStorage instance] preserveSequenceriptionAbstract:accountModel];
|
||||
}
|
||||
[[self acquireRegard] surmountAccomplishment];
|
||||
} EvidenceChambering:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password" phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
- (void)dilemmaAboutMobile:(NSString *)phone code:(NSString *)code {
|
||||
NSString * ticket = [[AccountAbstractStorage instance] acquireTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api dilemmaAplictowardsionartowardsusCryptogram:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] dilemmaMobileAccomplishment];
|
||||
} EvidenceChambering:YES] phone:desPhone code:code ticket:ticket];
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// YMLoginVerifBindPhonePresenter.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "MainPresenter.h"
|
||||
#import "YUMINNNN.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPLoginVerifBindPhonePresenter : MainPresenter
|
||||
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
/// 校验手机验证码接口
|
||||
/// @param moblieNum 手机号码
|
||||
/// @param code 验证码
|
||||
- (void)checkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code;
|
||||
|
||||
/// 绑定手机验证码接口
|
||||
/// @param moblieNum 手机号码
|
||||
/// @param code 验证码
|
||||
- (void)bindkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// YMLoginVerifBindPhonePresenter.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "XPLoginVerifBindPhonePresenter.h"
|
||||
#import "Api+Login.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
///P
|
||||
#import "XPLoginVerifBindPhoneProtocol.h"
|
||||
|
||||
@implementation XPLoginVerifBindPhonePresenter
|
||||
|
||||
/// 获取手机的验证码
|
||||
/// @param phone 手机号
|
||||
/// @param type 类型
|
||||
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] phoneSmsCodeSuccess];
|
||||
}] mobile:desPhone type:typeStr phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
|
||||
/// 校验手机验证码接口
|
||||
/// @param moblieNum 手机号码
|
||||
/// @param code 验证码
|
||||
- (void)checkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api checkMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] checkMoblieCodeWithMoblieSuccess];
|
||||
}] mobile:desPhone code:code uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
/// 绑定手机验证码接口
|
||||
/// @param moblieNum 手机号码
|
||||
/// @param code 验证码
|
||||
- (void)bindkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code {
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
|
||||
[Api bindMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] bindMoblieCodeWithMoblieSuccess];
|
||||
}] phone:desPhone code:code ticket:ticket];
|
||||
}
|
||||
@end
|
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// YMLoginVerifBindPhonePresenter.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "MainExternalizer.h"
|
||||
#import "YUMINNNN.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountValidationDilemmaMobileExternalizer : MainExternalizer
|
||||
|
||||
- (void)mobileSmsCryptogram:(NSString *)phone type:(GetSmsGenre)type phoneAreaCode:(NSString *)phoneAreaCode;
|
||||
|
||||
- (void)examineAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsus:(NSString *)moblieNum code:(NSString *)code;
|
||||
|
||||
- (void)dilemmakAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsus:(NSString *)moblieNum code:(NSString *)code;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,42 +0,0 @@
|
||||
//
|
||||
// YMLoginVerifBindPhonePresenter.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import "YUMISurmountValidationDilemmaMobileExternalizer.h"
|
||||
#import "Api+Login.h"
|
||||
#import "AccountAbstractStorage.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "FBCSurmountVerifBindPhoneCeremony.h"
|
||||
|
||||
@implementation YUMISurmountValidationDilemmaMobileExternalizer
|
||||
|
||||
- (void)mobileSmsCryptogram:(NSString *)phone type:(GetSmsGenre)type phoneAreaCode:(NSString *)phoneAreaCode{
|
||||
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api mobileSmsCryptogram:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] mobileSmsCryptogramAccomplishment];
|
||||
}] mobile:desPhone type:typeStr phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
|
||||
|
||||
- (void)examineAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsus:(NSString *)moblieNum code:(NSString *)code {
|
||||
NSString * uid = [[AccountAbstractStorage instance] acquireCid];
|
||||
NSString * ticket = [[AccountAbstractStorage instance] acquireTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api examineAplictowardsionartowardsusCryptogram:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] examineAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsusAccomplishment];
|
||||
}] mobile:desPhone code:code uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
- (void)dilemmakAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsus:(NSString *)moblieNum code:(NSString *)code {
|
||||
NSString * ticket = [[AccountAbstractStorage instance] acquireTicket];
|
||||
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyGenre_PasswordEncode)];
|
||||
[Api dilemmaAplictowardsionartowardsusCryptogram:[self produceHyperessayImplementtowardsion:^(BaseMatrix * _Nonnull data) {
|
||||
[[self acquireRegard] dilemmaAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsusAccomplishment];
|
||||
}] phone:desPhone code:code ticket:ticket];
|
||||
}
|
||||
@end
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// YMLoginVerifBindPhoneProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol FBCSurmountVerifBindPhoneCeremony <NSObject>
|
||||
- (void)mobileSmsCryptogramAccomplishment;
|
||||
- (void)dilemmaAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsusAccomplishment;
|
||||
- (void)examineAplictowardsionartowardsusCryptogramAboutAplictowardsionartowardsusAccomplishment;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
19
YuMi/Modules/YMLogin/Protocol/LoginForgetPasswordProtocol.h
Normal file
19
YuMi/Modules/YMLogin/Protocol/LoginForgetPasswordProtocol.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// LoginForgetPasswordProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol LoginForgetPasswordProtocol <NSObject>
|
||||
///请求手机号的验证码成功
|
||||
- (void)phoneSmsCodeSuccess;
|
||||
///重置密码成功
|
||||
- (void)resetPasswrodSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
19
YuMi/Modules/YMLogin/Protocol/LoginFullInfoProtocol.h
Normal file
19
YuMi/Modules/YMLogin/Protocol/LoginFullInfoProtocol.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// LoginFullInfoProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol LoginFullInfoProtocol <NSObject>
|
||||
///随机请求一个昵称
|
||||
- (void)requestRandomNickSuccess:(NSString *)nick;
|
||||
///补全资料成功
|
||||
- (void)complementInfoSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
YuMi/Modules/YMLogin/Protocol/LoginPasswordProtocol.h
Normal file
17
YuMi/Modules/YMLogin/Protocol/LoginPasswordProtocol.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// LoginPasswordProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol LoginPasswordProtocol <NSObject>
|
||||
///手机号密码登录成功
|
||||
- (void)phoneAndPasswordLoginSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
YuMi/Modules/YMLogin/Protocol/LoginProtocol.h
Normal file
17
YuMi/Modules/YMLogin/Protocol/LoginProtocol.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// LoginProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/1.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol LoginProtocol <NSObject>
|
||||
|
||||
- (void)loginSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
21
YuMi/Modules/YMLogin/Protocol/LoginVerifCodeProtocol.h
Normal file
21
YuMi/Modules/YMLogin/Protocol/LoginVerifCodeProtocol.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// LoginVerifCodeProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol LoginVerifCodeProtocol <NSObject>
|
||||
///请求手机号的验证码成功
|
||||
- (void)phoneSmsCodeSuccess;
|
||||
///登录成功
|
||||
- (void)loginSuccess;
|
||||
///绑定手机号成功
|
||||
- (void)bindPhoneSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// SurmountCeremony.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by zu on 2021/9/1.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SurmountCeremony <NSObject>
|
||||
|
||||
- (void)surmountAccomplishment;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// SurmountCiphercodeCeremony.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SurmountCiphercodeCeremony <NSObject>
|
||||
- (void)mobileGrantedCiphercryptogramSurmountAccomplishment;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// SurmountForgetCiphercodeCeremony.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SurmountForgetCiphercodeCeremony <NSObject>
|
||||
- (void)mobileSmsCryptogramAccomplishment;
|
||||
- (void)replacementPasswrodAccomplishment;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// SurmountFullAbstractCeremony.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/14.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SurmountFullAbstractCeremony <NSObject>
|
||||
- (void)requisitionArbitraryMonicerAccomplishment:(NSString *)nick;
|
||||
- (void)complementAbstractAccomplishment;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// SurmountVerifCodeCeremony.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SurmountVerifCodeCeremony <NSObject>
|
||||
- (void)mobileSmsCryptogramAccomplishment;
|
||||
- (void)surmountAccomplishment;
|
||||
- (void)dilemmaMobileAccomplishment;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// YMLoginVerifBindPhoneProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/9/18.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPLoginVerifBindPhoneProtocol <NSObject>
|
||||
///请求手机号的验证码成功
|
||||
- (void)phoneSmsCodeSuccess;
|
||||
///绑定手机号成功
|
||||
- (void)bindMoblieCodeWithMoblieSuccess;
|
||||
///验证绑定手机成功
|
||||
- (void)checkMoblieCodeWithMoblieSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// ConsumerPrivacyRegard.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/1.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ConsumerPrivacyRegard : UIView
|
||||
@property (nonatomic,strong) UIViewController * controller;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -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
|
17
YuMi/Modules/YMLogin/View/CustomView/UserPrivacyView.h
Normal file
17
YuMi/Modules/YMLogin/View/CustomView/UserPrivacyView.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// UserPrivacyView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/11/1.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserPrivacyView : UIView
|
||||
///
|
||||
@property (nonatomic,strong) UIViewController * controller;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YMForgetPwdViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPForgetPwdViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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
|
152
YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m
Normal file
152
YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m
Normal file
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// XPLoginAraeViewController.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#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 XPLoginAraeViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@property (nonatomic,strong) NSMutableArray *listData;
|
||||
@property (nonatomic,strong) NSMutableArray *titleList;
|
||||
@end
|
||||
|
||||
@implementation XPLoginAraeViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[Api getPhoneAreaCodeList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSArray *list = [LoginAreaModel modelsWithArray:data.data];
|
||||
[self.titleList removeAllObjects];
|
||||
[self.listData removeAllObjects];
|
||||
[self getLocalPlistWithList:list];
|
||||
}
|
||||
}];
|
||||
}
|
||||
#pragma mark - LoginVerifCodeProtocol
|
||||
|
||||
-(void)getPhoneAreaCodeListSuccess:(NSArray *)list{
|
||||
[self hideHUD];
|
||||
[self.titleList removeAllObjects];
|
||||
[self.listData removeAllObjects];
|
||||
[self getLocalPlistWithList:list];
|
||||
}
|
||||
-(void)getPhoneAreaCodeListFail{
|
||||
[self hideHUD];
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
NSString *file = [bundle pathForResource:@"district" ofType:@"plist"];
|
||||
NSArray *dictArray = [NSArray arrayWithContentsOfFile:file];
|
||||
|
||||
NSArray *list = [LoginAreaModel modelsWithArray:dictArray];
|
||||
[self getLocalPlistWithList: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 *modelList = [NSMutableArray array];
|
||||
for (LoginAreaModel *model in list) {
|
||||
NSString *fristLetter = [model.name substringWithRange:NSMakeRange(0, 1)];
|
||||
if([letter isEqualToString:fristLetter]){
|
||||
[modelList addObject:model];
|
||||
}else{
|
||||
if(![letterList containsObject:fristLetter] && ![otherList containsObject:model]){
|
||||
[otherList addObject:model];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(modelList.count > 0){
|
||||
|
||||
[self.titleList addObject:letter];
|
||||
[self.listData addObject:modelList];
|
||||
}
|
||||
}
|
||||
[self.listData addObject:otherList];
|
||||
[self.titleList addObject:@"#"];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.listData.count;
|
||||
}
|
||||
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
|
||||
|
||||
return self.titleList[section];
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return [self.listData[section] count];
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView {
|
||||
return self.titleList;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
XPLoginAreaTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPLoginAreaTableViewCell class]) forIndexPath:indexPath];
|
||||
if(indexPath.section < self.listData.count){
|
||||
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{
|
||||
LoginAreaModel *codeModel = self.listData[indexPath.section][indexPath.row];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(chooseAreaCodeSuccess:)]){
|
||||
|
||||
[self.delegate chooseAreaCodeSuccess:codeModel.phoneAreaCode ?: codeModel.phone_area_code];
|
||||
}
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.title = YMLocalizedString(@"XPChooseRreaCodeVC0");
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
- (void)initSubViewConstraints {
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.rowHeight = kGetScaleWidth(37);
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
[_tableView registerClass:[XPLoginAreaTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPLoginAreaTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
- (NSMutableArray *)titleList{
|
||||
if (!_titleList){
|
||||
_titleList = [NSMutableArray array];
|
||||
}
|
||||
return _titleList;
|
||||
}
|
||||
- (NSMutableArray *)listData{
|
||||
if (!_listData){
|
||||
_listData = [NSMutableArray array];
|
||||
}
|
||||
return _listData;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -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
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YMLoginPhoneViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPLoginPhoneViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YMLoginPwdViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPLoginPwdViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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
|
16
YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.h
Normal file
16
YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YMLoginViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "XPLoginBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPLoginViewController : XPLoginBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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,16 +0,0 @@
|
||||
//
|
||||
// YMForgetPwdViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMIForgetPwordRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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,150 +0,0 @@
|
||||
//
|
||||
// YUMISurmountAraeRegardGovernancer.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/25.
|
||||
//
|
||||
|
||||
#import "YUMISurmountAraeRegardGovernancer.h"
|
||||
#import "YUMISurmountAreaTabulationRegardElement.h"
|
||||
#import "SurmountAreaMatrix.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "Api+Login.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
@interface YUMISurmountAraeRegardGovernancer ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@property (nonatomic,strong) NSMutableArray *listData;
|
||||
@property (nonatomic,strong) NSMutableArray *championStatement;
|
||||
@end
|
||||
|
||||
@implementation YUMISurmountAraeRegardGovernancer
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initChildLyRestrictions];
|
||||
[Api acquireMobileAreaCryptogramSttowardsement:^(BaseMatrix * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSArray *list = [SurmountAreaMatrix mtowardsrixsAboutGarment:data.data];
|
||||
[self.championStatement removeAllObjects];
|
||||
[self.listData removeAllObjects];
|
||||
[self acquireProvincialPlistAboutSttowardsement:list];
|
||||
}
|
||||
}];
|
||||
}
|
||||
#pragma mark - SurmountVerifCodeCeremony
|
||||
|
||||
-(void)acquireMobileAreaCryptogramSttowardsementAccomplishment:(NSArray *)list{
|
||||
[self brakeHUD];
|
||||
[self.championStatement removeAllObjects];
|
||||
[self.listData removeAllObjects];
|
||||
[self acquireProvincialPlistAboutSttowardsement:list];
|
||||
}
|
||||
-(void)acquireMobileAreaCryptogramSttowardsementFlunk{
|
||||
[self brakeHUD];
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
NSString *file = [bundle pathForResource:@"district" ofType:@"plist"];
|
||||
NSArray *dictArray = [NSArray arrayWithContentsOfFile:file];
|
||||
|
||||
NSArray *list = [SurmountAreaMatrix mtowardsrixsAboutGarment:dictArray];
|
||||
[self acquireProvincialPlistAboutSttowardsement:list];
|
||||
}
|
||||
-(void)acquireProvincialPlistAboutSttowardsement:(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) {
|
||||
NSString *fristLetter = [model.name substringWithRange:NSMakeRange(0, 1)];
|
||||
if([letter isEqualToString:fristLetter]){
|
||||
[matrixStatement addObject:model];
|
||||
}else{
|
||||
if(![letterList containsObject:fristLetter] && ![otherList containsObject:model]){
|
||||
[otherList addObject:model];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(matrixStatement.count > 0){
|
||||
|
||||
[self.championStatement addObject:letter];
|
||||
[self.listData addObject:matrixStatement];
|
||||
}
|
||||
}
|
||||
[self.listData addObject:otherList];
|
||||
[self.championStatement addObject:@"#"];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.listData.count;
|
||||
}
|
||||
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
|
||||
|
||||
return self.championStatement[section];
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return [self.listData[section] count];
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView {
|
||||
return self.championStatement;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
YUMISurmountAreaTabulationRegardElement * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([YUMISurmountAreaTabulationRegardElement 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];
|
||||
}
|
||||
}
|
||||
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:)]){
|
||||
|
||||
[self.delegate concludeAreaCryptogramAccomplishment: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.view addSubview:self.tableView];
|
||||
}
|
||||
- (void)initChildLyRestrictions {
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.rowHeight = kGetScaleWidth(37);
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
[_tableView registerClass:[YUMISurmountAreaTabulationRegardElement class] forCellReuseIdentifier:NSStringFromClass([YUMISurmountAreaTabulationRegardElement class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
- (NSMutableArray *)championStatement{
|
||||
if (!_championStatement){
|
||||
_championStatement = [NSMutableArray array];
|
||||
}
|
||||
return _championStatement;
|
||||
}
|
||||
- (NSMutableArray *)listData{
|
||||
if (!_listData){
|
||||
_listData = [NSMutableArray array];
|
||||
}
|
||||
return _listData;
|
||||
}
|
||||
|
||||
|
||||
@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,16 +0,0 @@
|
||||
//
|
||||
// YMLoginPhoneViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountMobileRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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,16 +0,0 @@
|
||||
//
|
||||
// YMLoginPwdViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/14.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountPwordRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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,16 +0,0 @@
|
||||
//
|
||||
// YMLoginViewController.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by XY on 2023/2/13.
|
||||
//
|
||||
|
||||
#import "YUMISurmountBaseRegardGovernancer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YUMISurmountRegardGovernancer : YUMISurmountBaseRegardGovernancer
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_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
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user