提交
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) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// QXRedBagRecordViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/11.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRedBagRecordViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString *redbagId;
|
||||
@end
|
||||
|
||||
@interface QXRedBagRecordCell : UITableViewCell
|
||||
+(instancetype)cellWithTabelView:(UITableView*)tableView;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,226 @@
|
||||
//
|
||||
// QXRedBagRecordViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/11.
|
||||
//
|
||||
|
||||
#import "QXRedBagRecordViewController.h"
|
||||
@class QXRedBagRecordCell;
|
||||
@interface QXRedBagRecordViewController ()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)UIView *topView;
|
||||
@property (nonatomic,strong)UIImageView *topImageView;
|
||||
@property (nonatomic,strong)UIImageView *senderHeaderImageView;
|
||||
@property (nonatomic,strong)UILabel *senderNameLabel;
|
||||
@property (nonatomic,strong)UILabel *remarkLabel;
|
||||
@property (nonatomic,strong)UILabel *moneyLabel;
|
||||
@property (nonatomic,strong)UILabel *bottomLabel;
|
||||
@property (nonatomic,strong)UILabel *countLabel;
|
||||
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@end
|
||||
|
||||
@implementation QXRedBagRecordViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
|
||||
self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(308))];
|
||||
self.topImageView = [[UIImageView alloc] init];
|
||||
self.topImageView.image = [UIImage imageNamed:@"red_bag_record_top_bg"];
|
||||
[self.topView addSubview:self.topImageView];
|
||||
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.left.right.equalTo(self.topView);
|
||||
}];
|
||||
|
||||
self.senderNameLabel = [[UILabel alloc] init];
|
||||
self.senderNameLabel.textColor = RGB16(0xffffff);
|
||||
self.senderNameLabel.font = [UIFont systemFontOfSize:18];
|
||||
self.senderNameLabel.text = @"傻狗涛的红包";
|
||||
[self.topView addSubview:self.senderNameLabel];
|
||||
[self.senderNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView).offset(41);;
|
||||
make.top.equalTo(self.topView).offset(92);
|
||||
}];
|
||||
|
||||
self.senderHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.senderHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.senderHeaderImageView addRoundedCornersWithRadius:20.5];
|
||||
[self.topView addSubview:self.senderHeaderImageView];
|
||||
[self.senderHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.senderNameLabel.mas_left).offset(-13);
|
||||
make.centerY.equalTo(self.senderNameLabel);
|
||||
make.width.height.mas_equalTo(41);
|
||||
}];
|
||||
|
||||
self.remarkLabel = [[UILabel alloc] init];
|
||||
self.remarkLabel.text = @"恭喜发财大吉大利";
|
||||
self.remarkLabel.textColor = RGB16(0xffffff);
|
||||
self.remarkLabel.font = [UIFont systemFontOfSize:13];
|
||||
[self.topView addSubview:self.remarkLabel];
|
||||
[self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.senderHeaderImageView.mas_bottom).offset(5);
|
||||
make.height.mas_equalTo(26);
|
||||
make.centerX.equalTo(self.topView);
|
||||
}];
|
||||
|
||||
self.moneyLabel = [[UILabel alloc] init];
|
||||
self.moneyLabel.font = [UIFont boldSystemFontOfSize:19];
|
||||
self.moneyLabel.textColor = RGB16(0xffffff);
|
||||
self.moneyLabel.text = @"5000金币";
|
||||
[self.topView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView);
|
||||
make.top.equalTo(self.remarkLabel.mas_bottom);
|
||||
}];
|
||||
|
||||
self.bottomLabel = [[UILabel alloc] init];
|
||||
self.bottomLabel.textColor = RGB16(0xffffff);
|
||||
self.bottomLabel.text = @"已存入金币";
|
||||
self.bottomLabel.font = [UIFont systemFontOfSize:13];
|
||||
[self.topView addSubview:self.bottomLabel];
|
||||
[self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView);
|
||||
make.top.equalTo(self.moneyLabel.mas_bottom);
|
||||
}];
|
||||
|
||||
self.countLabel = [[UILabel alloc] init];
|
||||
self.countLabel.textColor = RGB16(0x999999);
|
||||
self.countLabel.font = [UIFont systemFontOfSize:13];
|
||||
self.countLabel.text = @"已领取0/0";
|
||||
[self.topView addSubview:self.countLabel];
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo (15);
|
||||
make.bottom.mas_equalTo(-10);
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.topView];
|
||||
|
||||
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.backgroundColor = RGB16(0xffffff);
|
||||
self.tableView.rowHeight = 67;
|
||||
|
||||
// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.equalTo(self.topView.mas_bottom);
|
||||
}];
|
||||
|
||||
UIButton*backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 44, 44)];
|
||||
[backBtn setImage:[[UIImage imageNamed:@"back"] imageByTintColor:UIColor.whiteColor] forState:(UIControlStateNormal)];
|
||||
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
|
||||
[backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:backBtn];
|
||||
}
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRedBagRecordCell *cell = [QXRedBagRecordCell cellWithTabelView:tableView];
|
||||
return cell;
|
||||
}
|
||||
-(void)backAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@interface QXRedBagRecordCell()
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *userHeaderImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UILabel *timeLabel;
|
||||
@property (nonatomic,strong)UILabel *moneyLabel;
|
||||
@end
|
||||
|
||||
@implementation QXRedBagRecordCell
|
||||
|
||||
+(instancetype)cellWithTabelView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXRedBagRecordCell";
|
||||
QXRedBagRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXRedBagRecordCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.bgView = [[UIView alloc] init];
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(15);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.height.mas_equalTo(52);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
self.userHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.userHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.userHeaderImageView addRoundedCornersWithRadius:24.5];
|
||||
[self.bgView addSubview:self.userHeaderImageView];
|
||||
[self.userHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.centerY.equalTo(self.bgView);
|
||||
make.width.height.mas_equalTo(49);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = RGB16(0x666666);
|
||||
self.nameLabel.text = @"大家好,我是傻狗涛";
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.bgView addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.userHeaderImageView.mas_right).offset(13);
|
||||
make.top.equalTo(self.userHeaderImageView);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
|
||||
self.timeLabel = [[UILabel alloc] init];
|
||||
self.timeLabel.textColor = RGB16(0x999999);
|
||||
self.timeLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.timeLabel.text = @"00:61";
|
||||
[self.bgView addSubview:self.timeLabel];
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.userHeaderImageView.mas_right).offset(13);
|
||||
make.bottom.equalTo(self.userHeaderImageView);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
|
||||
self.moneyLabel = [[UILabel alloc] init];
|
||||
self.moneyLabel.textColor = RGB16(0x333333);
|
||||
self.moneyLabel.text = @"0 金币";
|
||||
self.moneyLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.bgView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.bgView);
|
||||
make.centerY.equalTo(self.bgView);
|
||||
}];
|
||||
}
|
||||
@end
|
||||
@@ -30,6 +30,10 @@
|
||||
#import "QXRoomSubsidyViewController.h"
|
||||
#import "QXRoomViewController+Friend.h"
|
||||
#import "QXAllRoomHourRankView.h"
|
||||
#import "QXRedBagSendView.h"
|
||||
#import "QXRedBagTagView.h"
|
||||
#import "QXRedBagDrawView.h"
|
||||
#import "QXRedBagListView.h"
|
||||
|
||||
@interface QXRoomViewController ()<
|
||||
QXRoomBottomViewDelegate,
|
||||
@@ -76,6 +80,11 @@ QXRoomUserInfoViewDelegate
|
||||
|
||||
@property (nonatomic,strong)QXAllRoomHourRankView *hourRankView;
|
||||
@property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView;
|
||||
|
||||
/// 红包入口
|
||||
@property (nonatomic,strong)QXRedBagTagView *redBagTagView;
|
||||
@property (nonatomic,strong)QXRedBagDrawView *redbagDrawView;
|
||||
@property (nonatomic,strong)QXRedBagListView *redbagListView;
|
||||
@end
|
||||
|
||||
@implementation QXRoomViewController
|
||||
@@ -202,6 +211,7 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
|
||||
[self.view addSubview:self.hourRankIconView];
|
||||
// [self.view addSubview:self.redBagTagView];
|
||||
[self setupEffectView];
|
||||
|
||||
// [self.view addSubview:self.headlineView];
|
||||
@@ -1177,46 +1187,6 @@ QXRoomUserInfoViewDelegate
|
||||
QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:vc];
|
||||
na.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
[self presentViewController:na animated:YES completion:nil];
|
||||
// vc.isFromRoom = YES;
|
||||
// // 设置初始 frame (在屏幕下方)
|
||||
// CGRect finalFrame = CGRectMake(0, SCREEN_HEIGHT- ScaleWidth(429),
|
||||
// self.view.bounds.size.width,
|
||||
// ScaleWidth(429));
|
||||
// CGRect initialFrame = CGRectOffset(finalFrame, 0, finalFrame.size.height);
|
||||
// vc.view.frame = initialFrame;
|
||||
//
|
||||
// // 添加圆角
|
||||
// vc.view.layer.cornerRadius = 10;
|
||||
// vc.view.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
|
||||
// vc.view.clipsToBounds = YES;
|
||||
//
|
||||
// // 添加阴影
|
||||
// vc.view.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
// vc.view.layer.shadowOffset = CGSizeMake(0, -5);
|
||||
// vc.view.layer.shadowOpacity = 0.3;
|
||||
// vc.view.layer.shadowRadius = 10;
|
||||
//
|
||||
// // 添加为子视图控制器
|
||||
// [self addChildViewController:vc];
|
||||
// [self.view addSubview:vc.view];
|
||||
// [vc didMoveToParentViewController:self];
|
||||
//
|
||||
// // 创建半透明背景
|
||||
// UIView *dimmingView = [[UIView alloc] initWithFrame:self.view.bounds];
|
||||
// dimmingView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
// dimmingView.alpha = 0;
|
||||
// dimmingView.tag = 212;
|
||||
// [self.view insertSubview:dimmingView belowSubview:vc.view];
|
||||
//
|
||||
// // 添加点击手势
|
||||
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissHalfScreenView)];
|
||||
// [dimmingView addGestureRecognizer:tap];
|
||||
//
|
||||
// // 执行动画
|
||||
// [UIView animateWithDuration:0.3 animations:^{
|
||||
// vc.view.frame = finalFrame;
|
||||
// dimmingView.alpha = 1;
|
||||
// }];
|
||||
}
|
||||
break;
|
||||
case QXRoomBottomViewEventTypePK:{
|
||||
@@ -1403,20 +1373,13 @@ QXRoomUserInfoViewDelegate
|
||||
break;
|
||||
}
|
||||
}
|
||||
- (void)dismissHalfScreenView {
|
||||
UIViewController *halfScreenVC = self.childViewControllers.lastObject;
|
||||
UIView *dimmingView = [self.view viewWithTag:212];
|
||||
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
halfScreenVC.view.frame = CGRectOffset(halfScreenVC.view.frame, 0, halfScreenVC.view.frame.size.height);
|
||||
dimmingView.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[halfScreenVC willMoveToParentViewController:nil];
|
||||
[halfScreenVC.view removeFromSuperview];
|
||||
[halfScreenVC removeFromParentViewController];
|
||||
[dimmingView removeFromSuperview];
|
||||
}];
|
||||
-(void)didSendMessage:(NSString *)message redpacketModel:(nonnull QXRedPacketModel *)redpacketModel{
|
||||
if (redpacketModel) {
|
||||
self.redbagDrawView.type = QXRedBagDrawTypeOpen;
|
||||
[self.redbagDrawView showInView:self.view];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 麦位点击用户信息
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{
|
||||
if (isPkRoom) {
|
||||
@@ -1530,7 +1493,11 @@ QXRoomUserInfoViewDelegate
|
||||
[self.navigationController pushViewController:reportVC animated:YES];
|
||||
}
|
||||
break;
|
||||
|
||||
case QXRoomSettingTypeSendRedBag:{
|
||||
QXRedBagSendView *redbagView = [[QXRedBagSendView alloc] init];
|
||||
[redbagView showInView:self.view];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1955,5 +1922,45 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
return _hourRankView;
|
||||
}
|
||||
-(QXRedBagTagView *)redBagTagView{
|
||||
if (!_redBagTagView) {
|
||||
_redBagTagView = [[QXRedBagTagView alloc] init];
|
||||
MJWeakSelf
|
||||
_redBagTagView.startBlock = ^(BOOL isList) {
|
||||
weakSelf.redbagListView.dataArray = @[@"",@"",@"",@"",@""];
|
||||
[weakSelf.redbagListView showInView:weakSelf.view];
|
||||
return;
|
||||
if (isList) {
|
||||
[weakSelf.redbagListView showInView:weakSelf.view];
|
||||
}else{
|
||||
[weakSelf.redbagDrawView showInView:weakSelf.view];
|
||||
}
|
||||
};
|
||||
}
|
||||
return _redBagTagView;
|
||||
}
|
||||
-(QXRedBagDrawView *)redbagDrawView{
|
||||
if (!_redbagDrawView) {
|
||||
_redbagDrawView = [[QXRedBagDrawView alloc] init];
|
||||
MJWeakSelf
|
||||
_redbagDrawView.toInputPwdBlock = ^(NSString * _Nonnull password, QXRedPacketModel * _Nonnull redpacketModel) {
|
||||
[weakSelf.bottomView inputMessageWithName:password redpacketModel:redpacketModel];
|
||||
};
|
||||
}
|
||||
return _redbagDrawView;
|
||||
}
|
||||
-(QXRedBagListView *)redbagListView{
|
||||
if (!_redbagListView) {
|
||||
_redbagListView = [[QXRedBagListView alloc] init];
|
||||
MJWeakSelf
|
||||
_redbagListView.didSelectedRedBlock = ^{
|
||||
weakSelf.redbagDrawView.redpacketModel = [QXRedPacketModel new];
|
||||
weakSelf.redbagDrawView.type = QXRedBagDrawTypePwdSend;
|
||||
[weakSelf.redbagDrawView showInView:weakSelf.view];
|
||||
};
|
||||
|
||||
}
|
||||
return _redbagListView;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user