登录界面更改

This commit is contained in:
liyuhua
2023-08-14 14:39:41 +08:00
parent 6e84953469
commit b5f6ce4822
69 changed files with 1384 additions and 456 deletions

View File

@@ -172,6 +172,8 @@
2331C1B82A60F32D00E1D940 /* XPRoomHalfWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1A62A60F32D00E1D940 /* XPRoomHalfWebView.m */; };
2331C1B92A60F32D00E1D940 /* Api+CandyTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1A82A60F32D00E1D940 /* Api+CandyTree.m */; };
2331C1BD2A60F69E00E1D940 /* UILabel+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1BC2A60F69E00E1D940 /* UILabel+Utils.m */; };
2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2369F9902A89CE0E00563B48 /* PIUserSexView.m */; };
23942E912A86424500D0ECC2 /* XPLoginAuthCodeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23942E902A86424500D0ECC2 /* XPLoginAuthCodeVC.m */; };
23B2AEC12A64E9C200543D17 /* LoginForgetEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC02A64E9C200543D17 /* LoginForgetEditView.m */; };
23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; };
23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; };
@@ -1672,6 +1674,10 @@
2331C1BB2A60F69E00E1D940 /* UILabel+Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UILabel+Utils.h"; sourceTree = "<group>"; };
2331C1BC2A60F69E00E1D940 /* UILabel+Utils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Utils.m"; sourceTree = "<group>"; };
23352A0D2A669D57001DB9B5 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
2369F98F2A89CE0E00563B48 /* PIUserSexView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIUserSexView.h; sourceTree = "<group>"; };
2369F9902A89CE0E00563B48 /* PIUserSexView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIUserSexView.m; sourceTree = "<group>"; };
23942E8F2A86424500D0ECC2 /* XPLoginAuthCodeVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPLoginAuthCodeVC.h; sourceTree = "<group>"; };
23942E902A86424500D0ECC2 /* XPLoginAuthCodeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPLoginAuthCodeVC.m; sourceTree = "<group>"; };
23B2AEBF2A64E9C200543D17 /* LoginForgetEditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginForgetEditView.h; sourceTree = "<group>"; };
23B2AEC02A64E9C200543D17 /* LoginForgetEditView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginForgetEditView.m; sourceTree = "<group>"; };
23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginForgetPasswordViewController.m; sourceTree = "<group>"; };
@@ -4029,6 +4035,8 @@
14B880E6299A4B62005FCA1B /* XPLoginPhoneViewController.m */,
14DCAD06299B36A500A7DD31 /* XPLoginPwdViewController.h */,
14DCAD07299B36A500A7DD31 /* XPLoginPwdViewController.m */,
23942E8F2A86424500D0ECC2 /* XPLoginAuthCodeVC.h */,
23942E902A86424500D0ECC2 /* XPLoginAuthCodeVC.m */,
14DCAD0C299B6AD900A7DD31 /* XPForgetPwdViewController.h */,
14DCAD0D299B6AD900A7DD31 /* XPForgetPwdViewController.m */,
14DCAD09299B5D3A00A7DD31 /* XPLoginInputView.h */,
@@ -4037,6 +4045,8 @@
E818DD1B2A4896EE00F163F7 /* XPLoginAraeViewController.m */,
E818DD202A48977F00F163F7 /* XPLoginAreaTableViewCell.h */,
E818DD212A48977F00F163F7 /* XPLoginAreaTableViewCell.m */,
2369F98F2A89CE0E00563B48 /* PIUserSexView.h */,
2369F9902A89CE0E00563B48 /* PIUserSexView.m */,
);
path = NewLogin;
sourceTree = "<group>";
@@ -10006,6 +10016,7 @@
23E9EA4E2A837BE400B792F2 /* XPTreasureFairyPoolRecordView.m in Sources */,
E85E7B042A4EB0D200B6D00A /* XPGuildIncomeDetailPresenter.m in Sources */,
9BD9A17C27A0EE24004186FE /* XPMineVisitorViewController.m in Sources */,
2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */,
E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */,
E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */,
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
@@ -10482,6 +10493,7 @@
E80EC81228ACD84000D133C5 /* QEmotionAttachment.m in Sources */,
E8DACCFB2766EDC60052092C /* MicroGiftValueView.m in Sources */,
E85E7BAE2A4EC99300B6D00A /* XPMineGiveDiamondVC.m in Sources */,
23942E912A86424500D0ECC2 /* XPLoginAuthCodeVC.m in Sources */,
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */,
2331C1752A5EB71000E1D940 /* XPNobleUpgradeLevelView.m in Sources */,
E885D533297798E1004DC088 /* SessionSettingTableViewCell.m in Sources */,
@@ -11112,7 +11124,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 10.9;
MARKETING_VERSION = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -11145,7 +11157,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 10.9;
MARKETING_VERSION = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -37,7 +37,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
[UMConfigure initWithAppkey:@"6434c6dfd64e686139618269" channel:@"yumi_appstore"];
}
[[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
[FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
[FIRApp configure];
return YES;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 206 B

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "login_full_info_male_normal@2x.png",
"filename" : "login_choose_phone_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_full_info_male_normal@3x.png",
"filename" : "login_choose_phone_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "login_full_info_male_select@2x.png",
"filename" : "login_choose_pwd_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_full_info_male_select@3x.png",
"filename" : "login_choose_pwd_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 461 B

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "login_full_info_female_normal@2x.png",
"filename" : "login_full_female@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_full_info_female_normal@3x.png",
"filename" : "login_full_female@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "login_full_info_female_select@2x.png",
"filename" : "login_full_female_logo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_full_info_female_select@3x.png",
"filename" : "login_full_female_logo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_full_male@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_full_male@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_full_male_logo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_full_male_logo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_next_login@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_next_login@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_phone_pwd_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_phone_pwd_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@@ -75,6 +75,10 @@ NS_ASSUME_NONNULL_BEGIN
ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode;
+(void)getPhoneAreaCodeList:(HttpRequestHelperCompletion)complection;
/// 绑定授权码
/// @param complection 完成
+(void)bindAuthorizationCode:(HttpRequestHelperCompletion)complection authCode:(NSString *)authCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -78,5 +78,10 @@
NSString * fang = [NSString stringFromBase64String:@"YXJlYUluZm8vbGlzdA=="];///areaInfo/list
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,nil];
}
///
/// @param complection
+(void)bindAuthorizationCode:(HttpRequestHelperCompletion)complection authCode:(NSString *)authCode{
[self makeRequest:@"phone/auth/bound" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,authCode, nil];
}
@end

View File

@@ -78,7 +78,7 @@
}
[Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] complementInfoSuccess];
}] userInfo:params];
}showLoading:YES errorToast:YES] userInfo:params];
}
@end

View File

@@ -26,7 +26,46 @@
@implementation LoginPresenter
- (void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
- (instancetype)init{
self = [super init];
if(self){
[FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
[[NSNotificationCenter defaultCenter] addObserverForName:FBSDKProfileDidChangeNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:
^(NSNotification *notification) {
if ([FBSDKProfile currentProfile]) {
//
[FBSDKProfile loadCurrentProfileWithCompletion:
^(FBSDKProfile *profile, NSError *error) {
if (profile) {
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
NSString * openid = profile.userID;
NSString * access_token = profile.userID;
NSString * unionid = profile.userID;
userInfo.openid = openid;
userInfo.access_token = access_token;
userInfo.unionid = unionid;
userInfo.userName = profile.name;
userInfo.avatarUrl = profile.imageURL.absoluteString;
[AccountInfoStorage instance].thirdUserInfo = userInfo;
[self loginWithThirdPartWithType:ThirdLoginType_FB];
}
}];
}
}];
}
return self;
}
- (id<LoginProtocol>)getView {
return ((id<LoginProtocol>) [super getView]);
}
@@ -42,151 +81,156 @@
///
/// @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")];
}
}];
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];
[XPAdjustEvent loginEvent];
}
} 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]];
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];
[XPAdjustEvent loginEvent];
[[NSUserDefaults standardUserDefaults]setValue:@(type) forKey:@"kLoginSuccessType"];
[[NSUserDefaults standardUserDefaults]synchronize];
}
} 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)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController {
FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
[manager logOut];
[manager logInWithPermissions:@[@"public_profile"]
fromViewController:presentingViewController
handler:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
if (error) {
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
} else if (result.isCancelled) {
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
} else {
NSLog(@"Logged in");
}
}];
[manager logOut];
[manager logInWithPermissions:@[@"public_profile"]
fromViewController:presentingViewController
handler:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
if (error) {
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
} else if (result.isCancelled) {
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
} else {
NSLog(@"Logged in");
}
}];
}
-(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];
}
}];
[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];
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];
[XPAdjustEvent loginEvent];
}
[[NSUserDefaults standardUserDefaults]setValue:@(ThirdLoginType_Gmail) forKey:@"kLoginSuccessType"];
[[NSUserDefaults standardUserDefaults]synchronize];
}
}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]];
}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]];
}

