diff --git a/QXLive.xcworkspace/xcuserdata/qixing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/QXLive.xcworkspace/xcuserdata/qixing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 89d3c1d..8e626de 100644
--- a/QXLive.xcworkspace/xcuserdata/qixing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/QXLive.xcworkspace/xcuserdata/qixing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -208,22 +208,6 @@
landmarkType = "7">
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/QXLive/Config/QXConfig.h b/QXLive/Config/QXConfig.h
index ee8bc82..7386341 100644
--- a/QXLive/Config/QXConfig.h
+++ b/QXLive/Config/QXConfig.h
@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
+(UIColor*)themeColor;
/// 获取按钮字体色
+(UIColor*)btnTextColor;
-/// 主题色
+/// 背景图
+(NSString*)backgroundImage;
/// tabbar
+(NSArray*)tabbarArray;
diff --git a/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m b/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m
index efaa331..57d7bd3 100644
--- a/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m
+++ b/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m
@@ -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 ()
@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) {
diff --git a/QXLive/HomePage(声播)/Controlller/房间/QXRedBagRecordViewController.h b/QXLive/HomePage(声播)/Controlller/房间/QXRedBagRecordViewController.h
new file mode 100644
index 0000000..364e2e3
--- /dev/null
+++ b/QXLive/HomePage(声播)/Controlller/房间/QXRedBagRecordViewController.h
@@ -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
diff --git a/QXLive/HomePage(声播)/Controlller/房间/QXRedBagRecordViewController.m b/QXLive/HomePage(声播)/Controlller/房间/QXRedBagRecordViewController.m
new file mode 100644
index 0000000..4267ab1
--- /dev/null
+++ b/QXLive/HomePage(声播)/Controlller/房间/QXRedBagRecordViewController.m
@@ -0,0 +1,226 @@
+//
+// QXRedBagRecordViewController.m
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import "QXRedBagRecordViewController.h"
+@class QXRedBagRecordCell;
+@interface QXRedBagRecordViewController ()
+@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
diff --git a/QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.m b/QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.m
index b07cead..2618a9d 100644
--- a/QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.m
+++ b/QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.m
@@ -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
diff --git a/QXLive/HomePage(声播)/Model/QXNiceGiftRechargeModel.h b/QXLive/HomePage(声播)/Model/QXNiceGiftRechargeModel.h
new file mode 100644
index 0000000..f590779
--- /dev/null
+++ b/QXLive/HomePage(声播)/Model/QXNiceGiftRechargeModel.h
@@ -0,0 +1,51 @@
+//
+// QXNiceGiftRechargeModel.h
+// QXLive
+//
+// Created by 启星 on 2025/10/12.
+//
+
+#import
+#import "QXGiftModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXNiceGiftRechargeModel : UIView
+/// 名称
+@property (nonatomic,strong)NSString *name;
+/// 礼包名称
+@property (nonatomic,strong)NSString *bag_name;
+
+@property (nonatomic,strong)NSString *title1;
+
+@property (nonatomic,strong)NSString *title2;
+/// 剩余时间
+@property (nonatomic,strong)NSString* effective_time;
+/// 规则
+@property (nonatomic,strong)NSString *rule;
+/// 说明
+@property (nonatomic,strong)NSString *counter;
+/// 金钱
+@property (nonatomic,strong)NSString *money;
+/// 钻石
+@property (nonatomic,strong)NSString *diamond;
+/// 礼物列表
+@property (nonatomic,strong)NSArray *gift_list;
+@end
+
+
+@interface QXFirstRechargeModel : NSObject
+/// 9|30元
+@property (nonatomic,strong)NSString *name;
+/// 9元限时抢
+@property (nonatomic,strong)NSString *title1;
+/// 88元礼包
+@property (nonatomic,strong)NSString *title2;
+/// 充值金额
+@property (nonatomic,strong)NSString *money;
+/// 时间
+@property (nonatomic,strong)NSString *time;
+/// 礼物列表
+@property (nonatomic,strong)NSArray *gift_list;
+@end
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/Model/QXNiceGiftRechargeModel.m b/QXLive/HomePage(声播)/Model/QXNiceGiftRechargeModel.m
new file mode 100644
index 0000000..7678f46
--- /dev/null
+++ b/QXLive/HomePage(声播)/Model/QXNiceGiftRechargeModel.m
@@ -0,0 +1,28 @@
+//
+// QXNiceGiftRechargeModel.m
+// QXLive
+//
+// Created by 启星 on 2025/10/12.
+//
+
+#import "QXNiceGiftRechargeModel.h"
+
+@implementation QXNiceGiftRechargeModel
+
++(NSDictionary *)modelContainerPropertyGenericClass{
+ return @{
+ @"gift_list" : @"QXGiftModel"
+ };
+}
+
+@end
+
+@implementation QXFirstRechargeModel
++(NSDictionary *)modelContainerPropertyGenericClass{
+ return @{
+ @"gift_list" : @"QXGiftModel"
+ };
+}
+
+
+@end
diff --git a/QXLive/HomePage(声播)/Model/QXRechargePermissionModel.h b/QXLive/HomePage(声播)/Model/QXRechargePermissionModel.h
new file mode 100644
index 0000000..e6ef74e
--- /dev/null
+++ b/QXLive/HomePage(声播)/Model/QXRechargePermissionModel.h
@@ -0,0 +1,27 @@
+//
+// QXRechargePermissionModel.h
+// QXLive
+//
+// Created by 启星 on 2025/10/12.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXRechargePermissionModel : NSObject
+/// 首充权限:1开启 0关闭
+@property (nonatomic,strong)NSString* first_charge_permission;
+/// 天降好礼权限:1开启 0关闭
+@property (nonatomic,strong)NSString* day_drop_permission;
+/// 新人好礼权限:1开启 0关闭
+@property (nonatomic,strong)NSString* n_people_permission;
+@end
+
+@interface QXRechargeTypeModel : NSObject
+/// 1 新人好礼 2天降好礼 3首充好礼
+@property (nonatomic,assign)NSInteger type;
+@property (nonatomic,strong)NSString* icon;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/Model/QXRechargePermissionModel.m b/QXLive/HomePage(声播)/Model/QXRechargePermissionModel.m
new file mode 100644
index 0000000..a1011c0
--- /dev/null
+++ b/QXLive/HomePage(声播)/Model/QXRechargePermissionModel.m
@@ -0,0 +1,18 @@
+//
+// QXRechargePermissionModel.m
+// QXLive
+//
+// Created by 启星 on 2025/10/12.
+//
+
+#import "QXRechargePermissionModel.h"
+
+@implementation QXRechargePermissionModel
+
+@end
+
+@implementation QXRechargeTypeModel
+
+
+
+@end
diff --git a/QXLive/HomePage(声播)/Model/QXRedPacketModel.h b/QXLive/HomePage(声播)/Model/QXRedPacketModel.h
new file mode 100644
index 0000000..33b3044
--- /dev/null
+++ b/QXLive/HomePage(声播)/Model/QXRedPacketModel.h
@@ -0,0 +1,27 @@
+//
+// QXRedPacketModel.h
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXRedPacketModel : NSObject
+@property (nonatomic, copy) NSString *packetId; // 红包唯一ID
+@property (nonatomic, assign) NSInteger type; // 红包类型
+@property (nonatomic, assign) long long end_time; // 倒计时时间(秒)
+@property (nonatomic, assign) CGFloat amount; // 红包金额
+@property (nonatomic, strong) NSDate *createTime; // 创建时间
+@property (nonatomic, assign) BOOL isAvailable; // 是否可领取
+@property (nonatomic, assign) NSInteger position; // 在房间中的位置标识
+
+// 计算剩余时间
+- (long)remainingTime;
+// 检查是否可领取
+- (BOOL)canOpenNow;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/Model/QXRedPacketModel.m b/QXLive/HomePage(声播)/Model/QXRedPacketModel.m
new file mode 100644
index 0000000..4d6680a
--- /dev/null
+++ b/QXLive/HomePage(声播)/Model/QXRedPacketModel.m
@@ -0,0 +1,23 @@
+//
+// QXRedPacketModel.m
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import "QXRedPacketModel.h"
+
+@implementation QXRedPacketModel
+- (long)remainingTime {
+ long needTime = 0;
+ NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
+ // 将秒转换为毫秒
+ long long milliseconds = (long long)(timeInterval);
+ needTime = self.end_time - milliseconds;
+ return needTime;
+}
+
+- (BOOL)canOpenNow {
+ return [self remainingTime] <= 0;
+}
+@end
diff --git a/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h b/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h
index 3a5bd8c..a26218a 100644
--- a/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h
+++ b/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h
@@ -10,6 +10,8 @@
#import "QXBanner.h"
#import "QXRankModel.h"
#import "QXGiftModel.h"
+#import "QXRechargePermissionModel.h"
+#import "QXNiceGiftRechargeModel.h"
NS_ASSUME_NONNULL_BEGIN
@@ -78,7 +80,21 @@ NS_ASSUME_NONNULL_BEGIN
*/
+(void)getFirstRechargePermissionSuccessBlock:(void (^)(BOOL isShow))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
-
+/**
+ 充值权限
+ */
++(void)getRechargePermissionSuccessBlock:(void (^)(QXRechargePermissionModel *model))successBlock
+ failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
+/**
+ 天降好礼
+ */
++(void)getSkyDropGiftListSuccessBlock:(void (^)(QXNiceGiftRechargeModel * model))successBlock
+ failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
+/**
+ 获取新人
+ */
++(void)getNewUserGiftListSuccessBlock:(void (^)(NSArray * list))successBlock
+ failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end
NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/Services/QXHomePageNetwork.m b/QXLive/HomePage(声播)/Services/QXHomePageNetwork.m
index c328f94..27ec4e1 100644
--- a/QXLive/HomePage(声播)/Services/QXHomePageNetwork.m
+++ b/QXLive/HomePage(声播)/Services/QXHomePageNetwork.m
@@ -131,6 +131,38 @@
failBlock(error,msg);
}];
}
++(void)getRechargePermissionSuccessBlock:(void (^)(QXRechargePermissionModel * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
+ [[QXRequset shareInstance] getWithUrl:QXAppRechargePermission parameters:@{} needCache:NO success:^(id responseObject) {
+ if (successBlock) {
+ QXRechargePermissionModel *model = [QXRechargePermissionModel yy_modelWithJSON:responseObject[@"data"]];
+ successBlock(model);
+ }
+ } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
+ failBlock(error,msg);
+ }];
+}
+
++(void)getSkyDropGiftListSuccessBlock:(void (^)(QXNiceGiftRechargeModel * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
+ [[QXRequset shareInstance] getWithUrl:QXAppSkyDropGiftList parameters:@{} needCache:NO success:^(id responseObject) {
+ if (successBlock) {
+ QXNiceGiftRechargeModel *model = [QXNiceGiftRechargeModel yy_modelWithJSON:responseObject[@"data"]];
+ successBlock(model);
+ }
+ } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
+ failBlock(error,msg);
+ }];
+}
+
++(void)getNewUserGiftListSuccessBlock:(void (^)(NSArray * list))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
+ [[QXRequset shareInstance] getWithUrl:QXAppNewUserGiftList parameters:@{} needCache:NO success:^(id responseObject) {
+ if (successBlock) {
+ NSArray *list = [NSArray yy_modelArrayWithClass:[QXNiceGiftRechargeModel class] json:responseObject[@"data"][@"gift_bag"]];
+ successBlock(list);
+ }
+ } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
+ failBlock(error,msg);
+ }];
+}
/// 首充好礼礼物列表
//static NSString * QXAppFirstRechargeGiftList = @"api/Activities/first_charge_gift";
/// 首充好礼弹框权限
diff --git a/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.h b/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.h
index 0b9acd5..63ae94b 100644
--- a/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.h
+++ b/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.h
@@ -8,6 +8,7 @@
#import
#import "QXRoomModel.h"
#import "NoitceAndKey.h"
+#import "QXRedPacketModel.h"
typedef NS_ENUM(NSInteger) {
/// 静音
@@ -35,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected;
+-(void)didSendMessage:(NSString*)message redpacketModel:(QXRedPacketModel*)redpacketModel;
@end
@interface QXRoomBottomView : UIView
@@ -48,6 +50,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign)BOOL isCabinRoom;
-(void)atUserWithName:(NSString*)nickname;
+
+-(void)inputMessageWithName:(NSString*)message redpacketModel:(QXRedPacketModel*)redpacketModel;
/// 是否静音 1 不静音 0 静音
-(void)setPlayAudioStatus:(BOOL)status;
/// 是否闭麦 0 未闭麦 1 已闭麦
diff --git a/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.m b/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.m
index 6329ba7..7559b6a 100644
--- a/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.m
+++ b/QXLive/HomePage(声播)/View/房间/QXRoomBottomView.m
@@ -29,6 +29,8 @@
@property (nonatomic,assign)QXRoomRoleType roleType;
@property (nonatomic,strong)QXDynamicCommentInputView *commentView;
+
+@property (nonatomic,assign)QXRedPacketModel* redpacketModel;
@end
@implementation QXRoomBottomView
@@ -346,6 +348,12 @@
[self.vc.view addSubview:self.commentView];
[self.commentView.textField becomeFirstResponder];
}
+-(void)inputMessageWithName:(NSString *)message redpacketModel:(QXRedPacketModel*)redpacketModel{
+ self.redpacketModel = redpacketModel;
+ self.commentView.textField.text = [NSString stringWithFormat:@"%@",message];
+ [self.vc.view addSubview:self.commentView];
+ [self.commentView.textField becomeFirstResponder];
+}
#pragma mark - 发消息
-(void)didClickSendWithText:(NSString*)text model:(nonnull QXDynamicCommentListModel *)model{
if (self.roomModel.user_info.is_mute.intValue == 1) {
@@ -357,7 +365,13 @@
[[QXRoomMessageManager shared] sendChatMessage:text messageType:(QXRoomMessageTypeText) needInsertMessage:YES];
self.commentView.textField.text = @"";
[self.vc.view endEditing:YES];
-
+ if (self.redpacketModel == nil) {
+ return;
+ }
+ if (self.delegate && [self.delegate respondsToSelector:@selector(didSendMessage:redpacketModel:)]) {
+ [self.delegate didSendMessage:text redpacketModel:self.redpacketModel];
+ }
+ self.redpacketModel = nil;
}
- (void)keyboardWillHide:(NSNotification *)notification {
diff --git a/QXLive/HomePage(声播)/View/房间/QXRoomChatListView.m b/QXLive/HomePage(声播)/View/房间/QXRoomChatListView.m
index 9ff95c5..95632e2 100644
--- a/QXLive/HomePage(声播)/View/房间/QXRoomChatListView.m
+++ b/QXLive/HomePage(声播)/View/房间/QXRoomChatListView.m
@@ -185,15 +185,15 @@ NSInteger maxMessageCount = 20;
if (model.messageType == QXRoomChatMessageTypeGift) {
[self.giftArray addObject:model];
}
- if (self.dataArray.count>maxMessageCount) {
- [self.dataArray removeFirstObject];
- }
- if (self.chatArray.count>maxMessageCount) {
- [self.chatArray removeFirstObject];
- }
- if (self.giftArray.count>maxMessageCount) {
- [self.giftArray removeFirstObject];
- }
+// if (self.dataArray.count>maxMessageCount) {
+// [self.dataArray removeFirstObject];
+// }
+// if (self.chatArray.count>maxMessageCount) {
+// [self.chatArray removeFirstObject];
+// }
+// if (self.giftArray.count>maxMessageCount) {
+// [self.giftArray removeFirstObject];
+// }
[self.tableView reloadData];
if (self.isDragging) {
self.messageCount++;
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagDrawView.h b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagDrawView.h
new file mode 100644
index 0000000..850f63f
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagDrawView.h
@@ -0,0 +1,48 @@
+//
+// QXRedBagDrawView.h
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import
+#import "QXRedPacketModel.h"
+typedef NS_ENUM(NSInteger) {
+ /// 打开红包
+ QXRedBagDrawTypeOpen = 0,
+ /// 倒计时
+ QXRedBagDrawTypeTimeDown,
+ /// 收藏房间
+ QXRedBagDrawTypeCollect,
+ /// 手慢了被领完了
+ QXRedBagDrawTypeFinished,
+ /// 口令红包发送评论
+ QXRedBagDrawTypePwdSend,
+ /// 口令红包倒计时
+ QXRedBagDrawTypePwdTimeDown,
+ /// 口令红包收藏房间
+ QXRedBagDrawTypePwdCollect,
+ /// 需要完成两个任务
+ QXRedBagDrawTypePwdAllTask,
+}QXRedBagDrawType;
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXRedBagDrawView : UIView
+@property (nonatomic,strong)QXRedPacketModel *redpacketModel;
+@property (nonatomic,assign)QXRedBagDrawType type;
+@property (nonatomic,copy)void(^toInputPwdBlock)(NSString *password,QXRedPacketModel*redpacketModel);
+-(void)showInView:(UIView*)view;
+-(void)hide;
+@end
+
+
+@interface QXRedBagTimeDownView : UIView
+@property (nonatomic,strong)UIImageView *bgImageView;
+@property (nonatomic,strong)UILabel *timeLabel;
+@property (nonatomic,strong)UIButton *btn;
+@property (nonatomic,assign)QXRedBagDrawType type;
+@property (nonatomic,assign)int time;
+@property (nonatomic,copy)void(^btnBlcok)(QXRedBagDrawType type);
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagDrawView.m b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagDrawView.m
new file mode 100644
index 0000000..694f991
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagDrawView.m
@@ -0,0 +1,437 @@
+//
+// QXRedBagDrawView.m
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import "QXRedBagDrawView.h"
+#import "QXRedBagRecordViewController.h"
+@class QXRedBagTimeDownView;
+@interface QXRedBagDrawView()
+@property (nonatomic,strong)UIView *bgView;
+@property (nonatomic,strong)UIImageView *bgImageView;
+@property (nonatomic,strong)UIImageView *userHeaderImageView;
+@property (nonatomic,strong)UILabel *userNameLabel;
+@property (nonatomic,strong)UILabel *remarkLabel;
+@property (nonatomic,strong)UIButton *closeBtn;
+
+/// 开红包
+@property (nonatomic,strong)UIButton *openBtn;
+/// 查看大家手气
+@property (nonatomic,strong)UIButton *recordBtn;
+/// 倒计时
+@property (nonatomic,strong)QXRedBagTimeDownView *timeDownView;
+/// 参与条件
+@property (nonatomic,strong)UIView *pwdBgView;
+@property (nonatomic,strong)UILabel *drawTitleLabel;
+@property (nonatomic,strong)UILabel *commentTitleLabel;
+@property (nonatomic,strong)UILabel *pwdTitleLable;
+/// 抢红包必须在本房间内
+@property (nonatomic,strong)UILabel *bottomLabel;
+@end
+@implementation QXRedBagDrawView
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+ [self initSubviews];
+ }
+ return self;
+}
+
+-(void)initSubviews{
+ self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-345)/2, (SCREEN_HEIGHT-454)/2, 345, 454)];
+ [self addSubview:self.bgView];
+
+ self.bgImageView = [[UIImageView alloc] initWithFrame:self.bgView.bounds];
+ self.bgImageView.image = [UIImage imageNamed:@"room_draw_redbag_bg"];
+ [self.bgView addSubview:self.bgImageView];
+
+ self.closeBtn = [[UIButton alloc] init];
+ [self.closeBtn setImage:[UIImage imageNamed:@"room_redbag_close"] forState:(UIControlStateNormal)];
+ [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bgView addSubview:self.closeBtn];
+ [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.height.mas_equalTo(40);
+ make.right.mas_equalTo(-5);
+ make.top.mas_equalTo(15);
+ }];
+
+ self.userHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
+ self.userHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
+ [self.userHeaderImageView addRoundedCornersWithRadius:39.5];
+ [self.bgView addSubview:self.userHeaderImageView];
+ [self.userHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.centerX.equalTo(self.bgView);
+ make.top.mas_equalTo(73);
+ make.width.height.mas_equalTo(79);
+ }];
+
+ self.userNameLabel = [[UILabel alloc] init];
+ self.userNameLabel.text = @"傻狗涛";
+ self.userNameLabel.textColor = RGB16(0xffffff);
+ self.userNameLabel.font = [UIFont boldSystemFontOfSize:18];
+ self.userNameLabel.textAlignment = NSTextAlignmentCenter;
+ [self.bgView addSubview:self.userNameLabel];
+ [self.userNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.height.mas_equalTo(26);
+ make.top.equalTo(self.userHeaderImageView.mas_bottom).offset(27);
+ }];
+
+ self.remarkLabel = [[UILabel alloc] init];
+ self.remarkLabel.textColor = RGB16(0xffffff);
+ self.remarkLabel.text = @"恭喜发财,大吉大利";
+ self.remarkLabel.font = [UIFont boldSystemFontOfSize:24];
+ self.remarkLabel.textAlignment = NSTextAlignmentCenter;
+ [self.bgView addSubview:self.remarkLabel];
+ [self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.height.mas_equalTo(26);
+ make.top.equalTo(self.userNameLabel.mas_bottom).offset(2);
+ }];
+
+ self.openBtn = [[UIButton alloc] init];
+ [self.openBtn setImage:[UIImage imageNamed:@"draw_redbag_btn"] forState:(UIControlStateNormal)];
+ [self.openBtn addTarget:self action:@selector(openAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bgView addSubview:self.openBtn];
+ [self.openBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.remarkLabel.mas_bottom).offset(19);
+ make.width.height.mas_equalTo(126);
+ make.centerX.equalTo(self.bgView);
+ }];
+
+ self.recordBtn = [[UIButton alloc] init];
+ [self.recordBtn setTitle:@"查看大家手气 >" forState:(UIControlStateNormal)];
+ [self.recordBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
+ self.recordBtn.titleLabel.font = [UIFont systemFontOfSize:16];
+ [self.recordBtn addTarget:self action:@selector(recordAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bgView addSubview:self.recordBtn];
+ [self.recordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.centerX.equalTo(self.bgView);
+ make.bottom.mas_equalTo(-63);
+ make.height.mas_equalTo(26);
+ }];
+
+ self.timeDownView = [[QXRedBagTimeDownView alloc] init];
+ self.timeDownView.hidden = YES;
+ @weakify(self)
+ self.timeDownView.btnBlcok = ^(QXRedBagDrawType type) {
+ @strongify(self);
+ if (type == QXRedBagDrawTypePwdCollect) {
+ /// 这里去收藏房间
+ [self setType:(QXRedBagDrawTypeOpen)];
+ return;
+ }
+ if (self.toInputPwdBlock) {
+ self.toInputPwdBlock(@"傻狗涛来了,大家都让一让",self.redpacketModel);
+ }
+ [self hide];
+ };
+ [self.bgView addSubview:self.timeDownView];
+ [self.timeDownView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.mas_equalTo(220);
+ make.height.mas_equalTo(93);
+ make.centerX.equalTo(self.bgView);
+ make.top.equalTo(self.remarkLabel.mas_bottom).offset(30);
+ }];
+
+ self.bottomLabel = [[UILabel alloc] init];
+ self.bottomLabel.text = @"抢红包必须在本房间内";
+ self.bottomLabel.hidden = YES;
+ self.bottomLabel.textColor = RGB16(0xffffff);
+ self.bottomLabel.font = [UIFont systemFontOfSize:14];
+ [self.bgView addSubview:self.bottomLabel];
+ [self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.height.mas_equalTo(26);
+ make.bottom.mas_equalTo(-15);
+ make.centerX.equalTo(self.bgView);
+ }];
+
+ self.pwdBgView = [[UIView alloc] init];
+ [self.bgView addSubview:self.pwdBgView];
+ [self.pwdBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.bottom.equalTo(self.bottomLabel.mas_top);
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.height.mas_equalTo(72);
+ }];
+
+ self.drawTitleLabel = [[UILabel alloc] init];
+ self.drawTitleLabel.text = @"口令红包参与条件";
+ self.drawTitleLabel.textColor = RGB16(0xffffff);
+ self.drawTitleLabel.textAlignment = NSTextAlignmentCenter;
+ self.drawTitleLabel.font = [UIFont systemFontOfSize:12];
+ [self.pwdBgView addSubview:self.drawTitleLabel];
+ [self.drawTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.pwdBgView);
+ make.height.mas_equalTo(20);
+ make.centerX.equalTo(self.bgView);
+ }];
+
+ self.commentTitleLabel = [[UILabel alloc] init];
+ self.commentTitleLabel.text = @"发送评论:这是一个口令";
+ self.commentTitleLabel.textColor = RGB16(0xFFCE47);
+ self.commentTitleLabel.textAlignment = NSTextAlignmentCenter;
+ self.commentTitleLabel.font = [UIFont systemFontOfSize:14];
+ [self.pwdBgView addSubview:self.commentTitleLabel];
+ [self.commentTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.drawTitleLabel.mas_bottom).offset(3);
+ make.height.mas_equalTo(20);
+ make.centerX.equalTo(self.bgView);;
+ }];
+
+ self.pwdTitleLable = [[UILabel alloc] init];
+ self.pwdTitleLable.text = @"收藏房间";
+ self.pwdTitleLable.textColor = RGB16(0xFFCE47);
+ self.pwdTitleLable.textAlignment = NSTextAlignmentCenter;
+ self.pwdTitleLable.font = [UIFont systemFontOfSize:14];
+ [self.pwdBgView addSubview:self.pwdTitleLable];
+ [self.pwdTitleLable mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.commentTitleLabel.mas_bottom).offset(3);
+ make.height.mas_equalTo(20);
+ make.centerX.equalTo(self.bgView);;
+ }];
+}
+/**
+ /// 打开红包
+ QXRedBagDrawTypeOpen = 0,
+ /// 倒计时
+ QXRedBagDrawTypeTimeDown,
+ /// 收藏房间
+ QXRedBagDrawTypeCollect,
+ /// 手慢了被领完了
+ QXRedBagDrawTypeFinished,
+ /// 口令红包发送评论
+ QXRedBagDrawTypePwdSend,
+ /// 口令红包倒计时
+ QXRedBagDrawTypePwdTimeDown,
+ /// 口令红包收藏房间
+ QXRedBagDrawTypePwdCollect,
+ */
+
+-(void)setType:(QXRedBagDrawType)type{
+ _type = type;
+ switch (type) {
+ case QXRedBagDrawTypeOpen:{
+ self.openBtn.hidden = NO;
+ self.remarkLabel.text = @"恭喜发财,大吉大利";
+ self.recordBtn.hidden = YES;
+ self.timeDownView.hidden = YES;
+ self.bottomLabel.hidden = YES;
+ self.pwdBgView.hidden = YES;
+ }
+ break;
+ case QXRedBagDrawTypeFinished:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"手慢了,红包被领完了";
+ self.recordBtn.hidden = NO;
+ self.timeDownView.hidden = YES;
+ self.bottomLabel.hidden = YES;
+ self.pwdBgView.hidden = YES;
+ }
+ break;
+ case QXRedBagDrawTypeCollect:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"恭喜发财,大吉大利";
+ self.recordBtn.hidden = YES;
+ self.timeDownView.type = QXRedBagDrawTypeCollect;
+ self.timeDownView.hidden = NO;
+ self.bottomLabel.hidden = NO;
+ self.pwdBgView.hidden = YES;
+ [self performSelector:@selector(changeType) afterDelay:2];
+ }
+ break;
+ case QXRedBagDrawTypeTimeDown:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"恭喜发财,大吉大利";
+ self.recordBtn.hidden = YES;
+ self.timeDownView.type = QXRedBagDrawTypeTimeDown;
+ self.timeDownView.hidden = NO;
+ self.bottomLabel.hidden = NO;
+ self.pwdBgView.hidden = YES;
+ [self performSelector:@selector(changeType) afterDelay:2];
+ }
+ break;
+ case QXRedBagDrawTypePwdSend:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"恭喜发财,大吉大利";
+ self.recordBtn.hidden = YES;
+ self.timeDownView.type = QXRedBagDrawTypePwdSend;
+ self.timeDownView.hidden = NO;
+ self.pwdBgView.hidden = NO;
+ self.pwdTitleLable.hidden = YES;
+ }
+ break;
+ case QXRedBagDrawTypePwdTimeDown:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"恭喜发财,大吉大利";
+ self.recordBtn.hidden = YES;
+ self.timeDownView.type = QXRedBagDrawTypePwdTimeDown;
+ self.timeDownView.hidden = NO;
+ self.bottomLabel.hidden = NO;
+ self.pwdBgView.hidden = YES;
+ [self performSelector:@selector(changeType) afterDelay:2];
+ }
+ break;
+ case QXRedBagDrawTypePwdCollect:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"手慢了,红包被领完了";
+ self.recordBtn.hidden = NO;
+ }
+ break;
+ case QXRedBagDrawTypePwdAllTask:{
+ self.openBtn.hidden = YES;
+ self.remarkLabel.text = @"手慢了,红包被领完了";
+ self.recordBtn.hidden = NO;
+ }
+ break;
+ default:
+ break;
+ }
+}
+-(void)changeType{
+ [self setType:QXRedBagDrawTypeOpen];
+}
+#pragma mark - action
+-(void)closeAction{
+ [self hide];
+}
+
+-(void)openAction{
+
+ CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
+ //旋转角度
+ rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI];
+ //每次旋转的时间(单位秒)
+ rotationAnimation.duration = 0.5;
+ rotationAnimation.cumulative = YES;
+ rotationAnimation.removedOnCompletion = NO;
+ //重复旋转的次数,如果你想要无数次,那么设置成MAXFLOAT
+ rotationAnimation.repeatCount = MAXFLOAT;
+ [self.openBtn.layer addAnimation:rotationAnimation forKey:@"openRedBagAnimate"];
+
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ [self.openBtn.layer removeAnimationForKey:@"openRedBagAnimate"];
+
+ BOOL isDrawed = NO;
+ if (isDrawed) {
+ QXRedBagRecordViewController *vc = [[QXRedBagRecordViewController alloc] init];
+ vc.redbagId = @"";
+ [self.viewController.navigationController pushViewController:vc animated:YES];
+ [self hide];
+ }else{
+ [self setType:QXRedBagDrawTypeFinished];
+ }
+
+ });
+}
+-(void)recordAction{
+ QXRedBagRecordViewController *vc = [[QXRedBagRecordViewController alloc] init];
+ vc.redbagId = @"";
+ [self.viewController.navigationController pushViewController:vc animated:YES];
+ [self hide];
+}
+
+-(void)showInView:(UIView *)view{
+ self.bgView.y = -SCREEN_HEIGHT;
+ [view addSubview:self];
+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.bgView.y = (SCREEN_HEIGHT-454)/2;
+ } completion:^(BOOL finished) {
+
+ }];
+}
+
+-(void)hide{
+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.bgView.y = SCREEN_HEIGHT;
+ } completion:^(BOOL finished) {
+ [self removeFromSuperview];
+ }];
+}
+@end
+
+
+@implementation QXRedBagTimeDownView
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ [self initSubViews];
+ }
+ return self;
+}
+-(void)setType:(QXRedBagDrawType)type{
+ _type = type;
+ switch (type) {
+ case QXRedBagDrawTypeCollect:{
+ self.timeLabel.text = @"收藏房间抢红包";
+ }
+ break;
+ case QXRedBagDrawTypeTimeDown:
+ case QXRedBagDrawTypePwdTimeDown:{
+ self.timeLabel.text = @"00:00后开启红包";
+ }
+ break;
+ case QXRedBagDrawTypePwdSend:{
+ self.timeLabel.text = @"发送评论抢红包";
+ }
+ break;
+
+ case QXRedBagDrawTypePwdCollect:{
+ self.timeLabel.text = @"收藏房间抢红包";
+ }
+ break;
+ case QXRedBagDrawTypePwdAllTask:{
+ self.timeLabel.text = @"完成任务抢红包";
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+-(void)btnClick{
+ if (self.type == QXRedBagDrawTypePwdSend || self.type == QXRedBagDrawTypePwdCollect) {
+ if (self.btnBlcok) {
+ self.btnBlcok(self.type);
+ }
+ }
+}
+-(void)setTime:(int)time{
+ _time = time;
+
+}
+
+-(void)initSubViews{
+ self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"red_bag_time_down_bg"]];
+ [self addSubview:self.bgImageView];
+ [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.edges.equalTo(self);
+ }];
+
+ self.timeLabel = [[UILabel alloc] init];
+ self.timeLabel.textAlignment = NSTextAlignmentCenter;
+ self.timeLabel.font = [UIFont boldSystemFontOfSize:22];
+ self.timeLabel.textColor = RGB16(0xffffff);
+ [self addSubview:self.timeLabel];
+ [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.right.equalTo(self);
+ make.height.mas_equalTo(26);
+ make.top.mas_equalTo(19);
+ }];
+
+ self.btn = [[UIButton alloc] init];
+ [self.btn addTarget:self action:@selector(btnClick) forControlEvents:(UIControlEventTouchUpInside)];
+ [self addSubview:self.btn];
+ [self.btn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.edges.equalTo(self);
+ }];
+}
+@end
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagListView.h b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagListView.h
new file mode 100644
index 0000000..b999546
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagListView.h
@@ -0,0 +1,23 @@
+//
+// QXRedBagListView.h
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXRedBagListView : UIView
+@property (nonatomic,strong)NSMutableArray *dataArray;
+-(void)showInView:(UIView *)view;
+-(void)hide;
+@property (nonatomic,copy)void(^didSelectedRedBlock)(void);
+@end
+
+@interface QXRedBagListCell : UICollectionViewCell
+@property (nonatomic,strong)UIImageView *redBagImageView;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagListView.m b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagListView.m
new file mode 100644
index 0000000..355231e
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagListView.m
@@ -0,0 +1,164 @@
+//
+// QXRedBagListView.m
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import "QXRedBagListView.h"
+@interface QXRedBagListView()
+@property (nonatomic,strong)UIView *bigBgView;
+@property (nonatomic,strong)UIImageView *bigBgImageView;
+@property (nonatomic,strong)UIView *bgView;
+@property (nonatomic,strong)UIImageView *bgImageView;
+@property (nonatomic,strong)UIImageView *bottomImageView;
+@property (nonatomic,strong)UIButton *closeBtn;
+
+@property (nonatomic,strong)UICollectionView *collectionView;
+@end
+@implementation QXRedBagListView
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+ [self initSubviews];
+ }
+ return self;
+}
+
+-(void)initSubviews{
+ self.bigBgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-375)/2, (SCREEN_HEIGHT-480)/2, 375, 480)];
+ [self addSubview:self.bigBgView];
+
+ self.bigBgImageView = [[UIImageView alloc] initWithFrame:self.bigBgView.bounds];
+ self.bigBgImageView.image = [UIImage imageNamed:@"red_bag_list_big_bg"];
+ [self.bigBgView addSubview:self.bigBgImageView];
+
+ self.bgView = [[UIView alloc] init];
+ [self.bgView addRoundedCornersWithRadius:10];
+ [self.bigBgView addSubview:self.bgView];
+ [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.mas_equalTo(280);
+ make.height.mas_equalTo(252);
+ make.centerX.equalTo(self.bigBgView);
+ make.top.mas_equalTo(60);
+ }];
+
+ self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, 242)];
+ self.bgImageView.image = [UIImage imageNamed:@"red_bag_list_bg"];
+ [self.bgView addSubview:self.bgImageView];
+ [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.right.top.equalTo(self.bgView);
+ make.height.mas_equalTo(242);
+ }];
+ self.bottomImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"red_bag_list_bottom_bg"]];
+ self.bottomImageView.contentMode = UIViewContentModeScaleToFill;
+ [self.bgView addSubview:self.bottomImageView];
+ [self.bottomImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.bottom.right.equalTo(self.bgView);
+ make.top.equalTo(self.bgImageView.mas_bottom).offset(-1);
+ }];
+
+ self.closeBtn = [[UIButton alloc] init];
+ [self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)];
+ [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bigBgView addSubview:self.closeBtn];
+ [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.centerX.equalTo(self);
+ make.top.equalTo(self.bgView.mas_bottom).offset(40);
+ make.height.width.mas_equalTo(30);
+ }];
+
+
+ UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+ layout.itemSize = CGSizeMake(66,66);
+ layout.minimumLineSpacing =20;
+ layout.minimumInteritemSpacing =16;
+ layout.scrollDirection = UICollectionViewScrollDirectionVertical;
+ self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
+ [self.collectionView registerClass:[QXRedBagListCell class] forCellWithReuseIdentifier:@"QXRedBagListCell"];
+ self.collectionView.delegate = self;
+ self.collectionView.dataSource = self;
+ self.collectionView.showsHorizontalScrollIndicator = NO;
+ self.collectionView.showsVerticalScrollIndicator = NO;
+ self.collectionView.bounces = NO;
+ self.collectionView.backgroundColor = [UIColor clearColor];
+ [self.bgView addSubview:self.collectionView];
+ [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(25);
+ make.right.mas_equalTo(-25);
+ make.bottom.mas_equalTo(-30);
+ make.top.mas_equalTo(156);
+ }];
+}
+-(void)setDataArray:(NSMutableArray *)dataArray{
+ _dataArray = dataArray;
+ if (dataArray.count >3) {
+ [self.bgView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.height.mas_equalTo(338);
+ }];
+ }else{
+ [self.bgView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.height.mas_equalTo(252);
+ }];
+ }
+ [self.collectionView reloadData];
+}
+-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
+ return self.dataArray.count;
+}
+-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
+ QXRedBagListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRedBagListCell" forIndexPath:indexPath];
+ return cell;
+}
+-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
+ if (self.didSelectedRedBlock) {
+ self.didSelectedRedBlock();
+ }
+ [self hide];
+}
+-(void)closeAction{
+ [self hide];
+}
+-(void)showInView:(UIView *)view{
+ self.bigBgView.y = -SCREEN_HEIGHT;
+ [view addSubview:self];
+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.bigBgView.y = (SCREEN_HEIGHT-480)/2;
+ } completion:^(BOOL finished) {
+
+ }];
+}
+
+-(void)hide{
+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.bigBgView.y = SCREEN_HEIGHT;
+ } completion:^(BOOL finished) {
+ [self removeFromSuperview];
+ }];
+}
+@end
+
+
+@implementation QXRedBagListCell
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.contentView.backgroundColor = [UIColor clearColor];
+ [self initSubviews];
+ }
+ return self;
+}
+
+-(void)initSubviews{
+ self.redBagImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"red_bag_list_icon"]];
+ [self.contentView addSubview:self.redBagImageView];
+ [self.redBagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.edges.equalTo(self.contentView);
+ }];
+}
+
+@end
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagSendView.h b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagSendView.h
new file mode 100644
index 0000000..42d83de
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagSendView.h
@@ -0,0 +1,17 @@
+//
+// QXRedBagSendView.h
+// QXLive
+//
+// Created by 启星 on 2025/10/10.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXRedBagSendView : UIView
+-(void)showInView:(UIView*)view;
+-(void)hide;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagSendView.m b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagSendView.m
new file mode 100644
index 0000000..c56ff15
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagSendView.m
@@ -0,0 +1,847 @@
+//
+// QXRedBagSendView.m
+// QXLive
+//
+// Created by 启星 on 2025/10/10.
+//
+
+#import "QXRedBagSendView.h"
+#import
+@interface QXRedBagSendView()
+@property (nonatomic,strong)UIView *bgView;
+@property (nonatomic,strong)UIImageView *bgImageView;
+@property (nonatomic,strong)UILabel *titleLabel;
+@property (nonatomic,strong)UIButton *helpBtn;
+@property (nonatomic,strong)UIButton *backBtn;
+@property (nonatomic,strong)UIButton *closeBtn;
+@property (nonatomic,strong)UIButton *nextBtn;
+@property (nonatomic,strong)UIButton *commitBtn;
+
+
+@property (nonatomic,strong)UIView* firstContentView;
+@property (nonatomic,strong)UIButton *normalRedBagBtn;
+@property (nonatomic,strong)UIButton *pwdRedBagBtn;
+@property (nonatomic,strong)UIView *firstTopView;
+@property (nonatomic,strong)UIView *firstPwdView;
+@property (nonatomic,strong)UITextField *pwdTextField;
+@property (nonatomic,strong)UIView *firstTimeView;
+@property (nonatomic,strong)UIView *scrollBgView;
+@property (nonatomic,strong)UIButton *coinRedBagBtn;
+@property (nonatomic,strong)UIButton *diamondRedBagBtn;
+@property (nonatomic,strong)UIButton *selectedRedBagTimeBtn;
+
+/// 红包类型 默认为普通红包 普通红包 1 口令红包 2
+@property (nonatomic,strong)NSString *redBagType;
+/// 红包是否为金币红包 金币红包 1 钻石红包 2
+@property (nonatomic,strong)NSString *redBagContentType;
+/// 红包倒计时
+@property (nonatomic,strong)NSString *redBagTime;
+
+
+
+@property (nonatomic,strong)UIView* nextContentView;
+@property (nonatomic,strong)UILabel *moneyLabel;
+@property (nonatomic,strong)UILabel *moneyUnitLabel;
+@property (nonatomic,strong)UITextField *moneyTextField;
+@property (nonatomic,strong)UITextField *countTextField;
+@property (nonatomic,strong)UITextField *remarkTextField;
+/// 无
+@property (nonatomic,strong)UIButton *noDrawAuthBtn;
+/// 收藏房间
+@property (nonatomic,strong)UIButton *collectDrawAuthBtn;
+/// 仅麦上用户
+@property (nonatomic,strong)UIButton *upSeatDrawAuthBtn;
+
+
+
+@property (nonatomic,strong)UIView* ruleContentView;
+@property (nonatomic,strong)WKWebView* webView;
+
+
+@property (nonatomic,strong)NSArray* timeArray;
+
+@property (nonatomic,strong)NSArray* drawAuthArray;
+
+/// 0 选择红包类型 1 塞红包页面
+@property (nonatomic,assign)NSInteger currentPage;
+
+/// 是否为规则页面返回
+@property (nonatomic,assign)BOOL isFromRule;
+@end
+
+@implementation QXRedBagSendView
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+ [self initSubviews];
+ }
+ return self;
+}
+
+-(void)initSubviews{
+ self.redBagType = @"1";
+ self.redBagContentType = @"1";
+ self.redBagTime = @"0";
+ self.timeArray = @[@0,@1,@2,@5,@10];
+
+ self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-345)/2, (SCREEN_HEIGHT-454)/2, 345, 454)];
+ [self addSubview:self.bgView];
+
+ self.bgImageView = [[UIImageView alloc] initWithFrame:self.bgView.bounds];
+ self.bgImageView.image = [UIImage imageNamed:@"room_send_redbag_bg"];
+ [self.bgView addSubview:self.bgImageView];
+
+ self.titleLabel = [[UILabel alloc] init];
+ self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
+ self.titleLabel.text = @"直播间红包";
+ self.titleLabel.textColor = RGB16(0xffffff);
+ [self.bgView addSubview:self.titleLabel];
+ [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.centerX.equalTo(self.bgView);
+ make.top.mas_equalTo(15);
+ make.height.mas_equalTo(26);
+ }];
+
+ self.helpBtn = [[UIButton alloc] init];
+ [self.helpBtn setImage:[UIImage imageNamed:@"room_redbag_help"] forState:(UIControlStateNormal)];
+ [self.helpBtn addTarget:self action:@selector(helpAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bgView addSubview:self.helpBtn];
+ [self.helpBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.height.mas_equalTo(40);
+ make.centerY.equalTo(self.titleLabel);
+ make.left.mas_equalTo(5);
+ }];
+
+ self.backBtn = [[UIButton alloc] init];
+ [self.backBtn setImage:[UIImage imageNamed:@"room_redbag_back"] forState:(UIControlStateNormal)];
+ [self.backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bgView addSubview:self.backBtn];
+ self.backBtn.hidden = YES;
+ [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.edges.equalTo(self.helpBtn);
+ }];
+
+ self.closeBtn = [[UIButton alloc] init];
+ [self.closeBtn setImage:[UIImage imageNamed:@"room_redbag_close"] forState:(UIControlStateNormal)];
+ [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.bgView addSubview:self.closeBtn];
+ [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.height.mas_equalTo(40);
+ make.centerY.equalTo(self.titleLabel);
+ make.right.mas_equalTo(-5);
+ }];
+
+ self.nextBtn = [[UIButton alloc] init];
+ [self.nextBtn setTitle:@"下一步" forState:(UIControlStateNormal)];
+ self.nextBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18];
+ [self.nextBtn addTarget:self action:@selector(nextAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.nextBtn setTitleColor:RGB16(0xF35248) forState:UIControlStateNormal];
+ [self.nextBtn setBackgroundImage:[UIImage imageNamed:@"red_bag_next_btn_bg"] forState:(UIControlStateNormal)];
+ [self.bgView addSubview:self.nextBtn];
+ [self.nextBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.height.mas_equalTo(44);
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.bottom.mas_equalTo(-15);
+ }];
+
+ self.commitBtn = [[UIButton alloc] init];
+ [self.commitBtn setTitle:@"发红包" forState:(UIControlStateNormal)];
+ self.commitBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18];
+ self.commitBtn.hidden = YES;
+ [self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.commitBtn setBackgroundImage:[UIImage imageNamed:@"red_bag_next_btn_bg"] forState:(UIControlStateNormal)];
+ [self.commitBtn setTitleColor:RGB16(0xF35248) forState:UIControlStateNormal];
+ [self.bgView addSubview:self.commitBtn];
+ [self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.edges.equalTo(self.nextBtn);
+ }];
+
+ [self initFirstContentView];
+
+ [self initNextContentView];
+
+ [self initRuleView];
+}
+
+
+-(void)initFirstContentView{
+ self.firstContentView = [[UIView alloc] init];
+ [self.bgView addSubview:self.firstContentView];
+ [self.firstContentView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.titleLabel.mas_bottom).offset(15);
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.bottom.equalTo(self.nextBtn.mas_top).offset(-15);
+ }];
+
+
+ UIView *topView = [[UIView alloc] init];
+ topView.backgroundColor = RGB16(0xffffff);
+ topView.layer.masksToBounds = YES;
+ topView.layer.cornerRadius = 8;
+ [self.firstContentView addSubview:topView];
+ self.firstTopView = topView;
+ [topView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.left.right.equalTo(self.firstContentView);
+ make.height.mas_equalTo(88);
+ }];
+
+ UILabel *topTitleLabel = [[UILabel alloc] init];
+ topTitleLabel.text = @"参与领取限制";
+ topTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ topTitleLabel.textColor = RGB16(0x666666);
+ [topView addSubview:topTitleLabel];
+ [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.top.mas_equalTo(11);
+ make.height.mas_equalTo(26);
+ }];
+
+ UIButton *normalRedBagBtn = [[UIButton alloc] init];
+ normalRedBagBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
+ [normalRedBagBtn setTitle:@"普通红包" forState:(UIControlStateNormal)];
+ [normalRedBagBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
+ [normalRedBagBtn setBackgroundImage:[UIImage imageNamed:@"red_bag_btn_bg_nor"] forState:(UIControlStateNormal)];
+ [normalRedBagBtn setBackgroundImage:[UIImage imageNamed:@"red_bag_btn_bg_sel"] forState:(UIControlStateSelected)];
+ [normalRedBagBtn addTarget:self action:@selector(selectedRedBagTypeAction:) forControlEvents:(UIControlEventTouchUpInside)];
+ [topView addSubview:normalRedBagBtn];
+ self.normalRedBagBtn = normalRedBagBtn;
+ [normalRedBagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.bottom.mas_equalTo(-5);
+ make.height.mas_equalTo(36);
+ make.width.mas_equalTo(137);
+ }];
+
+ UIButton *pwdRedBagBtn = [[UIButton alloc] init];
+ pwdRedBagBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
+ [pwdRedBagBtn setTitle:@"口令红包" forState:(UIControlStateNormal)];
+ [pwdRedBagBtn addTarget:self action:@selector(selectedRedBagTypeAction:) forControlEvents:(UIControlEventTouchUpInside)];
+ [pwdRedBagBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
+ [pwdRedBagBtn setBackgroundImage:[UIImage imageNamed:@"red_bag_btn_bg_nor"] forState:(UIControlStateNormal)];
+ [pwdRedBagBtn setBackgroundImage:[UIImage imageNamed:@"red_bag_btn_bg_sel"] forState:(UIControlStateSelected)];
+ [topView addSubview:pwdRedBagBtn];
+ self.pwdRedBagBtn = pwdRedBagBtn;
+ [pwdRedBagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.right.mas_equalTo(-15);
+ make.bottom.mas_equalTo(-5);
+ make.height.mas_equalTo(36);
+ make.width.mas_equalTo(137);
+ }];
+
+ UIView *centerView1 = [[UIView alloc] init];
+ centerView1.backgroundColor = RGB16(0xffffff);
+ centerView1.layer.masksToBounds = YES;
+ centerView1.layer.cornerRadius = 8;
+ [self.firstContentView addSubview:centerView1];
+ self.firstPwdView = centerView1;
+ [centerView1 mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(topView.mas_bottom).offset(12);
+ make.left.right.equalTo(self.firstContentView);
+ make.height.mas_equalTo(48);
+ }];
+
+ UILabel *pwdTitleLabel = [[UILabel alloc] init];
+ pwdTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ pwdTitleLabel.text = @"口令";
+ pwdTitleLabel.textColor = RGB16(0x666666);
+ [self.firstPwdView addSubview:pwdTitleLabel];
+ [pwdTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.centerY.equalTo(self.firstPwdView);
+ make.width.mas_equalTo(40);
+ }];
+
+ UITextField *pwdTextField = [[UITextField alloc] init];
+ pwdTextField.font = [UIFont boldSystemFontOfSize:18];
+ pwdTextField.delegate = self;
+ pwdTextField.textColor = RGB16(0x666666);
+ pwdTextField.textAlignment = NSTextAlignmentRight;
+ pwdTextField.returnKeyType = UIReturnKeyDone;
+ pwdTextField.placeholder = @"请输入口令";
+ self.pwdTextField = pwdTextField;
+ [self.firstPwdView addSubview:pwdTextField];
+ [pwdTextField mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.equalTo(pwdTitleLabel.mas_right).offset(15);
+ make.right.mas_equalTo(-15);
+ make.top.bottom.equalTo(self.firstPwdView);
+ }];
+
+
+ UIView *centerView2 = [[UIView alloc] init];
+ centerView2.backgroundColor = RGB16(0xffffff);
+ centerView2.layer.masksToBounds = YES;
+ centerView2.layer.cornerRadius = 8;
+ self.firstTimeView = centerView2;
+ [self.firstContentView addSubview:centerView2];
+ [centerView2 mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(topView.mas_bottom).offset(72);
+ make.left.right.equalTo(self.firstContentView);
+ make.height.mas_equalTo(88);
+ }];
+
+ UILabel *timeTitleLabel = [[UILabel alloc] init];
+ timeTitleLabel.textColor = RGB16(0x666666);
+ timeTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ timeTitleLabel.text = @"开奖倒计时";
+ [self.firstTimeView addSubview:timeTitleLabel];
+ [timeTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.top.mas_equalTo(11);
+ make.height.mas_equalTo(26);
+ }];
+
+ CGFloat btnWidth = 49;
+ CGFloat leftMargin = 15;
+ CGFloat btnSpace = 10;
+ CGFloat btnHeight = 36;
+ for (int i = 0; i < self.timeArray.count ; i++) {
+ UIButton *btn = [[UIButton alloc] init];
+ NSNumber *number = self.timeArray[i];
+ btn.tag = number.intValue+10;
+ NSString *title = @"立刻";
+ if (number.intValue>0) {
+ title = [NSString stringWithFormat:@"%d分钟",number.intValue];
+ }
+ [btn setTitle:title forState:(UIControlStateNormal)];
+ [btn setBackgroundImage:[UIImage imageNamed:@"red_bag_time_btn_bg_nor"] forState:(UIControlStateNormal)];
+ [btn setBackgroundImage:[UIImage imageNamed:@"red_bag_time_btn_bg_sel"] forState:(UIControlStateSelected)];
+ btn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
+ [btn addTarget:self action:@selector(redBagTimeAction:) forControlEvents:(UIControlEventTouchUpInside)];
+ [self.firstTimeView addSubview:btn];
+ // 首次选中立刻
+ if (i == 0) {
+ btn.selected = YES;
+ self.selectedRedBagTimeBtn = btn;
+ }
+ [btn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(leftMargin+(btnWidth+btnSpace)*i);
+ make.width.mas_equalTo(btnWidth);
+ make.height.mas_equalTo(btnHeight);
+ make.bottom.mas_equalTo(-5);
+ }];
+ }
+
+ UIView *bottomView = [[UIView alloc] init];
+ bottomView.backgroundColor = RGB16(0xffffff);
+ bottomView.layer.masksToBounds = YES;
+ bottomView.layer.cornerRadius = 8;
+ [self.firstContentView addSubview:bottomView];
+ [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(centerView2.mas_bottom).offset(12);
+ make.left.right.equalTo(self.firstContentView);
+ make.height.mas_equalTo(48);
+ }];
+
+ UILabel *redBagTypeLabel = [[UILabel alloc] init];
+ redBagTypeLabel.textColor = RGB16(0x666666);
+ redBagTypeLabel.font = [UIFont boldSystemFontOfSize:18];
+ redBagTypeLabel.text = @"红包类型";
+ [bottomView addSubview:redBagTypeLabel];
+ [redBagTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.centerY.equalTo(bottomView);
+ }];
+
+ UIView *redBagTypeView = [[UIView alloc] init];
+ redBagTypeView.backgroundColor = RGB16(0xBA230A);
+ redBagTypeView.layer.masksToBounds = YES;
+ redBagTypeView.layer.cornerRadius = 13;
+ [bottomView addSubview:redBagTypeView];
+ [redBagTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.mas_equalTo(130);
+ make.height.mas_equalTo(26);
+ make.centerY.equalTo(bottomView);
+ make.right.mas_equalTo(-15);
+ }];
+
+ UIView *scrollBgView = [[UIView alloc] init];
+ scrollBgView.backgroundColor = RGB16(0xFDE8A3);
+ scrollBgView.layer.masksToBounds = YES;
+ scrollBgView.layer.cornerRadius = 13;
+ [redBagTypeView addSubview:scrollBgView];
+ self.scrollBgView = scrollBgView;
+ [scrollBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.width.mas_equalTo(66);
+ make.top.bottom.equalTo(redBagTypeView);
+ make.left.equalTo(redBagTypeView);
+ }];
+
+ self.coinRedBagBtn = [[UIButton alloc] init];
+ [self.coinRedBagBtn setTitle:@"金币红包" forState:(UIControlStateNormal)];
+ self.coinRedBagBtn.titleLabel.font = [UIFont systemFontOfSize:14];
+ [self.coinRedBagBtn setTitleColor:RGB16(0xD01717) forState:(UIControlStateSelected)];
+ [self.coinRedBagBtn setTitleColor:RGB16(0xFFC9C7) forState:(UIControlStateNormal)];
+ self.coinRedBagBtn.selected = YES;
+ [self.coinRedBagBtn addTarget:self action:@selector(redBagContentTypeAction:) forControlEvents:(UIControlEventTouchUpInside)];
+ [redBagTypeView addSubview:self.coinRedBagBtn];
+ [self.coinRedBagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.equalTo(redBagTypeView);
+ make.width.mas_equalTo(66);
+ make.top.bottom.equalTo(redBagTypeView);
+ }];
+
+ self.diamondRedBagBtn = [[UIButton alloc] init];
+ [self.diamondRedBagBtn setTitle:@"钻石红包" forState:(UIControlStateNormal)];
+ self.diamondRedBagBtn.titleLabel.font = [UIFont systemFontOfSize:14];
+ [self.diamondRedBagBtn setTitleColor:RGB16(0xD01717) forState:(UIControlStateSelected)];
+ [self.diamondRedBagBtn setTitleColor:RGB16(0xFFC9C7) forState:(UIControlStateNormal)];
+ [self.diamondRedBagBtn addTarget:self action:@selector(redBagContentTypeAction:) forControlEvents:(UIControlEventTouchUpInside)];
+ [redBagTypeView addSubview:self.diamondRedBagBtn];
+ [self.diamondRedBagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.right.equalTo(redBagTypeView);
+ make.width.mas_equalTo(66);
+ make.top.bottom.equalTo(redBagTypeView);
+ }];
+
+ [self selectedRedBagTypeAction:self.normalRedBagBtn];
+}
+
+-(void)initNextContentView{
+ self.drawAuthArray = @[@0,@1,@2];
+ self.nextContentView = [[UIView alloc] init];
+ self.nextContentView.hidden = YES;
+ [self.bgView addSubview:self.nextContentView];
+ [self.nextContentView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.titleLabel.mas_bottom).offset(15);
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.bottom.equalTo(self.nextBtn.mas_top).offset(-15);
+ }];
+
+ self.moneyLabel = [[UILabel alloc] init];
+ self.moneyLabel.font = [UIFont boldSystemFontOfSize:13];
+ self.moneyLabel.textColor = RGB16(0xffffff);
+ self.moneyLabel.text = @"-金币可用";
+ [self.nextContentView addSubview:self.moneyLabel];
+ [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.right.equalTo(self.nextContentView).offset(-8);
+ make.height.mas_equalTo(17);
+ make.top.equalTo(self.nextContentView).offset(0);
+ }];
+
+ UIView *moneyBgView = [[UIView alloc] init];
+ moneyBgView.backgroundColor = RGB16(0xC51A0C);
+ moneyBgView.layer.masksToBounds = YES;
+ moneyBgView.layer.cornerRadius = 8;
+ [self.nextContentView insertSubview:moneyBgView belowSubview:self.moneyLabel];
+ [moneyBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.bottom.right.equalTo(self.moneyLabel).offset(8);
+ make.left.equalTo(self.moneyLabel).offset(-8);
+ make.top.equalTo(self.moneyLabel).offset(-3);
+ }];
+
+ UIView *topBgView = [[UIView alloc] init];
+ topBgView.backgroundColor = RGB16(0xffffff);
+ topBgView.layer.masksToBounds = YES;
+ topBgView.layer.cornerRadius = 8;
+ [self.nextContentView addSubview:topBgView];
+ [topBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(moneyBgView.mas_bottom).offset(-8);
+ make.left.right.equalTo(self.nextContentView);
+ make.height.mas_equalTo(48);
+ }];
+
+ UILabel *moneyTitleLabel = [[UILabel alloc] init];
+ moneyTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ moneyTitleLabel.text = @"金额";
+ moneyTitleLabel.textColor = RGB16(0x666666);
+ moneyTitleLabel.textAlignment = NSTextAlignmentLeft;
+ [topBgView addSubview:moneyTitleLabel];
+ [moneyTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.centerY.equalTo(topBgView);
+ make.width.mas_equalTo(40);
+ }];
+
+ UILabel *moneyUnitLabel = [[UILabel alloc] init];
+ moneyUnitLabel.font = [UIFont systemFontOfSize:13];
+ moneyUnitLabel.textAlignment = NSTextAlignmentRight;
+ moneyUnitLabel.textColor = RGB16(0x666666);
+ self.moneyUnitLabel = moneyUnitLabel;
+ [topBgView addSubview:moneyUnitLabel];
+ [moneyUnitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.right.mas_equalTo(-15);
+ make.centerY.equalTo(topBgView);
+ make.width.mas_equalTo(30);
+ }];
+
+
+ UITextField *pwdTextField = [[UITextField alloc] init];
+ pwdTextField.font = [UIFont boldSystemFontOfSize:18];
+ pwdTextField.delegate = self;
+ pwdTextField.textColor = RGB16(0x666666);
+ pwdTextField.textAlignment = NSTextAlignmentRight;
+ pwdTextField.returnKeyType = UIReturnKeyDone;
+ pwdTextField.placeholder = @"请输入红包金额";
+ self.moneyTextField = pwdTextField;
+ [topBgView addSubview:pwdTextField];
+ [pwdTextField mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.equalTo(moneyTitleLabel.mas_right).offset(15);
+ make.right.equalTo(moneyUnitLabel.mas_left);
+ make.top.bottom.equalTo(topBgView);
+ }];
+
+
+
+ UIView *countBgView = [[UIView alloc] init];
+ countBgView.backgroundColor = RGB16(0xffffff);
+ countBgView.layer.masksToBounds = YES;
+ countBgView.layer.cornerRadius = 8;
+ [self.nextContentView addSubview:countBgView];
+ [countBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(topBgView.mas_bottom).offset(12);
+ make.left.right.equalTo(self.nextContentView);
+ make.height.mas_equalTo(48);
+ }];
+
+ UILabel *countTitleLabel = [[UILabel alloc] init];
+ countTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ countTitleLabel.text = @"个数";
+ countTitleLabel.textColor = RGB16(0x666666);
+ countTitleLabel.textAlignment = NSTextAlignmentLeft;
+ [countBgView addSubview:countTitleLabel];
+ [countTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.centerY.equalTo(countBgView);
+ make.width.mas_equalTo(40);
+ }];
+
+ UILabel *countUnitLabel = [[UILabel alloc] init];
+ countUnitLabel.font = [UIFont systemFontOfSize:13];
+ countUnitLabel.text = @"个";
+ countUnitLabel.textAlignment = NSTextAlignmentRight;
+ countUnitLabel.textColor = RGB16(0x666666);
+ [countBgView addSubview:countUnitLabel];
+ [countUnitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.right.mas_equalTo(-15);
+ make.centerY.equalTo(countBgView);
+ make.width.mas_equalTo(15);
+ }];
+
+
+ UITextField *countTextField = [[UITextField alloc] init];
+ countTextField.font = [UIFont boldSystemFontOfSize:18];
+ countTextField.delegate = self;
+ countTextField.textColor = RGB16(0x666666);
+ countTextField.textAlignment = NSTextAlignmentRight;
+ countTextField.returnKeyType = UIReturnKeyDone;
+ countTextField.placeholder = @"请输入红包数量";
+ self.countTextField = countTextField;
+ [countBgView addSubview:countTextField];
+ [countTextField mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.equalTo(countTitleLabel.mas_right).offset(15);
+ make.right.equalTo(countUnitLabel.mas_left);
+ make.top.bottom.equalTo(countBgView);
+ }];
+
+ UIView *drawAuthBgView = [[UIView alloc] init];
+ drawAuthBgView.backgroundColor = RGB16(0xffffff);
+ drawAuthBgView.layer.masksToBounds = YES;
+ drawAuthBgView.layer.cornerRadius = 8;
+ [self.nextContentView addSubview:drawAuthBgView];
+ [drawAuthBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(countBgView.mas_bottom).offset(12);
+ make.left.right.equalTo(self.nextContentView);
+ make.height.mas_equalTo(88);
+ }];
+
+ UILabel *authTitleLabel = [[UILabel alloc] init];
+ authTitleLabel.textColor = RGB16(0x666666);
+ authTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ authTitleLabel.text = @"条件";
+ [drawAuthBgView addSubview:authTitleLabel];
+ [authTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.top.mas_equalTo(11);
+ make.height.mas_equalTo(26);
+ }];
+
+ CGFloat btnWidth = 88.3;
+ CGFloat leftMargin = 15;
+ CGFloat btnSpace = 10;
+ CGFloat btnHeight = 36;
+ for (int i = 0; i < self.drawAuthArray.count ; i++) {
+ UIButton *btn = [[UIButton alloc] init];
+ NSNumber *number = self.drawAuthArray[i];
+ NSString *title = @"";
+ if (number.intValue == 0) {
+ self.noDrawAuthBtn = btn;
+ title = @"无";
+ }else if(number.intValue == 1){
+ self.collectDrawAuthBtn = btn;
+ title = @"收藏房间";
+ }else if(number.intValue == 2){
+ self.upSeatDrawAuthBtn = btn;
+ title = @"仅麦上用户";
+ }
+ [btn setTitle:title forState:(UIControlStateNormal)];
+ [btn setBackgroundImage:[UIImage imageNamed:@"red_bag_auth_btn_bg_nor"] forState:(UIControlStateNormal)];
+ [btn setBackgroundImage:[UIImage imageNamed:@"red_bag_auth_btn_bg_sel"] forState:(UIControlStateSelected)];
+ btn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
+ [btn addTarget:self action:@selector(drawAuthAction:) forControlEvents:(UIControlEventTouchUpInside)];
+ [drawAuthBgView addSubview:btn];
+ [btn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(leftMargin+(btnWidth+btnSpace)*i);
+ make.width.mas_equalTo(btnWidth);
+ make.height.mas_equalTo(btnHeight);
+ make.bottom.mas_equalTo(-5);
+ }];
+ // 首次选中立刻
+ if (i == 0) {
+ btn.selected = YES;
+ }
+ }
+
+ UIView *remarkBgView = [[UIView alloc] init];
+ remarkBgView.backgroundColor = RGB16(0xffffff);
+ remarkBgView.layer.masksToBounds = YES;
+ remarkBgView.layer.cornerRadius = 8;
+ [self.nextContentView addSubview:remarkBgView];
+ [remarkBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(drawAuthBgView.mas_bottom).offset(12);
+ make.left.right.equalTo(self.nextContentView);
+ make.height.mas_equalTo(48);
+ }];
+
+ UILabel *remarkTitleLabel = [[UILabel alloc] init];
+ remarkTitleLabel.font = [UIFont boldSystemFontOfSize:18];
+ remarkTitleLabel.text = @"备注";
+ remarkTitleLabel.textColor = RGB16(0x666666);
+ [remarkBgView addSubview:remarkTitleLabel];
+ [remarkTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(15);
+ make.centerY.equalTo(remarkBgView);
+ make.width.mas_equalTo(40);
+ }];
+
+ UITextField *remarkTextField = [[UITextField alloc] init];
+ remarkTextField.font = [UIFont boldSystemFontOfSize:18];
+ remarkTextField.delegate = self;
+ remarkTextField.textColor = RGB16(0x666666);
+ remarkTextField.textAlignment = NSTextAlignmentRight;
+ remarkTextField.returnKeyType = UIReturnKeyDone;
+ remarkTextField.placeholder = @"请输入备注";
+ self.remarkTextField = remarkTextField;
+ [remarkBgView addSubview:remarkTextField];
+ [remarkTextField mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.equalTo(remarkTitleLabel.mas_right).offset(15);
+ make.right.mas_equalTo(-15);
+ make.top.bottom.equalTo(remarkBgView);
+ }];
+}
+
+
+-(void)initRuleView{
+ self.ruleContentView = [[UIView alloc] init];
+ self.ruleContentView.hidden = YES;
+ self.ruleContentView.backgroundColor = RGB16(0xffffff);
+ self.ruleContentView.layer.masksToBounds = YES;
+ self.ruleContentView.layer.cornerRadius = 16;
+ [self.bgView addSubview:self.ruleContentView];
+ [self.ruleContentView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.titleLabel.mas_bottom).offset(15);
+ make.left.mas_equalTo(15);
+ make.right.mas_equalTo(-15);
+ make.bottom.equalTo(self.bgView).offset(-15);
+ }];
+
+ self.webView = [[WKWebView alloc] init];
+ [self.ruleContentView addSubview:self.webView];
+ [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.top.mas_equalTo(15);
+ make.right.bottom.mas_equalTo(-15);
+ }];
+}
+#pragma mark - UITextFieldDelegate
+-(void)textFieldDidBeginEditing:(UITextField *)textField{
+ [UIView animateWithDuration:0.3 animations:^{
+ self.bgView.y = 0;
+ }];
+
+}
+-(void)textFieldDidEndEditing:(UITextField *)textField{
+ [UIView animateWithDuration:0.3 animations:^{
+ self.bgView.y = (SCREEN_HEIGHT-454)/2;
+ }];
+}
+-(BOOL)textFieldShouldReturn:(UITextField *)textField{
+ [textField resignFirstResponder];
+ return YES;
+}
+
+-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
+ [self endEditing:YES];
+}
+
+#pragma mark - action
+-(void)nextAction{
+ self.currentPage = 1;
+ if (self.redBagContentType.intValue == 1) {
+ self.moneyUnitLabel.text = @"金币";
+ }else{
+ self.moneyUnitLabel.text = @"钻石";
+ }
+ self.backBtn.hidden = YES;
+ self.helpBtn.hidden = NO;
+
+ self.nextBtn.hidden = YES;
+ self.commitBtn.hidden = NO;
+
+ self.nextContentView.alpha = 0;
+ self.nextContentView.hidden = NO;
+ [UIView animateWithDuration:0.3 animations:^{
+ self.firstContentView.alpha = 0;
+ self.nextContentView.alpha = 1;
+ } completion:^(BOOL finished) {
+ self.firstContentView.hidden = YES;
+ self.firstContentView.alpha = 1;
+ }];
+}
+-(void)commitAction{
+
+}
+
+-(void)helpAction{
+ self.isFromRule = YES;
+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.baidu.com"]];
+ [self.webView loadRequest:request];
+ self.backBtn.hidden = NO;
+ self.helpBtn.hidden = YES;
+
+ self.nextBtn.hidden = YES;
+ self.commitBtn.hidden = YES;
+
+ self.ruleContentView.alpha = 0;
+ self.ruleContentView.hidden = NO;
+
+ UIView *currentView = self.currentPage==1?self.nextContentView:self.firstContentView;
+ [UIView animateWithDuration:0.3 animations:^{
+ currentView.alpha = 0;
+ self.ruleContentView.alpha = 1;
+ } completion:^(BOOL finished) {
+ currentView.hidden = YES;
+ currentView.alpha = 1;
+ }];
+}
+-(void)closeAction{
+ [self hide];
+}
+-(void)backAction{
+ self.backBtn.hidden = YES;
+ self.helpBtn.hidden = NO;
+ UIView *currentView = self.currentPage==1?self.nextContentView:self.firstContentView;
+
+ self.nextBtn.hidden = self.currentPage==0?NO:YES;
+ self.commitBtn.hidden = self.currentPage==1?NO:YES;
+ currentView.alpha = 0;
+ currentView.hidden = NO;
+ [UIView animateWithDuration:0.3 animations:^{
+ self.ruleContentView.alpha = 0;
+ currentView.alpha = 1;
+ } completion:^(BOOL finished) {
+ self.ruleContentView.alpha = 1;
+ self.ruleContentView.hidden = YES;
+ }];
+ self.isFromRule = NO;
+}
+-(void)selectedRedBagTypeAction:(UIButton*)sender{
+ if (sender.selected) {
+ return;
+ }
+ if (sender == self.normalRedBagBtn) {
+ self.pwdRedBagBtn.selected = NO;
+ self.normalRedBagBtn.selected = YES;
+ self.firstPwdView.hidden = YES;
+ [self.firstTimeView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.firstTopView.mas_bottom).offset(12);
+ }];
+ self.redBagType = @"1";
+ }else{
+ self.pwdRedBagBtn.selected = YES;
+ self.normalRedBagBtn.selected = NO;
+ self.firstPwdView.hidden = NO;
+ [self.firstTimeView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.firstTopView.mas_bottom).offset(72);
+ }];
+ self.redBagType = @"2";
+ }
+}
+
+-(void)redBagContentTypeAction:(UIButton*)sender{
+ if (sender.selected) {
+ return;
+ }
+ if (sender == self.coinRedBagBtn) {
+ self.diamondRedBagBtn.selected = NO;
+ [self.scrollBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+ make.width.mas_equalTo(66);
+ make.left.top.bottom.mas_equalTo(0);
+ }];
+ self.coinRedBagBtn.selected = YES;
+ self.redBagContentType = @"1";
+ }else{
+ self.coinRedBagBtn.selected = NO;
+ [self.scrollBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+ make.width.mas_equalTo(66);
+ make.right.top.bottom.mas_equalTo(0);
+ }];
+ self.diamondRedBagBtn.selected = YES;
+ self.redBagContentType = @"2";
+ }
+}
+-(void)drawAuthAction:(UIButton*)sender{
+ if (sender == self.noDrawAuthBtn) {
+ self.noDrawAuthBtn.selected = YES;
+ self.collectDrawAuthBtn.selected = NO;
+ self.upSeatDrawAuthBtn.selected = NO;
+ }else if (sender == self.collectDrawAuthBtn) {
+ self.collectDrawAuthBtn.selected = !self.collectDrawAuthBtn.selected;
+ if (self.upSeatDrawAuthBtn.selected || self.collectDrawAuthBtn.selected) {
+ self.noDrawAuthBtn.selected = NO;
+ }else{
+ self.noDrawAuthBtn.selected = YES;
+ }
+ }else if (sender == self.upSeatDrawAuthBtn) {
+ self.noDrawAuthBtn.selected = NO;
+ self.upSeatDrawAuthBtn.selected = !self.upSeatDrawAuthBtn.selected;
+ if (self.upSeatDrawAuthBtn.selected || self.collectDrawAuthBtn.selected) {
+ self.noDrawAuthBtn.selected = NO;
+ }else{
+ self.noDrawAuthBtn.selected = YES;
+ }
+ }
+}
+-(void)redBagTimeAction:(UIButton*)sender{
+ if (sender.selected == YES) {
+ return;
+ }
+ self.selectedRedBagTimeBtn.selected = NO;
+ sender.selected = YES;
+ self.selectedRedBagTimeBtn = sender;
+ self.redBagTime = [NSString stringWithFormat:@"%ld",(sender.tag-10)*60];
+}
+
+
+-(void)showInView:(UIView *)view{
+ self.bgView.y = -SCREEN_HEIGHT;
+ [view addSubview:self];
+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.bgView.y = (SCREEN_HEIGHT-454)/2;
+ } completion:^(BOOL finished) {
+
+ }];
+}
+
+-(void)hide{
+ [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.bgView.y = SCREEN_HEIGHT;
+ } completion:^(BOOL finished) {
+ [self removeFromSuperview];
+ }];
+}
+@end
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagTagView.h b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagTagView.h
new file mode 100644
index 0000000..427a0b7
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagTagView.h
@@ -0,0 +1,17 @@
+//
+// QXRedBagTagView.h
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXRedBagTagView : UIView
+@property (nonatomic,copy)void(^startBlock)(BOOL isList);
+@property (nonatomic,strong)NSString *count;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/HomePage(声播)/View/房间/红包/QXRedBagTagView.m b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagTagView.m
new file mode 100644
index 0000000..77ba093
--- /dev/null
+++ b/QXLive/HomePage(声播)/View/房间/红包/QXRedBagTagView.m
@@ -0,0 +1,79 @@
+//
+// QXRedBagTagView.m
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import "QXRedBagTagView.h"
+
+@interface QXRedBagTagView()
+@property (nonatomic,strong)UIImageView *imageView;
+@property (nonatomic,strong)UILabel *countLabel;
+@property (nonatomic,strong)UIButton *btn;
+@property (nonatomic,assign)CGFloat redTagHeight;
+@property (nonatomic,assign)CGFloat redTagWidth;
+@end
+@implementation QXRedBagTagView
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ self.redTagHeight = ScaleWidth(80);
+ self.redTagWidth = ScaleWidth(80);
+ self.frame = CGRectMake(0, NavContentHeight+125, self.redTagHeight, self.redTagWidth);
+ [self initSubviews];
+ }
+ return self;
+}
+
+-(void)initSubviews{
+
+
+ self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"redbag_tag_icon"]];
+ self.imageView.frame = CGRectMake(0, 0, self.redTagHeight, self.redTagWidth);
+ [self addSubview:self.imageView];
+
+ self.countLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 20)];
+ self.countLabel.textAlignment = NSTextAlignmentRight;
+ self.countLabel.font = [UIFont boldSystemFontOfSize:14];
+ self.countLabel.textColor = RGB16(0xFFFEB2);
+ [self addSubview:self.countLabel];
+
+ self.btn = [[UIButton alloc] initWithFrame:self.bounds];
+ [self.btn addTarget:self action:@selector(btnClick) forControlEvents:(UIControlEventTouchUpInside)];
+ [self addSubview:self.btn];
+
+ UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
+ [self addGestureRecognizer:panRecognizer];
+}
+-(void)btnClick{
+ BOOL isList = self.count.intValue>0?YES:NO;
+ if (self.startBlock) {
+ self.startBlock(isList);
+ }
+}
+-(void)setCount:(NSString *)count{
+ _count = count;
+ self.countLabel.text = [NSString stringWithFormat:@"x%@",count];
+}
+
+-(void)handlePan:(UIPanGestureRecognizer*)recognizer{
+ if (recognizer.state == UIGestureRecognizerStateEnded) {
+ NSLog(@"拖动结束");
+ }
+ CGPoint translation = [recognizer translationInView:self.viewController.view];
+ CGPoint panCenter = CGPointMake(recognizer.view.center.x + translation.x,
+ recognizer.view.center.y + translation.y);
+ if (panCenter.y < kSafeAreaTop || panCenter.y> SCREEN_HEIGHT-kSafeAreaBottom) {
+ return;
+ }
+
+
+ recognizer.view.center = CGPointMake(self.redTagWidth/2,
+ recognizer.view.center.y + translation.y);
+ [recognizer setTranslation:CGPointZero inView:self.viewController.view];
+}
+
+@end
diff --git a/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.h b/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.h
index 83279ee..ae4ca12 100644
--- a/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.h
+++ b/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.h
@@ -54,6 +54,8 @@ typedef NS_ENUM(NSInteger) {
QXRoomSettingTypeRoomReport = 26,
/// 关闭飘屏
QXRoomSettingTypeDrifPop = 27,
+ /// 发红包
+ QXRoomSettingTypeSendRedBag = 28,
}QXRoomSettingType;
NS_ASSUME_NONNULL_BEGIN
@class QXRoomSettingModel;
diff --git a/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.m b/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.m
index 4f50362..696f73a 100644
--- a/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.m
+++ b/QXLive/HomePage(声播)/View/房间/设置/QXRoomSettingView.m
@@ -74,6 +74,8 @@
@property (nonatomic,strong)QXRoomSettingModel *roomReport;
/// 飘屏开关
@property (nonatomic,strong)QXRoomSettingModel *drifPop;
+/// 发送红包
+@property (nonatomic,strong)QXRoomSettingModel *redBag;
/// 主持列表
@@ -176,7 +178,8 @@
/// 暂时不需要房间补贴
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
- moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+ moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
}else{
@@ -184,7 +187,8 @@
/// 暂时不需要房间补贴
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
- moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+ moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
}
@@ -196,7 +200,8 @@
// 观众 更多操作 不区分麦上麦下
roomTypeArr = @[];
toolsArr = @[];
- moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomEffects,self.drifPop,self.roomReport];
+// moreArr = @[self.redBag,self.roomVoiceSet,self.roomEffects,self.drifPop,self.roomReport];
+ moreArr = @[self.roomVoiceSet,self.roomEffects,self.drifPop,self.roomReport];
self.titles = @[QXText(@"更多操作")];
}
break;
@@ -218,7 +223,8 @@
toolsArr = @[self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
}
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
- moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+ moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
@@ -244,7 +250,8 @@
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
- moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
+ moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
}
break;
@@ -574,6 +581,15 @@
}
return _drifPop;
}
+-(QXRoomSettingModel *)redBag{
+ if (!_redBag) {
+ _redBag = [[QXRoomSettingModel alloc] init];
+ _redBag.icon = @"room_set_room_send_redbag";
+ _redBag.name = QXText(@"发红包");
+ _redBag.type = QXRoomSettingTypeSendRedBag;
+ }
+ return _redBag;
+}
-(QXDirectListView *)directView{
if (!_directView) {
_directView = [[QXDirectListView alloc] init];
diff --git a/QXLive/Config/QXAgoraEngine.h b/QXLive/Manager/QXAgoraEngine.h
similarity index 100%
rename from QXLive/Config/QXAgoraEngine.h
rename to QXLive/Manager/QXAgoraEngine.h
diff --git a/QXLive/Config/QXAgoraEngine.m b/QXLive/Manager/QXAgoraEngine.m
similarity index 100%
rename from QXLive/Config/QXAgoraEngine.m
rename to QXLive/Manager/QXAgoraEngine.m
diff --git a/QXLive/Config/QXAgoraEngineEx.h b/QXLive/Manager/QXAgoraEngineEx.h
similarity index 100%
rename from QXLive/Config/QXAgoraEngineEx.h
rename to QXLive/Manager/QXAgoraEngineEx.h
diff --git a/QXLive/Config/QXAgoraEngineEx.m b/QXLive/Manager/QXAgoraEngineEx.m
similarity index 100%
rename from QXLive/Config/QXAgoraEngineEx.m
rename to QXLive/Manager/QXAgoraEngineEx.m
diff --git a/QXLive/Config/QXFileManager.h b/QXLive/Manager/QXFileManager.h
similarity index 100%
rename from QXLive/Config/QXFileManager.h
rename to QXLive/Manager/QXFileManager.h
diff --git a/QXLive/Config/QXFileManager.m b/QXLive/Manager/QXFileManager.m
similarity index 100%
rename from QXLive/Config/QXFileManager.m
rename to QXLive/Manager/QXFileManager.m
diff --git a/QXLive/Base/QXLocationManager.h b/QXLive/Manager/QXLocationManager.h
similarity index 100%
rename from QXLive/Base/QXLocationManager.h
rename to QXLive/Manager/QXLocationManager.h
diff --git a/QXLive/Base/QXLocationManager.m b/QXLive/Manager/QXLocationManager.m
similarity index 100%
rename from QXLive/Base/QXLocationManager.m
rename to QXLive/Manager/QXLocationManager.m
diff --git a/QXLive/Config/QXManagerMqtt.h b/QXLive/Manager/QXManagerMqtt.h
similarity index 100%
rename from QXLive/Config/QXManagerMqtt.h
rename to QXLive/Manager/QXManagerMqtt.h
diff --git a/QXLive/Config/QXManagerMqtt.m b/QXLive/Manager/QXManagerMqtt.m
similarity index 100%
rename from QXLive/Config/QXManagerMqtt.m
rename to QXLive/Manager/QXManagerMqtt.m
diff --git a/QXLive/Manager/QXRedPacketManager.h b/QXLive/Manager/QXRedPacketManager.h
new file mode 100644
index 0000000..e13e1d0
--- /dev/null
+++ b/QXLive/Manager/QXRedPacketManager.h
@@ -0,0 +1,35 @@
+//
+// QXRedPacketManager.h
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import
+#import "QXRedPacketModel.h"
+
+@class QXRedPacketManager;
+@protocol QXRedPacketManagerDelegate
+- (void)QXRedPacketManager:(QXRedPacketManager *)manager didAddRedPacket:(QXRedPacketModel *)redPacket;
+- (void)QXRedPacketManager:(QXRedPacketManager *)manager didRemoveRedPacket:(NSString *)packetId;
+- (void)QXRedPacketManager:(QXRedPacketManager *)manager didUpdateRedPacket:(QXRedPacketModel *)redPacket;
+@end
+
+@interface QXRedPacketManager : NSObject
+
+@property (nonatomic, weak) id delegate;
+
++ (instancetype)sharedManager;
+
+// 添加红包
+- (void)addRedPacket:(QXRedPacketModel *)redPacket;
+// 移除红包
+- (void)removeRedPacket:(NSString *)packetId;
+// 获取所有红包
+- (NSArray *)allRedPackets;
+// 根据位置获取红包
+- (QXRedPacketModel *)redPacketAtPosition:(NSInteger)position;
+// 检查并更新红包状态
+- (void)checkAndUpdateRedPackets;
+
+@end
diff --git a/QXLive/Manager/QXRedPacketManager.m b/QXLive/Manager/QXRedPacketManager.m
new file mode 100644
index 0000000..9abcb24
--- /dev/null
+++ b/QXLive/Manager/QXRedPacketManager.m
@@ -0,0 +1,101 @@
+//
+// QXRedPacketManager.m
+// QXLive
+//
+// Created by 启星 on 2025/10/11.
+//
+
+#import "QXRedPacketManager.h"
+
+@interface QXRedPacketManager ()
+@property (nonatomic, strong) NSMutableDictionary *redPackets;
+@property (nonatomic, strong) NSTimer *checkTimer;
+@end
+
+@implementation QXRedPacketManager
+
++ (instancetype)sharedManager {
+ static QXRedPacketManager *instance = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ instance = [[QXRedPacketManager alloc] init];
+ });
+ return instance;
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (self) {
+ _redPackets = [NSMutableDictionary dictionary];
+ [self startCheckTimer];
+ }
+ return self;
+}
+
+- (void)addRedPacket:(QXRedPacketModel *)redPacket {
+ if (!redPacket.packetId) return;
+
+ self.redPackets[redPacket.packetId] = redPacket;
+
+ if ([self.delegate respondsToSelector:@selector(QXRedPacketManager:didAddRedPacket:)]) {
+ [self.delegate respondsToSelector:@selector(QXRedPacketManager:didAddRedPacket:)];
+ }
+}
+
+- (void)removeRedPacket:(NSString *)packetId {
+ [self.redPackets removeObjectForKey:packetId];
+
+ if ([self.delegate respondsToSelector:@selector(QXRedPacketManager:didRemoveRedPacket:)]) {
+ [self.delegate QXRedPacketManager:self didRemoveRedPacket:packetId];
+ }
+}
+
+- (NSArray *)allRedPackets {
+ return [self.redPackets allValues];
+}
+
+- (QXRedPacketModel *)redPacketAtPosition:(NSInteger)position {
+ for (QXRedPacketModel *packet in self.redPackets.allValues) {
+ if (packet.position == position) {
+ return packet;
+ }
+ }
+ return nil;
+}
+
+- (void)startCheckTimer {
+ self.checkTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
+ target:self
+ selector:@selector(checkAndUpdateRedPackets)
+ userInfo:nil
+ repeats:YES];
+}
+
+- (void)checkAndUpdateRedPackets {
+ NSArray *packets = [self.allRedPackets copy];
+
+ for (QXRedPacketModel *packet in packets) {
+ BOOL wasAvailable = packet.isAvailable;
+ packet.isAvailable = [packet canOpenNow];
+
+ // 状态发生变化时通知
+ if (wasAvailable != packet.isAvailable) {
+ if ([self.delegate respondsToSelector:@selector(QXRedPacketManager:didUpdateRedPacket:)]) {
+ [self.delegate QXRedPacketManager:self didUpdateRedPacket:packet];
+ }
+ }
+
+ // 倒计时结束的红包可以设置自动移除
+// if (packet.type == RedPacketTypeCountdown && [packet remainingTime] <= -10) {
+// // 倒计时结束10秒后自动移除
+// [self removeRedPacket:packet.packetId];
+// }
+ }
+}
+
+- (void)dealloc {
+ [self.checkTimer invalidate];
+ self.checkTimer = nil;
+}
+
+@end
diff --git a/QXLive/Config/QXRoomMessageManager.h b/QXLive/Manager/QXRoomMessageManager.h
similarity index 100%
rename from QXLive/Config/QXRoomMessageManager.h
rename to QXLive/Manager/QXRoomMessageManager.h
diff --git a/QXLive/Config/QXRoomMessageManager.m b/QXLive/Manager/QXRoomMessageManager.m
similarity index 100%
rename from QXLive/Config/QXRoomMessageManager.m
rename to QXLive/Manager/QXRoomMessageManager.m
diff --git a/QXLive/Mine(音域)/Model/QXGiftModel.h b/QXLive/Mine(音域)/Model/QXGiftModel.h
index fa375e4..c7c5a77 100644
--- a/QXLive/Mine(音域)/Model/QXGiftModel.h
+++ b/QXLive/Mine(音域)/Model/QXGiftModel.h
@@ -54,18 +54,4 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *time;
@end
-@interface QXFirstRechargeModel : NSObject
-/// 9|30元
-@property (nonatomic,strong)NSString *name;
-/// 9元限时抢
-@property (nonatomic,strong)NSString *title1;
-/// 88元礼包
-@property (nonatomic,strong)NSString *title2;
-/// 充值金额
-@property (nonatomic,strong)NSString *money;
-/// 时间
-@property (nonatomic,strong)NSString *time;
-/// 礼物列表
-@property (nonatomic,strong)NSArray *gift_list;
-@end
NS_ASSUME_NONNULL_END
diff --git a/QXLive/Mine(音域)/Model/QXGiftModel.m b/QXLive/Mine(音域)/Model/QXGiftModel.m
index 1f2b682..9e9f948 100644
--- a/QXLive/Mine(音域)/Model/QXGiftModel.m
+++ b/QXLive/Mine(音域)/Model/QXGiftModel.m
@@ -23,13 +23,3 @@
@end
-
-@implementation QXFirstRechargeModel
-+(NSDictionary *)modelContainerPropertyGenericClass{
- return @{
- @"gift_list" : @"QXGiftModel"
- };
-}
-
-
-@end
diff --git a/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/first_recharge_icon@2x.png b/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/first_recharge_icon@2x.png
deleted file mode 100644
index 6d9a8f8..0000000
Binary files a/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/first_recharge_icon@2x.png and /dev/null differ
diff --git a/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/first_recharge_icon@3x.png b/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/first_recharge_icon@3x.png
deleted file mode 100644
index 3146a50..0000000
Binary files a/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/first_recharge_icon@3x.png and /dev/null differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/Contents.json
new file mode 100644
index 0000000..73c0059
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/draw_redbag_btn.imageset/Contents.json
similarity index 75%
rename from QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/Contents.json
rename to QXLive/Other/Assets.xcassets/home/room/a_redbag/draw_redbag_btn.imageset/Contents.json
index fe8c64e..7549cd9 100644
--- a/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/Contents.json
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/draw_redbag_btn.imageset/Contents.json
@@ -5,12 +5,11 @@
"scale" : "1x"
},
{
- "filename" : "sky_down_gift@2x.png",
+ "filename" : "draw_redbag_btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "sky_down_gift@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/draw_redbag_btn.imageset/draw_redbag_btn@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/draw_redbag_btn.imageset/draw_redbag_btn@2x.png
new file mode 100644
index 0000000..f4087b9
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/draw_redbag_btn.imageset/draw_redbag_btn@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/Contents.json
new file mode 100644
index 0000000..a532ea1
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_auth_btn_bg_nor@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "red_bag_auth_btn_bg_nor@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/red_bag_auth_btn_bg_nor@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/red_bag_auth_btn_bg_nor@2x.png
new file mode 100644
index 0000000..b52f0a2
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/red_bag_auth_btn_bg_nor@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/red_bag_auth_btn_bg_nor@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/red_bag_auth_btn_bg_nor@3x.png
new file mode 100644
index 0000000..b3dc2e6
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_nor.imageset/red_bag_auth_btn_bg_nor@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/Contents.json
new file mode 100644
index 0000000..03063ce
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_auth_btn_bg_sel@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "red_bag_auth_btn_bg_sel@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/red_bag_auth_btn_bg_sel@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/red_bag_auth_btn_bg_sel@2x.png
new file mode 100644
index 0000000..6f0f7ee
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/red_bag_auth_btn_bg_sel@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/red_bag_auth_btn_bg_sel@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/red_bag_auth_btn_bg_sel@3x.png
new file mode 100644
index 0000000..70c275e
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_auth_btn_bg_sel.imageset/red_bag_auth_btn_bg_sel@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/Contents.json
similarity index 73%
rename from QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/Contents.json
rename to QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/Contents.json
index 73e550b..4bc0135 100644
--- a/QXLive/Other/Assets.xcassets/home/first_recharge_icon.imageset/Contents.json
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/Contents.json
@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
- "filename" : "first_recharge_icon@2x.png",
+ "filename" : "red_bag_btn_bg_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "first_recharge_icon@3x.png",
+ "filename" : "red_bag_btn_bg_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/red_bag_btn_bg_nor@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/red_bag_btn_bg_nor@2x.png
new file mode 100644
index 0000000..39a1a0b
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/red_bag_btn_bg_nor@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/red_bag_btn_bg_nor@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/red_bag_btn_bg_nor@3x.png
new file mode 100644
index 0000000..c861186
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_nor.imageset/red_bag_btn_bg_nor@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/Contents.json
new file mode 100644
index 0000000..6380f85
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_btn_bg_sel@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "red_bag_btn_bg_sel@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/red_bag_btn_bg_sel@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/red_bag_btn_bg_sel@2x.png
new file mode 100644
index 0000000..f800718
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/red_bag_btn_bg_sel@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/red_bag_btn_bg_sel@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/red_bag_btn_bg_sel@3x.png
new file mode 100644
index 0000000..9aa71a0
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_btn_bg_sel.imageset/red_bag_btn_bg_sel@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bg.imageset/Contents.json
new file mode 100644
index 0000000..37be68f
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_list_bg@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bg.imageset/red_bag_list_bg@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bg.imageset/red_bag_list_bg@2x.png
new file mode 100644
index 0000000..6e07ce4
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bg.imageset/red_bag_list_bg@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_big_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_big_bg.imageset/Contents.json
new file mode 100644
index 0000000..2bea33b
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_big_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_list_big_bg@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_big_bg.imageset/red_bag_list_big_bg@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_big_bg.imageset/red_bag_list_big_bg@2x.png
new file mode 100644
index 0000000..2ea143e
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_big_bg.imageset/red_bag_list_big_bg@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bottom_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bottom_bg.imageset/Contents.json
new file mode 100644
index 0000000..6c9a624
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bottom_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_list_bottom_bg@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bottom_bg.imageset/red_bag_list_bottom_bg@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bottom_bg.imageset/red_bag_list_bottom_bg@2x.png
new file mode 100644
index 0000000..f7b81e5
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_bottom_bg.imageset/red_bag_list_bottom_bg@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/Contents.json
new file mode 100644
index 0000000..9553bd4
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_list_icon@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "red_bag_list_icon@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/red_bag_list_icon@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/red_bag_list_icon@2x.png
new file mode 100644
index 0000000..0e8e027
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/red_bag_list_icon@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/red_bag_list_icon@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/red_bag_list_icon@3x.png
new file mode 100644
index 0000000..2b81c44
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_list_icon.imageset/red_bag_list_icon@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_next_btn_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_next_btn_bg.imageset/Contents.json
new file mode 100644
index 0000000..2865b2c
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_next_btn_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_next_btn_bg@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_next_btn_bg.imageset/red_bag_next_btn_bg@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_next_btn_bg.imageset/red_bag_next_btn_bg@2x.png
new file mode 100644
index 0000000..d13ebdd
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_next_btn_bg.imageset/red_bag_next_btn_bg@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/a_pop_first_recharge.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_record_top_bg.imageset/Contents.json
similarity index 86%
rename from QXLive/Other/Assets.xcassets/弹窗/a_pop_first_recharge.imageset/Contents.json
rename to QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_record_top_bg.imageset/Contents.json
index 7c55b7b..2a24199 100644
--- a/QXLive/Other/Assets.xcassets/弹窗/a_pop_first_recharge.imageset/Contents.json
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_record_top_bg.imageset/Contents.json
@@ -5,7 +5,7 @@
"scale" : "1x"
},
{
- "filename" : "Group 7229@2x.png",
+ "filename" : "蒙版组 99@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_record_top_bg.imageset/蒙版组 99@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_record_top_bg.imageset/蒙版组 99@2x.png
new file mode 100644
index 0000000..ad6104b
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_record_top_bg.imageset/蒙版组 99@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/Contents.json
new file mode 100644
index 0000000..326b72d
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_time_btn_bg_nor@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "red_bag_time_btn_bg_nor@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/red_bag_time_btn_bg_nor@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/red_bag_time_btn_bg_nor@2x.png
new file mode 100644
index 0000000..b71a085
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/red_bag_time_btn_bg_nor@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/red_bag_time_btn_bg_nor@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/red_bag_time_btn_bg_nor@3x.png
new file mode 100644
index 0000000..69d6294
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_nor.imageset/red_bag_time_btn_bg_nor@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/Contents.json
new file mode 100644
index 0000000..f36a0fc
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_time_btn_bg_sel@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "red_bag_time_btn_bg_sel@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/red_bag_time_btn_bg_sel@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/red_bag_time_btn_bg_sel@2x.png
new file mode 100644
index 0000000..f8450a9
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/red_bag_time_btn_bg_sel@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/red_bag_time_btn_bg_sel@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/red_bag_time_btn_bg_sel@3x.png
new file mode 100644
index 0000000..b8df925
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_btn_bg_sel.imageset/red_bag_time_btn_bg_sel@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_down_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_down_bg.imageset/Contents.json
new file mode 100644
index 0000000..dec2fd8
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_down_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "red_bag_time_down_bg@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_down_bg.imageset/red_bag_time_down_bg@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_down_bg.imageset/red_bag_time_down_bg@2x.png
new file mode 100644
index 0000000..88329d4
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/red_bag_time_down_bg.imageset/red_bag_time_down_bg@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/redbag_tag_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/redbag_tag_icon.imageset/Contents.json
new file mode 100644
index 0000000..2862936
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/redbag_tag_icon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "redbag_tag_icon@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/redbag_tag_icon.imageset/redbag_tag_icon@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/redbag_tag_icon.imageset/redbag_tag_icon@2x.png
new file mode 100644
index 0000000..014cd64
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/redbag_tag_icon.imageset/redbag_tag_icon@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_draw_redbag_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_draw_redbag_bg.imageset/Contents.json
new file mode 100644
index 0000000..302c984
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_draw_redbag_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "room_draw_redbag_bg@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_draw_redbag_bg.imageset/room_draw_redbag_bg@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_draw_redbag_bg.imageset/room_draw_redbag_bg@2x.png
new file mode 100644
index 0000000..29c29fb
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_draw_redbag_bg.imageset/room_draw_redbag_bg@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/Contents.json
new file mode 100644
index 0000000..11fc4ca
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "room_redbag_back@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "room_redbag_back@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/room_redbag_back@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/room_redbag_back@2x.png
new file mode 100644
index 0000000..1858d27
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/room_redbag_back@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/room_redbag_back@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/room_redbag_back@3x.png
new file mode 100644
index 0000000..72adda7
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_back.imageset/room_redbag_back@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/Contents.json
new file mode 100644
index 0000000..403dfe8
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "room_redbag_close@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "room_redbag_close@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/room_redbag_close@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/room_redbag_close@2x.png
new file mode 100644
index 0000000..c98e0ac
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/room_redbag_close@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/room_redbag_close@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/room_redbag_close@3x.png
new file mode 100644
index 0000000..21f1d38
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_close.imageset/room_redbag_close@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/Contents.json
new file mode 100644
index 0000000..b25b0d6
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "room_redbag_help@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "room_redbag_help@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/room_redbag_help@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/room_redbag_help@2x.png
new file mode 100644
index 0000000..9ffb157
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/room_redbag_help@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/room_redbag_help@3x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/room_redbag_help@3x.png
new file mode 100644
index 0000000..a3ed2e5
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_redbag_help.imageset/room_redbag_help@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_send_redbag_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_send_redbag_bg.imageset/Contents.json
new file mode 100644
index 0000000..c75ef75
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_send_redbag_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "蒙版组 98@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_send_redbag_bg.imageset/蒙版组 98@2x.png b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_send_redbag_bg.imageset/蒙版组 98@2x.png
new file mode 100644
index 0000000..41e4cf9
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/a_redbag/room_send_redbag_bg.imageset/蒙版组 98@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/Contents.json b/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/Contents.json
new file mode 100644
index 0000000..6b64fcc
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "room_set_room_send_redbag@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "room_set_room_send_redbag@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/room_set_room_send_redbag@2x.png b/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/room_set_room_send_redbag@2x.png
new file mode 100644
index 0000000..5fa9a41
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/room_set_room_send_redbag@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/room_set_room_send_redbag@3x.png b/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/room_set_room_send_redbag@3x.png
new file mode 100644
index 0000000..b1479fd
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/home/room/room_set_room_send_redbag.imageset/room_set_room_send_redbag@3x.png differ
diff --git a/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/sky_down_gift@2x.png b/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/sky_down_gift@2x.png
deleted file mode 100644
index a1539bf..0000000
Binary files a/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/sky_down_gift@2x.png and /dev/null differ
diff --git a/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/sky_down_gift@3x.png b/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/sky_down_gift@3x.png
deleted file mode 100644
index 1089a00..0000000
Binary files a/QXLive/Other/Assets.xcassets/home/sky_down_gift_icon.imageset/sky_down_gift@3x.png and /dev/null differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/a_first_recharge_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/弹窗/a_first_recharge_bg.imageset/Contents.json
new file mode 100644
index 0000000..d68ba33
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/弹窗/a_first_recharge_bg.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "天降好礼@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/弹窗/a_first_recharge_bg.imageset/天降好礼@2x.png b/QXLive/Other/Assets.xcassets/弹窗/a_first_recharge_bg.imageset/天降好礼@2x.png
new file mode 100644
index 0000000..394755b
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/a_first_recharge_bg.imageset/天降好礼@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/a_pop_first_recharge.imageset/Group 7229@2x.png b/QXLive/Other/Assets.xcassets/弹窗/a_pop_first_recharge.imageset/Group 7229@2x.png
deleted file mode 100644
index a1a4118..0000000
Binary files a/QXLive/Other/Assets.xcassets/弹窗/a_pop_first_recharge.imageset/Group 7229@2x.png and /dev/null differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/a_pop_new_user_recharge.imageset/Contents.json b/QXLive/Other/Assets.xcassets/弹窗/a_pop_new_user_recharge.imageset/Contents.json
new file mode 100644
index 0000000..e4199f8
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/弹窗/a_pop_new_user_recharge.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "新人好礼@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/弹窗/a_pop_new_user_recharge.imageset/新人好礼@2x.png b/QXLive/Other/Assets.xcassets/弹窗/a_pop_new_user_recharge.imageset/新人好礼@2x.png
new file mode 100644
index 0000000..110cafd
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/a_pop_new_user_recharge.imageset/新人好礼@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/first_recharge_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/弹窗/first_recharge_icon.imageset/Contents.json
new file mode 100644
index 0000000..5ccf9d7
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/弹窗/first_recharge_icon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "Frame 1321316462@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/弹窗/first_recharge_icon.imageset/Frame 1321316462@2x.png b/QXLive/Other/Assets.xcassets/弹窗/first_recharge_icon.imageset/Frame 1321316462@2x.png
new file mode 100644
index 0000000..1332de2
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/first_recharge_icon.imageset/Frame 1321316462@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/new_people_recharge_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/弹窗/new_people_recharge_icon.imageset/Contents.json
new file mode 100644
index 0000000..4e825ab
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/弹窗/new_people_recharge_icon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "Frame 1321316460@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/弹窗/new_people_recharge_icon.imageset/Frame 1321316460@2x.png b/QXLive/Other/Assets.xcassets/弹窗/new_people_recharge_icon.imageset/Frame 1321316460@2x.png
new file mode 100644
index 0000000..9dcf9dd
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/new_people_recharge_icon.imageset/Frame 1321316460@2x.png differ
diff --git a/QXLive/Other/Assets.xcassets/弹窗/sky_drop_gift_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/弹窗/sky_drop_gift_icon.imageset/Contents.json
new file mode 100644
index 0000000..fa70fb0
--- /dev/null
+++ b/QXLive/Other/Assets.xcassets/弹窗/sky_drop_gift_icon.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "Frame 1321316461@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/QXLive/Other/Assets.xcassets/弹窗/sky_drop_gift_icon.imageset/Frame 1321316461@2x.png b/QXLive/Other/Assets.xcassets/弹窗/sky_drop_gift_icon.imageset/Frame 1321316461@2x.png
new file mode 100644
index 0000000..e66b341
Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/sky_drop_gift_icon.imageset/Frame 1321316461@2x.png differ
diff --git a/QXLive/Other/QXApi.h b/QXLive/Other/QXApi.h
index fd5574d..e80b3fc 100644
--- a/QXLive/Other/QXApi.h
+++ b/QXLive/Other/QXApi.h
@@ -420,7 +420,12 @@ static NSString * QXRoomUserGiveCoin = @"api/User/give_coin";
static NSString * QXAppFirstRechargeGiftList = @"api/Activities/first_charge_gift";
/// 首充好礼弹框权限
static NSString * QXAppFirstRechargePermission = @"api/Activities/first_charge_gift_permission";
-
+/// 各种充值活动是否展示 包含首充、天降好礼、新人好礼
+static NSString * QXAppRechargePermission = @"api/Activities/activities_permission";
+/// 天降好礼列表
+static NSString * QXAppSkyDropGiftList = @"api/Activities/day_drop_gift";
+/// 新人好礼列表
+static NSString * QXAppNewUserGiftList = @"api/Activities/new_charge_gift";
#pragma mark - 交友房
/// 交友房开始
diff --git a/QXLive/Tabbar/QXTabbarController.m b/QXLive/Tabbar/QXTabbarController.m
index 63058d4..220c3ac 100644
--- a/QXLive/Tabbar/QXTabbarController.m
+++ b/QXLive/Tabbar/QXTabbarController.m
@@ -22,8 +22,7 @@
//弹窗
#import "QXChirldPopView.h" // 青少年
-#import "QXNiceGiftPopView.h" // 天降好礼
-#import "QXFirstRechargePopView.h" // 首充
+//#import "QXFirstRechargePopView.h" // 首充
#import "QXInvitePopView.h" // 邀请
#import "QXGiftDriftView.h" // 礼物飘屏
#import
@@ -143,30 +142,7 @@
//
// }];
}
--(void)popNiceGiftView{
- MJWeakSelf
- QXNiceGiftPopView *view = [[QXNiceGiftPopView alloc] init];
- view.closeActionBlock = ^{
- [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
- QXLOG(@"页面关闭");
- [weakSelf popFirstRechargeView];
- }];
- };
- view.getActionBlock = ^{
- [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
- QXLOG(@"页面关闭");
- }];
- };
- view.ruleActionBlock = ^{
- [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
- QXLOG(@"页面关闭");
- }];
- };
- view.giftArray = @[@"",@"",@"",@"",@"",@""];
- [[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
-
- }];
-}
+
-(void)popInvitePopView{
QXInvitePopView *view = [[QXInvitePopView alloc] init];
diff --git a/QXLive/Tabbar/弹窗/QXFirstRechargeView.h b/QXLive/Tabbar/弹窗/QXFirstRechargeView.h
new file mode 100644
index 0000000..b9ef2c0
--- /dev/null
+++ b/QXLive/Tabbar/弹窗/QXFirstRechargeView.h
@@ -0,0 +1,18 @@
+//
+// QXFirstRechargeView.h
+// QXLive
+//
+// Created by 启星 on 2025/10/12.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QXFirstRechargeView : UIView
+@property (nonatomic,copy)void(^closeActionBlock)(void);
+@property (nonatomic,copy)void(^getActionBlock)(void);
+@property (nonatomic,copy)void(^refreshBlcock)(void);
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/QXLive/Tabbar/弹窗/QXFirstRechargeView.m b/QXLive/Tabbar/弹窗/QXFirstRechargeView.m
new file mode 100644
index 0000000..76052f6
--- /dev/null
+++ b/QXLive/Tabbar/弹窗/QXFirstRechargeView.m
@@ -0,0 +1,161 @@
+//
+// QXFirstRechargeView.m
+// QXLive
+//
+// Created by 启星 on 2025/10/12.
+//
+
+#import "QXFirstRechargeView.h"
+#import "QXHomePageNetwork.h"
+#import "QXGiftCell.h"
+
+@interface QXFirstRechargeView()
+@property (nonatomic,strong)UIImageView *lightBgImageView;
+@property (nonatomic,strong)UIImageView *bgImageView;
+@property (nonatomic,strong)UILabel *timeDownLabel;
+@property (nonatomic,strong)UIView *giftBgView;
+//@property (nonatomic,strong)UIButton *ruleBtn;
+@property (nonatomic,strong)UICollectionView *collectionView;
+@property (nonatomic,strong)UILabel *messageLabel;
+@property (nonatomic,strong)UIButton *getBtn;
+@property (nonatomic,strong)UIButton *closeBtn;
+@property (nonatomic,strong)QXFirstRechargeModel *model;
+@end
+@implementation QXFirstRechargeView
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ self.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(582));
+ [self initSubViews];
+ }
+ return self;
+}
+-(void)initSubViews{
+ self.lightBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_bg"]];
+ [self addSubview:self.lightBgImageView];
+ [self.lightBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.right.top.bottom.equalTo(self);
+ }];
+
+ self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_first_recharge_bg"]];
+ [self addSubview:self.bgImageView];
+ [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.centerX.centerY.equalTo(self);
+ make.size.mas_equalTo(CGSizeMake(ScaleWidth(287), ScaleWidth(338)));
+ }];
+
+
+ self.giftBgView = [[UIView alloc] init];
+// self.giftBgView.backgroundColor = [UIColor whiteColor];
+ [self.giftBgView addRoundedCornersWithRadius:13];
+ [self addSubview:self.giftBgView];
+ [self.giftBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.top.equalTo(self.bgImageView).offset(ScaleWidth(135));
+ make.left.equalTo(self.bgImageView).offset(ScaleWidth(18));
+ make.right.equalTo(self.bgImageView).offset(-ScaleWidth(22));
+ make.bottom.equalTo(self.bgImageView).offset(-ScaleWidth(51));
+ }];
+
+ UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+ layout.itemSize = CGSizeMake((ScaleWidth(287-18-22-12*2-3*8))/4, ScaleWidth(76));
+ layout.minimumLineSpacing = 8;
+ layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
+ self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
+ [self.collectionView registerNib:[UINib nibWithNibName:@"QXGiftCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXGiftCell"];
+ self.collectionView.delegate = self;
+ self.collectionView.dataSource = self;
+ self.collectionView.showsHorizontalScrollIndicator = NO;
+ self.collectionView.bounces = NO;
+ self.collectionView.pagingEnabled = YES;
+ [self.giftBgView addSubview:self.collectionView];
+ [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(12);
+ make.top.mas_equalTo(ScaleWidth(16));
+ make.height.mas_equalTo(ScaleWidth(76));
+ make.right.mas_equalTo(-12);
+ }];
+
+
+
+ self.messageLabel = [[UILabel alloc] init];
+ self.messageLabel.font = [UIFont systemFontOfSize:12];
+ self.messageLabel.numberOfLines = 0;
+ self.messageLabel.text = QXText(@"充值6元即可获得总价值888金币的道具或装扮");
+ self.messageLabel.textColor = QXConfig.textColor;
+ [self.giftBgView addSubview:self.messageLabel];
+ [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.left.mas_equalTo(12);
+ make.right.mas_equalTo(-12);
+ make.top.equalTo(self.collectionView.mas_bottom).offset(2);
+ make.bottom.equalTo(self.giftBgView).offset(-5);
+ }];
+
+
+ self.getBtn = [[UIButton alloc] init];
+ [self.getBtn addRoundedCornersWithRadius:21];
+ self.getBtn.backgroundColor = QXConfig.themeColor;
+ [self.getBtn setTitle:QXText(@"立即充值") forState:(UIControlStateNormal)];
+ [self.getBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
+ self.getBtn.titleLabel.font = [UIFont systemFontOfSize:14];
+ [self.getBtn addTarget:self action:@selector(getAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self addSubview:self.getBtn];
+ [self.getBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.bottom.equalTo(self.bgImageView).offset(-ScaleWidth(16));
+ make.height.mas_equalTo(42);
+ make.right.equalTo(self.bgImageView).offset(-48);
+ make.left.equalTo(self.bgImageView).offset(48);
+ }];
+
+ self.closeBtn = [[UIButton alloc] init];
+ [self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)];
+ [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
+ [self addSubview:self.closeBtn];
+ [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+ make.centerX.equalTo(self);
+ make.top.equalTo(self.bgImageView.mas_bottom).offset(8);
+ make.height.width.mas_equalTo(30);
+ }];
+ [self getFirstRechargeGiftList];
+}
+
+-(void)getFirstRechargeGiftList{
+ MJWeakSelf
+ [QXHomePageNetwork getFirstRechargeGiftListSuccessBlock:^(NSArray * _Nonnull list) {
+ QXFirstRechargeModel *md = list.firstObject;
+ if (md) {
+ weakSelf.model = md;
+ [weakSelf.collectionView reloadData];
+ }
+ } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
+ showToast(msg);
+ if (weakSelf.refreshBlcock) {
+ weakSelf.refreshBlcock();
+ }
+ }];
+}
+
+-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
+ return self.model.gift_list.count;
+}
+-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
+ QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
+ cell.cellType = QXGiftCellTypeNiceGift;
+ cell.niceGiftModel = self.model.gift_list[indexPath.row];
+ return cell;
+}
+
+
+// 立即领取
+-(void)getAction{
+ if (self.getActionBlock) {
+ self.getActionBlock();
+ }
+}
+-(void)closeAction{
+ if (self.closeActionBlock) {
+ self.closeActionBlock();
+ }
+}
+@end
diff --git a/QXLive/Tabbar/弹窗/QXGiftCell.h b/QXLive/Tabbar/弹窗/QXGiftCell.h
index 37294d3..c6a1aed 100644
--- a/QXLive/Tabbar/弹窗/QXGiftCell.h
+++ b/QXLive/Tabbar/弹窗/QXGiftCell.h
@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIImageView *activityImageView;
@property (strong, nonatomic) QXGiftModel *roomGiftModel;
+
+@property (strong, nonatomic) QXGiftModel *niceGiftModel;
@property (strong, nonatomic) QXUserGiftWallModel *giftWall;
@property (assign, nonatomic) QXGiftCellType cellType;
@end
diff --git a/QXLive/Tabbar/弹窗/QXGiftCell.m b/QXLive/Tabbar/弹窗/QXGiftCell.m
index 96659bd..28145f8 100644
--- a/QXLive/Tabbar/弹窗/QXGiftCell.m
+++ b/QXLive/Tabbar/弹窗/QXGiftCell.m
@@ -27,7 +27,6 @@
self.cornHeight.constant = 10;
self.nameLabelHeight.constant = 10;
self.giftNameLabel.font = [UIFont systemFontOfSize:8];
- self.giftNameLabel.textColor = RGB16(0xffffff);
self.cornBtn.titleLabel.font = [UIFont systemFontOfSize:8];
[self.cornBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.giftNameLabel.textColor = RGB16(0x333333);
@@ -81,6 +80,20 @@
break;
}
}
+-(void)setNiceGiftModel:(QXGiftModel *)niceGiftModel{
+ _niceGiftModel = niceGiftModel;
+ self.giftNameLabel.text = niceGiftModel.gift_name;
+ NSString *encodedQuery = [niceGiftModel.base_image stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+ NSURL *imageUrl = [NSURL URLWithString:encodedQuery];
+ [self.gitfImageView sd_setImageWithURL:imageUrl];
+ [self.cornBtn setTitle:[NSString stringWithFormat:@" %@",niceGiftModel.gift_price] forState:(UIControlStateNormal)];
+ if (niceGiftModel.num.intValue > 0) {
+ self.numberBgView.hidden = NO;
+ self.numberLabel.text = [NSString stringWithFormat:@"x%@",niceGiftModel.num];
+ }else{
+ self.numberBgView.hidden = YES;
+ }
+}
-(void)setRoomGiftModel:(QXGiftModel *)roomGiftModel{
_roomGiftModel = roomGiftModel;
self.giftNameLabel.text = roomGiftModel.gift_name;
diff --git a/QXLive/Tabbar/弹窗/QXFirstRechargePopView.h b/QXLive/Tabbar/弹窗/QXNewPeoplePopView.h
similarity index 73%
rename from QXLive/Tabbar/弹窗/QXFirstRechargePopView.h
rename to QXLive/Tabbar/弹窗/QXNewPeoplePopView.h
index 864cd45..e3943ae 100644
--- a/QXLive/Tabbar/弹窗/QXFirstRechargePopView.h
+++ b/QXLive/Tabbar/弹窗/QXNewPeoplePopView.h
@@ -1,5 +1,5 @@
//
-// QXFirstRechargePopView.h
+// QXNewPeoplePopView.h
// QXLive
//
// Created by 启星 on 2025/5/13.
@@ -9,9 +9,10 @@
NS_ASSUME_NONNULL_BEGIN
-@interface QXFirstRechargePopView : UIView
+@interface QXNewPeoplePopView : UIView
@property (nonatomic,copy)void(^closeActionBlock)(void);
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money);
+@property (nonatomic,copy)void(^refreshBlcock)(void);
@property (nonatomic,strong)NSArray *giftArray;
-(void)reloadData;
@end
diff --git a/QXLive/Tabbar/弹窗/QXFirstRechargePopView.m b/QXLive/Tabbar/弹窗/QXNewPeoplePopView.m
similarity index 92%
rename from QXLive/Tabbar/弹窗/QXFirstRechargePopView.m
rename to QXLive/Tabbar/弹窗/QXNewPeoplePopView.m
index 2045140..f0efcfb 100644
--- a/QXLive/Tabbar/弹窗/QXFirstRechargePopView.m
+++ b/QXLive/Tabbar/弹窗/QXNewPeoplePopView.m
@@ -1,17 +1,17 @@
//
-// QXFirstRechargePopView.m
+// QXNewPeoplePopView.m
// QXLive
//
// Created by 启星 on 2025/5/13.
//
-#import "QXFirstRechargePopView.h"
+#import "QXNewPeoplePopView.h"
#import "GKPageControl.h"
#import
#import "QXGiftCell.h"
#import "QXHomePageNetwork.h"
-@interface QXFirstRechargePopView()
+@interface QXNewPeoplePopView()
@property (nonatomic,strong)UIImageView *lightBgImageView;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *priceLabel;
@@ -26,13 +26,13 @@
@property (nonatomic,strong)GKPageControl *pageControl;
@property (nonatomic,strong)UIButton *getBtn;
@property (nonatomic,strong)UIButton *closeBtn;
-@property (nonatomic,strong)QXFirstRechargeModel *md1;
-@property (nonatomic,strong)QXFirstRechargeModel *md2;
-@property (nonatomic,strong)QXFirstRechargeModel *md3;
-@property (nonatomic,strong)QXFirstRechargeModel *smd;
+@property (nonatomic,strong)QXNiceGiftRechargeModel *md1;
+@property (nonatomic,strong)QXNiceGiftRechargeModel *md2;
+@property (nonatomic,strong)QXNiceGiftRechargeModel *md3;
+@property (nonatomic,strong)QXNiceGiftRechargeModel *smd;
@end
-@implementation QXFirstRechargePopView
+@implementation QXNewPeoplePopView
- (instancetype)init
{
@@ -50,11 +50,11 @@
make.left.right.top.bottom.equalTo(self);
}];
- self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_first_recharge"]];
+ self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_new_user_recharge"]];
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(self);
- make.size.mas_equalTo(CGSizeMake(ScaleWidth(275), ScaleWidth(338)));
+ make.size.mas_equalTo(CGSizeMake(ScaleWidth(287), ScaleWidth(338)));
}];
self.priceLabel = [[UILabel alloc] init];
@@ -139,7 +139,7 @@
}];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
- layout.itemSize = CGSizeMake((ScaleWidth(275)-24*2-3*8-12*2)/4, ScaleWidth(76));
+ layout.itemSize = CGSizeMake((ScaleWidth(287)-24*2-3*8-12*2)/4, ScaleWidth(76));
layout.minimumLineSpacing = 8;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
@@ -204,7 +204,13 @@
}
-(void)getFirstRechargeGiftList{
MJWeakSelf
- [QXHomePageNetwork getFirstRechargeGiftListSuccessBlock:^(NSArray * _Nonnull list) {
+ [QXHomePageNetwork getNewUserGiftListSuccessBlock:^(NSArray * _Nonnull list) {
+
+ } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
+
+ }];
+
+ [QXHomePageNetwork getNewUserGiftListSuccessBlock:^(NSArray * _Nonnull list) {
for (int i = 0; i
@property (nonatomic,strong)UIImageView *lightBgImageView;
@@ -15,12 +16,13 @@
@property (nonatomic,strong)UIImageView *timeDownbgView;
@property (nonatomic,strong)UILabel *timeDownLabel;
@property (nonatomic,strong)UIView *giftBgView;
-@property (nonatomic,strong)UIButton *ruleBtn;
+//@property (nonatomic,strong)UIButton *ruleBtn;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)GKPageControl *pageControl;
@property (nonatomic,strong)UILabel *messageLabel;
@property (nonatomic,strong)UIButton *getBtn;
@property (nonatomic,strong)UIButton *closeBtn;
+@property (nonatomic,strong)QXNiceGiftRechargeModel *model;
@end
@implementation QXNiceGiftPopView
@@ -57,7 +59,7 @@
self.timeDownLabel = [[UILabel alloc] init];
self.timeDownLabel.textColor = RGB16(0x666666);
- self.timeDownLabel.text = QXText(@"剩余时间");
+ self.timeDownLabel.text = QXText(@"截止时间");
self.timeDownLabel.font = [UIFont systemFontOfSize:12];
[self addSubview:self.timeDownLabel];
[self.timeDownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -66,19 +68,19 @@
make.right.equalTo(self.timeDownbgView).offset(-19);
}];
- self.ruleBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 54, 20)];
- self.ruleBtn.backgroundColor = QXConfig.themeColor;
- [self.ruleBtn addTarget:self action:@selector(ruleAction) forControlEvents:(UIControlEventTouchUpInside)];
- [self.ruleBtn setTitle:QXText(@"规则") forState:(UIControlStateNormal)];
- self.ruleBtn.titleLabel.font = [UIFont systemFontOfSize:12];
- [self.ruleBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
- [self.ruleBtn addRoundedCornersWithRadius:10 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerBottomLeft)];
- [self addSubview:self.ruleBtn];
- [self.ruleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.bgImageView);
- make.centerY.equalTo(self.timeDownbgView);
- make.size.mas_equalTo(CGSizeMake(ScaleWidth(54), ScaleWidth(20)));
- }];
+// self.ruleBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 54, 20)];
+// self.ruleBtn.backgroundColor = QXConfig.themeColor;
+// [self.ruleBtn addTarget:self action:@selector(ruleAction) forControlEvents:(UIControlEventTouchUpInside)];
+// [self.ruleBtn setTitle:QXText(@"规则") forState:(UIControlStateNormal)];
+// self.ruleBtn.titleLabel.font = [UIFont systemFontOfSize:12];
+// [self.ruleBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
+// [self.ruleBtn addRoundedCornersWithRadius:10 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerBottomLeft)];
+// [self addSubview:self.ruleBtn];
+// [self.ruleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+// make.right.equalTo(self.bgImageView);
+// make.centerY.equalTo(self.timeDownbgView);
+// make.size.mas_equalTo(CGSizeMake(ScaleWidth(54), ScaleWidth(20)));
+// }];
self.giftBgView = [[UIView alloc] init];
// self.giftBgView.backgroundColor = [UIColor whiteColor];
@@ -142,7 +144,7 @@
self.getBtn = [[UIButton alloc] init];
[self.getBtn addRoundedCornersWithRadius:21];
self.getBtn.backgroundColor = QXConfig.themeColor;
- [self.getBtn setTitle:QXText(@"立即领取") forState:(UIControlStateNormal)];
+ [self.getBtn setTitle:QXText(@"立即充值") forState:(UIControlStateNormal)];
[self.getBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
self.getBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.getBtn addTarget:self action:@selector(getAction) forControlEvents:(UIControlEventTouchUpInside)];
@@ -163,46 +165,37 @@
make.top.equalTo(self.bgImageView.mas_bottom).offset(8);
make.height.width.mas_equalTo(30);
}];
+ [self getGiftList];
}
--(void)scrollViewDidScroll:(UIScrollView *)scrollView{
- if ([scrollView isKindOfClass:[UICollectionView class]]) {
- long offsetX = (long)scrollView.contentOffset.x;
- int width = ScaleWidth(275-15*2-12*2-3*8);
- int remainder = offsetX % width;
- NSInteger index;
- if (remainder>(width)/2) {
- index = offsetX/width+1;
- }else{
- index = offsetX/width;
+-(void)getGiftList{
+ MJWeakSelf
+ [QXHomePageNetwork getSkyDropGiftListSuccessBlock:^(QXNiceGiftRechargeModel * _Nonnull model) {
+ weakSelf.model = model;
+ weakSelf.timeDownLabel.text = model.effective_time;
+ NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:model.counter];
+ [attr yy_setColor:QXConfig.themeColor range:[model.counter rangeOfString:model.money]];
+ [attr yy_setColor:QXConfig.themeColor range:[model.counter rangeOfString:model.diamond]];
+ weakSelf.messageLabel.attributedText = attr;
+ [weakSelf.collectionView reloadData];
+ } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
+ if (weakSelf.refreshBlcock) {
+ weakSelf.refreshBlcock();
}
- self.pageControl.currentPage = index;
- }
-}
-
-
--(void)setGiftArray:(NSArray *)giftArray{
- _giftArray = giftArray;
- self.pageControl.numberOfPages = giftArray.count/4+1;
- self.pageControl.currentPage = 0;
- [self.collectionView reloadData];
+ }];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
- return self.giftArray.count;
+ return self.model.gift_list.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
cell.cellType = QXGiftCellTypeNiceGift;
+ cell.roomGiftModel = self.model.gift_list[indexPath.row];
return cell;
}
-// 规则
--(void)ruleAction{
- if (self.ruleActionBlock) {
- self.ruleActionBlock();
- }
-}
+
// 立即领取
-(void)getAction{
if (self.getActionBlock) {
diff --git a/QXLive/Tabbar/弹窗/QXDrifRoomHourRankView.h b/QXLive/Tabbar/飘屏/QXDrifRoomHourRankView.h
similarity index 100%
rename from QXLive/Tabbar/弹窗/QXDrifRoomHourRankView.h
rename to QXLive/Tabbar/飘屏/QXDrifRoomHourRankView.h
diff --git a/QXLive/Tabbar/弹窗/QXDrifRoomHourRankView.m b/QXLive/Tabbar/飘屏/QXDrifRoomHourRankView.m
similarity index 100%
rename from QXLive/Tabbar/弹窗/QXDrifRoomHourRankView.m
rename to QXLive/Tabbar/飘屏/QXDrifRoomHourRankView.m
diff --git a/QXLive/Tabbar/弹窗/QXGiftDriftView.h b/QXLive/Tabbar/飘屏/QXGiftDriftView.h
similarity index 100%
rename from QXLive/Tabbar/弹窗/QXGiftDriftView.h
rename to QXLive/Tabbar/飘屏/QXGiftDriftView.h
diff --git a/QXLive/Tabbar/弹窗/QXGiftDriftView.m b/QXLive/Tabbar/飘屏/QXGiftDriftView.m
similarity index 100%
rename from QXLive/Tabbar/弹窗/QXGiftDriftView.m
rename to QXLive/Tabbar/飘屏/QXGiftDriftView.m
diff --git a/QXLive/Tabbar/弹窗/QXMeetActivityDriftView.h b/QXLive/Tabbar/飘屏/QXMeetActivityDriftView.h
similarity index 100%
rename from QXLive/Tabbar/弹窗/QXMeetActivityDriftView.h
rename to QXLive/Tabbar/飘屏/QXMeetActivityDriftView.h
diff --git a/QXLive/Tabbar/弹窗/QXMeetActivityDriftView.m b/QXLive/Tabbar/飘屏/QXMeetActivityDriftView.m
similarity index 100%
rename from QXLive/Tabbar/弹窗/QXMeetActivityDriftView.m
rename to QXLive/Tabbar/飘屏/QXMeetActivityDriftView.m