Compare commits
8 Commits
2.7.32
...
enterprise
Author | SHA1 | Date | |
---|---|---|---|
![]() |
73f937259f | ||
![]() |
8dfd32b59c | ||
![]() |
a33f132353 | ||
![]() |
ff39aeb5c8 | ||
![]() |
d05c1691b7 | ||
![]() |
367851d971 | ||
![]() |
7ebc65dfa0 | ||
![]() |
9182cdedcf |
@@ -42,7 +42,7 @@
|
||||
if (code == 200) {
|
||||
self.retryCount = 0;
|
||||
NSDictionary * initData = data.data;
|
||||
self.canOpen = ![initData[@"aModel"] boolValue];
|
||||
self.canOpen = YES;
|
||||
self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue];
|
||||
//糖果树配置
|
||||
self.openCandyTree = [initData[@"openBoxSwitch"] boolValue];
|
||||
|
@@ -100,6 +100,8 @@ typedef NS_ENUM(NSUInteger, URLType) {
|
||||
kTreasureRuleURL,
|
||||
///夺宝记录
|
||||
kTreasureRecordURL,
|
||||
///第三方充值
|
||||
kThirdPartyPay,
|
||||
};
|
||||
|
||||
NSString * const URLWithType(URLType type);
|
||||
|
@@ -26,6 +26,7 @@ NSString * const URLWithType(URLType type) {
|
||||
@(kNobleRankURL) : @"modules/noble/index.html",///排行榜
|
||||
@(kGoldEarningsRecord) : @"modules/myincome/index.html#/GoldLog",///金币收益记录
|
||||
@(kCandyTreeRuleURL) : @"modules/rule/newWishingWellRule.html",///糖果树规则 modules/rank/index.html#/wishingWellRule
|
||||
@(kThirdPartyPay) : @"modules/pay/index.html?channelType=%@&deviceId=%@",///第三方充值
|
||||
};
|
||||
NSString * newUrl = [newDic objectForKey:@(type)];
|
||||
if(newUrl != nil){
|
||||
|
@@ -5,6 +5,8 @@
|
||||
// Created by YUMI on 2021/9/10.
|
||||
//
|
||||
///一些宏
|
||||
#import "NSBundle+Localizable.h"
|
||||
|
||||
#ifndef YUMIMacroUitls_h
|
||||
#define YUMIMacroUitls_h
|
||||
|
||||
@@ -49,7 +51,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"https://beta.api",@".pekolive.com"]
|
||||
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"]
|
||||
|
||||
#else
|
||||
|
||||
@@ -58,7 +60,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
#endif
|
||||
|
||||
#define API_Image_URL @"https://image.hfighting.com"
|
||||
#import "NSBundle+Localizable.h"
|
||||
|
||||
#define YMLocalizedString(key) \
|
||||
[NSBundle ymLocalizedStringForKey:(key)]
|
||||
#endif /* YUMIMacroUitls_h */
|
||||
|
@@ -54,7 +54,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
///qq
|
||||
@property (nonatomic, strong) UIButton *lineButtonView;
|
||||
|
||||
@property (nonatomic, strong) UIButton *appleButton;
|
||||
|
||||
|
||||
///谷歌登录配置
|
||||
@property (nonatomic,strong) GIDConfiguration *configuration;
|
||||
@@ -101,9 +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.stackView addArrangedSubview:self.googleButtonView];
|
||||
[self.stackView addArrangedSubview:self.fbButtonView];
|
||||
[self.stackView addArrangedSubview:self.lineButtonView];
|
||||
@@ -121,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);
|
||||
}];
|
||||
|
||||
@@ -157,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));
|
||||
@@ -177,9 +172,7 @@ 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){
|
||||
if([type intValue] == ThirdLoginType_Gmail){
|
||||
typeButton = self.googleButtonView;
|
||||
}else if([type intValue] == ThirdLoginType_FB){
|
||||
typeButton = self.fbButtonView;
|
||||
@@ -442,22 +435,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{
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPMineSimpleUserInfoViewController.h"
|
||||
#import "XPMineDressUpViewController.h"
|
||||
@@ -143,9 +142,10 @@
|
||||
case SecretaryRouterType_Purse:
|
||||
case SecretaryRouterType_Recharge:
|
||||
{
|
||||
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
break;
|
||||
case SecretaryRouterType_UserInfo:
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#import "XPMineDressUpViewController.h"
|
||||
#import "XPDressUpShopCardViewController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
|
||||
@interface XPDressUpShopViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, SDCycleScrollViewDelegate>
|
||||
|
||||
@@ -233,9 +232,10 @@
|
||||
}
|
||||
|
||||
- (void)rechargeButtonAction:(UIButton *)sender {
|
||||
// XPMineRechargeViewController *vc = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPExchangeDiamondsVC.h"
|
||||
#import "XPIncomeRecordGoldDetailsVC.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
///Present
|
||||
#import "XPIncomeRecordPresent.h"
|
||||
///Protocol
|
||||
@@ -116,7 +115,9 @@
|
||||
}
|
||||
case ClickType_Diamond_Pay:
|
||||
{
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
break;
|
||||
}
|
||||
@@ -137,16 +138,16 @@
|
||||
default:
|
||||
{
|
||||
|
||||
NSString * myUid = [AccountInfoStorage instance].getUid;
|
||||
if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){
|
||||
// NSString * myUid = [AccountInfoStorage instance].getUid;
|
||||
// if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kGoldEarningsRecord);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
return;
|
||||
|
||||
}
|
||||
XPIncomeRecordGoldDetailsVC *goldDetailVC = [XPIncomeRecordGoldDetailsVC new];
|
||||
[self.navigationController pushViewController:goldDetailVC animated:YES];
|
||||
// return;
|
||||
//
|
||||
// }
|
||||
// XPIncomeRecordGoldDetailsVC *goldDetailVC = [XPIncomeRecordGoldDetailsVC new];
|
||||
// [self.navigationController pushViewController:goldDetailVC animated:YES];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@
|
||||
self.descLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterEntranceView0"), value];
|
||||
self.descLabel.textColor = UIColorFromRGB(0x5E4D98);
|
||||
self.nextLevelLabel.text = nextLevelName;
|
||||
|
||||
self.descLabel.hidden = nobleInfo.currLevel >= 9;
|
||||
CGFloat margin = self.backProgressView.frame.size.width * (nobleInfo.currScore * 1.0 / (nextScore > 0 ? nextScore : 1));
|
||||
[self.currentProgressView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(self.backProgressView.mas_leading).mas_offset(margin);
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#import "WalletInfoModel.h"
|
||||
#import "XPNobleCenterPayView.h"
|
||||
#import "XPNobleCenterProtocol.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
@interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, XPIAPHelperDelegate, NIMSystemNotificationManagerDelegate>
|
||||
///分页标题
|
||||
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
||||
@@ -196,8 +195,9 @@
|
||||
config.message = YMLocalizedString(@"XPNobleCenterViewController3");
|
||||
config.actionStyle = TTAlertActionBothStyle;
|
||||
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
|
||||
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"5",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
|
@@ -55,7 +55,6 @@
|
||||
#import "XPMineCollectRoomListViewController.h"
|
||||
#import "XPMineMainGuildListVC.h"
|
||||
#import "XPMineGiveDiamondVC.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPIncomeRecordVC.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
UIKIT_EXTERN NSString *kRequestRicket;
|
||||
@@ -415,8 +414,10 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
}
|
||||
///点击充值
|
||||
-(void)pushThirdPartyPayVC{
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
///点击收益记录
|
||||
-(void)pushEarningsRecordVC{
|
||||
|
@@ -44,7 +44,6 @@
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPMineSimpleUserInfoViewController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPMineDressUpViewController.h"
|
||||
@@ -59,7 +58,6 @@
|
||||
#import "XPMineCollectRoomListViewController.h"
|
||||
#import "XPMineFeedbackViewController.h"
|
||||
#import "XPMineSimpleUserInfoViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
|
||||
@interface XPSimpleMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeBannerTableViewCellDelegate, XPMineProtocol, XPSimpleMineHeaderViewDelegate>
|
||||
|
||||
@@ -137,9 +135,10 @@
|
||||
break;
|
||||
case XPMineItemType_Account:
|
||||
{
|
||||
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController *rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
break;
|
||||
case XPMineItemType_Personinfo:
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPCandyTreeInsufficientBalanceView.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
///P
|
||||
#import "XPCandyTreePresenter.h"
|
||||
#import "XPCandyTreeProtocol.h"
|
||||
@@ -490,7 +489,14 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey;
|
||||
}
|
||||
#pragma mark -XPCandyTreeInsufficientBalanceViewDelegate
|
||||
- (void)payBalanceAction{
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
@kWeakify(self)
|
||||
webVC.CloseWebViewBlock = ^(BOOL result){
|
||||
@kStrongify(self)
|
||||
[self.presenter getCandyTreeInfo];
|
||||
};
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
- (void)pickButtonAction:(UIButton *)sender {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
//
|
||||
// XPFirstRechargeView.h
|
||||
// YuMi
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by YuMi on 2023/2/27.
|
||||
// Created by duoban on 2023/2/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
@@ -1,24 +1,15 @@
|
||||
//
|
||||
// XPFirstRechargeView.m
|
||||
// YuMi
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by YuMi on 2023/2/27.
|
||||
// Created by duoban on 2023/2/27.
|
||||
//
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import <Base64/MF_Base64Additions.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "XPFirstRechargeFlowLayout.h"
|
||||
#import "NSArray+Safe.h"
|
||||
#import "XNDJTDDLoadingTool.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "YYUtility.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "XPIAPHelper.h"
|
||||
#import "RechargeStorage.h"
|
||||
///Model
|
||||
#import "FirstRechargeModel.h"
|
||||
///View
|
||||
@@ -34,7 +25,7 @@
|
||||
#import "Api+FirstRecharge.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "XPSkillCardPlayerManager.h"
|
||||
@interface XPFirstRechargeView ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPIAPHelperDelegate>
|
||||
@interface XPFirstRechargeView ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *backBtn;
|
||||
///背景图
|
||||
@@ -65,23 +56,15 @@
|
||||
@property (nonatomic,weak) UINavigationController * currentNav;
|
||||
///
|
||||
@property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView;
|
||||
@property (nonatomic,strong) FirstRechargeModel *currentInfo;
|
||||
@property (nonatomic,copy) NSString *orderId;
|
||||
@end
|
||||
@implementation XPFirstRechargeView
|
||||
|
||||
- (void)dealloc {
|
||||
[XPIAPHelper shareHelper].delegate = nil;
|
||||
}
|
||||
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self getFirstRechargeRewardList];
|
||||
[XPIAPHelper shareHelper].delegate = self;
|
||||
|
||||
}
|
||||
return self;
|
||||
@@ -189,8 +172,8 @@
|
||||
|
||||
NSString * title = model.chargeProdTitle;
|
||||
NSString * giveMoneyStr = [NSString stringWithFormat:@"%ld", model.giveMoney];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}];
|
||||
[attribute addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold] range:[title rangeOfString:giveMoneyStr]];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:kFontRegular(12), NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}];
|
||||
[attribute addAttribute:NSFontAttributeName value:kFontSemibold(12) range:[title rangeOfString:giveMoneyStr]];
|
||||
[self.extraButton setAttributedTitle:attribute forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
@@ -199,7 +182,6 @@
|
||||
if (array.count <= 0) return;
|
||||
self.typeArrowView.hidden = NO;
|
||||
self.originArray = array;
|
||||
self.currentInfo = [array safeObjectAtIndex1:0];
|
||||
if (self.segmentView.arrangedSubviews.count > 0) {
|
||||
[[self.segmentView arrangedSubviews] enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
[obj removeFromSuperview];
|
||||
@@ -207,11 +189,11 @@
|
||||
}
|
||||
for (int i = 0 ; i < array.count; i++) {
|
||||
FirstRechargeModel * modelInfo = [array safeObjectAtIndex1:i];
|
||||
NSString * title = [NSString stringWithFormat:@"$%.2f", modelInfo.chargeMoney];
|
||||
NSString * title = [NSString stringWithFormat:@"$%.2f ", modelInfo.chargeMoney];
|
||||
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
|
||||
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
button.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
||||
button.titleLabel.font = kFontMedium(15);
|
||||
[button setTitle:title forState:UIControlStateNormal];
|
||||
[button setTitle:title forState:UIControlStateSelected];
|
||||
button.tag = i;
|
||||
@@ -259,100 +241,6 @@
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - 充值
|
||||
/// 获取充值的订单编号
|
||||
/// @param chargeProdId 苹果服务器的充值 的id
|
||||
- (void)requestIAPRechargeOrderWithChargeProdId:(NSString *)chargeProdId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
NSString * deviceInfo = [YYUtility deviceID];
|
||||
NSString * clientIp= [YYUtility ipAddress];
|
||||
[Api requestIAPRecharge:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSString *orderId = (NSString *)data.data[@"recordId"];
|
||||
[self requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId];
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideHUD];
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
|
||||
}
|
||||
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId {
|
||||
if (orderId.length > 0) {
|
||||
self.orderId = orderId;
|
||||
[[XPIAPHelper shareHelper] buyAppProductWithAppProductId:chargeProdId];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPIAPHelperDelegate
|
||||
///当前充值的状态
|
||||
- (void)rechargeProcessStatus:(PaymentStatus)status {
|
||||
[XNDJTDDLoadingTool hideHUD];
|
||||
if (status == PaymentStatus_Purchased) {
|
||||
[XNDJTDDLoadingTool showLoading];
|
||||
} else if (status == PaymentStatus_Purchasing) {
|
||||
[XNDJTDDLoadingTool showLoading];
|
||||
} else if (status == PaymentStatus_Failed) {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
} else if (status == PaymentStatus_Deferred) {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
}
|
||||
}
|
||||
|
||||
///充值成功回调id
|
||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
|
||||
///保存唯一凭证
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
NSData *receiptData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString * receipt = [MF_Base64Codec base64StringFromData:receiptData];
|
||||
///二次验证
|
||||
[self checkReceiptWithData:receipt orderId:self.orderId transcationId:transactionIdentifier];
|
||||
}
|
||||
|
||||
///充值成功之后保存订单到钥匙串
|
||||
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
|
||||
[dictionary setObject:encodeStr forKey:@"recipt"];
|
||||
[dictionary setObject:self.orderId forKey:@"orderId"];
|
||||
NSString *reciptJson = [dictionary toJSONString];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
|
||||
if (!saveSuccess) {
|
||||
#warning to do 保存失败 需要埋点
|
||||
}
|
||||
}
|
||||
|
||||
///删除本地保存的
|
||||
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier uid:uid];
|
||||
if (deleteSuccess) {
|
||||
#warning to do 保存失败 需要埋点
|
||||
}
|
||||
}
|
||||
|
||||
- (void)checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api checkReceipt:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[self checkReceiptSuccess:transcationId];
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
[XNDJTDDLoadingTool hideHUD];
|
||||
} receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
///二次验证成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
self.orderId = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
|
||||
|
||||
@@ -362,14 +250,22 @@
|
||||
}
|
||||
|
||||
- (void)rechargeButtonAction {
|
||||
if (self.currentInfo == nil|| self.currentInfo.chargeProdId == nil) {
|
||||
return;
|
||||
}
|
||||
FirstRechargeModel *model = self.currentInfo;
|
||||
if (model.chargeProdId) {
|
||||
[XNDJTDDLoadingTool showLoading];
|
||||
[self requestIAPRechargeOrderWithChargeProdId:model.chargeProdId];
|
||||
}
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
|
||||
[self.delegate rechargeHandle];
|
||||
}
|
||||
[self backAction];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
-(void)backAction{
|
||||
[self removeFromSuperview];
|
||||
@@ -377,7 +273,6 @@
|
||||
- (void)buttonAction:(UIButton *)sender {
|
||||
if (sender.tag <= self.originArray.count) {
|
||||
FirstRechargeModel * model = [self.originArray safeObjectAtIndex1:sender.tag];
|
||||
self.currentInfo = model;
|
||||
[self createExtraRewardAttrebute:model];
|
||||
self.rewardArray = model.firstChargeRewardList;
|
||||
self.collectionView.hidden = self.rewardArray.count < 2;
|
||||
@@ -461,7 +356,7 @@
|
||||
- (UIButton *)extraButton {
|
||||
if (!_extraButton) {
|
||||
_extraButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_extraButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_extra"] forState:UIControlStateNormal];
|
||||
[_extraButton setBackgroundImage:kImage(@"room_first_recharge_extra") forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
return _extraButton;
|
||||
@@ -516,7 +411,7 @@
|
||||
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateNormal];
|
||||
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateSelected];
|
||||
[_rechargeButton setTitle:YMLocalizedString(@"XPFirstRechargeViewController1") forState:UIControlStateNormal];
|
||||
_rechargeButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_rechargeButton.titleLabel.font = kFontSemibold(18);
|
||||
[_rechargeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
@@ -525,7 +420,7 @@
|
||||
- (UIImageView *)typeArrowView{
|
||||
if (!_typeArrowView){
|
||||
_typeArrowView = [UIImageView new];
|
||||
_typeArrowView.image = [UIImage imageNamed:@"room_first_recharge_recharge_arrow"];
|
||||
_typeArrowView.image = kImage(@"room_first_recharge_recharge_arrow");
|
||||
_typeArrowView.hidden = YES;
|
||||
}
|
||||
return _typeArrowView;
|
||||
|
@@ -44,7 +44,6 @@
|
||||
#import "XPGiftProtocol.h"
|
||||
///VC
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
@@ -435,11 +434,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
///充值
|
||||
- (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view {
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES];
|
||||
}];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.isPush = YES;
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)xPGiftBarViewDidClickFirstRecharge:(XPGiftBarView *)view {
|
||||
|
@@ -21,8 +21,8 @@
|
||||
#import "XPMinePayPwdViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPWebViewController.h"
|
||||
///P
|
||||
#import "XPRoomRedPacketPresenter.h"
|
||||
#import "XPRoomRedPacketProtocol.h"
|
||||
@@ -31,6 +31,7 @@
|
||||
#import "RoomInfoModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
|
||||
|
||||
@interface XPRoomSendRedPacketViewController ()<YYTextViewDelegate, XPRoomRedPacketProtocol, XPRoomRedPacketPwdViewDelegate>
|
||||
|
||||
///host代理
|
||||
@@ -403,9 +404,10 @@
|
||||
}
|
||||
|
||||
- (void)onRechargeButtonClick:(UIButton *)sender {
|
||||
// XPMineRechargeViewController *rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)onRuleButtonClick:(UIButton *)sender {
|
||||
|
@@ -32,8 +32,7 @@
|
||||
///P
|
||||
#import "XPTreasureFailyPresenter.h"
|
||||
#import "XPTreasureFailyProtocol.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
@interface XPTreasureFairyViewController ()<XPTreasureFailyProtocol, NIMSystemNotificationManagerDelegate, XPTreasureFairyMoreViewDelegate,XPTreasureFairyWebViewDelegate,XPIAPRechargeViewControllerDelegate>
|
||||
@interface XPTreasureFairyViewController ()<XPTreasureFailyProtocol, NIMSystemNotificationManagerDelegate, XPTreasureFairyMoreViewDelegate,XPTreasureFairyWebViewDelegate>
|
||||
///点击消失
|
||||
@property (nonatomic,strong) UIView *dismissView;
|
||||
///背景
|
||||
@@ -395,28 +394,36 @@
|
||||
#pragma mark - XPTreasureFairyWebViewDelegate
|
||||
-(void)payWithFairyHandler{
|
||||
[TTPopup dismiss];
|
||||
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.delegate = self;
|
||||
rechargeVC.isFairyPay = YES;
|
||||
rechargeVC.view.backgroundColor = [UIColor whiteColor];
|
||||
[self addChildViewController:rechargeVC];
|
||||
[self.view addSubview:rechargeVC.view];
|
||||
|
||||
rechargeVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
rechargeVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
|
||||
}completion:^(BOOL finished) {
|
||||
|
||||
|
||||
}];
|
||||
|
||||
XPWebViewController *payVC = [[XPWebViewController alloc] initWithCustomizeNav:YES];
|
||||
payVC.view.backgroundColor = [UIColor whiteColor];
|
||||
payVC.webview.opaque = NO;
|
||||
payVC.isFairyPay = YES;
|
||||
[self addChildViewController:payVC];
|
||||
[self.view addSubview:payVC.view];
|
||||
@kWeakify(payVC);
|
||||
payVC.CloseWebViewBlock = ^(BOOL result) {
|
||||
@kStrongify(payVC);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
payVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
|
||||
}completion:^(BOOL finished) {
|
||||
[payVC.view removeFromSuperview];
|
||||
[self ticketRecognizer];
|
||||
}];
|
||||
});
|
||||
|
||||
};
|
||||
payVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
payVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
|
||||
}completion:^(BOOL finished) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
payVC.roomUid = self.roomUid;
|
||||
payVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
});
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
#pragma mark - XPIAPRechargeViewController
|
||||
- (void)paySuccess{
|
||||
[self ticketRecognizer];
|
||||
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)dismissVC {
|
||||
|
@@ -59,7 +59,7 @@
|
||||
///P
|
||||
#import "XPRoomPresenter.h"
|
||||
#import "XPRoomProtocol.h"
|
||||
|
||||
#import "XPWebViewController.h"
|
||||
#import "RoomHostDelegate.h"
|
||||
#import "RoomGuestDelegate.h"
|
||||
|
||||
@@ -1687,7 +1687,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self enterRoomFail:0];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPFirstRechargeViewDelegate
|
||||
-(void)rechargeHandle{
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] initWithCustomizeNav:YES];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"6",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
webVC.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self presentViewController:webVC animated:YES completion:nil];
|
||||
}
|
||||
- (XPRoomBackContainerView *)backContainerView {
|
||||
if (!_backContainerView) {
|
||||
_backContainerView = [[XPRoomBackContainerView alloc] initWithdelegate:self];
|
||||
|
@@ -661,15 +661,11 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
if (logined) {
|
||||
msg = [[SessionListViewController alloc] init];
|
||||
|
||||
if ([ClientConfig shareConfig].canOpen) {
|
||||
|
||||
home = [[XPNewHomeViewController alloc] init];
|
||||
monents = [[XPMonentsViewController alloc] init];
|
||||
me = [[XPMineViewController alloc] init];
|
||||
}else{
|
||||
home = [[XPHomeSloganViewController alloc] init];
|
||||
monents = [[XPMomentListViewController alloc] init];
|
||||
me = [[XPSimpleMineViewController alloc] init];
|
||||
}
|
||||
|
||||
} else {
|
||||
game = [[XPBlankViewController alloc]init];
|
||||
msg = [[SessionListViewController alloc]init];
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#import "XPWebViewNavView.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "SessionViewController.h"
|
||||
|
||||
typedef NS_ENUM(NSUInteger, RightNavigationPushType){
|
||||
///跳转h5页面
|
||||
RightNavigationPushType_Web = 1,
|
||||
@@ -303,24 +304,30 @@ NSString * const kJSOpenChatPage = @"geToChatPage";
|
||||
|
||||
|
||||
|
||||
[TTPopup dismiss];
|
||||
if(self.isPush){
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
return;
|
||||
}
|
||||
UIViewController *controller = [XCCurrentVCStackManager shareManager].getCurrentVC;
|
||||
if (controller.presentingViewController) {
|
||||
[controller dismissViewControllerAnimated:NO completion:nil];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
});
|
||||
}else {
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
[TTPopup dismiss];
|
||||
if(self.isPush){
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
return;
|
||||
}
|
||||
UIViewController *controller = [XCCurrentVCStackManager shareManager].getCurrentVC;
|
||||
if (controller.presentingViewController) {
|
||||
[controller dismissViewControllerAnimated:NO completion:nil];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.isPush = YES;
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
});
|
||||
}else {
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.isPush = YES;
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
} else if ([message.name isEqualToString:kOpenPersonPage]) {
|
||||
NSString *uid = [NSString stringWithFormat:@"%@",message.body];
|
||||
if (uid.integerValue > 0) {
|
||||
|
Reference in New Issue
Block a user