View File

@@ -24,8 +24,12 @@ NS_ASSUME_NONNULL_BEGIN
/// @param phone 手机号
/// @param code 验证码
- (void)bindWithPhone:(NSString *)phone code:(NSString *)code phoneAreaCode:(NSString *)phoneAreaCode;
/// 使用手机号和密码登录
/// @param phone 手机号
/// @param password 验证码
- (void)loginWithPhone:(NSString *)phone password:(NSString *)password;
///绑定授权码
-(void)bindAuthorizationCodeWithAuthCode:(NSString *)authCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -49,9 +49,22 @@
[[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];
} showLoading:YES errorToast:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password" phoneAreaCode:phoneAreaCode];
}
/// 使
/// @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] loginSuccess];
} showLoading:YES errorToast:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
}
///
/// @param phone
/// @param code
@@ -62,5 +75,11 @@
[[self getView] bindPhoneSuccess];
} showLoading:YES] phone:desPhone code:code ticket:ticket phoneAreaCode:phoneAreaCode];
}
-(void)bindAuthorizationCodeWithAuthCode:(NSString *)authCode{
[Api bindAuthorizationCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] bindAuthorizationCodeSuccess];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]bindAuthorizationCodeFail];
} showLoading:YES errorToast:YES] authCode:authCode];
}
@end

View File

@@ -16,6 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)loginSuccess;
///绑定手机号成功
- (void)bindPhoneSuccess;
///绑定授权码成功
-(void)bindAuthorizationCodeSuccess;
///绑定授权码失败
-(void)bindAuthorizationCodeFail;
@end
NS_ASSUME_NONNULL_END

View File

