diff --git a/YuMi/Global/YUMIHtmlUrl.h b/YuMi/Global/YUMIHtmlUrl.h
index b50a063a..f484d39d 100644
--- a/YuMi/Global/YUMIHtmlUrl.h
+++ b/YuMi/Global/YUMIHtmlUrl.h
@@ -100,7 +100,8 @@ typedef NS_ENUM(NSUInteger, URLType) {
kTreasureRuleURL,
///夺宝记录
kTreasureRecordURL,
- kChannelUrl,
+ ///第三方充值
+ kThirdPartyPay,
};
NSString * const URLWithType(URLType type);
diff --git a/YuMi/Global/YUMIHtmlUrl.m b/YuMi/Global/YUMIHtmlUrl.m
index b9f3286c..cb883d02 100644
--- a/YuMi/Global/YUMIHtmlUrl.m
+++ b/YuMi/Global/YUMIHtmlUrl.m
@@ -17,8 +17,6 @@ NSString * const URLWithType(URLType type) {
prefix = [NSString stringWithFormat:@"%@k",prefix];
prefix = [NSString stringWithFormat:@"%@o",prefix];
-
-
NSDictionary *newDic = @{
@(kTreasureTicketBuyURL) : @"modules/act-treasureSnatching/index.html",///夺宝购买
@@ -28,7 +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
- @(kChannelUrl) : @"modules/%@/index.html?channelType=%@&deviceId=%@",
+ @(kThirdPartyPay) : @"modules/pay/index.html?channelType=%@&deviceId=%@",///第三方充值
};
NSString * newUrl = [newDic objectForKey:@(type)];
if(newUrl != nil){
diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTextClickable.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTextClickable.m
index 6a5de5a7..9ec5186b 100644
--- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTextClickable.m
+++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTextClickable.m
@@ -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,10 +142,10 @@
case SecretaryRouterType_Purse:
case SecretaryRouterType_Recharge:
{
-// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
- XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
- rechargeVC.type = @"4";
- [[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:
diff --git a/YuMi/Modules/YMMine/View/DressUp/View/XPDressUpShopViewController.m b/YuMi/Modules/YMMine/View/DressUp/View/XPDressUpShopViewController.m
index 3174477f..425a2d2d 100644
--- a/YuMi/Modules/YMMine/View/DressUp/View/XPDressUpShopViewController.m
+++ b/YuMi/Modules/YMMine/View/DressUp/View/XPDressUpShopViewController.m
@@ -28,7 +28,6 @@
#import "XPMineDressUpViewController.h"
#import "XPDressUpShopCardViewController.h"
#import "XPMineRechargeViewController.h"
-#import "XPIAPRechargeViewController.h"
@interface XPDressUpShopViewController ()
@@ -233,10 +232,10 @@
}
- (void)rechargeButtonAction:(UIButton *)sender {
-// XPMineRechargeViewController *vc = [[XPMineRechargeViewController alloc] init];
- XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
- rechargeVC.type = @"4";
- [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
diff --git a/YuMi/Modules/YMMine/View/IncomeRecord/XPIncomeRecordVC.m b/YuMi/Modules/YMMine/View/IncomeRecord/XPIncomeRecordVC.m
index 2cb75fe1..0cd9b15b 100644
--- a/YuMi/Modules/YMMine/View/IncomeRecord/XPIncomeRecordVC.m
+++ b/YuMi/Modules/YMMine/View/IncomeRecord/XPIncomeRecordVC.m
@@ -12,7 +12,6 @@
#import "XPWebViewController.h"
#import "XPExchangeDiamondsVC.h"
#import "XPIncomeRecordGoldDetailsVC.h"
-#import "XPIAPRechargeViewController.h"
///Present
#import "XPIncomeRecordPresent.h"
///Protocol
@@ -116,8 +115,9 @@
}
case ClickType_Diamond_Pay:
{
- XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
- webVC.type = @"4";
+ XPWebViewController * webVC =[[XPWebViewController alloc] init];
+ webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
+ webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
break;
}
@@ -138,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;
}
}
diff --git a/YuMi/Modules/YMMine/View/Noble/View/XPNobleCenterViewController.m b/YuMi/Modules/YMMine/View/Noble/View/XPNobleCenterViewController.m
index cd437d4b..a42d9bbd 100644
--- a/YuMi/Modules/YMMine/View/Noble/View/XPNobleCenterViewController.m
+++ b/YuMi/Modules/YMMine/View/Noble/View/XPNobleCenterViewController.m
@@ -17,8 +17,8 @@
#import "DJDKMIMOMColor.h"
#import "ThemeColor+NobleCenter.h"
#import "Api+NobleCenter.h"
-#import "Api+Main.h"
+#import "XPIAPHelper.h"
#import "RechargeStorage.h"
#import "AccountInfoStorage.h"
#import "UIImage+Utils.h"
@@ -31,7 +31,6 @@
#import "XPWebViewController.h"
#import "XPNobleSettingViewController.h"
#import "XPSkillCardPlayerManager.h"
-#import "SessionViewController.h"
///P
#import "XPNobleCenterPresenter.h"
#import "Api+Gift.h"
@@ -43,10 +42,7 @@
#import "WalletInfoModel.h"
#import "XPNobleCenterPayView.h"
#import "XPNobleCenterProtocol.h"
-#import "XPIAPRechargeViewController.h"
-#import "YuMi-swift.h"
-#import "ClientConfig.h"
-@interface XPNobleCenterViewController ()
+@interface XPNobleCenterViewController ()
///分页标题
@property (nonatomic, strong) NSArray *titles;
///分页控件
@@ -82,7 +78,6 @@
@property (nonatomic, assign) NSInteger roomUid;
@property (nonatomic,strong) WalletInfoModel * infoModel;
@property(nonatomic,strong) UIButton *rankBtn;
-@property(nonatomic,assign) BOOL pi_IsNative;
@end
@implementation XPNobleCenterViewController
@@ -96,18 +91,19 @@
}
- (void)dealloc {
-
+ [XPIAPHelper shareHelper].delegate = nil;
}
- (void)viewDidLoad {
[super viewDidLoad];
- self.pi_IsNative = YES;
+
+ [XPIAPHelper shareHelper].delegate = self;
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
[self requestHttp];
[self initSubViews];
[self initSubViewConstraints];
}
-
+
- (BOOL)isHiddenNavBar {
return YES;
}
@@ -119,8 +115,8 @@
[self.presenter getUserInfo];
}
if([XPSkillCardPlayerManager shareInstance].isInRoom == YES && [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == NO){
- [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
- }
+ [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
+ }
}
- (XPNobleCenterPresenter *)createPresenter {
@@ -147,7 +143,7 @@
make.leading.top.trailing.mas_equalTo(self.view);
make.height.mas_equalTo(height);
}];
-
+
[self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(self.view);
make.height.mas_equalTo(kNavigationHeight);
@@ -157,7 +153,7 @@
make.height.mas_equalTo(40);
make.top.mas_equalTo(self.navView.mas_bottom);
}];
-
+
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleView.mas_bottom);
@@ -181,7 +177,7 @@
make.width.height.mas_equalTo(20);
make.centerY.equalTo(self.openNobleView);
make.trailing.equalTo(self.openNobleButton.mas_leading).mas_offset(-2);
-
+
}];
[self.rankBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(57);
@@ -189,7 +185,7 @@
make.trailing.mas_equalTo(-24);
make.top.mas_equalTo(139);
}];
-
+
}
#pragma mark - XPNobleCenterPayViewDelegate
- (void)payWithType:(NobleCenterPayType)type{
@@ -199,11 +195,12 @@
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:^{
-
+
}];
return;
}
@@ -211,20 +208,8 @@
[self.presenter openVipWithDiamondRoomUid:roomUid];
return;
}
-
- if(self.pi_IsNative == NO){
- XPWebViewController *vc = [[XPWebViewController alloc]init];
- NSString *channel = @"p";
- channel = [NSString stringWithFormat:@"%@a",channel];
- channel = [NSString stringWithFormat:@"%@y",channel];
- NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,@"5",[YYUtility deviceID]];
- vc.url = url;
- [self.navigationController pushViewController:vc animated:YES];
- return;
- }
-
if(self.rechargeModel.list.count == 0)return;
- [XNDJTDDLoadingTool showOnlyView:kWindow];
+ [self showLoading];
RechargeListModel *rechargeModel = [self.rechargeModel.list safeObjectAtIndex1:0];
[self.presenter requestNobleIAPRechargeOrderWithChargeProdId:rechargeModel.chargeProdId roomUid:self.roomUid ? [NSString stringWithFormat:@"%zd", self.roomUid] : nil];
}
@@ -247,34 +232,14 @@
self.infoModel = model;
}
} uid:uid ticket:ticket];
-
-
-
- if([ClientConfig shareConfig].canOpen){
- [Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
- if(code == 200){
- if(data.data[@"isNative"] != nil){
- self.pi_IsNative = [data.data[@"isNative"] boolValue];
-
- }
-
- }
-
- }];
-
- }
-
}
///批量验证
- (void)checkTranscationIds {
NSString * uid = [AccountInfoStorage instance].getUid;
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
- for (NSDictionary *transcation in array) {
- NSString *orderId = transcation[@"orderId"];
- NSString *transcationId = transcation[@"transcationId"];
- ///二次验证
- [self.presenter checkReceiptWithOrderId:orderId transcationId:transcationId errorToast:NO];
+ if (array.count > 0) {
+ [self.presenter checkTranscationIds:array];
}
}
@@ -320,8 +285,7 @@
}
///请求充值id的状态成功
-- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid{
-
+- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId {
if (orderId.length > 0) {
self.orderId = orderId;
if (@available(iOS 15.0, *)) {
@@ -360,47 +324,17 @@
}
+
} else {
- [XNDJTDDLoadingTool hideOnlyView:kWindow];
+ [self hideHUD];
}
}
///请求充值账单失败
- (void)requestIAPRechargeOrderFail:(NSString *)message code:(NSInteger)code {
- [XNDJTDDLoadingTool hideOnlyView:kWindow];
-
- if(code == 50000){
-
- TTAlertConfig *config = [[TTAlertConfig alloc]init];
- config.title = YMLocalizedString(@"XPIAPRechargeViewController7");
- config.message = YMLocalizedString(@"XPIAPRechargeViewController8");
- TTAlertButtonConfig *confirmButtonConfig = [[TTAlertButtonConfig alloc]init];
- confirmButtonConfig.title = YMLocalizedString(@"XPIAPRechargeViewController9");
- UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(200, 200)];
- confirmButtonConfig.backgroundColor = [UIColor colorWithPatternImage:image];
- confirmButtonConfig.cornerRadius = 38/2;
- config.confirmButtonConfig = confirmButtonConfig;
- [TTPopup alertWithConfig:config confirmHandler:^{
- [self.presenter getContactCustomerService];
- } cancelHandler:^{
- }];
- return;
- }
-
-
- [self showErrorToast:message];
-
-
-
-}
-- (void)getContactCustomerServiceSuccessWithUid:(NSString *)uid{
[self hideHUD];
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P];
- SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
- [self.navigationController pushViewController:sessionVC animated:YES];
- });
-
+ [self showErrorToast:message];
}
+
///二次校验成功
- (void)checkReceiptSuccess:(NSString *)transcationId {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
@@ -420,6 +354,7 @@
}
});
}
+
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if(code == 1444){
@@ -432,6 +367,7 @@
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
}
}
+
///删除本地保存的
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSString * uid = [AccountInfoStorage instance].getUid;
@@ -470,8 +406,10 @@
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
///保存唯一凭证
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
+ NSData *receiptData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
+ NSString * receipt = [MF_Base64Codec base64StringFromData:receiptData];
///二次验证
- [self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
+ [self.presenter checkReceiptWithData:receipt orderId:self.orderId transcationId:transactionIdentifier];
}
///充值成功之后保存订单到钥匙串
@@ -568,7 +506,7 @@
payView.delegate = self;
[self.view addSubview:payView];
-
+
}
#pragma mark - Getters And Setters
@@ -645,7 +583,7 @@
_openNobleButton.textColor = [DJDKMIMOMColor mainTextColor];
_openNobleButton.numberOfLines = 0;
_openNobleButton.textAlignment = NSTextAlignmentCenter;
-
+
}
return _openNobleButton;
}
diff --git a/YuMi/Modules/YMMine/View/XPMineViewController.m b/YuMi/Modules/YMMine/View/XPMineViewController.m
index 4886b2da..97ffbb9b 100644
--- a/YuMi/Modules/YMMine/View/XPMineViewController.m
+++ b/YuMi/Modules/YMMine/View/XPMineViewController.m
@@ -55,13 +55,8 @@
#import "XPMineCollectRoomListViewController.h"
#import "XPMineMainGuildListVC.h"
#import "XPMineGiveDiamondVC.h"
-#import "XPIAPRechargeViewController.h"
#import "XPIncomeRecordVC.h"
#import "XPNobleCenterViewController.h"
-#import "LittleGameInfoModel.h"
-#import "HomeLittleGameRoomModel.h"
-#import "XPLittleGameRoomOpenView.h"
-#import "XPMineGameTableViewCell.h"
UIKIT_EXTERN NSString *kRequestRicket;
@interface XPMineViewController ()
@@ -87,10 +82,6 @@ UIKIT_EXTERN NSString *kRequestRicket;
@property (nonatomic,assign) BOOL isRefreshRoomInfo;
///是否正在请示数据,防止过多请求
@property (nonatomic,assign) BOOL isRequestData;
-///游戏列表
-@property (nonatomic, strong) NSMutableArray *littleGameArray;
-
-
@end
@implementation XPMineViewController
@@ -228,22 +219,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
break;
case XPMineItemType_My_Room:
{
- NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
- [Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
- if (code == 200) {
- RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
- if (roomInfo.isReselect) {
- XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
- roomOpenView.roomInfo = roomInfo;
- roomOpenView.currentVC = self;
- [TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
- } else {
- [XPRoomViewController openRoom:roomUid viewController:self];
- }
- } else {
- [self showErrorToast:msg];
- }
- } uid:roomUid intoUid:roomUid];
+ NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
+ [XPRoomViewController openRoom:roomUid viewController:self];
}
break;
case XPMineItemType_Collect_Room://收藏房间
@@ -431,9 +408,10 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
///点击充值
-(void)pushThirdPartyPayVC{
- XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
- webVC.type = @"4";
- [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{
@@ -447,24 +425,9 @@ UIKIT_EXTERN NSString *kRequestRicket;
///点击我的房间
-(void)pushMyRoomVC{
if(self.isRefreshRoomInfo == YES)return;
- self.isRefreshRoomInfo = YES;
- NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
- [Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
- self.isRefreshRoomInfo = NO;
- if (code == 200) {
- RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
- if (roomInfo.isReselect) {
- XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
- roomOpenView.roomInfo = roomInfo;
- roomOpenView.currentVC = self;
- [TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
- } else {
- [XPRoomViewController openRoom:roomUid viewController:self];
- }
- } else {
- [self showErrorToast:msg];
- }
- } uid:roomUid intoUid:roomUid];
+ self.isRefreshRoomInfo = YES;
+ NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
+ [XPRoomViewController openRoom:roomUid viewController:self];
}
#pragma mark - XPMineHeadViewDelegate
///点击头像
@@ -522,21 +485,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
- (void)onGetMineFuntionItemFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
-///获取小游戏列表
-- (void)onGetLittleGameListSuccess:(NSArray *)items WithGroup:(nonnull dispatch_group_t)group{
- [self.littleGameArray removeAllObjects];
- [self.littleGameArray addObjectsFromArray:items];
- dispatch_group_leave(group);
- NSMutableArray *array = [NSMutableArray array];
- for (LittleGameInfoModel *item in self.littleGameArray) {
- [array addObject:item.name];
- }
- NSString *trackName = [array componentsJoinedByString:@","];
- [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_show eventAttributes:@{@"gameName" : trackName}];
-}
-- (void)onGetLittleGameListFailWithGroup:(dispatch_group_t)group{
- dispatch_group_leave(group);
-}
+
///获取个人中心banner
- (void)onGetPersonalBannerListSuccess:(NSArray *)items WithGroup:(nonnull dispatch_group_t)group{
[self.bannerArray removeAllObjects];
@@ -585,10 +534,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
dispatch_group_async(group, queue, ^{
[self.presenter getPersonItemListWithGroup:group];
});
- dispatch_group_enter(group);
- dispatch_group_async(group, queue, ^{
- [self.presenter getLittleGameListWithGroup:group];
- });
+
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getMineBannerListWithGroup:group];
@@ -597,8 +543,6 @@ UIKIT_EXTERN NSString *kRequestRicket;
dispatch_group_async(group, queue, ^{
[self.presenter getNobleInfoWithGroup:group];
});
-
-
dispatch_group_notify(group,dispatch_get_main_queue(), ^{
self.isRequestData = NO;
self.userInfo = userInfo;
@@ -636,58 +580,6 @@ UIKIT_EXTERN NSString *kRequestRicket;
- (void)onGetClanDetailInfofailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
-
-///匹配游戏房成功
-- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId {
- if (roomInfo.isPick && roomInfo.uid.length > 0) {
- [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomInfo.uid}];
- [XPRoomViewController openRoom:roomInfo.uid viewController:self];
- } else if (roomInfo.needOpenSelfRoom) {
- NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
- [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomUid}];
- [Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
- if (code == 200) {
- RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
- if (roomInfo.mgId != [mgId intValue]) {///更新房间游戏类型
- NSMutableDictionary * params = [NSMutableDictionary dictionary];
- NSString * uid = [AccountInfoStorage instance].getUid;
- NSString * ticket = [AccountInfoStorage instance].getTicket;
- [params setObject:ticket forKey:@"ticket"];
- [params setObject:uid forKey:@"uid"];
- [params setObject:[NSString stringWithFormat:@"%ld", roomInfo.uid] forKey:@"roomUid"];
- if (roomInfo.title.length > 0) {
- [params setObject:roomInfo.title forKey:@"title"];
- }
- if (roomInfo.roomPwd.length > 0) {
- [params setObject:roomInfo.roomPwd forKey:@"roomPwd"];
- } else{
- [params setObject:@"" forKey:@"roomPwd"];
- }
- if (roomInfo.tagId > 0) {
- [params setObject:[NSString stringWithFormat:@"%ld", roomInfo.tagId] forKey:@"tagId"];
- }
- [params setObject:@(RoomType_MiniGame) forKey:@"type"];
- [params setObject:mgId forKey:@"mgId"];
- [params setObject:@(roomInfo.hasAnimationEffect) forKey:@"hasAnimationEffect"];
- [Api ownerUpdateRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
- if (code == 200) {
- [XPRoomViewController openRoom:[AccountInfoStorage instance].getUid mgId:mgId viewController:self];
- }
- } params:params];
- }
- } else {
- [self showErrorToast:msg];
- }
- } uid:roomUid intoUid:roomUid];
- }
-}
-
-///匹配游戏房失败
-- (void)quickMatchLittleGameRoomFail:(NSString *)mgId {
- [XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", self.userInfo.uid] mgId:mgId viewController:self];
-}
-
-
#pragma mark - XPMineHeadItemTableViewCellDelegate
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
@@ -717,11 +609,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
break;
}
}
-#pragma mark - XPMineGameTableViewCellDelegate
-///选择了某个游戏
-- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item {
- [self.presenter quickMatchLittleGameWithMgId:item.mgId];
-}
+
#pragma mark - NSNotification
- (void)onVisitorUnReadCountUpdate:(NSNotification *)noti {
@@ -735,6 +623,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
+ _tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;;
[_tableView registerClass:[XPMineTheGuildCell class] forCellReuseIdentifier:NSStringFromClass([XPMineTheGuildCell class])];
[_tableView registerClass:[XPMinePersonalCenterCell class] forCellReuseIdentifier:NSStringFromClass([XPMinePersonalCenterCell class])];
@@ -767,12 +656,6 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
return _functionArray;
}
-- (NSMutableArray *)littleGameArray {
- if (!_littleGameArray) {
- _littleGameArray = [NSMutableArray array];
- }
- return _littleGameArray;
-}
- (NSMutableArray *)bannerArray {
if (!_bannerArray) {
diff --git a/YuMi/Modules/YMMine/View/XPSimpleMineViewController.m b/YuMi/Modules/YMMine/View/XPSimpleMineViewController.m
index 91090c67..d2fd472c 100644
--- a/YuMi/Modules/YMMine/View/XPSimpleMineViewController.m
+++ b/YuMi/Modules/YMMine/View/XPSimpleMineViewController.m
@@ -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 ()
@@ -137,10 +135,10 @@
break;
case XPMineItemType_Account:
{
-// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
- XPIAPRechargeViewController *rechargeVC = [[XPIAPRechargeViewController alloc] init];
- rechargeVC.type = @"4";
- [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:
@@ -441,7 +439,7 @@
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
[_tableView registerClass:[XPMineItemTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineItemTableViewCell class])];
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
-
+ _tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
}
return _tableView;
}
diff --git a/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m b/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m
index 8c232ea0..f499261c 100644
--- a/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m
+++ b/YuMi/Modules/YMRoom/View/CandyTree/View/XPCandyTreeViewController.m
@@ -454,9 +454,15 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey;
#pragma mark -XPCandyTreeInsufficientBalanceViewDelegate
- (void)payBalanceAction{
- XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
- webVC.delegate = self;
- webVC.type = @"4";
+
+ 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];
}
#pragma mark - XPIAPRechargeViewControllerDelegate
diff --git a/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.h b/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.h
index 67348634..f903b65c 100644
--- a/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.h
+++ b/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.h
@@ -1,8 +1,8 @@
//
// XPFirstRechargeView.h
-// YuMi
+// xplan-ios
//
-// Created by YuMi on 2023/2/27.
+// Created by duoban on 2023/2/27.
//
#import
diff --git a/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.m b/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.m
index 49578835..fec74270 100644
--- a/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.m
+++ b/YuMi/Modules/YMRoom/View/FirstRecharge/View/XPFirstRechargeView.m
@@ -1,26 +1,15 @@
//
// XPFirstRechargeView.m
-// YuMi
+// xplan-ios
//
-// Created by YuMi on 2023/2/27.
+// Created by duoban on 2023/2/27.
//
///Third
#import
-#import
///Tool
-#import
-#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 "Api+Main.h"
-
-#import "RechargeStorage.h"
///Model
#import "FirstRechargeModel.h"
///View
@@ -31,14 +20,11 @@
#import "XPFirstRechargeProtocol.h"
///VC
#import "XPMineRechargeViewController.h"
-
#import "XPWebViewController.h"
#import "XPFirstRechargeView.h"
#import "Api+FirstRecharge.h"
#import "FirstRechargeModel.h"
#import "XPSkillCardPlayerManager.h"
-#import "YuMi-swift.h"
-#import "ClientConfig.h"
@interface XPFirstRechargeView ()
///
@property (nonatomic,strong) UIButton *backBtn;
@@ -70,25 +56,16 @@
@property (nonatomic,weak) UINavigationController * currentNav;
///
@property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView;
-@property (nonatomic,strong) FirstRechargeModel *currentInfo;
-@property (nonatomic,copy) NSString *orderId;
-@property(nonatomic,assign) BOOL pi_IsNative;
@end
@implementation XPFirstRechargeView
-- (void)dealloc {
-
-}
-
-
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self initSubViews];
[self initSubViewConstraints];
[self getFirstRechargeRewardList];
-
-
+
}
return self;
}
@@ -104,22 +81,6 @@
}
[XNDJTDDLoadingTool showErrorWithMessage:msg];
} channelType:@"3"];
- [self checkTranscationIds];
- if([ClientConfig shareConfig].canOpen){
-
- [Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
-
- if(code == 200){
- if(data.data[@"isNative"] != nil){
- self.pi_IsNative = [data.data[@"isNative"] boolValue];
-
- }
-
- }
-
- }];
-
- }
}
#pragma mark - Private Method
- (void)initSubViews {
@@ -211,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];
}
@@ -221,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];
@@ -229,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;
@@ -481,6 +441,7 @@
self.orderId = nil;
}
+
#pragma mark - Event Response
@@ -490,23 +451,22 @@
}
- (void)rechargeButtonAction {
+ if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
+ [self.delegate rechargeHandle];
+ }
+ [self backAction];
+
+
+
+
+
+
+
+
+
+
- if(self.pi_IsNative == NO){
- if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
- [self.delegate rechargeHandle];
- }
- [self backAction];
- return;
- }
- if (self.currentInfo == nil|| self.currentInfo.chargeProdId == nil) {
- return;
- }
- FirstRechargeModel *model = self.currentInfo;
- if (model.chargeProdId) {
- [XNDJTDDLoadingTool showOnlyView:kWindow];
- [self requestIAPRechargeOrderWithChargeProdId:model.chargeProdId];
- }
}
-(void)backAction{
[self removeFromSuperview];
@@ -514,7 +474,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;
@@ -598,7 +557,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;
@@ -653,7 +612,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];
}
@@ -662,7 +621,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;
@@ -678,7 +637,7 @@
if (!_backBtn){
_backBtn = [UIButton new];
[_backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
-
+
}
return _backBtn;
}
diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m
index 0edbb268..92e49f0b 100644
--- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m
+++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m
@@ -44,9 +44,8 @@
#import "XPGiftProtocol.h"
///VC
#import "XPMineRechargeViewController.h"
-#import "XPIAPRechargeViewController.h"
#import "XPWebViewController.h"
-UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
+
UIKIT_EXTERN NSString * kShowFirstRechargeView;
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate>
@@ -89,8 +88,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
@property (nonatomic,assign) GiftSegmentType segmentType;
///福袋礼物全服记录
@property (nonatomic,strong) NSArray *records;
-///背包礼物数据
-@property (nonatomic,copy) NSArray * packGiftList;
@end
@implementation XPSendGiftView
@@ -99,9 +96,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
return [[XPGiftPresenter alloc] init];
}
--(void)dealloc{
- [[NSNotificationCenter defaultCenter]removeObserver:self];
-}
+
- (instancetype)initWithType:(SendGiftType)type uid:(NSString * __nullable)uid{
if (self = [super init]) {
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
@@ -129,17 +124,8 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
[self.stackView addArrangedSubview:self.giftInfoView];
[self.stackView addArrangedSubview:self.giftBarView];
[self.stackView addArrangedSubview:self.bottomView];
- [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(getFreeGiftCountdownNotification:) name:kFreeGiftCountdownNotification object:nil];
-}
--(void)getFreeGiftCountdownNotification:(NSNotification *)not{
- NSDictionary *freeDic = not.userInfo;
- BOOL isReset = [freeDic[@"isReset"] boolValue];///礼物清零
-
- if(isReset == YES){
- [self.presenter getPackGiftList];
- self.giftInfoView.isDelFreeGift = NO;
- }
}
+
- (void)initSubViewConstraints {
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.view);
@@ -448,12 +434,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
///充值
- (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view {
- [self dismissViewControllerAnimated:NO completion:^{
-// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
- XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
- rechargeVC.type = @"4";
- [[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 {
@@ -627,28 +612,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
}
///背包礼物
- (void)getPacketGiftListSuccess:(NSArray *)giftList {
- self.packGiftList = giftList;
- NSMutableArray *giftArray = [NSMutableArray arrayWithArray:self.packGiftList];
- BOOL isHaveFreeGift = NO;
- for (int i = 0 ; i < self.packGiftList.count; i++) {
- GiftInfoModel *infoModel = self.packGiftList[i];
- if(infoModel.giftId == self.freeModel.giftId.integerValue){
- [giftArray removeObjectAtIndex:i];
- [giftArray insertObject:infoModel atIndex:0];
- isHaveFreeGift = YES;
- break;
- }
- }
- if(isHaveFreeGift == NO && self.freeModel.curStage != nil && self.freeModel.curStage.integerValue == 0 ){
- GiftInfoModel *infoModel = [GiftInfoModel new];
- infoModel.giftId = self.freeModel.giftId.integerValue;
- infoModel.count = 0;
- infoModel.giftUrl = self.freeModel.giftUrl;
- infoModel.giftName = self.freeModel.giftName;
- [giftArray insertObject:infoModel atIndex:0];
- }
- self.giftInfoView.freeModel = self.freeModel;
- self.giftInfoView.packOriginArray = giftArray;
+ self.giftInfoView.packOriginArray = giftList;
}
- (void)getPacketGiftListFail:(NSString *)message {
@@ -682,11 +646,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
} else {
[self.presenter getUserWallInfo];
}
- dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC));
- dispatch_after(delayTime, dispatch_get_main_queue(), ^{
- [self sendCustomMessage:receiveInfo oringinDic:originDic];
- });
-
+ [self sendCustomMessage:receiveInfo oringinDic:originDic];
///发送涂鸦礼物消息
[self sendGraffitiGiftMessage];
if (self.segmentType == GiftSegmentType_Graffiti) {
diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/XPRoomSendRedPacketViewController.m b/YuMi/Modules/YMRoom/View/SendRedPacket/XPRoomSendRedPacketViewController.m
index 7767bb5b..8a12f8c2 100644
--- a/YuMi/Modules/YMRoom/View/SendRedPacket/XPRoomSendRedPacketViewController.m
+++ b/YuMi/Modules/YMRoom/View/SendRedPacket/XPRoomSendRedPacketViewController.m
@@ -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 ()
///host代理
@@ -403,10 +405,10 @@
}
- (void)onRechargeButtonClick:(UIButton *)sender {
-// XPMineRechargeViewController *rechargeVC = [[XPMineRechargeViewController alloc] init];
- XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
- rechargeVC.type = @"4";
- [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 {
diff --git a/YuMi/Modules/YMRoom/View/TreasureFairy/View/XPTreasureFairyViewController.m b/YuMi/Modules/YMRoom/View/TreasureFairy/View/XPTreasureFairyViewController.m
index 7baac4c3..38ca44ac 100644
--- a/YuMi/Modules/YMRoom/View/TreasureFairy/View/XPTreasureFairyViewController.m
+++ b/YuMi/Modules/YMRoom/View/TreasureFairy/View/XPTreasureFairyViewController.m
@@ -32,8 +32,7 @@
///P
#import "XPTreasureFailyPresenter.h"
#import "XPTreasureFailyProtocol.h"
-#import "XPIAPRechargeViewController.h"
-@interface XPTreasureFairyViewController ()
+@interface XPTreasureFairyViewController ()
///点击消失
@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 {
diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m
index b3f51b6b..67b37a9f 100644
--- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m
+++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m
@@ -24,7 +24,6 @@
#import "NSMutableDictionary+Saft.h"
#import "XPSkillCardPlayerManager.h"
#import "XCCurrentVCStackManager.h"
-#import "CountDownHelper.h"
///Model
#import "RoomInfoModel.h"
#import "UserInfoModel.h"
@@ -37,7 +36,6 @@
#import "XPReceiveRedPacketModel.h"
#import "XPRedPacketModel.h"
#import "FirstChargeRoomWindowModel.h"
-#import "XPFreeGiftModel.h"
///View
#import "BaseNavigationController.h"
#import "XPRoomActivityContainerView.h"
@@ -58,31 +56,24 @@
#import "AnchorRoomSrollTipView.h"
#import "XPReceiveRedPacketView.h"
#import "XPFirstRechargeView.h"
-#import "XPWebViewController.h"
-#import "SessionViewController.h"
-#import "XPFreeGiftsObtainView.h"
///P
#import "XPRoomPresenter.h"
#import "XPRoomProtocol.h"
-
+#import "XPWebViewController.h"
#import "RoomHostDelegate.h"
#import "RoomGuestDelegate.h"
#import "XNDJTDDLoadingTool.h"
-#import "ClientConfig.h"
-#import "LittleGameStageView.h"
-#import "LittleGameScrollStageView.h"
-#import "XPRoomLittleGameContainerView.h"
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
UIKIT_EXTERN NSString * kNewUserRechargeKey;
UIKIT_EXTERN NSString * kShowFirstRechargeView;
-UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
+
NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否展示过个播房上划用户引导
NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出过非自己房间
-@interface XPRoomViewController ()
+@interface XPRoomViewController ()
///背景
@property (nonatomic,strong) XPRoomBackContainerView *backContainerView;
@@ -104,8 +95,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
@property (nonatomic,strong) XPRoomAnimationView *animationView;
///功能view的的容器
@property (nonatomic,strong) XPRoomFunctionContainerView *functionView;
-///小游戏的容器
-@property (nonatomic,strong) XPRoomLittleGameContainerView *littleGameView;
///房间的Uid
@property (nonatomic,copy) NSString * roomUid;
///小游戏的id
@@ -137,10 +126,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
@property (nonatomic,assign) NSInteger anchorIndex;
@property (nonatomic,strong) XPFirstRechargeView *firstRechargeView;
@property (nonatomic,assign) BOOL isShowFirstRecharge;
-///免费礼物数量
-@property (nonatomic,strong) XPFreeGiftModel *freeModel;
-///免费礼物弹窗
-@property (nonatomic,strong) XPFreeGiftsObtainView *freeView;
@end
@implementation XPRoomViewController
@@ -214,13 +199,10 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
if([[XPRoomMiniManager shareManager] getRoomInfo]==nil){
[XPSkillCardPlayerManager shareInstance].isMineInMic = NO;
}
- [[CountDownHelper shareHelper] stopCountDown];
- [CountDownHelper shareHelper].delegate = nil;
[[NIMSDK sharedSDK].chatroomManager removeDelegate:self];
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
[[NIMSDK sharedSDK].loginManager removeDelegate:self];
[[NIMSDK sharedSDK].conversationManager removeDelegate:self];
- [[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@@ -248,8 +230,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.presenter getNormalGiftList:self.roomUid];
///获取房间超管列表
[self.presenter getRoomSuperAdmin:self.roomUid];
- ///获取免费礼物
- [self.presenter getFreeGiftData];
///获取首充次数
[self.presenter getRoomFirstCharegWindow:self.roomUid];
//监听云信消息x
@@ -257,8 +237,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[[NIMSDK sharedSDK].chatManager addDelegate:self];
[[NIMSDK sharedSDK].loginManager addDelegate:self];
[[NIMSDK sharedSDK].conversationManager addDelegate:self];
- [[NIMSDK sharedSDK].broadcastManager addDelegate:self];
- [CountDownHelper shareHelper].delegate = self;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myGiftEffectUpdate:) name:kRoomGiftEffectUpdateNotificationKey object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(showRoomFirstChargeWindowFormNot:) name:kShowFirstRechargeView object:nil];
[XPSkillCardPlayerManager shareInstance].isInRoom = YES;
@@ -272,13 +250,16 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[super viewWillAppear:animated];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
+
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
self.freeView.hidden = YES;
}
+
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
+
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
[XPSkillCardPlayerManager shareInstance].isInRoomVC = NO;
}
@@ -298,7 +279,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
- (void)initSubViews {
self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.backContainerView];
- [self.view addSubview:self.littleGameView];
[self.view addSubview:self.stageView];
[self.view addSubview:self.messageContainerView];
[self.view addSubview:self.quickMessageContainerView];
@@ -307,21 +287,13 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.view addSubview:self.roomHeaderView];
[self.view addSubview:self.functionView];
[self.view addSubview:self.animationView];
- self.activityContainerView.hidden = YES;
- self.littleGameView.hidden = YES;
- if ([ClientConfig shareConfig].canOpen) {
- self.littleGameView.hidden = NO;
- self.activityContainerView.hidden = NO;
- }
}
- (void)initSubViewConstraints {
[self.backContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
- [self.littleGameView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.mas_equalTo(self.view);
- }];
+
[self.roomHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.view);
make.height.mas_equalTo(kNavigationHeight);
@@ -477,17 +449,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
self.stageView = nil;
self.stageView = [[AnchorStageView alloc] initWithDelegate:self];
}
- }else if(self.roomInfo.type == RoomType_MiniGame) {
- if (self.roomInfo.mgMicNum > 6 && ![self.stageView isKindOfClass:[LittleGameScrollStageView class]]) {
- [self.stageView removeFromSuperview];
- self.stageView = nil;
- self.stageView = [[LittleGameScrollStageView alloc] initWithDelegate:self];
- } else if (self.roomInfo.mgMicNum <= 6 && ![self.stageView isKindOfClass:[LittleGameStageView class]]) {
- [self.stageView removeFromSuperview];
- self.stageView = nil;
- self.stageView = [[LittleGameStageView alloc] initWithDelegate:self];
- }
- }else if(self.roomInfo.hadChangeRoomType && ![self.stageView isKindOfClass:[SocialStageView class]]) {
+ }else if(self.roomInfo.hadChangeRoomType && ![self.stageView isKindOfClass:[SocialStageView class]]) {
[self.stageView removeFromSuperview];
self.stageView = nil;
self.stageView = [[SocialStageView alloc] initWithDelegate:self];
@@ -500,7 +462,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.view insertSubview:self.stageView belowSubview:self.roomHeaderView];
}
- [self.functionView updateRankViewConstraintsWityType:self.roomInfo.type];
+
if (self.roomInfo.type == RoomType_MiniGame) {
[self.stageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
@@ -519,22 +481,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
make.left.mas_equalTo(self.view);
make.right.mas_equalTo(self.activityContainerView.mas_left).offset(-10);
}];
- self.quickMessageContainerView.hidden = YES;
- [self.quickMessageContainerView mas_updateConstraints:^(MASConstraintMaker *make) {
- make.height.mas_equalTo(0);
- }];
+
[self.activityContainerView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(65);
make.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5);
make.width.mas_equalTo(80);
}];
-
} else {
- self.quickMessageContainerView.hidden = NO;
- [self.quickMessageContainerView mas_updateConstraints:^(MASConstraintMaker *make) {
- make.height.mas_equalTo(30);
- }];
[self.stageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.top.mas_equalTo(self.roomHeaderView.mas_bottom);
@@ -606,29 +560,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
}];
}
-#pragma mark - CountDownHelperDelegate
-- (void)onCountdownFinish {
- [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"isCountdownFinish":@(YES)}];
- if(self.freeModel.curStage.integerValue < self.freeModel.maxStage.integerValue){
- [self.presenter getFreeGiftData];
- }
- if(self.freeModel.curStage.intValue == 0){
- self.freeView.freeModel = self.freeModel;
- if(!self.freeView.superview){
- [kWindow addSubview:self.freeView];
- }
- }
-
-}
-- (void)onCountdownOpen:(int)time {
- NSInteger seconds = time;
- int hours = (seconds)%(24*3600)/3600;
- int minutes = (seconds)%3600/60;
- int second = (seconds)%60;
- [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"text":[NSString stringWithFormat:@"%02d:%02d:%02d",hours,minutes,second],@"isCountdownFinish":@(NO)}];
-
-
-}
-(void)showRoomFirstChargeWindowFormNot:(NSNotification *)not{
if(not != nil){
NSDictionary *parameter = not.object;
@@ -729,7 +660,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView onRoomEntered];
[self.menuContainerView onRoomEntered];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
if ([XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {// 最小化进房 还是原来的房间的话 不需要重新进入云信 因为压根没退
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
[self.functionView onRoomEntered];
@@ -798,7 +728,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView onRoomEntered];
[self.menuContainerView onRoomEntered];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
if ([XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {// 最小化进房 还是原来的房间的话 不需要重新进入云信 因为压根没退
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
[self.functionView onRoomEntered];
@@ -850,9 +779,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
return NO;
}
}
--(void)requesstShieldingAction{
- [self.presenter requesstShieldingWtihType:@"1" objId:[NSString stringWithFormat:@"%ld",self.roomInfo.uid]];
-}
+
#pragma mark - 本地礼物特效更新
- (void)myGiftEffectUpdate:(NSNotification *)notification {
NSDictionary * dic = notification.object;
@@ -897,7 +824,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView onRoomEntered];
[self.menuContainerView onRoomEntered];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
self.quickMessageContainerView.titleArray = self.roomInfo.speakTemplate;
if ([XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {// 最小化进房 还是原来的房间的话 不需要重新进入云信 因为压根没退
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
@@ -950,7 +876,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.roomHeaderView onRoomEntered];
[self.activityContainerView onRoomEntered];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
[self.functionView onRoomEntered];
[self.messageContainerView onRoomEntered];
self.quickMessageContainerView.titleArray = self.roomInfo.speakTemplate;
@@ -1121,7 +1046,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView onRoomEntered];
[self.menuContainerView onRoomEntered];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
if ([XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {// 最小化进房 还是原来的房间的话 不需要重新进入云信 因为压根没退
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
[self.functionView onRoomEntered];
@@ -1177,29 +1101,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.view bringSubviewToFront:view];
}
}
--(void)getFreeGiftDataSuccess:(XPFreeGiftModel *)freeModel{
- self.freeModel = freeModel;
- self.menuContainerView.freeModel = freeModel;
- if(self.freeModel.curStage.integerValue < self.freeModel.maxStage.integerValue){
- [CountDownHelper shareHelper].isCountdownFinish = NO;
- [[CountDownHelper shareHelper] openCountdownWithTime:freeModel.curStageSecond.intValue];
- }else{
- if([CountDownHelper shareHelper].isCountdownFinish == NO){
- [CountDownHelper shareHelper].isCountdownFinish = YES;
- }
- [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"isHiddenCountdown":@(YES)}];
- [[CountDownHelper shareHelper] stopCountDown];
- }
-
- if(self.freeModel.curStage.intValue > 0 && [[XPRoomMiniManager shareManager].curState isEqualToString:@"0"]){
- self.freeView.freeModel = self.freeModel;
- if(!self.freeView.superview){
- [kWindow addSubview:self.freeView];
- }
- [XPRoomMiniManager shareManager].curState = nil;
- }
-
-}
+
- (void)getRoomFirstChargeWindowSuccess:(FirstChargeRoomWindowModel *)model{
if(model.needToShow == NO || model.showAfterSecond <= 0 || self.isShowFirstRecharge == YES)return;
self.isShowFirstRecharge = YES;
@@ -1225,8 +1127,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self cancelRoomArrangeMic];
[[RtcManager instance] exitRoom];
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
- [self.littleGameView handleSelfInExitEvent];
- [self.littleGameView destroyMG];
[self dismissViewControllerAnimated:YES completion:nil];
}
@@ -1326,7 +1226,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.functionView onRoomUpdate];
[self.activityContainerView onRoomUpdate];
[self.messageContainerView onRoomUpdate];
- [self.littleGameView onRoomUpdate];
} else {
if (self.roomInfo.type == RoomType_Anchor) {
[self changeStageViewOnAnchorRoom];
@@ -1338,7 +1237,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.functionView onRoomUpdate];
[self.activityContainerView onRoomUpdate];
[self.messageContainerView onRoomUpdate];
- [self.littleGameView onRoomUpdate];
}
}
break;
@@ -1381,7 +1279,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView handleNIMNotificationMessage:message];
[self.menuContainerView handleNIMNotificationMessage:message];
[self.functionView handleNIMNotificationMessage:message];
- [self.littleGameView handleNIMNotificationMessage:message];
if([self.stageView findMicroViewByUid:@(self.userInfo.uid).stringValue] != nil){
[XPSkillCardPlayerManager shareInstance].isMineInMic = YES;
}else{
@@ -1396,7 +1293,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.menuContainerView handleNIMCustomMessage:message];
[self.activityContainerView handleNIMCustomMessage:message];
[self.functionView handleNIMCustomMessage:message];
- [self.littleGameView handleNIMCustomMessage:message];
if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
self.userInfo.isFirstCharge = NO;
[self.menuContainerView onRoomUpdate];
@@ -1424,8 +1320,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self cancelRoomArrangeMic];
[[RtcManager instance] exitRoom];
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
- [self.littleGameView handleSelfInExitEvent];
- [self.littleGameView destroyMG];
[self dismissViewControllerAnimated:YES completion:nil];
}
} else if (attachment.first == CustomMessageType_RedPacket) {
@@ -1442,57 +1336,17 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.view addSubview:view];
[self.view bringSubviewToFront:view];
}
- }else if(attachment.first == CustomMessageType_Free_Gift_Star_Reset_Time){
- if(attachment.second == Custom_Message_Sub_Free_Gift_Star_Reset_Time){
- [self.presenter getFreeGiftData];
- [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"isReset":@(YES)}];
- }else if(attachment.second == Custom_Message_Sub_Update_Gift_Information){
- [self.presenter getFreeGiftData];
- [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"updateGiftInfo":attachment.data ?: @""}];
- }
-
- }
+ }
[self.messageContainerView handleNIMCustomMessage:message];
}
} else if(message.messageType == NIMMessageTypeText) {
[self.messageContainerView handleNIMTextMessage:message];
- [self.littleGameView handleNIMTextMessage:message];
} else if(message.messageType == NIMMessageTypeTip) {
[self.messageContainerView handleNIMTextMessage:message];
}
}
}
-#pragma mark - NIMBroadcastDelegate
-// 广播消息
-- (void)onReceiveBroadcastMessage:(NIMBroadcastMessage *)broadcastMessage{
- if (![ClientConfig shareConfig].canOpen) {
- return;
- }
- if (broadcastMessage.content) {
- NSDictionary *msgDictionary = [broadcastMessage.content toJSONObject];
- AttachmentModel *attachment = [AttachmentModel modelWithJSON:msgDictionary[@"body"]];
- BOOL isHave = NO;
- if(attachment.first == CustomMessageType_Graffiti_Star_Kitchen && attachment.second == Custom_Message_Sub_Star_Kitchen_FullScreen){
- isHave = YES;
- }else if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){
-
- }else if (attachment.first == CustomMessageType_Treasure_Fairy && (attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L1 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L2 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) { //夺宝精灵
-
- }else if (attachment.first == CustomMessageType_Tarot && (attachment.second == Custom_Message_Sub_Tarot_Advanced || attachment.second == Custom_Message_Sub_Tarot_Intermediate)){
- isHave = YES;
- }
-
- if(isHave == NO)return;
- attachment.isBroadcast = YES;
- NIMMessage *message = [NIMMessage new];
- NIMCustomObject *object = [NIMCustomObject new];
- object.attachment = attachment;
- message.messageObject = object;
-
- [self.messageContainerView handleNIMTextMessage:message];
-
- }
-}
+
//发送消息成功回调
- (void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error {
// 非本房间不处理
@@ -1513,7 +1367,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
if (message.messageType == NIMMessageTypeCustom) {
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
- AttachmentModel * attachment = (AttachmentModel *)obj.attachment;
+ AttachmentModel * attachment = obj.attachment;
[self.stageView handleNIMCustomMessage:message];
[self.animationView handleNIMCustomMessage:message];
[self.functionView handleNIMCustomMessage:message];
@@ -1562,7 +1416,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
- (void)exitRoom {
[self.menuContainerView menuResignFirstResponder];
- [self.animationView resumeTimer];
if (self.roomInfo.roomModeType == RoomModeType_Open_Micro_Mode || self.roomInfo.roomModeType == RoomModeType_Open_Blind) {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
NSString * uid = [AccountInfoStorage instance].getUid;
@@ -1637,33 +1490,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self handleFirstOutRoom];
[self dismissViewControllerAnimated:YES completion:nil];
} roomUid:roomUid operUid:uid page:@"1" pageSize:@"50"];
- }else if(self.roomInfo.type == RoomType_MiniGame) {
- if ([self.littleGameView isInSudGame]) {
- TTAlertConfig *config = [[TTAlertConfig alloc] init];
- config.cancelButtonConfig.title = YMLocalizedString(@"XPRoomSettingInputView4");
- config.confirmButtonConfig.title = YMLocalizedString(@"XPRoomSettingInputView5");
- config.message = YMLocalizedString(@"XPRoomViewController14");
- [TTPopup alertWithConfig:config confirmHandler:^{ // 知道了
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
- [[RtcManager instance] exitRoom];
- [self.littleGameView handleSelfInExitEvent];
- [self.littleGameView destroyMG];
- [self handleFirstOutRoom];
- [self dismissViewControllerAnimated:YES completion:nil];
- });
- } cancelHandler:^{
- }];
- } else {
- [self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
- [[RtcManager instance] exitRoom];
- [self.littleGameView handleSelfInExitEvent];
- [self.littleGameView destroyMG];
- [self handleFirstOutRoom];
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- }
- else {
+ } else {
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
[[XPRoomMiniManager shareManager] resetLocalMessage];
[[RtcManager instance] exitRoom];
@@ -1674,57 +1501,18 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
}
- (void)miniRoom {
- if(self.freeModel != nil){
- [XPRoomMiniManager shareManager].curState = self.freeModel.curStage;
- }
- [self.menuContainerView menuResignFirstResponder];
- [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showRoomFirstChargeWindow) object:nil];
- NSDictionary *roomInfoDic = self.roomInfo.model2dictionary != nil ? self.roomInfo.model2dictionary : @{};
- NSDictionary *userInfoDic = self.userInfo.model2dictionary != nil ? self.userInfo.model2dictionary : @{};
- NSMutableDictionary *queueDic = self.getMicroQueue != nil ? self.getMicroQueue : [@{} mutableCopy];
- if(self.roomInfo.type == RoomType_MiniGame) {
- if ([self.littleGameView isInSudGame]) {
- TTAlertConfig *config = [[TTAlertConfig alloc] init];
- config.cancelButtonConfig.title = YMLocalizedString(@"XPRoomViewController15");
- config.confirmButtonConfig.title = YMLocalizedString(@"XPRoomViewController16");
- config.message = YMLocalizedString(@"XPRoomViewController17");
- [TTPopup alertWithConfig:config confirmHandler:^{ // 知道了
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
- [[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
- [[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
- NSDictionary * dic = @{@"roomInfo":roomInfoDic, @"userInfo":userInfoDic, @"microQueue":queueDic};
- [[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
- [self.view endEditing:YES];
- [self.littleGameView handleSelfInExitEvent];
- [self.littleGameView destroyMG];
- [self handleFirstOutRoom];
- [self dismissViewControllerAnimated:YES completion:nil];
- });
- } cancelHandler:^{
- }];
- } else {
- [[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
- [[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
- [[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
- NSDictionary * dic = @{@"roomInfo":roomInfoDic, @"userInfo":userInfoDic, @"microQueue":queueDic};
- [[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
- [self.view endEditing:YES];
- [self.littleGameView handleSelfInExitEvent];
- [self.littleGameView destroyMG];
- [self handleFirstOutRoom];
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- }else {
- [[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
- [[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
- [[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
- NSDictionary * dic = @{@"roomInfo":roomInfoDic, @"userInfo":userInfoDic, @"microQueue":queueDic};
- [[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
- [self.view endEditing:YES];
- [self handleFirstOutRoom];
- [self dismissViewControllerAnimated:YES completion:nil];
- }
+ [self.menuContainerView menuResignFirstResponder];
+ [[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo];
+ [[XPRoomMiniManager shareManager] configUserInfo:self.userInfo];
+ [[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying];
+ NSMutableDictionary * dic = [NSMutableDictionary dictionary];
+ [dic safeSetObject:self.roomInfo.model2dictionary forKey:@"roomInfo"];
+ [dic safeSetObject:self.userInfo.model2dictionary forKey:@"userInfo"];
+ [dic safeSetObject:self.getMicroQueue forKey:@"microQueue"];
+ [[NSNotificationCenter defaultCenter] postNotificationName:kRoomMiniNotificationKey object:nil userInfo:dic];
+ [self.view endEditing:YES];
+ [self handleFirstOutRoom];
+ [self dismissViewControllerAnimated:YES completion:nil];
}
- (UINavigationController *)getCurrentNav {
@@ -1780,11 +1568,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[[NSNotificationCenter defaultCenter] postNotificationName:kNewUserRechargeKey object:nil];
}
}
-#pragma mark - XPRoomLittleGameContainerViewDelegate
-- (void)hiddenSudGamePostionView {
- [self.functionView hiddenSudGamePostionView];
-}
-
#pragma mark - AnchorRoomScrollViewDelegate
- (void)anchorScrollViewScrollToNext:(AnchorRoomScrollView *)anchorScrollView {
if (!self) {
@@ -1850,8 +1633,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView onRoomEntered];
[self.menuContainerView onRoomEntered];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
- [self.littleGameView onRoomEntered];
if ([XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {// 最小化进房 还是原来的房间的话 不需要重新进入云信 因为压根没退
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
[self.functionView onRoomEntered];
@@ -1872,11 +1653,9 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.menuContainerView onRoomEntered];
[self changeStageViewOnRoomUpdate];
[self.backContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
[self.functionView onRoomEntered];
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
[self.messageContainerView onRoomEntered];
- [self.littleGameView onRoomEntered];
[[XPRoomMiniManager shareManager] configRoomInfo:nil];
[[XPRoomMiniManager shareManager] configUserInfo:nil];
[[XPRoomMiniManager shareManager] configCurrentMusic:nil isPlaying:NO];
@@ -1891,52 +1670,13 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self enterRoomFail:0];
}
}
-
-
#pragma mark - XPFirstRechargeViewDelegate
-(void)rechargeHandle{
-
- XPWebViewController * vc =[[XPWebViewController alloc] initWithCustomizeNav:YES];
- NSString *channel = @"p";
- channel = [NSString stringWithFormat:@"%@a",channel];
- channel = [NSString stringWithFormat:@"%@y",channel];
- NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,@"6",[YYUtility deviceID]];
- vc.url = url;
- vc.isPush = YES;
- vc.modalPresentationStyle = UIModalPresentationFullScreen;
- [self presentViewController:vc animated:YES completion:nil];
-
-
-}
--(void)contactCustomerService{
- TTAlertConfig *config = [[TTAlertConfig alloc]init];
- config.title = YMLocalizedString(@"XPIAPRechargeViewController7");
- config.message = YMLocalizedString(@"XPIAPRechargeViewController8");
- TTAlertButtonConfig *confirmButtonConfig = [[TTAlertButtonConfig alloc]init];
- confirmButtonConfig.title = YMLocalizedString(@"XPIAPRechargeViewController9");
- UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(200, 200)];
- confirmButtonConfig.backgroundColor = [UIColor colorWithPatternImage:image];
- confirmButtonConfig.cornerRadius = 38/2;
- config.confirmButtonConfig = confirmButtonConfig;
- [TTPopup alertWithConfig:config confirmHandler:^{
- [self requestContactCustomerService];
- } cancelHandler:^{
- }];
-
-}
--(void)requestContactCustomerService{
- [XNDJTDDLoadingTool showLoading];
- [Api requestContactCustomerServiceCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
- [XNDJTDDLoadingTool hideHUD];
- if(code == 200){
- NSString *uid = [NSString stringWithFormat:@"%@",data.data];
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P];
- SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
- [self.getCurrentNav pushViewController:sessionVC animated:YES];
- });
- }
- }];
+ 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) {
@@ -2000,13 +1740,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
}
return _stageView;
}
-- (XPRoomLittleGameContainerView *)littleGameView {
- if (!_littleGameView) {
- _littleGameView = [[XPRoomLittleGameContainerView alloc] initWithDelegate:self];
- _littleGameView.delegate = self;
- }
- return _littleGameView;
-}
+
- (AnchorRoomScrollView *)anchorScrollView {
if (!_anchorScrollView) {
_anchorScrollView = [[AnchorRoomScrollView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
@@ -2042,10 +1776,5 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
}
return _firstRechargeView;
}
--(XPFreeGiftsObtainView *)freeView{
- if (!_freeView){
- _freeView = [[XPFreeGiftsObtainView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
- }
- return _freeView;
-}
+
@end
diff --git a/YuMi/Modules/YMWeb/XPWebViewController.m b/YuMi/Modules/YMWeb/XPWebViewController.m
index 0de361c7..0fa4eaa0 100644
--- a/YuMi/Modules/YMWeb/XPWebViewController.m
+++ b/YuMi/Modules/YMWeb/XPWebViewController.m
@@ -27,9 +27,14 @@
#import "Api+Mine.h"
#import "XPSkillCardPlayerManager.h"
#import "XPWebViewNavView.h"
+<<<<<<< HEAD
#import "XPIAPRechargeViewController.h"
#import "SessionViewController.h"
#import "XPMonentTopicContainerViewController.h"
+=======
+
+
+>>>>>>> b669467 (更换支付方式)
typedef NS_ENUM(NSUInteger, RightNavigationPushType){
///跳转h5页面
RightNavigationPushType_Web = 1,
@@ -251,6 +256,7 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
#else
if (currentUrl != nil && [currentUrl containsString:API_HOST_URL]) {
#endif
+<<<<<<< HEAD
if ([message.name isEqualToString:kJSOpenSharePage]) {
if (message.body && message.body != [NSNull null]) {
NSDictionary *body;
@@ -308,6 +314,66 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
if(self.isPush){
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.type = @"4";
+=======
+ if ([message.name isEqualToString:kJSOpenSharePage]) {
+ if (message.body && message.body != [NSNull null]) {
+ NSDictionary *body;
+ //不知道是哪个蓝精灵弄的,变成了个dic,所以我们要判断类型
+ if ([message.body isKindOfClass:[NSDictionary class]]) {
+ body = message.body;
+ } else if ([message.body isKindOfClass:[NSString class]]) {
+ body = [message.body toJSONObject];
+ }
+ self.shareDic = body[@"data"];
+ [self showSharePanel];
+ }
+ } else if ([message.name isEqualToString:kJSGetUid]) {
+ NSString *uid = [[AccountInfoStorage instance] getUid];
+ NSString *js = [NSString stringWithFormat:@"getMessage(\"uid\",%@)", uid];
+ [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) {
+ NSLog(@"%@",error);
+ }];
+ } else if ([message.name isEqualToString:kJSGetTicket]) {
+ NSString *ticket = [[AccountInfoStorage instance] getTicket];
+ NSString *js = [NSString stringWithFormat:@"getMessage(\"ticket\",\"%@\")",ticket];
+ [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) {
+ NSLog(@"%@",error);
+ }];
+ } else if ([message.name isEqualToString:kJSGetDeviceId]) {
+ NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceId\",\"%@\")",[YYUtility deviceUniqueIdentification]];
+ [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) {
+ NSLog(@"%@",error);
+ }];
+ } else if ([message.name isEqualToString:kJSGetDeviceInfo]) {
+ NSDictionary *basicParmars = [HttpRequestHelper configBaseParmars:[[NSDictionary alloc] init]];
+ NSString *json = [basicParmars mj_JSONString];
+ NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json];
+ [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) {
+ NSLog(@"%@", error);
+ }];
+ } else if ([message.name isEqualToString:kJSOpenPurse]) {
+
+ }else if([message.name isEqualToString:kJSChargePayPage]){
+ NSString *money = [NSString stringWithFormat:@"%@",message.body] ;
+
+ }else if([message.name isEqualToString:kJSChargePayClickPage]){
+ if(message.body != nil && self.model.diamonds != nil){
+ NSString *type = [NSString stringWithFormat:@"%@",message.body];
+ }
+ }else if ([message.name isEqualToString:kJSOpenChargePage]) {
+ if(self.delegate && [self.delegate respondsToSelector:@selector(payHandler)]){
+ [self.delegate payHandler];
+ return;
+ }
+
+
+
+ [TTPopup dismiss];
+ if(self.isPush){
+ XPWebViewController * webVC =[[XPWebViewController alloc] init];
+ webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
+ webVC.isPush = YES;
+>>>>>>> b669467 (更换支付方式)
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
return;
}
@@ -316,6 +382,7 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
[controller dismissViewControllerAnimated:NO completion:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+<<<<<<< HEAD
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.type = @"4";
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
@@ -385,6 +452,64 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:sessionVC animated:YES];
}
}else if ([message.name isEqualToString:kJSOpenRoom]) {
+=======
+ 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) {
+ [TTPopup dismiss];
+ XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
+ userInfoVC.uid = uid.integerValue;
+ [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:userInfoVC animated:YES];
+ }
+ } else if([message.name isEqualToString:kJSInitNav]) {
+ [self initNav:message.body];
+ } else if([message.name isEqualToString:kJSGetRoomUid]) {
+ NSString *js = [NSString stringWithFormat:@"getMessage(\"roomUid\",\"%@\")",self.roomUid];
+ [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) {
+ NSLog(@"%@",error);
+ }];
+ } else if([message.name isEqualToString:kInitShowNav]) {
+ if (((NSNumber *)message.body).intValue == 0) {
+ if (self.InitShowNavBlock) {
+ self.InitShowNavBlock(YES);
+ return;
+ }
+ if (self.navigationController) {
+ [self.navigationController setNavigationBarHidden:YES];
+ }
+ }
+ } else if([message.name isEqualToString:kCloseWebView]) {
+ if (self.CloseWebViewBlock) {
+ self.CloseWebViewBlock(YES);
+ return;
+ }
+ if (self.navigationController) {
+ [self.navigationController popViewControllerAnimated:YES];
+ }
+ } else if ([message.name isEqualToString:kJumpAppointPage]) {
+ // h5与原生交互新协议
+ NSDictionary *bodyDict;
+ if ([message.body isKindOfClass:[NSDictionary class]]) {
+ bodyDict = message.body;
+ } else if ([message.body isKindOfClass:[NSString class]]) {
+ NSString *str = (NSString *)message.body;
+ bodyDict = [str toJSONObject];
+ }
+ NSInteger skyType = [bodyDict[@"routerType"] integerValue];
+ [self handleRouterType:skyType message:message];
+ } else if ([message.name isEqualToString:kJSOpenRoom]) {
+>>>>>>> b669467 (更换支付方式)
NSString *uid = [NSString stringWithFormat:@"%@",message.body];
if (uid.length > 0) {
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {