Compare commits

...

4 Commits

Author SHA1 Message Date
liyuhua
067db98ac7 删除审核 2023-08-17 15:05:18 +08:00
liyuhua
cacb649ebc 企业包关闭审核 2023-08-17 15:05:18 +08:00
liyuhua
2cd350e5de 修复bug 2023-08-17 15:05:18 +08:00
liyuhua
b6694676c6 更换支付方式 2023-08-17 15:05:18 +08:00
19 changed files with 140 additions and 217 deletions

View File

@@ -42,7 +42,7 @@
if (code == 200) { if (code == 200) {
self.retryCount = 0; self.retryCount = 0;
NSDictionary * initData = data.data; NSDictionary * initData = data.data;
self.canOpen = ![initData[@"aModel"] boolValue]; self.canOpen = YES;
self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue]; self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue];
// //
self.openCandyTree = [initData[@"openBoxSwitch"] boolValue]; self.openCandyTree = [initData[@"openBoxSwitch"] boolValue];

View File

@@ -100,6 +100,8 @@ typedef NS_ENUM(NSUInteger, URLType) {
kTreasureRuleURL, kTreasureRuleURL,
///夺宝记录 ///夺宝记录
kTreasureRecordURL, kTreasureRecordURL,
///第三方充值
kThirdPartyPay,
}; };
NSString * const URLWithType(URLType type); NSString * const URLWithType(URLType type);

View File

@@ -26,6 +26,7 @@ NSString * const URLWithType(URLType type) {
@(kNobleRankURL) : @"modules/noble/index.html",/// @(kNobleRankURL) : @"modules/noble/index.html",///
@(kGoldEarningsRecord) : @"modules/myincome/index.html#/GoldLog",/// @(kGoldEarningsRecord) : @"modules/myincome/index.html#/GoldLog",///
@(kCandyTreeRuleURL) : @"modules/rule/newWishingWellRule.html",/// modules/rank/index.html#/wishingWellRule @(kCandyTreeRuleURL) : @"modules/rule/newWishingWellRule.html",/// modules/rank/index.html#/wishingWellRule
@(kThirdPartyPay) : @"modules/pay/index.html?channelType=%@&deviceId=%@",///
}; };
NSString * newUrl = [newDic objectForKey:@(type)]; NSString * newUrl = [newDic objectForKey:@(type)];
if(newUrl != nil){ if(newUrl != nil){

View File

@@ -104,6 +104,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
if (@available(iOS 13.0, *)) { if (@available(iOS 13.0, *)) {
[self.stackView addArrangedSubview:self.appleButton]; [self.stackView addArrangedSubview:self.appleButton];
} }
self.appleButton.hidden = YES;
[self.stackView addArrangedSubview:self.googleButtonView]; [self.stackView addArrangedSubview:self.googleButtonView];
[self.stackView addArrangedSubview:self.fbButtonView]; [self.stackView addArrangedSubview:self.fbButtonView];
[self.stackView addArrangedSubview:self.lineButtonView]; [self.stackView addArrangedSubview:self.lineButtonView];

View File

@@ -26,7 +26,6 @@
#import "XPRoomViewController.h" #import "XPRoomViewController.h"
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "XPMineRechargeViewController.h" #import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPMineUserInfoViewController.h" #import "XPMineUserInfoViewController.h"
#import "XPMineSimpleUserInfoViewController.h" #import "XPMineSimpleUserInfoViewController.h"
#import "XPMineDressUpViewController.h" #import "XPMineDressUpViewController.h"
@@ -143,9 +142,10 @@
case SecretaryRouterType_Purse: case SecretaryRouterType_Purse:
case SecretaryRouterType_Recharge: case SecretaryRouterType_Recharge:
{ {
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES]; webVC.isPush = YES;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
} }
break; break;
case SecretaryRouterType_UserInfo: case SecretaryRouterType_UserInfo:

View File

@@ -28,7 +28,6 @@
#import "XPMineDressUpViewController.h" #import "XPMineDressUpViewController.h"
#import "XPDressUpShopCardViewController.h" #import "XPDressUpShopCardViewController.h"
#import "XPMineRechargeViewController.h" #import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
@interface XPDressUpShopViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, SDCycleScrollViewDelegate> @interface XPDressUpShopViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, SDCycleScrollViewDelegate>
@@ -233,9 +232,10 @@
} }
- (void)rechargeButtonAction:(UIButton *)sender { - (void)rechargeButtonAction:(UIButton *)sender {
// XPMineRechargeViewController *vc = [[XPMineRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
[self.navigationController pushViewController:rechargeVC animated:YES]; webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters

View File

@@ -12,7 +12,6 @@
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "XPExchangeDiamondsVC.h" #import "XPExchangeDiamondsVC.h"
#import "XPIncomeRecordGoldDetailsVC.h" #import "XPIncomeRecordGoldDetailsVC.h"
#import "XPIAPRechargeViewController.h"
///Present ///Present
#import "XPIncomeRecordPresent.h" #import "XPIncomeRecordPresent.h"
///Protocol ///Protocol
@@ -116,7 +115,9 @@
} }
case ClickType_Diamond_Pay: 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]; [self.navigationController pushViewController:webVC animated:YES];
break; break;
} }