@@ -17,6 +17,7 @@
#import "StatisticsServiceHelper.h"
#import "AccountInfoStorage.h"
#import "TTPopup.h"
#import "PIUserSexView.h"
///Model
#import "ThirdUserInfo.h"
///P
@@ -26,14 +27,18 @@
UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol>
///
@property(nonatomic,strong) UIImageView *bgImageView;
///
@property(nonatomic,strong) UIView *bgView;
///
@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;
///
@@ -43,21 +48,18 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
///x
@property (nonatomic,strong) UIStackView *sexStackView;
///
@property (nonatomic,strong) UIButton *maleButton;
@property (nonatomic,strong) PIUserSexView *maleView;
///
@property (nonatomic,strong) UIButton *femaleButton;
@property (nonatomic,strong) PIUserSexView*femaleView;
///
@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;
///
@@ -87,24 +89,35 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.bgImageView];
[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.bgView];
[self.bgView addSubview:self.remindLabel];
[self.bgView addSubview:self.sexStackView];
[self.bgView addSubview:self.backView];
[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.backView addSubview:self.textField];
[self.backView addSubview:self.refreshButton];
[self.backView addSubview:self.nameLabel];
[self.sexStackView addArrangedSubview:self.maleButton];
[self.sexStackView addArrangedSubview:self.femaleButton];
[self.sexStackView addArrangedSubview:self.maleView];
[self.sexStackView addArrangedSubview:self.femaleView];
[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;
@@ -114,64 +127,89 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
}
- (void)initSubViewConstraints {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(self.view).offset(60 + kSafeAreaTopHeight);
}];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(418));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(128));
make.leading.mas_equalTo(kGetScaleWidth(24));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(192));
}];
[self.remindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(8);
make.left.right.equalTo(self.bgView).inset(kGetScaleWidth(10));
make.top.mas_equalTo(kGetScaleWidth(48));
make.height.mas_equalTo(kGetScaleWidth(22));
}];
[self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kGetScaleWidth(38));
make.right.mas_equalTo(-kGetScaleWidth(38));
make.top.mas_equalTo(kGetScaleWidth(86));
}];
[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);
make.width.mas_equalTo(kGetScaleWidth(303));
make.height.mas_equalTo(kGetScaleWidth(52));
make.centerX.equalTo(self.bgView);
make.top.mas_equalTo(self.sexStackView.mas_bottom).offset(kGetScaleWidth(28));
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.backView).inset(25);
make.top.bottom.mas_equalTo(self.backView);
}];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-kGetScaleWidth(18));
make.centerY.equalTo(self.backView);
}];
[self.refreshButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(18));
make.centerY.equalTo(self.backView);
make.right.equalTo(self.nameLabel.mas_left).mas_offset(-kGetScaleWidth(4));
}];
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kGetScaleWidth(24));
make.top.bottom.equalTo(self.backView);
make.right.equalTo(self.refreshButton.mas_left).mas_offset(-kGetScaleWidth(4));
}];
[self.maleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(132));
make.height.mas_equalTo(kGetScaleWidth(108));
}];
[self.femaleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(132));
make.height.mas_equalTo(kGetScaleWidth(108));
}];
[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);
make.top.mas_equalTo(self.backView.mas_bottom).offset(kGetScaleWidth(20));
}];
[self.codeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.codeContainView).offset(10);
make.left.mas_equalTo(self.codeContainView).offset(kGetScaleWidth(24));
make.top.bottom.mas_equalTo(self.codeContainView);
make.right.mas_equalTo(self.codeDesLabel.mas_left).offset(-5);
make.right.mas_equalTo(self.codeContainView).offset(-kGetScaleWidth(18));
}];
[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);
make.width.mas_equalTo(kGetScaleWidth(303));
make.centerX.equalTo(self.bgView);
make.height.mas_equalTo(kGetScaleWidth(48));
make.top.mas_equalTo(self.codeContainView.mas_bottom).offset(kGetScaleWidth(48));
}];
[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 {
@@ -191,7 +229,7 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
///
- (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];
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl] gender:self.maleView.selected ? @"1":@"2" nick:self.textField.text inviteCode:self.codeTextField.text roomUid:nil shareUid:nil shareChannel:nil];
}
///
@@ -248,27 +286,29 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
}
}
- (void)refreshButtonAction:(UIButton *)sender {
- (void)refreshButtonAction {
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.refreshButton.layer addAnimation:lAni forKey:nil];
[self.presenter randomRequestNick];
}
- (void)maleButtonAction:(UIButton *)sender {
self.femaleButton.selected = NO;
sender.selected = YES;
self.sexString = @"1";
- (void)maleButtonAction:(UITapGestureRecognizer *)tap {
PIUserSexView * view = (PIUserSexView *)tap.view;
self.femaleView.selected = NO;
view.selected = YES;
self.sexString = @"1";
}
- (void)femaleButtonAction:(UIButton *)sender {
sender.selected = YES;
self.maleButton.selected = NO;
self.sexString = @"2";
- (void)femaleButtonAction:(UITapGestureRecognizer *)tap {
PIUserSexView * view = (PIUserSexView *)tap.view;
view.selected = YES;
self.maleView.selected = NO;
self.sexString = @"2";
}
#pragma mark - Getters And Setters
@@ -276,14 +316,20 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
_sexString = sexString;
[self updateNextButton];
}
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"login_phone_pwd_bg");
_bgImageView.contentMode = 2;
}
return _bgImageView;
}
- (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;
_titleLabel.font = kFontBold(28);
_titleLabel.textColor = UIColorFromRGB(0x1F1B4F);
}
return _titleLabel;
}
@@ -291,30 +337,22 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
- (UILabel *)remindLabel {
if (!_remindLabel) {
_remindLabel = [[UILabel alloc] init];
_remindLabel.text = YMLocalizedString(@"LoginFullInfoViewController2");
_remindLabel.font = [UIFont systemFontOfSize:13];
_remindLabel.textColor = [DJDKMIMOMColor secondTextColor];
NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",YMLocalizedString(@"LoginFullInfoViewController8"),YMLocalizedString(@"LoginFullInfoViewController2")] attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:UIColorFromRGB(0x1F1B4F)}];
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x6D6B89)} range:[textAtt.string rangeOfString:[NSString stringWithFormat:@"%@",YMLocalizedString(@"LoginFullInfoViewController2")]]];
_remindLabel.attributedText = textAtt;
_remindLabel.textAlignment = NSTextAlignmentCenter;
}
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.backgroundColor = UIColorFromRGB(0xF5F6FA);
_backView.layer.masksToBounds = YES;
_backView.layer.cornerRadius = 45/2;
_backView.layer.cornerRadius = kGetScaleWidth(52)/2;
}
return _backView;
}
@@ -322,9 +360,13 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
- (UILabel *)nameLabel {
if (!_nameLabel) {
_nameLabel = [[UILabel alloc] init];
_nameLabel.text = YMLocalizedString(@"LoginFullInfoViewController3");
_nameLabel.font = [UIFont systemFontOfSize:15];
_nameLabel.textColor = [DJDKMIMOMColor secondTextColor];
_nameLabel.text = YMLocalizedString(@"LoginFullInfoViewController9");
_nameLabel.font = kFontRegular(14);
_nameLabel.textColor = UIColorFromRGB(0x1F1B4F);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(refreshButtonAction)];
_nameLabel.userInteractionEnabled = YES;
[_nameLabel addGestureRecognizer:tap];
[_nameLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[_nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
@@ -335,11 +377,11 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
- (UITextField *)textField {
if (!_textField) {
_textField = [[UITextField alloc] init];
_textField.textColor = [DJDKMIMOMColor mainTextColor];
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
_textField.textColor = UIColorFromRGB(0x1F1B4F);
_textField.font = kFontMedium(16);
_textField.placeholder = YMLocalizedString(@"LoginFullInfoViewController3");
_textField.borderStyle = UITextBorderStyleNone;
_textField.tintColor = [DJDKMIMOMColor appMainColor];
_textField.textAlignment = NSTextAlignmentRight;
_textField.backgroundColor = [UIColor clearColor];
}
return _textField;
@@ -353,7 +395,7 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
[_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];
[_refreshButton addTarget:self action:@selector(refreshButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _refreshButton;
}
@@ -364,37 +406,39 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
_sexStackView.axis = UILayoutConstraintAxisHorizontal;
_sexStackView.distribution = UIStackViewDistributionFill;
_sexStackView.alignment = UIStackViewAlignmentCenter;
_sexStackView.spacing = 15;
_sexStackView.spacing = kGetScaleWidth(35);
}
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;
- (PIUserSexView *)maleView {
if (!_maleView) {
_maleView = [[PIUserSexView alloc] init];
_maleView.gender = GenderType_Male;
_maleView.selected = NO;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(maleButtonAction:)];
[_maleView addGestureRecognizer:tap];
}
return _maleView;
}
- (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;
- (PIUserSexView *)femaleView {
if (!_femaleView) {
_femaleView = [[PIUserSexView alloc] init];
_femaleView.gender = GenderType_Female;
_femaleView.selected = NO;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(femaleButtonAction:)];
[_femaleView addGestureRecognizer:tap];
}
return _femaleView;
}
- (UIView *)codeContainView {
if (!_codeContainView) {
_codeContainView = [[UIView alloc] init];
_codeContainView.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
_codeContainView.backgroundColor = UIColorFromRGB(0xF5F6FA);
_codeContainView.layer.masksToBounds= YES;
_codeContainView.layer.cornerRadius = 45/2;
_codeContainView.layer.cornerRadius = kGetScaleWidth(52)/2;
}
return _codeContainView;
}
@@ -402,64 +446,44 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
- (UITextField *)codeTextField {
if (!_codeTextField) {
_codeTextField = [[UITextField alloc] init];
_codeTextField.textColor = [DJDKMIMOMColor mainTextColor];
_codeTextField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
_codeTextField.textColor = UIColorFromRGB(0x1F1B4F);
_codeTextField.font = kFontMedium(14);
_codeTextField.borderStyle = UITextBorderStyleNone;
_codeTextField.tintColor = [DJDKMIMOMColor appMainColor];
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:YMLocalizedString(@"LoginFullInfoViewController5") attributes:@{NSFontAttributeName:kFontRegular(14),NSForegroundColorAttributeName:UIColorFromRGB(0xB3B3C3)}];
_codeTextField.attributedPlaceholder = placeholder;
_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 = YMLocalizedString(@"LoginFullInfoViewController5");
_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.layer.cornerRadius = kGetScaleWidth(48)/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.titleLabel.font = kFontMedium(16);
[_nextButton setTitleColor:[UIColor whiteColor] 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;
}
- (UIView *)bgView{
if(!_bgView){
UIView *bgView = [UIView new];
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.cornerRadius = kGetScaleWidth(20);
bgView.layer.masksToBounds = YES;
_bgView = bgView;
}
return _bgView;
}
@end

View File

@@ -0,0 +1,17 @@
//
// PIUserSexView.h
// YuMi
//
// Created by duoban on 2023/8/14.
//
#import <UIKit/UIKit.h>
#import "YUMINNNN.h"
NS_ASSUME_NONNULL_BEGIN
@interface PIUserSexView : UIView
@property (nonatomic,assign) GenderType gender;
@property (nonatomic,assign) BOOL selected;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,137 @@
//
// PIUserSexView.m
// YuMi
//
// Created by duoban on 2023/8/14.
//
#import "PIUserSexView.h"
@interface PIUserSexView ()
///
@property (nonatomic,strong) UIImageView *backImageView;
///
@property (nonatomic,strong) UIImageView *logoImageView;
///
@property (nonatomic,strong) UIImageView *sexImageView;
///
@property (nonatomic,strong) UILabel *sexLb;
@end
@implementation PIUserSexView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
- (void)initSubViews {
[self addSubview:self.backImageView];
[self.backImageView addSubview:self.logoImageView];
[self.backImageView addSubview:self.sexLb];
[self.backImageView addSubview:self.sexImageView];
}
- (void)initSubViewConstraints {
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(66), kGetScaleWidth(66)));
make.centerX.mas_equalTo(self.backImageView);
make.top.mas_equalTo(self.backImageView).offset(kGetScaleWidth(8));
}];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(16), kGetScaleWidth(16)));
make.right.mas_equalTo(self.backImageView.mas_centerX).offset(-1.5);
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(kGetScaleWidth(8));
}];
[self.sexLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backImageView.mas_centerX).offset(1.5);
make.centerY.mas_equalTo(self.sexImageView);
}];
}
- (void)setGender:(GenderType)gender {
_gender = gender;
switch (_gender) {
case GenderType_Male:
{
self.logoImageView.image = [UIImage imageNamed:@"login_full_male_logo"];
self.sexLb.text = YMLocalizedString(@"PIUserSexView0");
self.sexImageView.image = [UIImage imageNamed:@"login_full_male"];
}
break;
case GenderType_Female:
{
self.logoImageView.image = [UIImage imageNamed:@"login_full_female_logo"];
self.sexLb.text = YMLocalizedString(@"PIUserSexView1");
self.sexImageView.image = [UIImage imageNamed:@"login_full_female"];
}
break;
default:
break;
}
}
- (void)setSelected:(BOOL)selected {
_selected = selected;
if (_selected) {
if (self.gender == GenderType_Male) {
self.backImageView.image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#EBF5FF"],[DJDKMIMOMColor colorWithHexString:@"#FFFFFF"]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)];
self.backImageView.layer.borderColor = [DJDKMIMOMColor colorWithHexString:@"#B8E5FF"].CGColor;
} else {
self.backImageView.image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#FFEBFA"],[DJDKMIMOMColor colorWithHexString:@"#FFFFFF"]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)];
self.backImageView.layer.borderColor = [DJDKMIMOMColor colorWithHexString:@"#FFB8E2"].CGColor;
}
} else {
self.backImageView.image = [UIImage imageWithColor:[UIColor clearColor]];
self.backImageView.layer.borderColor = [DJDKMIMOMColor colorWithHexString:@"#FAFBFC"].CGColor;
}
}
- (UIImageView *)backImageView {
if (!_backImageView) {
_backImageView = [[UIImageView alloc] init];
_backImageView.userInteractionEnabled = YES;
_backImageView.layer.masksToBounds = YES;
_backImageView.layer.borderWidth = 1;
_backImageView.layer.cornerRadius = kGetScaleWidth(18);
}
return _backImageView;
}
- (UIImageView *)logoImageView {
if (!_logoImageView) {
_logoImageView = [[UIImageView alloc] init];
_logoImageView.userInteractionEnabled = YES;
}
return _logoImageView;
}
- (UIImageView *)sexImageView {
if (!_sexImageView) {
_sexImageView = [[UIImageView alloc] init];
_sexImageView.userInteractionEnabled = YES;
}
return _sexImageView;
}
- (UILabel *)sexLb {
if (!_sexLb) {
_sexLb = [[UILabel alloc] init];
_sexLb.font = kFontMedium(14);
_sexLb.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"];
}
return _sexLb;
}
@end

View File

@@ -17,7 +17,10 @@
#import "XPLoginAraeViewController.h"
@interface XPForgetPwdViewController ()<XPLoginInputViewDelegate, LoginForgetPasswordProtocol, XPLoginAraeViewControllerDelegate>
///
@property(nonatomic,strong) UIImageView *bgImageView;
///
@property(nonatomic,strong) UIButton *backBnt;
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@@ -33,7 +36,9 @@
@end
@implementation XPForgetPwdViewController
- (BOOL)isHiddenNavBar {
return YES;
}
- (LoginForgetPasswordPresent *)createPresenter {
return [[LoginForgetPasswordPresent alloc] init];
}
@@ -47,39 +52,65 @@
}
- (void)createUI {
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.backBnt];
[self.view addSubview:self.titleLabel];
UIView *bgView = [UIView new];
bgView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:bgView];
bgView.layer.cornerRadius = kGetScaleWidth(20);
bgView.layer.masksToBounds = YES;
[self.view addSubview:self.phoneInputView];
[self.view addSubview:self.codeInputView];
[self.view addSubview:self.pwdInputView];
[self.view addSubview:self.sureBtn];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(418));
}];
[self.backBnt mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(20));
make.width.mas_equalTo(kGetScaleWidth(28));
make.height.mas_equalTo(kGetScaleWidth(28));
make.top.mas_equalTo(kGetScaleWidth(52));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(kStatusBarHeight);
make.height.mas_equalTo(44);
make.top.equalTo(self.backBnt.mas_bottom).mas_offset(kGetScaleWidth(48));
make.leading.mas_equalTo(kGetScaleWidth(24));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(257));
}];
[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);
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(kGetScaleWidth(296));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
[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);
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(kGetScaleWidth(20));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
[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);
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(kGetScaleWidth(20));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
[self.sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(51);
make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(kGetScaleWidth(48));
make.centerX.mas_equalTo(self.view);
make.width.height.mas_equalTo(96);
make.height.mas_equalTo(kGetScaleWidth(48));
make.width.mas_equalTo(kGetScaleWidth(303));
}];
}
@@ -137,15 +168,18 @@
[self.navigationController popViewControllerAnimated:YES];
}
-(void)backViewAction1{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = kFontBold(28);
_titleLabel.textColor = UIColorFromRGB(0x1F1B4F);
_titleLabel.text = YMLocalizedString(@"XPForgetPwdViewController3");
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
_titleLabel.textColor = UIColor.whiteColor;
}
return _titleLabel;
}
@@ -156,7 +190,7 @@
_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)];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_phoneInputView.inputTextField.attributedPlaceholder = placeholder;
_phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
}
@@ -168,7 +202,7 @@
_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)];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_codeInputView.inputTextField.attributedPlaceholder = placeholder;
_codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
_codeInputView.delegate = self;
@@ -180,7 +214,7 @@
if (!_pwdInputView) {
_pwdInputView = [[XPLoginInputView alloc] init];
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPForgetPwdViewController6")];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_pwdInputView.inputTextField.attributedPlaceholder = placeholder;
_pwdInputView.inputTextField.keyboardType = UIKeyboardTypeAlphabet;
_pwdInputView.inputTextField.secureTextEntry = YES;
@@ -191,11 +225,41 @@
- (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];
UIImage *nextImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
UIImage *disableImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xD1F9FF),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
[_sureBtn setImage:nextImage forState:UIControlStateNormal];
[_sureBtn setImage:disableImage forState:UIControlStateDisabled];
_sureBtn.layer.cornerRadius = kGetScaleWidth(48)/2;
_sureBtn.layer.masksToBounds = YES;
UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginPhoneViewController8") font:kFontMedium(16) textColor:[UIColor whiteColor]];
titleView.textAlignment = NSTextAlignmentCenter;
[_sureBtn addSubview:titleView];
[titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.sureBtn);
}];
[_sureBtn addTarget:self action:@selector(sureBtnClicked) forControlEvents:UIControlEventTouchUpInside];
}
return _sureBtn;
}
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"login_phone_pwd_bg");
_bgImageView.contentMode = 2;
}
return _bgImageView;
}
- (UIButton *)backBnt{
if(!_backBnt){
_backBnt = [UIButton new];
[_backBnt setImage:kImage(@"common_nav_back") forState:UIControlStateNormal];
[_backBnt addTarget:self action:@selector(backViewAction1) forControlEvents:UIControlEventTouchUpInside];
[_backBnt setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
}
return _backBnt;
}
@end

View File

@@ -0,0 +1,22 @@
//
// XPLoginAuthCodeVC.h
// YuMi
//
// Created by duoban on 2023/8/11.
//
#import "MvpViewController.h"
@protocol XPLoginAuthCodeVCDelegate <NSObject>
-(void)bindCodeSuccess;
@end
NS_ASSUME_NONNULL_BEGIN
@interface XPLoginAuthCodeVC : MvpViewController
@property(nonatomic,weak) id<XPLoginAuthCodeVCDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,155 @@
//
// XPLoginAuthCodeVC.m
// YuMi
//
// Created by duoban on 2023/8/11.
//
#import "XPLoginAuthCodeVC.h"
#import "XPLoginInputView.h"
#import <ReactiveObjC.h>
#import "LoginVerifCodePresent.h"
@interface XPLoginAuthCodeVC ()
///
@property(nonatomic,strong) UIImageView *bgImageView;
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@property (nonatomic, strong) XPLoginInputView *codeInputView;
///
@property (nonatomic, strong) UIButton *loginBtn;
@end
@implementation XPLoginAuthCodeVC
- (LoginVerifCodePresent *)createPresenter {
return [[LoginVerifCodePresent alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self installUI];
[self installConstraints];
[self racBind];
}
-(void)installUI{
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.titleLabel];
}
-(void)installConstraints{
UIView *bgView = [UIView new];
bgView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:bgView];
bgView.layer.cornerRadius = kGetScaleWidth(20);
bgView.layer.masksToBounds = YES;
[self.view addSubview:self.codeInputView];
[self.view addSubview:self.loginBtn];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(418));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(128));
make.leading.mas_equalTo(kGetScaleWidth(24));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(192));
}];
[self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(kGetScaleWidth(260));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
[self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(kGetScaleWidth(48));
make.centerX.mas_equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(48));
make.width.mas_equalTo(kGetScaleWidth(303));
}];
}
- (void)racBind {
RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.codeInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *account){
return @(account.length > 0);
}] takeUntil:self.rac_willDeallocSignal];
}
-(void)loginBtnClicked{
[self showLoading];
[self.presenter bindAuthorizationCodeWithAuthCode:self.codeInputView.inputTextField.text];
}
#pragma mark - LoginVerifCodeProtocol
- (void)bindAuthorizationCodeSuccess{
[self hideHUD];
[self showSuccessToast:YMLocalizedString(@"XPLoginAuthCodeVC2")];
[self dismissViewControllerAnimated:YES completion:nil];
if(self.delegate && [self.delegate respondsToSelector:@selector(bindCodeSuccess)]){
[self.delegate bindCodeSuccess];
}
self.loginBtn.enabled = YES;
}
-(void)bindAuthorizationCodeFail{
[self hideHUD];
self.loginBtn.enabled = YES;
}
#pragma mark -
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.text = YMLocalizedString(@"XPLoginAuthCodeVC0");
_titleLabel.font = kFontBold(28);
_titleLabel.textColor = UIColorFromRGB(0x1F1B4F);
}
return _titleLabel;
}
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"login_phone_pwd_bg");
_bgImageView.contentMode = 2;
}
return _bgImageView;
}
- (XPLoginInputView *)codeInputView {
if (!_codeInputView) {
_codeInputView = [[XPLoginInputView alloc] init];
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginAuthCodeVC1")];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_codeInputView.inputTextField.attributedPlaceholder = placeholder;
_codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
}
return _codeInputView;
}
- (UIButton *)loginBtn {
if (!_loginBtn) {
_loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *nextImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
UIImage *disableImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xD1F9FF),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
[_loginBtn setImage:nextImage forState:UIControlStateNormal];
[_loginBtn setImage:disableImage forState:UIControlStateDisabled];
_loginBtn.layer.cornerRadius = kGetScaleWidth(48)/2;
_loginBtn.layer.masksToBounds = YES;
UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginAuthCodeVC3") font:kFontMedium(16) textColor:[UIColor whiteColor]];
titleView.textAlignment = NSTextAlignmentCenter;
[_loginBtn addSubview:titleView];
[titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.loginBtn);
}];
[_loginBtn addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
}
return _loginBtn;
}
@end

