代充优化
This commit is contained in:
@@ -335,6 +335,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(void)saveAreaConfigWithArea:(HttpRequestHelperCompletion)completion region:(NSString *)region;
|
||||
///
|
||||
+(void)requestQueryWithRoomType:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -440,4 +440,6 @@
|
||||
+(void)saveAreaConfigWithArea:(HttpRequestHelperCompletion)completion region:(NSString *)region{
|
||||
[self makeRequest:@"region/save" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,region, nil];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -17,6 +17,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, strong) NSNumber *money;
|
||||
@property(nonatomic, strong) NSNumber *giftGoldNum;
|
||||
@property(nonatomic, strong) NSString *channel;
|
||||
//充值banner位数据
|
||||
@property(nonatomic,copy) NSString *bannerUrl;
|
||||
@property(nonatomic,copy) NSString *linkUrl;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -112,6 +112,7 @@
|
||||
[[self getView] onGetPersonalBannerListFailWithGroup:group];
|
||||
} errorToast:NO] uid:uid type:@"10"];
|
||||
}
|
||||
|
||||
///获取小游戏列表
|
||||
- (void)getLittleGameListWithGroup:(dispatch_group_t) group {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
@@ -137,4 +138,5 @@
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_click eventAttributes:@{@"mgId" : mgId}];
|
||||
}] uid:uid mgId:mgId];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 批量验证内购掉单
|
||||
/// @param transcations 凭据的数组
|
||||
- (void)checkTranscationIds:(NSArray *)transcations;
|
||||
//充值banner位
|
||||
-(void)getBannerList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -52,7 +52,7 @@
|
||||
NSString *orderId = (NSString *)data.data[@"recordId"];
|
||||
[[self getView] requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] requestIAPRechargeOrderFail];
|
||||
[[self getView] requestIAPRechargeOrderFailWithCode:code];
|
||||
}] chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
|
||||
}
|
||||
|
||||
@@ -80,5 +80,14 @@
|
||||
[[self getView] checkTranscationIdsSuccess];
|
||||
}] transcationIdStr:transcationIdStr];
|
||||
}
|
||||
|
||||
//充值banner位
|
||||
-(void)getBannerList{
|
||||
[Api requestBannerListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
|
||||
NSArray * array = [RechargeListModel modelsWithArray:data.data[@"banners"]];
|
||||
[[self getView]getBannerListSuccessWithList:array];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
} showLoading:NO errorToast:NO]];
|
||||
}
|
||||
@end
|
||||
|
@@ -17,11 +17,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///请求充值id的状态成功
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId;
|
||||
///请求充值账单失败
|
||||
- (void)requestIAPRechargeOrderFail;
|
||||
- (void)requestIAPRechargeOrderFailWithCode:(NSInteger)code;
|
||||
///二次校验成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId;
|
||||
///批量验证凭据成功
|
||||
- (void)checkTranscationIdsSuccess;
|
||||
//充值banner位
|
||||
-(void)getBannerListSuccessWithList:(NSArray *)list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -235,6 +235,7 @@
|
||||
- (void)rechargeButtonAction:(UIButton *)sender {
|
||||
// XPMineRechargeViewController *vc = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.type = @"4";
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
}
|
||||
|
||||
|
@@ -117,6 +117,7 @@
|
||||
case ClickType_Diamond_Pay:
|
||||
{
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
webVC.type = @"4";
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
break;
|
||||
}
|
||||
|
@@ -198,6 +198,7 @@
|
||||
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
|
||||
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
webVC.type = @"5";
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
|
@@ -38,32 +38,34 @@
|
||||
|
||||
- (void)createUI {
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.contentView addSubview:self.selectedBgView];
|
||||
[self.contentView addSubview:self.priceLabel];
|
||||
[self.contentView addSubview:self.iconImageView];
|
||||
[self.contentView addSubview:self.numLabel];
|
||||
[self.bgView addSubview:self.selectedBgView];
|
||||
[self.bgView addSubview:self.priceLabel];
|
||||
[self.bgView addSubview:self.iconImageView];
|
||||
[self.bgView addSubview:self.numLabel];
|
||||
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.contentView);
|
||||
make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(16));
|
||||
make.top.mas_equalTo(kGetScaleWidth(0));
|
||||
make.height.mas_equalTo(kGetScaleWidth(60));
|
||||
|
||||
}];
|
||||
[self.selectedBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.bgView);
|
||||
}];
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.bgView);
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(24));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
[self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(10);
|
||||
make.left.mas_equalTo(4);
|
||||
make.right.mas_equalTo(-4);
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(18));
|
||||
make.centerY.equalTo(self.bgView);
|
||||
}];
|
||||
[self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView).offset(8);
|
||||
make.top.mas_equalTo(self.priceLabel.mas_bottom).offset(5);
|
||||
make.left.mas_greaterThanOrEqualTo(18);
|
||||
}];
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.numLabel);
|
||||
make.width.height.mas_equalTo(14);
|
||||
make.right.mas_equalTo(self.numLabel.mas_left).offset(-4);
|
||||
make.centerY.equalTo(self.bgView);
|
||||
make.leading.equalTo(self.iconImageView.mas_trailing).mas_offset(kGetScaleWidth(5));
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)setRechargeModel:(RechargeListModel *)rechargeModel {
|
||||
@@ -86,8 +88,9 @@
|
||||
- (UIView *)bgView {
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] init];
|
||||
_bgView.backgroundColor = UIColor.whiteColor;
|
||||
_bgView.layer.cornerRadius = 5;
|
||||
_bgView.backgroundColor = UIColorFromRGB(0xF0F5F6);
|
||||
_bgView.layer.cornerRadius = kGetScaleWidth(13);
|
||||
_bgView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
@@ -95,10 +98,13 @@
|
||||
- (UIView *)selectedBgView {
|
||||
if (!_selectedBgView) {
|
||||
_selectedBgView = [[UIView alloc] init];
|
||||
_selectedBgView.backgroundColor = [[DJDKMIMOMColor appMainColor] colorWithAlphaComponent:0.1];
|
||||
_selectedBgView.layer.cornerRadius = 5;
|
||||
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE6FDFF),UIColorFromRGB(0xFAEDFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(343), kGetScaleWidth(60))];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(344), kGetScaleWidth(60))];
|
||||
_selectedBgView.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||
_selectedBgView.layer.cornerRadius = kGetScaleWidth(13);
|
||||
_selectedBgView.layer.masksToBounds = YES;
|
||||
_selectedBgView.layer.borderColor = [UIColor colorWithPatternImage:image].CGColor;
|
||||
_selectedBgView.layer.borderWidth = 1;
|
||||
_selectedBgView.layer.borderColor = [DJDKMIMOMColor appMainColor].CGColor;
|
||||
_selectedBgView.hidden = YES;
|
||||
}
|
||||
return _selectedBgView;
|
||||
@@ -107,9 +113,9 @@
|
||||
- (UILabel *)priceLabel {
|
||||
if (!_priceLabel) {
|
||||
_priceLabel = [[UILabel alloc] init];
|
||||
_priceLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_priceLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||
_priceLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_priceLabel.textColor = UIColorFromRGB(0x1F1B4F);
|
||||
_priceLabel.font = kFontMedium(18);
|
||||
|
||||
}
|
||||
return _priceLabel;
|
||||
}
|
||||
@@ -126,8 +132,8 @@
|
||||
- (UILabel *)numLabel {
|
||||
if (!_numLabel) {
|
||||
_numLabel = [[UILabel alloc] init];
|
||||
_numLabel.textColor = [DJDKMIMOMColor textThirdColor];
|
||||
_numLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular];
|
||||
_numLabel.textColor = UIColorFromRGB(0x1F1B4F);
|
||||
_numLabel.font = kFontBold(20);
|
||||
_numLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _numLabel;
|
||||
|
23
YuMi/Modules/YMMine/View/Recharge/XPIAPRechargeHeadCell.h
Normal file
23
YuMi/Modules/YMMine/View/Recharge/XPIAPRechargeHeadCell.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// XPIAPRechargeHeadCell.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/11.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "RechargeListModel.h"
|
||||
@class XPIAPRechargeHeadCell;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol XPIAPRechargeHeadCellDelegate <NSObject>
|
||||
|
||||
- (void)xpIAPRechargeHeadCell:(XPIAPRechargeHeadCell *)cycleScrollView didSelectItemAtIndex:(NSInteger)index;
|
||||
|
||||
@end
|
||||
@interface XPIAPRechargeHeadCell : UICollectionViewCell
|
||||
//////充值banner位
|
||||
@property(nonatomic,copy) NSArray *bannerList;
|
||||
@property(nonatomic,weak) id<XPIAPRechargeHeadCellDelegate>delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
71
YuMi/Modules/YMMine/View/Recharge/XPIAPRechargeHeadCell.m
Normal file
71
YuMi/Modules/YMMine/View/Recharge/XPIAPRechargeHeadCell.m
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// XPIAPRechargeHeadCell.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/11.
|
||||
//
|
||||
|
||||
#import "XPIAPRechargeHeadCell.h"
|
||||
#import <SDCycleScrollView/SDCycleScrollView.h>
|
||||
|
||||
@interface XPIAPRechargeHeadCell()<SDCycleScrollViewDelegate>
|
||||
|
||||
///轮播图
|
||||
@property (nonatomic, strong) SDCycleScrollView *pi_BannerView;
|
||||
@end
|
||||
@implementation XPIAPRechargeHeadCell
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self.contentView addSubview:self.pi_BannerView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.pi_BannerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(16));
|
||||
make.top.mas_equalTo(kGetScaleWidth(0));
|
||||
make.height.mas_equalTo(kGetScaleWidth(94));
|
||||
}];
|
||||
}
|
||||
- (void)setBannerList:(NSArray *)bannerList{
|
||||
_bannerList = bannerList;
|
||||
NSMutableArray *list = [NSMutableArray array];
|
||||
for ( RechargeListModel *rechargeModel in _bannerList) {
|
||||
[list addObject:rechargeModel.bannerUrl];
|
||||
}
|
||||
self.pi_BannerView.imageURLStringsGroup = list;
|
||||
[self.pi_BannerView autoScroll];
|
||||
}
|
||||
#pragma mark - SDCycleScrollViewDelegate
|
||||
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(xpIAPRechargeHeadCell:didSelectItemAtIndex:)]){
|
||||
[self.delegate xpIAPRechargeHeadCell:self didSelectItemAtIndex:index];
|
||||
}
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (SDCycleScrollView *)pi_BannerView {
|
||||
if (!_pi_BannerView) {
|
||||
_pi_BannerView = [[SDCycleScrollView alloc] init];
|
||||
_pi_BannerView.backgroundColor = [UIColor clearColor];
|
||||
_pi_BannerView.layer.cornerRadius = kGetScaleWidth(10);
|
||||
_pi_BannerView.layer.masksToBounds = YES;
|
||||
_pi_BannerView.delegate = self;
|
||||
_pi_BannerView.showPageControl = YES;
|
||||
_pi_BannerView.autoScrollTimeInterval = 5.0;
|
||||
_pi_BannerView.currentPageDotColor = UIColorFromRGB(0x9168FA);
|
||||
_pi_BannerView.pageDotColor = UIColorRGBAlpha(0xB3B3C3, 0.4);
|
||||
_pi_BannerView.pageControlDotSize = CGSizeMake(kGetScaleWidth(4), kGetScaleWidth(4));
|
||||
_pi_BannerView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
_pi_BannerView.placeholderImage = [UIImageConstant defalutBannerPlaceholder];
|
||||
|
||||
}
|
||||
return _pi_BannerView;
|
||||
}
|
||||
@end
|
@@ -15,10 +15,14 @@
|
||||
|
||||
/// 背景图
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
///余额背景
|
||||
@property(nonatomic,strong) UIImageView *balanceBgVeiw;
|
||||
/// 余额文字
|
||||
@property (nonatomic, strong) UILabel *balanceTextLabel;
|
||||
/// 余额
|
||||
@property (nonatomic, strong) UILabel *balanceLabel;
|
||||
/// 💎
|
||||
@property (nonatomic, strong) UIImageView *iconImageView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -34,22 +38,36 @@
|
||||
|
||||
- (void)createUI {
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.balanceTextLabel];
|
||||
[self addSubview:self.balanceLabel];
|
||||
[self.bgImageView addSubview:self.balanceBgVeiw];
|
||||
[self.balanceBgVeiw addSubview:self.iconImageView];
|
||||
[self.balanceBgVeiw addSubview:self.balanceTextLabel];
|
||||
[self.balanceBgVeiw addSubview:self.balanceLabel];
|
||||
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(220.0/375.0*KScreenWidth);
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.balanceBgVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(343));
|
||||
make.height.mas_equalTo(kGetScaleWidth(86));
|
||||
make.centerX.equalTo(self.bgImageView);
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(22));
|
||||
}];
|
||||
|
||||
[self.balanceTextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.balanceBgVeiw).mas_offset(kGetScaleWidth(13));
|
||||
make.top.mas_equalTo(kGetScaleWidth(14));
|
||||
make.height.mas_equalTo(kGetScaleWidth(14));
|
||||
}];
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(21));
|
||||
make.trailing.equalTo(self.balanceTextLabel.mas_leading).mas_offset(-kGetScaleWidth(5));
|
||||
make.centerY.equalTo(self.balanceTextLabel);
|
||||
|
||||
}];
|
||||
[self.balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(-20);
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
}];
|
||||
[self.balanceTextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.balanceLabel.mas_top).offset(-4);
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(14));
|
||||
make.centerX.equalTo(self.balanceBgVeiw);
|
||||
make.leading.trailing.equalTo(self.balanceBgVeiw).inset(kGetScaleWidth(10));
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -65,16 +83,23 @@
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] init];
|
||||
_bgImageView.image = [UIImage imageNamed:@"mine_recharge_bg"];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth, kGetScaleWidth(123))];
|
||||
_bgImageView.image = image;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)balanceBgVeiw{
|
||||
if(!_balanceBgVeiw){
|
||||
_balanceBgVeiw = [UIImageView new];
|
||||
_balanceBgVeiw.image = kImage(@"mine_recharge_balance_bg");
|
||||
}
|
||||
return _balanceBgVeiw;
|
||||
}
|
||||
- (UILabel *)balanceTextLabel {
|
||||
if (!_balanceTextLabel) {
|
||||
_balanceTextLabel = [[UILabel alloc] init];
|
||||
_balanceTextLabel.textColor = UIColor.whiteColor;
|
||||
_balanceTextLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
_balanceTextLabel.textColor = UIColorFromRGB(0x333333);
|
||||
_balanceTextLabel.font = kFontRegular(14);
|
||||
_balanceTextLabel.text = YMLocalizedString(@"XPIAPRechargeHeaderView0");
|
||||
}
|
||||
return _balanceTextLabel;
|
||||
@@ -83,13 +108,21 @@
|
||||
- (UILabel *)balanceLabel {
|
||||
if (!_balanceLabel) {
|
||||
_balanceLabel = [[UILabel alloc] init];
|
||||
_balanceLabel.textColor = UIColor.whiteColor;
|
||||
_balanceLabel.font = [UIFont systemFontOfSize:64 weight:UIFontWeightMedium];
|
||||
_balanceLabel.textColor = UIColorFromRGB(0x1F1B4F);
|
||||
_balanceLabel.font = kFontMedium(32);
|
||||
_balanceLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_balanceLabel.text = @"0";
|
||||
_balanceLabel.adjustsFontSizeToFitWidth = YES;
|
||||
}
|
||||
return _balanceLabel;
|
||||
}
|
||||
- (UIImageView *)iconImageView {
|
||||
if (!_iconImageView) {
|
||||
_iconImageView = [[UIImageView alloc] init];
|
||||
_iconImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_iconImageView.image = [UIImage imageNamed:@"mine_main_recharge_diamond"];
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,weak) id<XPIAPRechargeViewControllerDelegate>delegate;
|
||||
///是否从精灵页面过来
|
||||
@property (nonatomic,assign) BOOL isFairyPay;
|
||||
@property(nonatomic,copy) NSString *type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -30,10 +30,13 @@
|
||||
#import "XPMineRechargeProtocol.h"
|
||||
///VC
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
#import "XPIAPRechargeHeadCell.h"
|
||||
#import "SessionViewController.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "Api+Main.h"
|
||||
#define kHeaderViewHeight 220.0/375.0*KScreenWidth
|
||||
|
||||
@interface XPIAPRechargeViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, XPMineRechargeProtocol, XPIAPHelperDelegate, XPMineRechargeNavViewDelegate>
|
||||
@interface XPIAPRechargeViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPMineRechargeProtocol, XPIAPHelperDelegate, XPMineRechargeNavViewDelegate,XPIAPRechargeHeadCellDelegate>
|
||||
|
||||
@property (nonatomic, strong) UICollectionView *collectionView;
|
||||
/// 头部
|
||||
@@ -43,16 +46,17 @@
|
||||
///
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///同意
|
||||
|
||||
@property (nonatomic,strong) UILabel *agreeLabel;
|
||||
///充值协议
|
||||
@property (nonatomic,strong) UIButton *protcoloButton;
|
||||
/// 联系
|
||||
@property (nonatomic,strong) UILabel *contactLabel;
|
||||
|
||||
|
||||
/// 返回
|
||||
@property (nonatomic,strong) UIButton *backBtn;
|
||||
/// 标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@property (nonatomic,strong) UILabel *tipslainiLable;
|
||||
|
||||
/// 数据源
|
||||
@property (nonatomic, strong) NSArray<RechargeListModel *> *dataSource;
|
||||
/// 选中下标
|
||||
@@ -60,6 +64,8 @@
|
||||
|
||||
/// 订单编号
|
||||
@property (nonatomic,copy) NSString *orderId;
|
||||
//////充值banner位
|
||||
@property(nonatomic,copy) NSArray *bannerList;
|
||||
|
||||
@end
|
||||
|
||||
@@ -83,16 +89,51 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
[self initHttpData];
|
||||
|
||||
[XPIAPHelper shareHelper].delegate = self;
|
||||
if([ClientConfig shareConfig].canOpen){
|
||||
[self showLoading];
|
||||
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self hideHUD];
|
||||
if(code == 200){
|
||||
if(data.data[@"isNative"] != nil){
|
||||
BOOL is = [data.data[@"isNative"] boolValue];
|
||||
[self initWebView:is];
|
||||
}
|
||||
return;
|
||||
}
|
||||
[self initWebView:YES];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
[self initWebView:YES];
|
||||
|
||||
|
||||
}
|
||||
-(void)initWebView:(BOOL)is{
|
||||
if(is == YES){
|
||||
[self createUI];
|
||||
[self initHttpData];
|
||||
[XPIAPHelper shareHelper].delegate = self;
|
||||
return;
|
||||
}
|
||||
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,self.type,[YYUtility deviceID]];
|
||||
vc.url = url;
|
||||
[self addChildViewController:vc];
|
||||
vc.view.frame = self.view.frame;
|
||||
[self.view addSubview:vc.view];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
|
||||
|
||||
|
||||
[self.view addSubview:self.headerView];
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self.view addSubview:self.tipslainiLable];
|
||||
[self.view addSubview:self.rechargeBtn];
|
||||
[self.view addSubview:self.stackView];
|
||||
[self.view addSubview:self.titleLabel];
|
||||
@@ -100,37 +141,37 @@
|
||||
|
||||
[self.stackView addArrangedSubview:self.agreeLabel];
|
||||
[self.stackView addArrangedSubview:self.protcoloButton];
|
||||
|
||||
CGFloat height = kGetScaleWidth(123)+kNavigationHeight;
|
||||
[self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(0);
|
||||
make.height.mas_equalTo(kHeaderViewHeight);
|
||||
make.height.mas_equalTo(height);
|
||||
}];
|
||||
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.headerView.mas_bottom);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(160);
|
||||
}];
|
||||
[self.tipslainiLable mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.collectionView.mas_bottom).offset(20);
|
||||
make.left.mas_equalTo(40);
|
||||
make.right.mas_equalTo(-40);
|
||||
}];
|
||||
[self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.height.mas_equalTo(48);
|
||||
make.bottom.mas_equalTo(-140);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.rechargeBtn.mas_bottom).offset(28);
|
||||
make.bottom.mas_equalTo(-34);
|
||||
make.height.mas_equalTo(kGetScaleWidth(14));
|
||||
}];
|
||||
|
||||
[self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(343));
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
make.centerX.equalTo(self.view);
|
||||
make.bottom.equalTo(self.stackView.mas_top).mas_offset(-kGetScaleWidth(10));
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.headerView.mas_bottom).mas_offset(-kGetScaleWidth(22));
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.bottom.equalTo(self.rechargeBtn.mas_top).mas_offset(-kGetScaleWidth(10));
|
||||
}];
|
||||
|
||||
[self.tipslainiLable mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view).inset(40);
|
||||
make.top.mas_equalTo(self.collectionView.mas_bottom).offset(20);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kStatusBarHeight);
|
||||
@@ -146,6 +187,7 @@
|
||||
|
||||
- (void)initHttpData {
|
||||
[self getRechargeList];
|
||||
[self.presenter getBannerList];
|
||||
[self getUserWalletBalanceInfo];
|
||||
[self checkTranscationIds];
|
||||
}
|
||||
@@ -197,7 +239,10 @@
|
||||
- (void)getUserWalletBalanceInfo {
|
||||
[self.presenter getUserWalletInfo];
|
||||
}
|
||||
|
||||
- (void)getBannerListSuccessWithList:(NSArray *)list{
|
||||
self.bannerList = list;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
///批量验证
|
||||
- (void)checkTranscationIds {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
@@ -275,9 +320,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)requestIAPRechargeOrderFail {
|
||||
- (void)requestIAPRechargeOrderFailWithCode:(NSInteger)code {
|
||||
///获取订单失败
|
||||
[self hideHUD];
|
||||
|
||||
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:^{
|
||||
NIMSession * session = [NIMSession session:@"10001" type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
///二次验证成功
|
||||
@@ -304,42 +367,59 @@
|
||||
#pragma mark - UICollectionViewDelegate
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.dataSource.count;
|
||||
return self.dataSource.count + self.bannerList.count;
|
||||
}
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return self.bannerList.count > 0 && indexPath.row == 0 ? CGSizeMake(KScreenWidth, kGetScaleWidth(114)) : CGSizeMake(KScreenWidth, kGetScaleWidth(80));
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
if(indexPath.row == 0 && self.bannerList.count > 0){
|
||||
XPIAPRechargeHeadCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPIAPRechargeHeadCell class]) forIndexPath:indexPath];
|
||||
cell.bannerList = self.bannerList;
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPIAPRechargeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeCollectionViewCell.self) forIndexPath:indexPath];
|
||||
cell.rechargeModel = [self.dataSource safeObjectAtIndex1:indexPath.item];
|
||||
cell.rechargeModel = [self.dataSource safeObjectAtIndex1:indexPath.item - 1];
|
||||
cell.selectedStyle = self.selectedIndex == indexPath.item;
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if(indexPath.row == 0)return;
|
||||
self.selectedIndex = indexPath.item;
|
||||
[collectionView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - XPIAPRechargeHeadCellDelegate
|
||||
- (void)xpIAPRechargeHeadCell:(XPIAPRechargeHeadCell *)cycleScrollView didSelectItemAtIndex:(NSInteger)index{
|
||||
RechargeListModel *bannerModel = [self.bannerList safeObjectAtIndex1:index];
|
||||
XPWebViewController * webVC= [[XPWebViewController alloc] init];
|
||||
webVC.url = bannerModel.linkUrl;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (UICollectionView *)collectionView {
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
CGFloat width = 108;
|
||||
CGFloat height = 65;
|
||||
layout.itemSize = CGSizeMake(width, height);
|
||||
layout.minimumLineSpacing = 10.0;
|
||||
layout.minimumInteritemSpacing = 8.0;
|
||||
layout.sectionInset = UIEdgeInsetsMake(20, 16, 16, 16);
|
||||
layout.minimumLineSpacing = 0;
|
||||
layout.minimumInteritemSpacing = 0;
|
||||
layout.sectionInset = UIEdgeInsetsMake(kGetScaleWidth(16), 0, kGetScaleWidth(16), 0);
|
||||
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.backgroundColor = UIColor.clearColor;
|
||||
_collectionView.backgroundColor = UIColor.whiteColor;
|
||||
_collectionView.alwaysBounceVertical = YES;
|
||||
[_collectionView registerClass:[XPIAPRechargeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeCollectionViewCell.self)];
|
||||
[_collectionView registerClass:[XPIAPRechargeHeadCell class] forCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeHeadCell.self)];
|
||||
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
|
||||
_collectionView.layer.cornerRadius = kGetScaleWidth(16);
|
||||
_collectionView.layer.masksToBounds = YES;
|
||||
// _collectionView.contentInset = UIEdgeInsetsMake(kHeaderViewHeight, 0, 0, 0);
|
||||
|
||||
}
|
||||
@@ -358,9 +438,9 @@
|
||||
_rechargeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_rechargeBtn setTitle:YMLocalizedString(@"XPIAPRechargeViewController2") forState:UIControlStateNormal];
|
||||
[_rechargeBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
_rechargeBtn.titleLabel.font = kFontMedium(16);
|
||||
[_rechargeBtn setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
_rechargeBtn.layer.cornerRadius = 48/2;
|
||||
_rechargeBtn.layer.cornerRadius = kGetScaleWidth(56)/2;
|
||||
_rechargeBtn.clipsToBounds = YES;
|
||||
[_rechargeBtn addTarget:self action:@selector(rechargeBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
@@ -398,15 +478,8 @@
|
||||
return _agreeLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)contactLabel {
|
||||
if (!_contactLabel) {
|
||||
_contactLabel = [[UILabel alloc] init];
|
||||
_contactLabel.text = [NSString stringWithFormat:@"%@: 88001",YMLocalizedString(@"XPIAPRechargeViewController5")];
|
||||
_contactLabel.font = [UIFont systemFontOfSize:12];
|
||||
_contactLabel.textColor = [DJDKMIMOMColor appMainColor];
|
||||
}
|
||||
return _contactLabel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (UIButton *)backBtn {
|
||||
if (!_backBtn) {
|
||||
@@ -422,21 +495,10 @@
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPIAPRechargeViewController6");
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
_titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium];
|
||||
_titleLabel.font = kFontSemibold(17);
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)tipslainiLable {
|
||||
if (!_tipslainiLable) {
|
||||
_tipslainiLable = [[UILabel alloc] init];
|
||||
_tipslainiLable.font = [UIFont systemFontOfSize:14];
|
||||
_tipslainiLable.textColor = [DJDKMIMOMColor colorWithHexString:@"#878B9C"];
|
||||
_tipslainiLable.text = YMLocalizedString(@"XPIAPRechargeViewController7");
|
||||
_tipslainiLable.numberOfLines = 2;
|
||||
_tipslainiLable.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _tipslainiLable;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -76,6 +76,8 @@
|
||||
@property (nonatomic, strong) NetImageView *nobleIconImageView;
|
||||
///等级
|
||||
@property (nonatomic,strong) NetImageView *experImageView;
|
||||
///代充
|
||||
@property (nonatomic,strong) NetImageView *rechargeImageView;
|
||||
///铭牌的容器
|
||||
@property (nonatomic,strong) UIView * namePlateView;
|
||||
///铭牌图片
|
||||
@@ -180,6 +182,7 @@
|
||||
[self.tagStackView addArrangedSubview:self.experImageView];
|
||||
[self.tagStackView addArrangedSubview:self.charmImageView];
|
||||
[self.tagStackView addArrangedSubview:self.namePlateView];
|
||||
[self.tagStackView addArrangedSubview:self.rechargeImageView];
|
||||
///铭牌
|
||||
[self.namePlateView addSubview:self.nameplateImageView];
|
||||
[self.namePlateView addSubview:self.nameplateLabel];
|
||||
@@ -337,7 +340,10 @@
|
||||
make.height.mas_equalTo(20);
|
||||
make.width.mas_equalTo(34);
|
||||
}];
|
||||
|
||||
[self.rechargeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(18);
|
||||
make.width.mas_equalTo(54);
|
||||
}];
|
||||
[self.newUserImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
@@ -603,6 +609,7 @@
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
self.rechargeImageView.hidden = !_userInfo.isRechargeUser;
|
||||
[self.userPhtotArray removeAllObjects];
|
||||
// 轮播图
|
||||
NSMutableArray * imageUrls = [NSMutableArray array];
|
||||
@@ -1080,4 +1087,12 @@
|
||||
}
|
||||
return _singStackView;
|
||||
}
|
||||
- (NetImageView *)rechargeImageView{
|
||||
if(!_rechargeImageView){
|
||||
_rechargeImageView = [NetImageView new];
|
||||
_rechargeImageView.image = kImage(@"mine_info_recharge");
|
||||
_rechargeImageView.hidden = YES;
|
||||
}
|
||||
return _rechargeImageView;
|
||||
}
|
||||
@end
|
||||
|
@@ -89,6 +89,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
@property (nonatomic,assign) BOOL isRequestData;
|
||||
///游戏列表
|
||||
@property (nonatomic, strong) NSMutableArray<LittleGameInfoModel *> *littleGameArray;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPMineViewController
|
||||
@@ -436,6 +438,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
///点击充值
|
||||
-(void)pushThirdPartyPayVC{
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
webVC.type = @"4";
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
///点击收益记录
|
||||
@@ -600,6 +603,8 @@ 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;
|
||||
@@ -637,6 +642,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
- (void)onGetClanDetailInfofailWithGroup:(dispatch_group_t)group{
|
||||
dispatch_group_leave(group);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
///匹配游戏房成功
|
||||
- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId {
|
||||
if (roomInfo.isPick && roomInfo.uid.length > 0) {
|
||||
@@ -686,6 +692,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
|
||||
- (void)quickMatchLittleGameRoomFail:(NSString *)mgId {
|
||||
[XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", self.userInfo.uid] mgId:mgId viewController:self];
|
||||
}
|
||||
=======
|
||||
>>>>>>> 90b22d5 (代充优化)
|
||||
|
||||
#pragma mark - XPMineHeadItemTableViewCellDelegate
|
||||
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
|
||||
|
@@ -139,6 +139,7 @@
|
||||
{
|
||||
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
XPIAPRechargeViewController *rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.type = @"4";
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user