Compare commits
2 Commits
1.0.30
...
enterprise
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dbdf90a38c | ||
![]() |
4f6cf8cbca |
@@ -31,7 +31,7 @@
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
|
@@ -100,7 +100,8 @@ typedef NS_ENUM(NSUInteger, URLType) {
|
||||
kTreasureRuleURL,
|
||||
///夺宝记录
|
||||
kTreasureRecordURL,
|
||||
kChannelUrl,
|
||||
///第三方充值
|
||||
kThirdPartyPay,
|
||||
};
|
||||
|
||||
NSString * const URLWithType(URLType type);
|
||||
|
@@ -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){
|
||||
|
@@ -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:
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#import "XPMineDressUpViewController.h"
|
||||
#import "XPDressUpShopCardViewController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
|
||||
@interface XPDressUpShopViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, SDCycleScrollViewDelegate>
|
||||
|
||||
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -180,7 +180,7 @@
|
||||
}
|
||||
- (NSArray *)listData{
|
||||
if(!_listData){
|
||||
_listData = @[YMLocalizedString(@"XPNobleCenterPayView2"),@"Apple Pay"];
|
||||
_listData = @[YMLocalizedString(@"XPNobleCenterPayView2")];
|
||||
}
|
||||
return _listData;
|
||||
}
|
||||
|
@@ -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,9 +42,6 @@
|
||||
#import "WalletInfoModel.h"
|
||||
#import "XPNobleCenterPayView.h"
|
||||
#import "XPNobleCenterProtocol.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "YuMi-swift.h"
|
||||
#import "ClientConfig.h"
|
||||
@interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, NIMSystemNotificationManagerDelegate>
|
||||
///分页标题
|
||||
@property (nonatomic, strong) NSArray<NSString *> *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,22 +208,10 @@
|
||||
[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];
|
||||
RechargeListModel *rechargeModel = [self.rechargeModel.list safeObjectAtIndex1:0];
|
||||
[self.presenter requestNobleIAPRechargeOrderWithChargeProdId:rechargeModel.chargeProdId roomUid:self.roomUid ? [NSString stringWithFormat:@"%zd", self.roomUid] : nil];
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"5",[YYUtility deviceID]];
|
||||
webVC.isPush = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
-(void)openVipWithDiamondSuccess{
|
||||
[self requestHttp];
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,185 +284,12 @@
|
||||
self.openNobleButton.text = title;
|
||||
}
|
||||
|
||||
///请求充值id的状态成功
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid{
|
||||
|
||||
if (orderId.length > 0) {
|
||||
self.orderId = orderId;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap demandCommodityThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
@kWeakify(self);
|
||||
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
|
||||
@kStrongify(self);
|
||||
|
||||
[self rechargeNewProcessStatus:state];
|
||||
switch (state) {
|
||||
case StoreConditionResultVerifiedServer:
|
||||
{
|
||||
NSString *transactionId = result[@"transactionId"];
|
||||
|
||||
[self rechargeSuccess:transactionId];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController10")];
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
}
|
||||
}
|
||||
///请求充值账单失败
|
||||
- (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];
|
||||
});
|
||||
|
||||
}
|
||||
///二次校验成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
self.orderId = nil;
|
||||
//5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (!self.userInfo.userVipInfoVO) {
|
||||
///刷新一下用户的信息
|
||||
[self.presenter getUserInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
if(code == 1444){
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
}
|
||||
}
|
||||
///删除本地保存的
|
||||
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier uid:uid];
|
||||
if (deleteSuccess) {
|
||||
#warning to do 保存失败 需要埋点
|
||||
}
|
||||
}
|
||||
|
||||
- (void)checkTranscationIdsSuccess {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[RechargeStorage delegateAllTranscationIdsWithUid:uid];
|
||||
}
|
||||
-(void)rankAction{
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kNobleRankURL);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
#pragma mark - XPIAPHelperDelegate
|
||||
///当前充值的状态
|
||||
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
|
||||
|
||||
|
||||
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
|
||||
|
||||
}else if (status == StoreConditionResultUnowned) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
}else{
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
}
|
||||
}
|
||||
|
||||
///充值成功回调id
|
||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
|
||||
///保存唯一凭证
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
|
||||
}
|
||||
|
||||
///充值成功之后保存订单到钥匙串
|
||||
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
if(transactionIdentifier != nil){
|
||||
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
|
||||
}
|
||||
if(encodeStr != nil){
|
||||
[dictionary setObject:encodeStr forKey:@"recipt"];
|
||||
}
|
||||
if(self.orderId != nil){
|
||||
[dictionary setObject:self.orderId forKey:@"orderId"];
|
||||
}
|
||||
if(dictionary.allKeys.count == 0)return;
|
||||
NSString *reciptJson = [dictionary toJSONString];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
|
||||
if (!saveSuccess) {
|
||||
#warning to do 保存失败 需要埋点
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - JXCategoryViewDelegate
|
||||
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
|
||||
return self.titles.count;
|
||||
@@ -568,7 +360,7 @@
|
||||
payView.delegate = self;
|
||||
[self.view addSubview:payView];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -645,7 +437,7 @@
|
||||
_openNobleButton.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_openNobleButton.numberOfLines = 0;
|
||||
_openNobleButton.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
|
||||
}
|
||||
return _openNobleButton;
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@
|
||||
NSString *channel = @"p";
|
||||
channel = [NSString stringWithFormat:@"%@a",channel];
|
||||
channel = [NSString stringWithFormat:@"%@y",channel];
|
||||
NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,self.type,[YYUtility deviceID]];
|
||||
NSString *url = [NSString stringWithFormat:URLWithType(kTreasureTicketBuyURL),channel,self.type,[YYUtility deviceID]];
|
||||
vc.url = url;
|
||||
[self addChildViewController:vc];
|
||||
vc.view.frame = self.view.frame;
|
||||
|
@@ -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 ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPHomeBannerTableViewCellDelegate>
|
||||
@@ -87,10 +82,6 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
@property (nonatomic,assign) BOOL isRefreshRoomInfo;
|
||||
///是否正在请示数据,防止过多请求
|
||||
@property (nonatomic,assign) BOOL isRequestData;
|
||||
///游戏列表
|
||||
@property (nonatomic, strong) NSMutableArray<LittleGameInfoModel *> *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<LittleGameInfoModel *> *)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<HomeBannerInfoModel *> *)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<LittleGameInfoModel *> *)littleGameArray {
|
||||
if (!_littleGameArray) {
|
||||
_littleGameArray = [NSMutableArray array];
|
||||
}
|
||||
return _littleGameArray;
|
||||
}
|
||||
|
||||
- (NSMutableArray<HomeBannerInfoModel *> *)bannerArray {
|
||||
if (!_bannerArray) {
|
||||
|
@@ -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,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;
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPCandyTreeInsufficientBalanceView.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPCandyTreeBuyView.h"
|
||||
#import "XPCandyTreeConfirmBuyView.h"
|
||||
#import "XPCandyTreeBuySuccessView.h"
|
||||
@@ -41,7 +40,7 @@
|
||||
#define KitemHeight (20 + 5)
|
||||
|
||||
UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey;
|
||||
@interface XPCandyTreeViewController ()<XPCandyTreeInsufficientBalanceViewDelegate,XPCandyRankContainerViewDelegate,XPCandyTreeProtocol, NIMSystemNotificationManagerDelegate,XPCandyTreeBuyViewDelegate,XPCandyTreeConfirmBuyViewDelegate,XPIAPRechargeViewControllerDelegate>
|
||||
@interface XPCandyTreeViewController ()<XPCandyTreeInsufficientBalanceViewDelegate,XPCandyRankContainerViewDelegate,XPCandyTreeProtocol, NIMSystemNotificationManagerDelegate,XPCandyTreeBuyViewDelegate,XPCandyTreeConfirmBuyViewDelegate>
|
||||
@property(nonatomic,strong) UIButton *backView;
|
||||
|
||||
///中间内容的容器
|
||||
@@ -454,12 +453,18 @@ 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
|
||||
|
||||
-(void)paySuccess{
|
||||
[self.presenter getLoveSettingInfo];
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
//
|
||||
// XPFirstRechargeView.h
|
||||
// YuMi
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by YuMi on 2023/2/27.
|
||||
// Created by duoban on 2023/2/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
@@ -1,26 +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>
|
||||
#import <NIMSDK/NIMSDK.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 "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 ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
///
|
||||
@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;
|
||||
@@ -281,232 +241,17 @@
|
||||
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"];
|
||||
NSString *uuid = (NSString *)data.data[@"appAccountToken"];
|
||||
[self requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:uuid];
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
if(code == 50000){
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(contactCustomerService)]){
|
||||
[self.delegate contactCustomerService];
|
||||
}
|
||||
[self backAction];
|
||||
return;
|
||||
}
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
|
||||
}
|
||||
|
||||
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid{
|
||||
if (orderId.length > 0) {
|
||||
self.orderId = orderId;
|
||||
|
||||
if (@available(iOS 15.0, *)) {
|
||||
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap demandCommodityThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
@kWeakify(self);
|
||||
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
|
||||
@kStrongify(self);
|
||||
|
||||
[self rechargeNewProcessStatus:state];
|
||||
switch (state) {
|
||||
case StoreConditionResultVerifiedServer:
|
||||
{
|
||||
NSString *transactionId = result[@"transactionId"];
|
||||
|
||||
[self rechargeSuccess:transactionId];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController10")];
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPIAPHelperDelegate
|
||||
|
||||
///当前充值的状态
|
||||
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
|
||||
|
||||
|
||||
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
|
||||
|
||||
}else if (status == StoreConditionResultUnowned) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
}else{
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///充值成功回调id
|
||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
|
||||
///保存唯一凭证
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
///二次验证
|
||||
[self checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
|
||||
}
|
||||
|
||||
///充值成功之后保存订单到钥匙串
|
||||
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
if(transactionIdentifier != nil){
|
||||
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
|
||||
}
|
||||
if(encodeStr != nil){
|
||||
[dictionary setObject:encodeStr forKey:@"recipt"];
|
||||
}
|
||||
if(self.orderId != nil){
|
||||
[dictionary setObject:self.orderId forKey:@"orderId"];
|
||||
}
|
||||
if(dictionary.allKeys.count == 0)return;
|
||||
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)checkTranscationIds {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
|
||||
|
||||
// [self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier];
|
||||
// NSMutableArray *list = [NSMutableArray array];
|
||||
// for (NSDictionary *transcationDic in array) {
|
||||
// NSString *transcationId = transcationDic[@"transcationId"];
|
||||
// if(transcationId){
|
||||
// [list addObject:transcationId];
|
||||
// }
|
||||
// }
|
||||
// if(list.count > 0){
|
||||
// if (@available(iOS 15.0, *)) {
|
||||
// PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
// [iap allTransactionWithList:list completionHandler:^{
|
||||
//
|
||||
// }];
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
for (NSDictionary *transcation in array) {
|
||||
NSString *orderId = transcation[@"orderId"];
|
||||
NSString *transcationId = transcation[@"transcationId"];
|
||||
///二次验证
|
||||
[self checkReceiptWithOrderId:orderId transcationId:transcationId errorToast:NO] ;
|
||||
}
|
||||
|
||||
}
|
||||
- (void)checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
|
||||
[Api checkReceipt:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
if (code == 200) {
|
||||
[self checkReceiptSuccess:transcationId];
|
||||
} else {
|
||||
if(code == 1444){
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
}
|
||||
if(errorToast == YES){
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
|
||||
}
|
||||
} chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
|
||||
|
||||
}
|
||||
|
||||
///二次验证成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
self.orderId = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
|
||||
|
||||
- (void)rewardHelpButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
self.descripBgView.hidden = !sender.selected;
|
||||
}
|
||||
|
||||
- (void)rechargeButtonAction {
|
||||
|
||||
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];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
|
||||
[self.delegate rechargeHandle];
|
||||
}
|
||||
[self backAction];
|
||||
}
|
||||
-(void)backAction{
|
||||
[self removeFromSuperview];
|
||||
@@ -514,7 +259,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 +342,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 +397,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 +406,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 +422,7 @@
|
||||
if (!_backBtn){
|
||||
_backBtn = [UIButton new];
|
||||
[_backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
}
|
||||
return _backBtn;
|
||||
}
|
||||
|
@@ -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<GiftInfoModel *> * 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<GiftInfoModel *> *)giftList {
|
||||
self.packGiftList = giftList;
|
||||
NSMutableArray<GiftInfoModel *> *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) {
|
||||
|
@@ -21,8 +21,8 @@
|
||||
#import "XPMinePayPwdViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPWebViewController.h"
|
||||
///P
|
||||
#import "XPRoomRedPacketPresenter.h"
|
||||
#import "XPRoomRedPacketProtocol.h"
|
||||
@@ -31,6 +31,7 @@
|
||||
#import "RoomInfoModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
|
||||
|
||||
@interface XPRoomSendRedPacketViewController ()<YYTextViewDelegate, XPRoomRedPacketProtocol, XPRoomRedPacketPwdViewDelegate>
|
||||
|
||||
///host代理
|
||||
@@ -403,10 +404,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 {
|
||||
|
@@ -40,9 +40,10 @@
|
||||
///P
|
||||
#import "XPTreasureFailyPresenter.h"
|
||||
#import "XPTreasureFailyProtocol.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
|
||||
#import "TreasureFairyUserInfoModel.h"
|
||||
@interface XPTreasureFairyViewController ()<XPTreasureFailyProtocol, NIMSystemNotificationManagerDelegate, XPTreasureFairyMoreViewDelegate,XPTreasureFairyWebViewDelegate,XPIAPRechargeViewControllerDelegate,XPTreasureFairyBottomViewDelegate,PITreasureFairyBuyElfShardViewDelegate>
|
||||
@interface XPTreasureFairyViewController ()<XPTreasureFailyProtocol, NIMSystemNotificationManagerDelegate, XPTreasureFairyMoreViewDelegate,XPTreasureFairyWebViewDelegate,XPTreasureFairyBottomViewDelegate,PITreasureFairyBuyElfShardViewDelegate>
|
||||
|
||||
///点击消失
|
||||
@property (nonatomic,strong) UIView *dismissView;
|
||||
///背景
|
||||
@@ -476,71 +477,44 @@
|
||||
#pragma mark - XPTreasureFairyWebViewDelegate
|
||||
-(void)payWithFairyHandler{
|
||||
[TTPopup dismiss];
|
||||
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.delegate = self;
|
||||
rechargeVC.isFairyPay = YES;
|
||||
rechargeVC.type = @"4";
|
||||
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 getDiamonds];
|
||||
}];
|
||||
});
|
||||
|
||||
};
|
||||
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];
|
||||
[self getDiamonds];
|
||||
[self showSuccessToast:YMLocalizedString(@"PITreasureFairyBuyElfShardView3")];
|
||||
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)dismissVC {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)ticketRecognizer {
|
||||
self.moreView.hidden = YES;
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.delegate = self;
|
||||
rechargeVC.isFairyPay = YES;
|
||||
rechargeVC.type = @"4";
|
||||
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) {
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
// CGFloat kscale = 550.0 / 375.0;
|
||||
// XPTreasureFairyWebView * webView = [[XPTreasureFairyWebView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenWidth * kscale)];
|
||||
// webView.delegate = self;
|
||||
// webView.url = URLWithType(kTreasureTicketBuyURL);
|
||||
// TTPopupService * config = [[TTPopupService alloc] init];
|
||||
// config.style = TTPopupStyleActionSheet;
|
||||
// config.contentView = webView;
|
||||
// config.maskBackgroundAlpha = 0.5;
|
||||
// @kWeakify(self);
|
||||
// config.didFinishDismissHandler = ^(BOOL isDismissOnBackgroundTouch) {
|
||||
// @kStrongify(self);
|
||||
// [self.presenter getTreasureFailyInfo];
|
||||
// };
|
||||
// [TTPopup popupWithConfig:config];
|
||||
}
|
||||
|
||||
- (void)fairyDrawRecognizer {
|
||||
self.moreView.hidden = YES;
|
||||
if (self.isRewardAnimting) {
|
||||
@@ -663,7 +637,7 @@
|
||||
config.message = YMLocalizedString(@"XPTreasureFairyViewController5");
|
||||
config.confirmButtonConfig.title = YMLocalizedString(@"XPTreasureFairyViewController6");
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
[self ticketRecognizer];
|
||||
[self payWithFairyHandler];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user