View File

@@ -22,10 +22,9 @@
- (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.backgroundColor = UIColorFromRGB(0xF5F6FA);
self.layer.cornerRadius = kGetScaleWidth(52)/2;
self.layer.masksToBounds = YES;
[self createUI];
}
@@ -37,7 +36,7 @@
stackView.axis = UILayoutConstraintAxisHorizontal;
stackView.distribution = UIStackViewDistributionFill;
stackView.alignment = UIStackViewAlignmentCenter;
stackView.spacing = 5;
stackView.spacing = kGetScaleWidth(8);
[self addSubview:stackView];
@@ -49,8 +48,8 @@
///
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 setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateNormal];
areaCodeBtn.titleLabel.font = kFontMedium(16);
_areaCodeBtn = areaCodeBtn;
areaCodeBtn.userInteractionEnabled = NO;
@@ -58,7 +57,7 @@
areaStackView.axis = UILayoutConstraintAxisHorizontal;
areaStackView.distribution = UIStackViewDistributionFill;
areaStackView.alignment = UIStackViewAlignmentCenter;
areaStackView.spacing = 2;
areaStackView.spacing = kGetScaleWidth(8);
UIButton *areaBtn = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -74,41 +73,44 @@
///
UITextField *inputTextField = [[UITextField alloc] init];
inputTextField.textColor = UIColor.whiteColor;
inputTextField.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
inputTextField.textColor = UIColorFromRGB(0x1F1B4F);
inputTextField.font = kFontRegular(14);
[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 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
smsCodeBtn.titleLabel.font = kFontMedium(14);
smsCodeBtn.layer.cornerRadius = kGetScaleWidth(38)/2;
smsCodeBtn.layer.masksToBounds = YES;
smsCodeBtn.backgroundColor = UIColorFromRGB(0x9168FA);
[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.left.mas_equalTo(kGetScaleWidth(24));
make.right.mas_equalTo(-kGetScaleWidth(24));
make.top.bottom.mas_equalTo(0);
}];
[areaImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(18);
make.height.mas_equalTo(18);
make.width.mas_equalTo(kGetScaleWidth(12));
make.height.mas_equalTo(kGetScaleWidth(8));
}];
[areaCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(50);
make.width.mas_lessThanOrEqualTo(kGetScaleWidth(60));
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);
make.width.mas_equalTo(kGetScaleWidth(102));
make.height.mas_equalTo(kGetScaleWidth(38));
}];
[areaBtn mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -16,33 +16,57 @@
#import "XPLoginAraeViewController.h"
#import "LoginVerifCodePresent.h"
#import "LoginVerifCodeProtocol.h"
#import "XPForgetPwdViewController.h"
@interface XPLoginPhoneViewController ()<XPLoginInputViewDelegate, LoginVerifCodeProtocol, XPLoginAraeViewControllerDelegate>
///
@property(nonatomic,strong) UIImageView *bgImageView;
///
@property(nonatomic,strong) UIButton *backBnt;
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@property (nonatomic, strong) UILabel *despLabel;
///
@property(nonatomic,strong) UIImageView *chooseTypeView;
///
@property(nonatomic,strong) UIButton *choosePhoneBtn;
///
@property(nonatomic,strong) UIButton *choosePsdBtn;
///
@property (nonatomic, strong) XPLoginInputView *phoneInputView;
///
@property (nonatomic, strong) XPLoginInputView *codeInputView;
/////
@property (nonatomic, strong) XPLoginInputView *accountView;
///
@property (nonatomic, strong) XPLoginInputView *accountPwdView;
///
@property (nonatomic, strong) UIButton *forgetBtn;
///
@property (nonatomic, strong) UIButton *loginBtn;
///
@property (nonatomic, strong) UIButton *pwdLoginBtn;
///
@property (nonatomic,copy) NSString *phoneAreaCode;
///,01.
@property(nonatomic,assign) int selectType;
@end
@implementation XPLoginPhoneViewController
- (BOOL)isHiddenNavBar {
return YES;
}
- (LoginVerifCodePresent *)createPresenter {
return [[LoginVerifCodePresent alloc] init];
}
- (void)viewDidLoad {
self.selectType = 0;
self.phoneAreaCode = @"852";
[super viewDidLoad];
[self createUI];
@@ -50,48 +74,104 @@
}
- (void)createUI {
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.backBnt];
[self.view addSubview:self.titleLabel];
[self.view addSubview:self.despLabel];
[self.view addSubview:self.chooseTypeView];
[self.chooseTypeView addSubview:self.choosePhoneBtn];
[self.chooseTypeView addSubview:self.choosePsdBtn];
UIView *bgView = [UIView new];
bgView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:bgView];
[self.view addSubview:self.phoneInputView];
[self.view addSubview:self.codeInputView];
[self.view addSubview:self.loginBtn];
[self.view addSubview:self.pwdLoginBtn];
[self.view addSubview:self.accountView];
[self.view addSubview:self.accountPwdView];
[self.view addSubview:self.forgetBtn];
[self.view addSubview:self.loginBtn];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(418));
}];
[self.backBnt mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(20));
make.width.mas_equalTo(kGetScaleWidth(28));
make.height.mas_equalTo(kGetScaleWidth(28));
make.top.mas_equalTo(kGetScaleWidth(52));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(146.0/812.0*KScreenHeight);
make.top.equalTo(self.backBnt.mas_bottom).mas_offset(kGetScaleWidth(48));
make.leading.mas_equalTo(kGetScaleWidth(24));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[self.despLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(4);
[self.chooseTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.titleLabel.mas_bottom).mas_offset(kGetScaleWidth(24));
make.left.right.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(65));
}];
[self.choosePsdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(16));
make.height.mas_equalTo(kGetScaleWidth(22));
make.width.mas_equalTo(KScreenWidth/2);
make.left.mas_equalTo(0);
}];
[self.choosePhoneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(16));
make.height.mas_equalTo(kGetScaleWidth(22));
make.width.mas_equalTo(KScreenWidth/2);
make.right.mas_equalTo(0);
}];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.top.equalTo(self.chooseTypeView.mas_bottom);
}];
[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);
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(self.chooseTypeView.mas_bottom).offset(kGetScaleWidth(39));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
[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);
make.centerX.equalTo(self.view);
make.width.mas_equalTo(kGetScaleWidth(303));
make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(kGetScaleWidth(20));
make.height.mas_equalTo(kGetScaleWidth(52));
}];
[self.accountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.phoneInputView);
}];
[self.accountPwdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.codeInputView);
}];
[self.forgetBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-kGetScaleWidth(52));
make.height.mas_equalTo(kGetScaleWidth(17));
make.top.equalTo(self.accountPwdView.mas_bottom).mas_offset(kGetScaleWidth(8));
}];
[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.top.mas_equalTo(self.codeInputView.mas_bottom).offset(kGetScaleWidth(48));
make.centerX.mas_equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(48));
make.width.mas_equalTo(kGetScaleWidth(303));
}];
}
- (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){
@weakify(self);
RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.codeInputView.inputTextField.rac_textSignal,self.accountView.inputTextField.rac_textSignal,self.accountPwdView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode,NSString *account,NSString *accountPwd){
@strongify(self);
if(self.selectType == 0){
return @((account.length > 0) && accountPwd.length >= 6);
}
return @((phone.length > 0) && smsCode.length >= 5);
}] takeUntil:self.rac_willDeallocSignal];
}
@@ -99,16 +179,23 @@
///
- (void)loginBtnClicked {
if(self.selectType == 0){
NSString *phone = self.accountView.inputTextField.text;
NSString *password = self.accountPwdView.inputTextField.text;
[self.presenter loginWithPhone:phone password:password];
return;
}
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];
- (void)forgetBtnClicked {
XPForgetPwdViewController *forgetVC = [[XPForgetPwdViewController alloc] init];
[self.navigationController pushViewController:forgetVC animated:YES];
}
#pragma mark - XPLoginInputViewDelegate
@@ -119,7 +206,7 @@
[self showErrorToast:YMLocalizedString(@"XPLoginPhoneViewController0")];
return;
}
[self.presenter phoneSmsCode:phone type:GetSmsType_Regist phoneAreaCode:self.phoneAreaCode];
[self.presenter phoneSmsCode:[NSString stringWithFormat:@"%@%@",self.phoneAreaCode,phone] type:GetSmsType_Regist phoneAreaCode:self.phoneAreaCode];
}
- (void)areaListAction {
@@ -137,6 +224,7 @@
#pragma mark - LoginVerifCodeProtocol
- (void)loginSuccess {
[[NSUserDefaults standardUserDefaults]removeObjectForKey:@"kLoginSuccessType"];
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
@@ -146,7 +234,9 @@
[self.navigationController popToRootViewControllerAnimated:NO];
}
-(void)backViewAction{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - LoginProtocol
- (void)phoneSmsCodeSuccess {
@@ -154,14 +244,34 @@
[self.codeInputView fireTimer];
}
-(void)setSelectType:(int)selectType{
_selectType = selectType;
_chooseTypeView.image = _selectType == 0 ? kImage(@"login_choose_phone_bg"): kImage(@"login_choose_pwd_bg");
_choosePhoneBtn.selected = _selectType != 0;
_choosePsdBtn.selected = _selectType == 0;
_forgetBtn.hidden = _selectType != 0;
_phoneInputView.hidden = _selectType == 0;
_codeInputView.hidden = _selectType == 0;
_accountView.hidden = _selectType != 0;
_accountPwdView.hidden = _selectType != 0;
}
-(void)choosePhoneAction{
self.selectType = 1;
}
-(void)choosePwdAction{
self.selectType = 0;
}
#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;
_titleLabel.text = @"Welcome to Piko";
_titleLabel.font = kFontBold(28);
_titleLabel.textColor = UIColorFromRGB(0x1F1B4F);
}
return _titleLabel;
}
@@ -182,9 +292,10 @@
_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)];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_phoneInputView.inputTextField.attributedPlaceholder = placeholder;
_phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
_phoneInputView.hidden = YES;
}
return _phoneInputView;
}
@@ -194,10 +305,11 @@
_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)];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_codeInputView.inputTextField.attributedPlaceholder = placeholder;
_codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
_codeInputView.delegate = self;
_codeInputView.hidden = YES;
}
return _codeInputView;
}
@@ -205,24 +317,112 @@
- (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];
UIImage *nextImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
UIImage *disableImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xD1F9FF),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
[_loginBtn setImage:nextImage forState:UIControlStateNormal];
[_loginBtn setImage:disableImage forState:UIControlStateDisabled];
_loginBtn.layer.cornerRadius = kGetScaleWidth(48)/2;
_loginBtn.layer.masksToBounds = YES;
UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginPhoneViewController8") font:kFontMedium(16) textColor:[UIColor whiteColor]];
titleView.textAlignment = NSTextAlignmentCenter;
[_loginBtn addSubview:titleView];
[titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.loginBtn);
}];
[_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];
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"login_phone_pwd_bg");
_bgImageView.contentMode = 2;
}
return _bgImageView;
}
- (UIButton *)backBnt{
if(!_backBnt){
_backBnt = [UIButton new];
[_backBnt setImage:kImage(@"common_nav_back") forState:UIControlStateNormal];
[_backBnt addTarget:self action:@selector(backViewAction) forControlEvents:UIControlEventTouchUpInside];
[_backBnt setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
}
return _pwdLoginBtn;
return _backBnt;
}
- (UIImageView *)chooseTypeView{
if(!_chooseTypeView){
_chooseTypeView = [UIImageView new];
_chooseTypeView.userInteractionEnabled = YES;
[_chooseTypeView setImage:kImage(@"login_choose_phone_bg")];
}
return _chooseTypeView;
}
- (UIButton *)choosePhoneBtn{
if(!_choosePhoneBtn){
_choosePhoneBtn = [UIButton new];
[_choosePhoneBtn setTitle:YMLocalizedString(@"XPLoginPhoneViewController10" ) forState:UIControlStateNormal];
[_choosePhoneBtn setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal];
[_choosePhoneBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateSelected];
_choosePhoneBtn.titleLabel.font = kFontSemibold(16);
[ _choosePhoneBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
[_choosePhoneBtn addTarget:self action:@selector(choosePhoneAction) forControlEvents:UIControlEventTouchUpInside];
}
return _choosePhoneBtn;
}
- (UIButton *)choosePsdBtn{
if(!_choosePsdBtn){
_choosePsdBtn = [UIButton new];
[_choosePsdBtn setTitle:YMLocalizedString(@"XPLoginPhoneViewController9") forState:UIControlStateNormal];
[_choosePsdBtn setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal];
[_choosePsdBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateSelected];
_choosePsdBtn.titleLabel.font = kFontSemibold(16);
[_choosePsdBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
[_choosePsdBtn addTarget:self action:@selector(choosePwdAction) forControlEvents:UIControlEventTouchUpInside];
_choosePsdBtn.selected = YES;
}
return _choosePsdBtn;
}
- (XPLoginInputView *)accountView {
if (!_accountView) {
_accountView = [[XPLoginInputView alloc] init];
_accountView.areaStackView.hidden = YES;
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController2")];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_accountView.inputTextField.attributedPlaceholder = placeholder;
_accountView.inputTextField.keyboardType = UIKeyboardTypeNumberPad;
}
return _accountView;
}
- (XPLoginInputView *)accountPwdView {
if (!_accountPwdView) {
_accountPwdView = [[XPLoginInputView alloc] init];
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController3")];
[placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)];
_accountPwdView.inputTextField.attributedPlaceholder = placeholder;
_accountPwdView.inputTextField.keyboardType = UIKeyboardTypeAlphabet;
_accountPwdView.inputTextField.secureTextEntry = YES;
}
return _accountPwdView;
}
- (UIButton *)forgetBtn {
if (!_forgetBtn) {
_forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_forgetBtn setTitle:YMLocalizedString(@"XPRoomRedPacketPwdView1") forState:UIControlStateNormal];
[_forgetBtn setTitleColor:UIColorFromRGB(0xB3B3C3) forState:UIControlStateNormal];
_forgetBtn.titleLabel.font = kFontRegular(12);
[_forgetBtn addTarget:self action:@selector(forgetBtnClicked) forControlEvents:UIControlEventTouchUpInside];
}
return _forgetBtn;
}
@end

View File

@@ -25,12 +25,13 @@
@property (nonatomic, strong) XPLoginInputView *phoneInputView;
///
@property (nonatomic, strong) XPLoginInputView *pwdInputView;
///
@property (nonatomic, strong) UIButton *forgetBtn;
///
@property (nonatomic, strong) UIButton *loginBtn;
///
@property (nonatomic, strong) UIButton *phoneLoginBtn;
///
@property (nonatomic, strong) UIButton *forgetBtn;
@end
@@ -155,7 +156,16 @@
}
return _pwdInputView;
}
- (UIButton *)forgetBtn {
if (!_forgetBtn) {
_forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_forgetBtn setTitle:YMLocalizedString(@"XPRoomRedPacketPwdView1") 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;
}
- (UIButton *)loginBtn {
if (!_loginBtn) {
_loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -179,15 +189,6 @@
return _phoneLoginBtn;
}
- (UIButton *)forgetBtn {
if (!_forgetBtn) {
_forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_forgetBtn setTitle:YMLocalizedString(@"XPRoomRedPacketPwdView1") 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

View File

@@ -41,8 +41,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
@property (nonatomic, strong) UIButton *agreeBtn;
///
@property (nonatomic, strong) YYLabel *protocolLabel;
///
@property (nonatomic, strong) UILabel *otherLabel;
///
@property (nonatomic, strong) UIImageView *authBubbleView;
///
@@ -59,6 +58,11 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
///
@property (nonatomic,strong) GIDConfiguration *configuration;
///
@property(nonatomic,strong) UIImageView *nextView;
///
@property(nonatomic,strong) UILabel *nextLabel;
@end
@implementation XPLoginViewController
@@ -92,7 +96,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
[self.view addSubview:self.quickLoginBtn];
[self.view addSubview:self.protocolLabel];
[self.view addSubview:self.agreeBtn];
[self.view addSubview:self.otherLabel];
[self.view addSubview:self.authBubbleView];
[self.authBubbleView addSubview:self.authBubbleLabel];
@@ -107,17 +111,17 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.view);
make.height.mas_equalTo(355);
make.height.mas_equalTo(kGetScaleWidth(355));
}];
[self.logoView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_offset(130);
make.height.mas_equalTo(148);
make.width.mas_offset(kGetScaleWidth(130));
make.height.mas_equalTo(kGetScaleWidth(148));
make.centerX.equalTo(self.view);
make.top.mas_equalTo(140);
make.top.mas_equalTo(kGetScaleWidth(100));
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.self.logoView.mas_bottom).offset(kGetScaleWidth(95));
make.top.mas_equalTo(self.self.logoView.mas_bottom).offset(kGetScaleWidth(60));
make.centerX.mas_equalTo(self.view);
}];
@@ -127,23 +131,20 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
make.centerX.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(22));
make.width.mas_equalTo(kGetScaleWidth(140));
make.top.equalTo(self.stackView.mas_bottom).mas_offset(kGetScaleWidth(28));
make.top.equalTo(self.stackView.mas_bottom).mas_offset(kGetScaleWidth(18));
}];
[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);
make.bottom.mas_equalTo(-kGetScaleWidth(35));
}];
[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.authBubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.agreeBtn).mas_offset((-16));
@@ -172,6 +173,33 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
make.width.mas_equalTo(kGetScaleWidth(295));
make.height.mas_equalTo(kGetScaleWidth(46));
}];
id type = [[NSUserDefaults standardUserDefaults]valueForKey:@"kLoginSuccessType"];
if(type != nil){
[self.view addSubview:self.nextView];
[self.nextView addSubview:self.nextLabel];
UIButton *typeButton ;
if([type intValue] == 5){
typeButton = self.appleButton;
}else if([type intValue] == 8){
typeButton = self.googleButtonView;
}else if([type intValue] == 10){
typeButton = self.fbButtonView;
}else{
typeButton = self.lineButtonView;
}
[self.nextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(28));
make.width.mas_equalTo(kGetScaleWidth(70));
make.height.mas_equalTo(kGetScaleWidth(24));
make.centerY.equalTo(typeButton.mas_top);
}];
[self.nextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.nextView);
}];
}
}
- (void)setConfigPrivacyAlertView {
@@ -194,7 +222,10 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
if(type == ThirdLoginType_Gmail){
[self.presenter thirdLoginByGoogleWithPresentingViewController:self configuration:self.configuration];
return;
}
}else if(type == ThirdLoginType_FB){
[self.presenter thirdLoginByFBWithPresentingViewController:self];
return;
}
[self.presenter thirdLoginWithType:type];
} else {
@@ -264,7 +295,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
[_quickLoginBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateNormal];
[_quickLoginBtn setImage:[UIImage imageNamed:@"login_phone_white"] forState:UIControlStateNormal];
[_quickLoginBtn setImageEdgeInsets:UIEdgeInsetsMake(0, kGetScaleWidth(122), 0, 0)];
[_quickLoginBtn setImageEdgeInsets:UIEdgeInsetsMake(0, kGetScaleWidth(130), 0, 0)];
[_quickLoginBtn addTarget:self action:@selector(quickLoginBtnClicked) forControlEvents:UIControlEventTouchUpInside];
}
return _quickLoginBtn;
@@ -289,13 +320,13 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
- (YYLabel *)protocolLabel {
if (!_protocolLabel) {
_protocolLabel = [[YYLabel alloc] init];
_protocolLabel.font = [UIFont systemFontOfSize:12];
_protocolLabel.font = kFontRegular(12);
_protocolLabel.numberOfLines = 0;
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginViewController6")];
attString.yy_color = UIColor.whiteColor;
attString.yy_color = UIColorFromRGB(0xB3B3C3);
NSString *userString = YMLocalizedString(@"XPLoginViewController7");
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}];
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x1F1B4F)}];
@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);
@@ -306,9 +337,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
} longPressAction:nil];
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginViewController8")];
andString.yy_color = UIColor.whiteColor;
andString.yy_color = UIColorFromRGB(0xB3B3C3);
NSString *protocolString = YMLocalizedString(@"XPLoginViewController9");
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}];
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x1F1B4F)}];
[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);
//
@@ -325,16 +356,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
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) {
@@ -456,4 +478,18 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}
return _logoView;
}
- (UIImageView *)nextView{
if(!_nextView){
_nextView = [UIImageView new];
_nextView.image = kImage(@"login_next_login");
}
return _nextView;
}
- (UILabel *)nextLabel{
if(!_nextLabel){
_nextLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginViewController17") font:kFontMedium(12) textColor:[UIColor whiteColor]];
_nextLabel.textAlignment = NSTextAlignmentCenter;
}
return _nextLabel;
}
@end

