更换支付方式

This commit is contained in:
liyuhua
2023-08-10 12:09:54 +08:00
parent 367851d971
commit d05c1691b7
16 changed files with 137 additions and 209 deletions

View File

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

View File

@@ -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){

View File

@@ -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:

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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:^{

View File

@@ -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,7 +414,9 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
///
-(void)pushThirdPartyPayVC{
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];
}
///

View File

@@ -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:

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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;

View File

@@ -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 {

View File

@@ -21,8 +21,9 @@
#import "XPMinePayPwdViewController.h"
#import "BaseNavigationController.h"
#import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPRoomHalfWebView.h"
#import "XPMineVerifIdentityViewController.h"
#import "XPWebViewController.h"
///P
#import "XPRoomRedPacketPresenter.h"
#import "XPRoomRedPacketProtocol.h"
@@ -31,6 +32,7 @@
#import "RoomInfoModel.h"
#import "UserInfoModel.h"
@interface XPRoomSendRedPacketViewController ()<YYTextViewDelegate, XPRoomRedPacketProtocol, XPRoomRedPacketPwdViewDelegate>
///host
@@ -403,9 +405,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 {

View File

@@ -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);
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:^{
rechargeVC.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
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 {

View File

@@ -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];

View File

@@ -29,6 +29,7 @@
#import "XPWebViewNavView.h"
#import "XPIAPRechargeViewController.h"
#import "SessionViewController.h"
typedef NS_ENUM(NSUInteger, RightNavigationPushType){
///h5
RightNavigationPushType_Web = 1,
@@ -305,7 +306,9 @@ NSString * const kJSOpenChatPage = @"geToChatPage";
[TTPopup dismiss];
if(self.isPush){
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
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;
}
@@ -314,11 +317,15 @@ NSString * const kJSOpenChatPage = @"geToChatPage";
[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];
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 {
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
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]) {