View File

@@ -42,7 +42,6 @@
#import "WalletInfoModel.h" #import "WalletInfoModel.h"
#import "XPNobleCenterPayView.h" #import "XPNobleCenterPayView.h"
#import "XPNobleCenterProtocol.h" #import "XPNobleCenterProtocol.h"
#import "XPIAPRechargeViewController.h"
@interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, XPIAPHelperDelegate, NIMSystemNotificationManagerDelegate> @interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, XPIAPHelperDelegate, NIMSystemNotificationManagerDelegate>
/// ///
@property (nonatomic, strong) NSArray<NSString *> *titles; @property (nonatomic, strong) NSArray<NSString *> *titles;
@@ -196,8 +195,9 @@
config.message = YMLocalizedString(@"XPNobleCenterViewController3"); config.message = YMLocalizedString(@"XPNobleCenterViewController3");
config.actionStyle = TTAlertActionBothStyle; config.actionStyle = TTAlertActionBothStyle;
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{ [TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"5",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES]; [self.navigationController pushViewController:webVC animated:YES];
} cancelHandler:^{ } cancelHandler:^{

View File

@@ -55,7 +55,6 @@
#import "XPMineCollectRoomListViewController.h" #import "XPMineCollectRoomListViewController.h"
#import "XPMineMainGuildListVC.h" #import "XPMineMainGuildListVC.h"
#import "XPMineGiveDiamondVC.h" #import "XPMineGiveDiamondVC.h"
#import "XPIAPRechargeViewController.h"
#import "XPIncomeRecordVC.h" #import "XPIncomeRecordVC.h"
#import "XPNobleCenterViewController.h" #import "XPNobleCenterViewController.h"
UIKIT_EXTERN NSString *kRequestRicket; UIKIT_EXTERN NSString *kRequestRicket;
@@ -415,8 +414,10 @@ UIKIT_EXTERN NSString *kRequestRicket;
} }
/// ///
-(void)pushThirdPartyPayVC{ -(void)pushThirdPartyPayVC{
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
[self.navigationController pushViewController:webVC animated:YES]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
} }
/// ///
-(void)pushEarningsRecordVC{ -(void)pushEarningsRecordVC{

View File

@@ -44,7 +44,6 @@
#import "XPMineUserInfoViewController.h" #import "XPMineUserInfoViewController.h"
#import "XPMineSimpleUserInfoViewController.h" #import "XPMineSimpleUserInfoViewController.h"
#import "XPMineRechargeViewController.h" #import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "XPRoomViewController.h" #import "XPRoomViewController.h"
#import "XPMineDressUpViewController.h" #import "XPMineDressUpViewController.h"
@@ -59,7 +58,6 @@
#import "XPMineCollectRoomListViewController.h" #import "XPMineCollectRoomListViewController.h"
#import "XPMineFeedbackViewController.h" #import "XPMineFeedbackViewController.h"
#import "XPMineSimpleUserInfoViewController.h" #import "XPMineSimpleUserInfoViewController.h"
#import "XPIAPRechargeViewController.h"
@interface XPSimpleMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeBannerTableViewCellDelegate, XPMineProtocol, XPSimpleMineHeaderViewDelegate> @interface XPSimpleMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeBannerTableViewCellDelegate, XPMineProtocol, XPSimpleMineHeaderViewDelegate>
@@ -137,9 +135,10 @@
break; break;
case XPMineItemType_Account: case XPMineItemType_Account:
{ {
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPIAPRechargeViewController *rechargeVC = [[XPIAPRechargeViewController alloc] init]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
[self.navigationController pushViewController:rechargeVC animated:YES]; webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
} }
break; break;
case XPMineItemType_Personinfo: case XPMineItemType_Personinfo:

View File

@@ -29,7 +29,6 @@
#import "XCCurrentVCStackManager.h" #import "XCCurrentVCStackManager.h"
#import "XPCandyTreeInsufficientBalanceView.h" #import "XPCandyTreeInsufficientBalanceView.h"
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "XPIAPRechargeViewController.h"
///P ///P
#import "XPCandyTreePresenter.h" #import "XPCandyTreePresenter.h"
#import "XPCandyTreeProtocol.h" #import "XPCandyTreeProtocol.h"
@@ -490,7 +489,14 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey;
} }
#pragma mark -XPCandyTreeInsufficientBalanceViewDelegate #pragma mark -XPCandyTreeInsufficientBalanceViewDelegate
- (void)payBalanceAction{ - (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]; [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
} }
- (void)pickButtonAction:(UIButton *)sender { - (void)pickButtonAction:(UIButton *)sender {

View File

@@ -1,8 +1,8 @@
// //
// XPFirstRechargeView.h // XPFirstRechargeView.h
// YuMi // xplan-ios
// //
// Created by YuMi on 2023/2/27. // Created by duoban on 2023/2/27.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>

View File

@@ -1,24 +1,15 @@
// //
// XPFirstRechargeView.m // XPFirstRechargeView.m
// YuMi // xplan-ios
// //
// Created by YuMi on 2023/2/27. // Created by duoban on 2023/2/27.
// //
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
///Tool ///Tool
#import <Base64/MF_Base64Additions.h>
#import "YUMIMacroUitls.h"
#import "ThemeColor+FirstRecharge.h" #import "ThemeColor+FirstRecharge.h"
#import "UIImage+Utils.h" #import "UIImage+Utils.h"
#import "XPFirstRechargeFlowLayout.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 ///Model
#import "FirstRechargeModel.h" #import "FirstRechargeModel.h"
///View ///View
@@ -34,7 +25,7 @@
#import "Api+FirstRecharge.h" #import "Api+FirstRecharge.h"
#import "FirstRechargeModel.h" #import "FirstRechargeModel.h"
#import "XPSkillCardPlayerManager.h" #import "XPSkillCardPlayerManager.h"
@interface XPFirstRechargeView ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPIAPHelperDelegate> @interface XPFirstRechargeView ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
/// ///
@property (nonatomic,strong) UIButton *backBtn; @property (nonatomic,strong) UIButton *backBtn;
/// ///
@@ -65,23 +56,15 @@
@property (nonatomic,weak) UINavigationController * currentNav; @property (nonatomic,weak) UINavigationController * currentNav;
/// ///
@property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView; @property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView;
@property (nonatomic,strong) FirstRechargeModel *currentInfo;
@property (nonatomic,copy) NSString *orderId;
@end @end
@implementation XPFirstRechargeView @implementation XPFirstRechargeView
- (void)dealloc {
[XPIAPHelper shareHelper].delegate = nil;
}
-(instancetype)initWithFrame:(CGRect)frame{ -(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if(self){ if(self){
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
[self getFirstRechargeRewardList]; [self getFirstRechargeRewardList];
[XPIAPHelper shareHelper].delegate = self;
} }
return self; return self;
@@ -189,8 +172,8 @@
NSString * title = model.chargeProdTitle; NSString * title = model.chargeProdTitle;
NSString * giveMoneyStr = [NSString stringWithFormat:@"%ld", model.giveMoney]; NSString * giveMoneyStr = [NSString stringWithFormat:@"%ld", model.giveMoney];
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}]; NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:kFontRegular(12), NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}];
[attribute addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold] range:[title rangeOfString:giveMoneyStr]]; [attribute addAttribute:NSFontAttributeName value:kFontSemibold(12) range:[title rangeOfString:giveMoneyStr]];
[self.extraButton setAttributedTitle:attribute forState:UIControlStateNormal]; [self.extraButton setAttributedTitle:attribute forState:UIControlStateNormal];
} }
@@ -199,7 +182,6 @@
if (array.count <= 0) return; if (array.count <= 0) return;
self.typeArrowView.hidden = NO; self.typeArrowView.hidden = NO;
self.originArray = array; self.originArray = array;
self.currentInfo = [array safeObjectAtIndex1:0];
if (self.segmentView.arrangedSubviews.count > 0) { if (self.segmentView.arrangedSubviews.count > 0) {
[[self.segmentView arrangedSubviews] enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [[self.segmentView arrangedSubviews] enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[obj removeFromSuperview]; [obj removeFromSuperview];
@@ -207,11 +189,11 @@
} }
for (int i = 0 ; i < array.count; i++) { for (int i = 0 ; i < array.count; i++) {
FirstRechargeModel * modelInfo = [array safeObjectAtIndex1: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]; UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [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:UIControlStateNormal];
[button setTitle:title forState:UIControlStateSelected]; [button setTitle:title forState:UIControlStateSelected];
button.tag = i; button.tag = i;
@@ -259,100 +241,6 @@
return cell; 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 #pragma mark - Event Response
@@ -362,14 +250,22 @@
} }
- (void)rechargeButtonAction { - (void)rechargeButtonAction {
if (self.currentInfo == nil|| self.currentInfo.chargeProdId == nil) { if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
return; [self.delegate rechargeHandle];
} }
FirstRechargeModel *model = self.currentInfo; [self backAction];
if (model.chargeProdId) {
[XNDJTDDLoadingTool showLoading];
[self requestIAPRechargeOrderWithChargeProdId:model.chargeProdId];
}
} }
-(void)backAction{ -(void)backAction{
[self removeFromSuperview]; [self removeFromSuperview];
@@ -377,7 +273,6 @@
- (void)buttonAction:(UIButton *)sender { - (void)buttonAction:(UIButton *)sender {
if (sender.tag <= self.originArray.count) { if (sender.tag <= self.originArray.count) {
FirstRechargeModel * model = [self.originArray safeObjectAtIndex1:sender.tag]; FirstRechargeModel * model = [self.originArray safeObjectAtIndex1:sender.tag];
self.currentInfo = model;
[self createExtraRewardAttrebute:model]; [self createExtraRewardAttrebute:model];
self.rewardArray = model.firstChargeRewardList; self.rewardArray = model.firstChargeRewardList;
self.collectionView.hidden = self.rewardArray.count < 2; self.collectionView.hidden = self.rewardArray.count < 2;
@@ -461,7 +356,7 @@
- (UIButton *)extraButton { - (UIButton *)extraButton {
if (!_extraButton) { if (!_extraButton) {
_extraButton = [UIButton buttonWithType:UIButtonTypeCustom]; _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; 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:UIControlStateNormal];
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateSelected]; [_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateSelected];
[_rechargeButton setTitle:YMLocalizedString(@"XPFirstRechargeViewController1") forState:UIControlStateNormal]; [_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 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside]; [_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
} }
@@ -525,7 +420,7 @@
- (UIImageView *)typeArrowView{ - (UIImageView *)typeArrowView{
if (!_typeArrowView){ if (!_typeArrowView){
_typeArrowView = [UIImageView new]; _typeArrowView = [UIImageView new];
_typeArrowView.image = [UIImage imageNamed:@"room_first_recharge_recharge_arrow"]; _typeArrowView.image = kImage(@"room_first_recharge_recharge_arrow");
_typeArrowView.hidden = YES; _typeArrowView.hidden = YES;
} }
return _typeArrowView; return _typeArrowView;

View File

@@ -44,7 +44,6 @@
#import "XPGiftProtocol.h" #import "XPGiftProtocol.h"
///VC ///VC
#import "XPMineRechargeViewController.h" #import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPWebViewController.h" #import "XPWebViewController.h"
UIKIT_EXTERN NSString * kShowFirstRechargeView; UIKIT_EXTERN NSString * kShowFirstRechargeView;
@@ -435,11 +434,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
/// ///
- (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view { - (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view {
[self dismissViewControllerAnimated:NO completion:^{ [self dismissViewControllerAnimated:YES completion:nil];
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init]; webVC.isPush = YES;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
}]; [self.delegate.getCurrentNav pushViewController:webVC animated:YES];
} }
- (void)xPGiftBarViewDidClickFirstRecharge:(XPGiftBarView *)view { - (void)xPGiftBarViewDidClickFirstRecharge:(XPGiftBarView *)view {

View File

@@ -21,8 +21,8 @@
#import "XPMinePayPwdViewController.h" #import "XPMinePayPwdViewController.h"
#import "BaseNavigationController.h" #import "BaseNavigationController.h"
#import "XPMineRechargeViewController.h" #import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPRoomHalfWebView.h" #import "XPRoomHalfWebView.h"
#import "XPWebViewController.h"
///P ///P
#import "XPRoomRedPacketPresenter.h" #import "XPRoomRedPacketPresenter.h"
#import "XPRoomRedPacketProtocol.h" #import "XPRoomRedPacketProtocol.h"
@@ -31,6 +31,7 @@
#import "RoomInfoModel.h" #import "RoomInfoModel.h"
#import "UserInfoModel.h" #import "UserInfoModel.h"
@interface XPRoomSendRedPacketViewController ()<YYTextViewDelegate, XPRoomRedPacketProtocol, XPRoomRedPacketPwdViewDelegate> @interface XPRoomSendRedPacketViewController ()<YYTextViewDelegate, XPRoomRedPacketProtocol, XPRoomRedPacketPwdViewDelegate>
///host ///host
@@ -403,9 +404,10 @@
} }
- (void)onRechargeButtonClick:(UIButton *)sender { - (void)onRechargeButtonClick:(UIButton *)sender {
// XPMineRechargeViewController *rechargeVC = [[XPMineRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
[self.navigationController pushViewController:rechargeVC animated:YES]; webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
} }
- (void)onRuleButtonClick:(UIButton *)sender { - (void)onRuleButtonClick:(UIButton *)sender {

View File

@@ -32,8 +32,7 @@
///P ///P
#import "XPTreasureFailyPresenter.h" #import "XPTreasureFailyPresenter.h"
#import "XPTreasureFailyProtocol.h" #import "XPTreasureFailyProtocol.h"
#import "XPIAPRechargeViewController.h" @interface XPTreasureFairyViewController ()<XPTreasureFailyProtocol, NIMSystemNotificationManagerDelegate, XPTreasureFairyMoreViewDelegate,XPTreasureFairyWebViewDelegate>
@interface XPTreasureFairyViewController ()<XPTreasureFailyProtocol, NIMSystemNotificationManagerDelegate, XPTreasureFairyMoreViewDelegate,XPTreasureFairyWebViewDelegate,XPIAPRechargeViewControllerDelegate>
/// ///
@property (nonatomic,strong) UIView *dismissView; @property (nonatomic,strong) UIView *dismissView;
/// ///
@@ -395,28 +394,36 @@
#pragma mark - XPTreasureFairyWebViewDelegate #pragma mark - XPTreasureFairyWebViewDelegate
-(void)payWithFairyHandler{ -(void)payWithFairyHandler{
[TTPopup dismiss]; [TTPopup dismiss];
XPWebViewController *payVC = [[XPWebViewController alloc] initWithCustomizeNav:YES];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init]; payVC.view.backgroundColor = [UIColor whiteColor];
rechargeVC.delegate = self; payVC.webview.opaque = NO;
rechargeVC.isFairyPay = YES; payVC.isFairyPay = YES;
rechargeVC.view.backgroundColor = [UIColor whiteColor]; [self addChildViewController:payVC];
[self addChildViewController:rechargeVC]; [self.view addSubview:payVC.view];
[self.view addSubview:rechargeVC.view]; @kWeakify(payVC);
payVC.CloseWebViewBlock = ^(BOOL result) {
rechargeVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight); @kStrongify(payVC);
[UIView animateWithDuration:0.5 animations:^{ dispatch_async(dispatch_get_main_queue(), ^{
rechargeVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); [UIView animateWithDuration:0.5 animations:^{
}completion:^(BOOL finished) { 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 #pragma mark - Event Response
- (void)dismissVC { - (void)dismissVC {

View File

@@ -59,7 +59,7 @@
///P ///P
#import "XPRoomPresenter.h" #import "XPRoomPresenter.h"
#import "XPRoomProtocol.h" #import "XPRoomProtocol.h"
#import "XPWebViewController.h"
#import "RoomHostDelegate.h" #import "RoomHostDelegate.h"
#import "RoomGuestDelegate.h" #import "RoomGuestDelegate.h"
@@ -1656,7 +1656,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self enterRoomFail:0]; [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 { - (XPRoomBackContainerView *)backContainerView {
if (!_backContainerView) { if (!_backContainerView) {
_backContainerView = [[XPRoomBackContainerView alloc] initWithdelegate:self]; _backContainerView = [[XPRoomBackContainerView alloc] initWithdelegate:self];

View File

@@ -657,15 +657,11 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
if (logined) { if (logined) {
msg = [[SessionListViewController alloc] init]; msg = [[SessionListViewController alloc] init];
if ([ClientConfig shareConfig].canOpen) {
home = [[XPNewHomeViewController alloc] init]; home = [[XPNewHomeViewController alloc] init];
monents = [[XPMonentsViewController alloc] init]; monents = [[XPMonentsViewController alloc] init];
me = [[XPMineViewController alloc] init]; me = [[XPMineViewController alloc] init];
}else{
home = [[XPHomeSloganViewController alloc] init];
monents = [[XPMomentListViewController alloc] init];
me = [[XPSimpleMineViewController alloc] init];
}
} else { } else {
game = [[XPBlankViewController alloc]init]; game = [[XPBlankViewController alloc]init];
msg = [[SessionListViewController alloc]init]; msg = [[SessionListViewController alloc]init];

View File

@@ -27,7 +27,7 @@
#import "Api+Mine.h" #import "Api+Mine.h"
#import "XPSkillCardPlayerManager.h" #import "XPSkillCardPlayerManager.h"
#import "XPWebViewNavView.h" #import "XPWebViewNavView.h"
#import "XPIAPRechargeViewController.h"
typedef NS_ENUM(NSUInteger, RightNavigationPushType){ typedef NS_ENUM(NSUInteger, RightNavigationPushType){
///h5 ///h5
@@ -300,24 +300,30 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId";
[TTPopup dismiss]; [TTPopup dismiss];
if(self.isPush){ if(self.isPush){
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
return; webVC.isPush = YES;
} [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
UIViewController *controller = [XCCurrentVCStackManager shareManager].getCurrentVC; return;
if (controller.presentingViewController) { }
[controller dismissViewControllerAnimated:NO completion:nil]; UIViewController *controller = [XCCurrentVCStackManager shareManager].getCurrentVC;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (controller.presentingViewController) {
[controller dismissViewControllerAnimated:NO completion:nil];
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}); XPWebViewController * webVC =[[XPWebViewController alloc] init];
}else { webVC.isPush = YES;
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; [[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]) { } else if ([message.name isEqualToString:kOpenPersonPage]) {
NSString *uid = [NSString stringWithFormat:@"%@",message.body]; NSString *uid = [NSString stringWithFormat:@"%@",message.body];
if (uid.integerValue > 0) { if (uid.integerValue > 0) {