View File

@@ -89,7 +89,6 @@
-(void)getRecordIncomeSuccess:(XPIncomeRecordModel *)model{
[self hideHUD];
self.recordModel = model;
self.goldView.hidden = self.recordModel.roomType == 4;
self.diamondView.number = @(model.diamonds).stringValue;
self.goldView.number = [NSString stringWithFormat:@"%.2f",model.golds];
// NSString * myUid = [AccountInfoStorage instance].getUid;

View File

@@ -325,7 +325,27 @@
#pragma mark - Event Response
- (void)logoutButtonAction:(UIButton *)sender {
[self.presenter logoutCurrentAccount];
id isSaveBindPwd = [[NSUserDefaults standardUserDefaults]valueForKey:@"kSaveBindPwd"];
if(self.userInfo.isBindPasswd == NO && isSaveBindPwd == nil){
[[NSUserDefaults standardUserDefaults]setValue:@"1" forKey:@"kSaveBindPwd"];
[[NSUserDefaults standardUserDefaults]synchronize];
TTAlertConfig * config = [[TTAlertConfig alloc] init];
config.title = YMLocalizedString(@"XPMineSettingViewController9");
config.message = YMLocalizedString(@"XPMineSettingViewController10");
[TTPopup alertWithConfig:config confirmHandler:^{
XPMineLoginPasswordViewController *vc = [[XPMineLoginPasswordViewController alloc] init];
vc.userInfo = self.userInfo;
vc.isModifiPwd = NO;
[self.navigationController pushViewController:vc animated:YES];
} cancelHandler:^{
[self.presenter logoutCurrentAccount];
}];
return;
}
[self.presenter logoutCurrentAccount];
}
#pragma mark - Getters And Setters

View File

@@ -54,6 +54,9 @@ NS_ASSUME_NONNULL_BEGIN
///心跳接口,每 30 秒调用一次,用来更新用户在线状态 登录成功之后调用
+ (void)requestClientHeartBrat:(HttpRequestHelperCompletion)completion;
/// /// ///判断是否绑定授权码
/// @param completion 完成
+(void)requestAuthorizationCodeInfo:(HttpRequestHelperCompletion)completion;
@end
NS_ASSUME_NONNULL_END

View File

@@ -113,5 +113,9 @@
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil];
}
/// /// ///
/// @param completion
+(void)requestAuthorizationCodeInfo:(HttpRequestHelperCompletion)completion{
[self makeRequest:@"phone/auth/isBoundPhoneAuthCode" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
@end

View File

@@ -43,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN
///app 启动调用此接口 主要功能:给主播分流
- (void)clientStartApp;
///判断是否绑定授权码
-(void)getAuthorizationCodeInfo;
@end

View File

@@ -219,5 +219,11 @@ static NSString * kUpdateVersionNum = @"kUpdateVersionNum";
NSString *dateStr = [formatter stringFromDate:now];
return dateStr;
}
-(void)getAuthorizationCodeInfo{
[Api requestAuthorizationCodeInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView]getAuthorizationCodeInfoWithPhoneSuccess:[data.data boolValue]];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]getAuthorizationCodeInfoWithPhonefail];
} errorToast:NO]];
}
@end

