提交
This commit is contained in:
@@ -17,11 +17,14 @@
|
||||
#import "QXHomePageNetwork.h"
|
||||
#import "QXMyRoomViewController.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXFirstRechargePopView.h"
|
||||
#import "QXNewPeoplePopView.h"
|
||||
#import "QXRechargeView.h"
|
||||
#import "QXAppstoreHomeView.h"
|
||||
#import "QXConfig.h"
|
||||
#import "QXSkyPraizeView.h"
|
||||
#import "QXRechargePermissionModel.h"
|
||||
#import "QXNiceGiftPopView.h" // 天降好礼
|
||||
#import "QXFirstRechargeView.h" // 首充好礼
|
||||
|
||||
@interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate>
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@@ -42,11 +45,13 @@
|
||||
@property (nonatomic,strong)UIView *headerView;
|
||||
@property (nonatomic,strong)UIView *sectionView;
|
||||
|
||||
@property (nonatomic,strong)UIButton *firstRechargeBtn;
|
||||
//@property (nonatomic,strong)UIButton *firstRechargeBtn;
|
||||
@property (nonatomic,strong)UIButton *skyDownBtn;
|
||||
@property (nonatomic,strong)QXFirstRechargePopView *firstRechargeView;
|
||||
@property (nonatomic,strong)QXNewPeoplePopView *nPeopleRechargeView;
|
||||
|
||||
@property (nonatomic,strong)QXAppstoreHomeView *appStoreView;
|
||||
@property (nonatomic,strong)SDCycleScrollView *rechargePermissionView;
|
||||
@property (nonatomic,strong)NSMutableArray *rechargePermissionArray;
|
||||
@end
|
||||
|
||||
@implementation QXHomeViewController
|
||||
@@ -62,16 +67,6 @@
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
// UILabel *tLabel = [[UILabel alloc] init];
|
||||
// tLabel.text = QXText(@"秘地");
|
||||
// tLabel.font = [UIFont boldSystemFontOfSize:20];
|
||||
// [self.view addSubview:tLabel];
|
||||
// [tLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.mas_equalTo(16);
|
||||
// make.top.mas_equalTo(kSafeAreaTop +10);
|
||||
// }];
|
||||
|
||||
|
||||
if ([QXConfig.backgroundImage hasPrefix:@"http"] || [QXConfig.backgroundImage hasPrefix:@"https"]) {
|
||||
[self updateBgImage:QXConfig.backgroundImage];
|
||||
}else{
|
||||
@@ -130,17 +125,23 @@
|
||||
[self getBanner];
|
||||
}];
|
||||
|
||||
self.firstRechargeBtn.hidden = YES;
|
||||
[self.view addSubview:self.firstRechargeBtn];
|
||||
[self.firstRechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(-(TabbarContentHeight+5));
|
||||
make.right.equalTo(self.view).offset(-17);
|
||||
make.width.height.mas_equalTo(ScaleWidth(57));
|
||||
}];
|
||||
// self.firstRechargeBtn.hidden = YES;
|
||||
// [self.view addSubview:self.firstRechargeBtn];
|
||||
// [self.firstRechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.mas_equalTo(-(TabbarContentHeight+5));
|
||||
// make.right.equalTo(self.view).offset(-17);
|
||||
// make.width.height.mas_equalTo(ScaleWidth(57));
|
||||
// }];
|
||||
[self getBanner];
|
||||
[self getFirstRechargePermission];
|
||||
// [self getRechargePermission];
|
||||
self.appStoreView.hidden = YES;
|
||||
[self.view addSubview:self.appStoreView];
|
||||
|
||||
self.rechargePermissionView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(SCREEN_WIDTH-80-17, SCREEN_HEIGHT-(TabbarContentHeight+90+80), 80, 80) delegate:self placeholderImage:nil];
|
||||
self.rechargePermissionView.pageControlBottomOffset = -15;
|
||||
self.rechargePermissionView.backgroundColor = [UIColor clearColor];
|
||||
self.rechargePermissionView.hidden = YES;
|
||||
[self.view addSubview:self.rechargePermissionView];
|
||||
}
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
@@ -170,32 +171,69 @@
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getFirstRechargePermission{
|
||||
//-(void)getFirstRechargePermission{
|
||||
// @weakify(self)
|
||||
// [QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
|
||||
// @strongify(self)
|
||||
// self.firstRechargeBtn.hidden = !isShow;
|
||||
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
//
|
||||
// }];
|
||||
//}
|
||||
-(void)getRechargePermission{
|
||||
// sky_drop_gift_icon ,new_people_recharge_icon ,first_recharge_icon
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
|
||||
[QXHomePageNetwork getRechargePermissionSuccessBlock:^(QXRechargePermissionModel * _Nonnull model) {
|
||||
@strongify(self)
|
||||
self.firstRechargeBtn.hidden = !isShow;
|
||||
[self.rechargePermissionArray removeAllObjects];
|
||||
NSMutableArray *imgs = [NSMutableArray array];
|
||||
if (model.day_drop_permission.intValue == 1) {
|
||||
[imgs addObject:@"sky_drop_gift_icon"];
|
||||
QXRechargeTypeModel *md = [[QXRechargeTypeModel alloc] init];
|
||||
md.icon = @"sky_drop_gift_icon";
|
||||
md.type = 2;
|
||||
[self.rechargePermissionArray addObject:md];
|
||||
}
|
||||
if (model.first_charge_permission.intValue == 1) {
|
||||
[imgs addObject:@"first_recharge_icon"];
|
||||
QXRechargeTypeModel *md = [[QXRechargeTypeModel alloc] init];
|
||||
md.icon = @"first_recharge_icon";
|
||||
md.type = 3;
|
||||
[self.rechargePermissionArray addObject:md];
|
||||
}
|
||||
if (model.n_people_permission.intValue == 1) {
|
||||
[imgs addObject:@"new_people_recharge_icon"];
|
||||
QXRechargeTypeModel *md = [[QXRechargeTypeModel alloc] init];
|
||||
md.icon = @"new_people_recharge_icon";
|
||||
md.type = 1;
|
||||
[self.rechargePermissionArray addObject:md];
|
||||
}
|
||||
if (imgs.count==0) {
|
||||
return;
|
||||
}
|
||||
self.rechargePermissionView.hidden = NO;
|
||||
self.rechargePermissionView.imageURLStringsGroup = imgs;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)firstAction{
|
||||
[self popFirstRechargeView];
|
||||
// QXSkyPraizeView *v = [[QXSkyPraizeView alloc] init];
|
||||
// [v showInView:self.view];
|
||||
}
|
||||
-(void)popFirstRechargeView{
|
||||
//-(void)firstAction{
|
||||
// [self popnPeopleRechargeView];
|
||||
//// QXSkyPraizeView *v = [[QXSkyPraizeView alloc] init];
|
||||
//// [v showInView:self.view];
|
||||
//}
|
||||
-(void)popnPeopleRechargeView{
|
||||
// MJWeakSelf
|
||||
// view.giftArray = @[@"",@"",@"",@"",@"",@""];
|
||||
self.firstRechargeView.closeActionBlock = ^{
|
||||
self.nPeopleRechargeView.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
self.firstRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) {
|
||||
self.nPeopleRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) {
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
@@ -207,11 +245,63 @@
|
||||
[recharge showInView:KEYWINDOW];
|
||||
}];
|
||||
};
|
||||
[self.firstRechargeView reloadData];
|
||||
[[QXGlobal shareGlobal] showView:self.firstRechargeView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
[self.nPeopleRechargeView reloadData];
|
||||
[[QXGlobal shareGlobal] showView:self.nPeopleRechargeView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)popNiceGiftView{
|
||||
MJWeakSelf
|
||||
QXNiceGiftPopView *view = [[QXNiceGiftPopView alloc] init];
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
view.getActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
|
||||
view.refreshBlcock = ^{
|
||||
[weakSelf getRechargePermission];
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)popFirstRechargeView{
|
||||
MJWeakSelf
|
||||
QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init];
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
view.getActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
|
||||
view.refreshBlcock = ^{
|
||||
[weakSelf getRechargePermission];
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - JXPagingViewDelegate
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
@@ -334,6 +424,23 @@
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
if (cycleScrollView == self.rechargePermissionView) {
|
||||
QXRechargeTypeModel *md = self.rechargePermissionArray[index];
|
||||
if (md.type == 1) {
|
||||
[self popnPeopleRechargeView];
|
||||
return;
|
||||
}
|
||||
if (md.type == 2) {
|
||||
[self popNiceGiftView];
|
||||
return;
|
||||
}
|
||||
if (md.type == 3) {
|
||||
[self popFirstRechargeView];
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
QXBanner *banner = self.bannerArry[index];
|
||||
if ([banner.type isEqualToString:@"2"]) {
|
||||
QXBaseWebViewController *webVc = [[QXBaseWebViewController alloc] init];
|
||||
@@ -482,28 +589,33 @@
|
||||
}
|
||||
return _bannerArry;
|
||||
}
|
||||
-(UIButton *)firstRechargeBtn{
|
||||
if (!_firstRechargeBtn) {
|
||||
_firstRechargeBtn = [[UIButton alloc] init];
|
||||
[_firstRechargeBtn setBackgroundImage:[UIImage imageNamed:@"first_recharge_icon"] forState:(UIControlStateNormal)];
|
||||
[_firstRechargeBtn addTarget:self action:@selector(firstAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
//-(UIButton *)firstRechargeBtn{
|
||||
// if (!_firstRechargeBtn) {
|
||||
// _firstRechargeBtn = [[UIButton alloc] init];
|
||||
// [_firstRechargeBtn setBackgroundImage:[UIImage imageNamed:@"first_recharge_icon"] forState:(UIControlStateNormal)];
|
||||
// [_firstRechargeBtn addTarget:self action:@selector(firstAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// }
|
||||
// return _firstRechargeBtn;
|
||||
//}
|
||||
//-(UIButton *)skyDownBtn{
|
||||
// if (!_skyDownBtn) {
|
||||
// _skyDownBtn = [[UIButton alloc] init];
|
||||
// [_skyDownBtn setBackgroundImage:[UIImage imageNamed:@"sky_down_gift_icon"] forState:(UIControlStateNormal)];
|
||||
// }
|
||||
// return _skyDownBtn;
|
||||
//}
|
||||
-(QXNewPeoplePopView *)nPeopleRechargeView{
|
||||
if (!_nPeopleRechargeView) {
|
||||
_nPeopleRechargeView = [[QXNewPeoplePopView alloc] init];
|
||||
}
|
||||
return _firstRechargeBtn;
|
||||
return _nPeopleRechargeView;
|
||||
}
|
||||
-(UIButton *)skyDownBtn{
|
||||
if (!_skyDownBtn) {
|
||||
_skyDownBtn = [[UIButton alloc] init];
|
||||
[_skyDownBtn setBackgroundImage:[UIImage imageNamed:@"sky_down_gift_icon"] forState:(UIControlStateNormal)];
|
||||
-(NSMutableArray *)rechargePermissionArray{
|
||||
if (!_rechargePermissionArray) {
|
||||
_rechargePermissionArray = [NSMutableArray array];
|
||||
}
|
||||
return _skyDownBtn;
|
||||
return _rechargePermissionArray;
|
||||
}
|
||||
-(QXFirstRechargePopView *)firstRechargeView{
|
||||
if (!_firstRechargeView) {
|
||||
_firstRechargeView = [[QXFirstRechargePopView alloc] init];
|
||||
}
|
||||
return _firstRechargeView;
|
||||
}
|
||||
|
||||
|
||||
-(QXAppstoreHomeView *)appStoreView{
|
||||
if (!_appStoreView) {
|
||||
|
||||
Reference in New Issue
Block a user