diff --git a/YuMi/Config/ClientConfig.m b/YuMi/Config/ClientConfig.m index 127369dc..98bfd8fe 100644 --- a/YuMi/Config/ClientConfig.m +++ b/YuMi/Config/ClientConfig.m @@ -42,7 +42,20 @@ if (code == 200) { self.retryCount = 0; NSDictionary * initData = data.data; - self.canOpen = ![initData[@"aModel"] boolValue]; + +#ifdef DEBUG + + self.canOpen = ![initData[@"aModel"] boolValue]; + +#else + if(isEnterprise == YES){ + self.canOpen = ![initData[@"aModel"] boolValue]; + }else{ + self.canOpen = YES; + } +#endif + + self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue]; //糖果树配置 self.openCandyTree = [initData[@"openBoxSwitch"] boolValue]; diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m index 06ae9bd3..5afe4f82 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m @@ -77,7 +77,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; - (void)viewDidLoad { - + [super viewDidLoad]; [self createUI]; @@ -85,7 +85,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - + } - (void)createUI { @@ -99,19 +99,32 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; [self.view addSubview:self.quickLoginBtn]; [self.view addSubview:self.protocolLabel]; [self.view addSubview:self.agreeBtn]; - - + + [self.view addSubview:self.authBubbleView]; [self.authBubbleView addSubview:self.authBubbleLabel]; - + if (@available(iOS 13.0, *)) { - [self.stackView addArrangedSubview:self.appleButton]; +#ifdef DEBUG + + + + [self.stackView addArrangedSubview:self.appleButton]; + + + +#else + if(isEnterprise == YES){ + [self.stackView addArrangedSubview:self.appleButton]; + } +#endif + } [self.stackView addArrangedSubview:self.googleButtonView]; - [self.stackView addArrangedSubview:self.fbButtonView]; - [self.stackView addArrangedSubview:self.lineButtonView]; + [self.stackView addArrangedSubview:self.fbButtonView]; + [self.stackView addArrangedSubview:self.lineButtonView]; + - [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.equalTo(self.view); make.height.mas_equalTo(kGetScaleWidth(355)); @@ -159,11 +172,28 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; make.left.mas_equalTo(8); 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)); - }]; + if (@available(iOS 13.0, *)) { +#ifdef DEBUG + + + [self.appleButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(295)); + make.height.mas_equalTo(kGetScaleWidth(46)); + }]; + + + +#else + if(isEnterprise == YES){ + [self.appleButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(295)); + make.height.mas_equalTo(kGetScaleWidth(46)); + }]; + } +#endif + + } + [self.googleButtonView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(kGetScaleWidth(295)); make.height.mas_equalTo(kGetScaleWidth(46)); @@ -222,23 +252,23 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; } - (void)loginDidClick:(UIButton *)sender { - if (self.agreeBtn.selected) { - ThirdLoginType type = sender.tag - 1000; - if(type == ThirdLoginType_Gmail){ - [self.presenter thirdLoginByGoogleWithPresentingViewController:self configuration:self.configuration]; - return; + if (self.agreeBtn.selected) { + ThirdLoginType type = sender.tag - 1000; + 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 { + [self.presenter thirdLoginWithType:type]; + + } else { [UIView animateWithDuration:0.5 animations:^{ self.authBubbleView.alpha = 1.0; }]; - } - + } + } /// 点击同意 @@ -276,9 +306,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; /// 点击一键登录 - (void)quickLoginBtnClicked { if (self.agreeBtn.isSelected) { - XPLoginPhoneViewController *phoneVC = [[XPLoginPhoneViewController alloc] init]; - [self.navigationController pushViewController:phoneVC animated:YES]; - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginPhoneClick]; + XPLoginPhoneViewController *phoneVC = [[XPLoginPhoneViewController alloc] init]; + [self.navigationController pushViewController:phoneVC animated:YES]; + [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginPhoneClick]; } else { [UIView animateWithDuration:0.5 animations:^{ self.authBubbleView.alpha = 1.0; @@ -296,7 +326,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; - (UIButton *)quickLoginBtn { if (!_quickLoginBtn) { _quickLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - + [_quickLoginBtn setTitle:YMLocalizedString(@"XPLoginViewController16") forState:UIControlStateNormal]; _quickLoginBtn.titleLabel.font = kFontRegular(14); [_quickLoginBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateNormal]; @@ -375,14 +405,14 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; } - (UIStackView *)stackView { - if (!_stackView) { - _stackView = [[UIStackView alloc] init]; - _stackView.axis = UILayoutConstraintAxisVertical; - _stackView.distribution = UIStackViewDistributionFillEqually; - _stackView.alignment = UIStackViewAlignmentFill; - _stackView.spacing = kGetScaleWidth(16); - } - return _stackView; + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisVertical; + _stackView.distribution = UIStackViewDistributionFillEqually; + _stackView.alignment = UIStackViewAlignmentFill; + _stackView.spacing = kGetScaleWidth(16); + } + return _stackView; } - (UILabel *)authBubbleLabel { @@ -396,9 +426,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; } - (UIButton *)fbButtonView { - if (!_fbButtonView) { - _fbButtonView = [UIButton buttonWithType:UIButtonTypeCustom]; - [_fbButtonView setImage: [UIImage imageNamed:@"login_facebook"] forState:UIControlStateNormal]; + if (!_fbButtonView) { + _fbButtonView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_fbButtonView setImage: [UIImage imageNamed:@"login_facebook"] forState:UIControlStateNormal]; [_fbButtonView setTitle:YMLocalizedString(@"XPLoginViewController14") forState:UIControlStateNormal]; _fbButtonView.titleLabel.font = kFontMedium(16); [_fbButtonView setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal]; @@ -406,16 +436,16 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; _fbButtonView.backgroundColor = UIColorFromRGB(0xF3F5FA); _fbButtonView.layer.cornerRadius = kGetScaleWidth(46)/2; _fbButtonView.layer.masksToBounds = YES; - _fbButtonView.tag = 1000 + ThirdLoginType_FB; - [_fbButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _fbButtonView; + _fbButtonView.tag = 1000 + ThirdLoginType_FB; + [_fbButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; + } + return _fbButtonView; } - (UIButton *)googleButtonView { - if (!_googleButtonView) { - _googleButtonView = [UIButton buttonWithType:UIButtonTypeCustom]; - [_googleButtonView setImage: [UIImage imageNamed:@"login_gmail"] forState:UIControlStateNormal]; + if (!_googleButtonView) { + _googleButtonView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_googleButtonView setImage: [UIImage imageNamed:@"login_gmail"] forState:UIControlStateNormal]; [_googleButtonView setTitle:YMLocalizedString(@"XPLoginViewController13") forState:UIControlStateNormal]; _googleButtonView.titleLabel.font = kFontMedium(16); [_googleButtonView setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal]; @@ -423,16 +453,16 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; _googleButtonView.backgroundColor = UIColorFromRGB(0xF3F5FA); _googleButtonView.layer.cornerRadius = kGetScaleWidth(46)/2; _googleButtonView.layer.masksToBounds = YES; - _googleButtonView.tag = 1000 + ThirdLoginType_Gmail; - [_googleButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _googleButtonView; + _googleButtonView.tag = 1000 + ThirdLoginType_Gmail; + [_googleButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; + } + return _googleButtonView; } - (UIButton *)lineButtonView { - if (!_lineButtonView) { - _lineButtonView = [UIButton buttonWithType:UIButtonTypeCustom]; - [_lineButtonView setImage: [UIImage imageNamed:@"login_line"] forState:UIControlStateNormal]; + if (!_lineButtonView) { + _lineButtonView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_lineButtonView setImage: [UIImage imageNamed:@"login_line"] forState:UIControlStateNormal]; [_lineButtonView setTitle:YMLocalizedString(@"XPLoginViewController15") forState:UIControlStateNormal]; _lineButtonView.titleLabel.font = kFontMedium(16); [_lineButtonView setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal]; @@ -440,10 +470,10 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; _lineButtonView.backgroundColor = UIColorFromRGB(0xF3F5FA); _lineButtonView.layer.cornerRadius = kGetScaleWidth(46)/2; _lineButtonView.layer.masksToBounds = YES; - _lineButtonView.tag = 1000 + ThirdLoginType_Line; - [_lineButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _lineButtonView; + _lineButtonView.tag = 1000 + ThirdLoginType_Line; + [_lineButtonView addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside]; + } + return _lineButtonView; } - (UIButton *)appleButton { if (!_appleButton) { @@ -464,18 +494,18 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; - (GIDConfiguration *)configuration{ - if (!_configuration){ - NSString * number = [AESUtils aesDecrypt:@"ScLBu7ctIiyGCKPro3Jj6XMdsdCCpNT9L4wyjHEF+bguqubkXNSayFBGMKmoDwe1hjfAc958XSaBdMyEaFXLO38Bwq3xURYVNpgEM4b14zg="]; - _configuration = [[GIDConfiguration alloc] initWithClientID:number]; - } - return _configuration; + if (!_configuration){ + NSString * number = [AESUtils aesDecrypt:@"ScLBu7ctIiyGCKPro3Jj6XMdsdCCpNT9L4wyjHEF+bguqubkXNSayFBGMKmoDwe1hjfAc958XSaBdMyEaFXLO38Bwq3xURYVNpgEM4b14zg="]; + _configuration = [[GIDConfiguration alloc] initWithClientID:number]; + } + return _configuration; } - (UIImageView *)bgImageView{ if(!_bgImageView){ _bgImageView = [[UIImageView alloc]init]; _bgImageView.image = kImage(@"pi_app_logo_new_bg"); _bgImageView.contentMode = 2; - } + } return _bgImageView; } - (UIImageView *)logoView{ diff --git a/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m b/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m index 3f94d6a6..d8ebc879 100644 --- a/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m +++ b/YuMi/Modules/YMMine/View/Noble/View/SubViews/XPNobleCenterPayView.m @@ -86,7 +86,7 @@ cell.iconImage = indexPath.row == 0 ? kImage( @"mine_noble_center__diamond") : kImage(@"mine_noble_center_apple"); NSString *num = [NSString stringWithFormat:@"(%@%@)",self.diamonds,YMLocalizedString(@"XPNobleCenterPayView1")]; NSString *text = indexPath.row == 0 ? [NSString stringWithFormat:@"%@%@",self.listData[indexPath.row],num] : self.listData[indexPath.row]; - + NSMutableAttributedString *titleAtt = [[NSMutableAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightSemibold],NSForegroundColorAttributeName:UIColorFromRGB(0x1F1B4F)}]; if(indexPath.row == 0){ [titleAtt addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12 weight:UIFontWeightRegular],NSForegroundColorAttributeName:UIColorFromRGB(0x8A8CAB)} range:[text rangeOfString:num]]; @@ -155,10 +155,10 @@ _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; - + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.rowHeight = 56; - + _tableView.backgroundColor = [UIColor whiteColor]; [_tableView registerClass:[XPNobleCenterPayCell class] forCellReuseIdentifier:NSStringFromClass([XPNobleCenterPayCell class])]; } @@ -180,7 +180,17 @@ } - (NSArray *)listData{ if(!_listData){ +#ifdef DEBUG _listData = @[YMLocalizedString(@"XPNobleCenterPayView2"),@"Apple Pay"]; +#else + if(isEnterprise == YES){ + _listData = @[YMLocalizedString(@"XPNobleCenterPayView2"),@"Apple Pay"]; + }else{ + _listData = @[YMLocalizedString(@"XPNobleCenterPayView2")]; + } +#endif + + } return _listData; }