View File

@@ -30,7 +30,10 @@ NS_ASSUME_NONNULL_BEGIN
///获取更新版本信息成功
- (void)getVersionUpdate:(XPVersionUpdateModel *)versionModel;
//////判断是否绑定授权码
-(void)getAuthorizationCodeInfoWithPhoneSuccess:(BOOL)flag;
//////判断是否绑定授权码
-(void)getAuthorizationCodeInfoWithPhonefail;
@end
NS_ASSUME_NONNULL_END

View File

@@ -75,6 +75,7 @@
#import "XPMomentListViewController.h"
#import "XPHomeSloganViewController.h"
#import "XPSimpleMineViewController.h"
#import "XPLoginAuthCodeVC.h"
///Present
#import "MainPresenter.h"
#import "MainProtocol.h"
@@ -91,7 +92,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
UIKIT_EXTERN NSString * kNewUserRechargeKey;
UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol, NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate, NIMChatManagerDelegate, XPAnchorCardViewDelegate, NIMBroadcastManagerDelegate, XPRoomYearActivityViewDelegate>
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol, NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate, NIMChatManagerDelegate,XPLoginAuthCodeVCDelegate, XPAnchorCardViewDelegate, NIMBroadcastManagerDelegate, XPRoomYearActivityViewDelegate>
{
NSTimer * timer;
}
@@ -244,7 +245,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
return;
}
if (userInfo.nick == nil || userInfo.avatar == nil) {
[self completeUserInfo];
[self.presenter getAuthorizationCodeInfo];
return;
}
[self initTabs:YES];
@@ -262,6 +264,25 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
vc.parentMode = self.parentMode;
}
}
- (void)getAuthorizationCodeInfoWithPhonefail{
[self completeUserInfo];
}
-(void)getAuthorizationCodeInfoWithPhoneSuccess:(BOOL)flag{
if(flag == NO){
XPLoginAuthCodeVC *vc = [[XPLoginAuthCodeVC alloc]init];
vc.delegate = self;
vc.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:vc animated:YES completion:nil];
return;
}
[self completeUserInfo];
}
#pragma mark - XPLoginAuthCodeVCDelegate
- (void)bindCodeSuccess{
[self completeUserInfo];
}
///
-(void)requestGiftList{
[self dealWithDefaultSvga];

View File

@@ -551,6 +551,9 @@
"XPMineSettingViewController6" = "目前已更新到最新版本";
"XPMineSettingViewController7" = "退出当前账号";
"XPMineSettingViewController8" = "退出账号";
"XPMineSettingViewController9" = "设置登录密码";
"XPMineSettingViewController10" = "为了方便您下次登录,请先设置登录密码";
"XPMineModifPayPwdViewController0" = "修改支付密码";
"XPMineModifPayPwdViewController1" = "修改支付密码成功";
@@ -2095,6 +2098,9 @@
"XPLoginPhoneViewController5" = "请输入手机号";
"XPLoginPhoneViewController6" = "请输入验证码";
"XPLoginPhoneViewController7" = "密码登录";
"XPLoginPhoneViewController8" = "登录";
"XPLoginPhoneViewController9" = "账号登录";
"XPLoginPhoneViewController10" = "短信登录";
"XPLoginInputView0" = "获取验证码";
"XPLoginInputView1" = "重新获取";
@@ -2116,6 +2122,7 @@
"XPLoginViewController14" = "Facebook登录";
"XPLoginViewController15" = "Line登录";
"XPLoginViewController16" = "选择其他方式登录";
"XPLoginViewController17" = "上次登录";
"XPForgetPwdViewController0" = "请输入正确的手机号";
@@ -2177,9 +2184,11 @@
"LoginFullInfoViewController2" = "性别后期无法进行修改";
"LoginFullInfoViewController3" = "昵称";
"LoginFullInfoViewController4" = "邀请码";
"LoginFullInfoViewController5" = "(选填)";
"LoginFullInfoViewController6" = "下一步";
"LoginFullInfoViewController5" = "请输入邀请码(选填";
"LoginFullInfoViewController6" = "完成";
"LoginFullInfoViewController7" = "本软件只提供给18岁或以上用户使用";
"LoginFullInfoViewController8" = "請選擇您的性別";
"LoginFullInfoViewController9" = "随机";
"LoginBindPhoneViewController0" = "第三方登录需绑定手机号喔~";
"LoginBindPhoneViewController1" = "手机格式不正确";
@@ -2836,7 +2845,14 @@
"XPMineUserInfoIndividualTagView2"="编辑标签";
///XPMineUserInfoHeaderTagView
"XPMineUserInfoHeaderTagView0"="设置你的个人标签";
///
///XPLoginAuthCodeVC
"XPLoginAuthCodeVC0"="授权码";
"XPLoginAuthCodeVC1"="请输入授权码";
"XPLoginAuthCodeVC2"="绑定授权码成功";
"XPLoginAuthCodeVC3"="完成";
///PIUserSexView.m
"PIUserSexView0" = "男生";
"PIUserSexView1" = "女生";
///不能脚本生成的
"App_Common_And" = "和";
"App_Common_Male" = "男";

View File

@@ -559,6 +559,8 @@
"XPMineSettingViewController6" = "目前已更新到最新版本";
"XPMineSettingViewController7" = "退出當前賬號";
"XPMineSettingViewController8" = "退出賬號";
"XPMineSettingViewController9" = "設置登錄密碼";
"XPMineSettingViewController10" = "為了方便您下次登錄,請先設置登錄密碼";
"XPMineModifPayPwdViewController0" = "修改支付密碼";
"XPMineModifPayPwdViewController1" = "修改支付密碼成功";
@@ -2103,6 +2105,9 @@
"XPLoginPhoneViewController5" = "請輸入手機號";
"XPLoginPhoneViewController6" = "請輸入驗證碼";
"XPLoginPhoneViewController7" = "密碼登錄";
"XPLoginPhoneViewController8" = "登錄";
"XPLoginPhoneViewController9" = "賬號登錄";
"XPLoginPhoneViewController10" = "短信登錄";
"XPLoginInputView0" = "獲取驗證碼";
"XPLoginInputView1" = "重新獲取";
@@ -2124,6 +2129,7 @@
"XPLoginViewController14" = "Facebook登錄";
"XPLoginViewController15" = "Line登錄";
"XPLoginViewController16" = "選擇其他方式登錄";
"XPLoginViewController17" = "上次登錄";
"XPForgetPwdViewController0" = "請輸入正確的手機號";
"XPForgetPwdViewController1" = "驗證碼發送成功";
@@ -2184,9 +2190,11 @@
"LoginFullInfoViewController2" = "性別後期無法進行修改";
"LoginFullInfoViewController3" = "昵稱";
"LoginFullInfoViewController4" = "邀請碼";
"LoginFullInfoViewController5" = "(選填)";
"LoginFullInfoViewController6" = "下一步";
"LoginFullInfoViewController5" = "請輸入邀請碼(選填";
"LoginFullInfoViewController6" = "完成";
"LoginFullInfoViewController7" = "本軟件只提供給18歲或以上用戶使用";
"LoginFullInfoViewController8" = "請選擇您的性別";
"LoginFullInfoViewController9" = "隨機";
"LoginBindPhoneViewController0" = "第三方登錄需綁定手機號喔~";
"LoginBindPhoneViewController1" = "手機格式不正確";
@@ -2836,6 +2844,15 @@
"XPMineUserInfoIndividualTagView2"="編輯標簽";
///XPMineUserInfoHeaderTagView
"XPMineUserInfoHeaderTagView0"="設置你的個人標簽";
///XPLoginAuthCodeVC
"XPLoginAuthCodeVC0"="授權碼";
"XPLoginAuthCodeVC1"="請輸入授權碼";
"XPLoginAuthCodeVC2"="綁定授權碼成功";
"XPLoginAuthCodeVC3"="完成";
///PIUserSexView.m
"PIUserSexView0" = "男生";
"PIUserSexView1" = "女生";
///不能腳本生成的
"App_Common_And" = "和";
"App_Common_Male" = "男";