diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m index 0c73e6e0..8d8207e3 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m @@ -54,7 +54,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; ///qq @property (nonatomic, strong) UIButton *lineButtonView; -@property (nonatomic, strong) UIButton *appleButton; + ///谷歌登录配置 @property (nonatomic,strong) GIDConfiguration *configuration; @@ -89,9 +89,6 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; } - (void)createUI { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults setObject:@"hadAgree" forKey:HadAgreePrivacy]; - [defaults synchronize]; self.view.backgroundColor = [UIColor whiteColor]; [self.view addSubview:self.bgImageView]; [self.view addSubview:self.logoView]; @@ -104,10 +101,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; [self.view addSubview:self.authBubbleView]; [self.authBubbleView addSubview:self.authBubbleLabel]; - if (@available(iOS 13.0, *)) { - [self.stackView addArrangedSubview:self.appleButton]; - } - self.appleButton.hidden = YES; + [self.stackView addArrangedSubview:self.googleButtonView]; [self.stackView addArrangedSubview:self.fbButtonView]; [self.stackView addArrangedSubview:self.lineButtonView]; @@ -125,7 +119,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; }]; [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.self.logoView.mas_bottom).offset(kGetScaleWidth(60)); + make.top.mas_equalTo(self.self.logoView.mas_bottom).offset(kGetScaleWidth(122)); make.centerX.mas_equalTo(self.view); }]; @@ -161,10 +155,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; make.bottom.mas_equalTo(self.authBubbleView).mas_offset(-6); }]; - [self.appleButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(kGetScaleWidth(295)); - make.height.mas_equalTo(kGetScaleWidth(46)); - }]; + [self.googleButtonView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(kGetScaleWidth(295)); make.height.mas_equalTo(kGetScaleWidth(46)); @@ -180,21 +171,17 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; id type = [[NSUserDefaults standardUserDefaults]valueForKey:@"kLoginSuccessType"]; if(type != nil){ - UIButton *typeButton ; - if([type intValue] == ThirdLoginType_Apple){ - typeButton = self.appleButton; - }else if([type intValue] == ThirdLoginType_Gmail){ - typeButton = self.googleButtonView; - }else if([type intValue] == ThirdLoginType_FB){ - typeButton = self.fbButtonView; - }else if([type intValue] == ThirdLoginType_Line){ - typeButton = self.lineButtonView; - } - if(typeButton == nil){ - return; - } [self.view addSubview:self.nextView]; [self.nextView addSubview:self.nextLabel]; + + UIButton *typeButton ; + 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)); @@ -446,22 +433,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; } return _lineButtonView; } -- (UIButton *)appleButton { - if (!_appleButton) { - _appleButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_appleButton setImage: [UIImage imageNamed:@"login_apple"] forState:UIControlStateNormal]; - [_appleButton setTitle:YMLocalizedString(@"XPLoginViewController12") forState:UIControlStateNormal]; - _appleButton.titleLabel.font = kFontMedium(16); - [_appleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - [_appleButton setImageEdgeInsets:UIEdgeInsetsMake(0, kGetScaleWidth(28), 0, kGetScaleWidth(200))]; - _appleButton.backgroundColor = UIColorFromRGB(0x141414); - _appleButton.layer.cornerRadius = kGetScaleWidth(46)/2; - _appleButton.layer.masksToBounds = YES; - _appleButton.tag = 1000 + ThirdLoginType_Apple; - [_appleButton addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _appleButton; -} + - (GIDConfiguration *)configuration{