This commit is contained in:
启星
2025-10-12 15:48:35 +08:00
parent 5adf8e8412
commit 0b855ca803
128 changed files with 3313 additions and 256 deletions

View File

@@ -208,22 +208,6 @@
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "D20DD5F9-6170-442F-A6EB-9B6B1D9E49E2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/HomePage(&#x58f0;&#x64ad;)/View/&#x623f;&#x95f4;/&#x9ea6;&#x4f4d;&#x89c6;&#x56fe;/QXRoomSeatTypeAuctionView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1061"
endingLineNumber = "1061"
landmarkName = "-helpAction"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
@@ -256,5 +240,37 @@
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "7258F68E-83A5-4C7F-A873-9DFEB2A7C758"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/HomePage(&#x58f0;&#x64ad;)/Controlller/&#x623f;&#x95f4;/QXRoomViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1947"
endingLineNumber = "1947"
landmarkName = "-redbagDrawView"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F63F08F4-7886-4CB8-9A4C-C6C41B376312"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/Tabbar/&#x5f39;&#x7a97;/QXNiceGiftPopView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "182"
endingLineNumber = "182"
landmarkName = "-getGiftList"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>

View File

@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
+(UIColor*)themeColor; +(UIColor*)themeColor;
/// 获取按钮字体色 /// 获取按钮字体色
+(UIColor*)btnTextColor; +(UIColor*)btnTextColor;
/// 主题色 /// 背景图
+(NSString*)backgroundImage; +(NSString*)backgroundImage;
/// tabbar /// tabbar
+(NSArray*)tabbarArray; +(NSArray*)tabbarArray;

View File

@@ -17,11 +17,14 @@
#import "QXHomePageNetwork.h" #import "QXHomePageNetwork.h"
#import "QXMyRoomViewController.h" #import "QXMyRoomViewController.h"
#import "QXUserHomePageViewController.h" #import "QXUserHomePageViewController.h"
#import "QXFirstRechargePopView.h" #import "QXNewPeoplePopView.h"
#import "QXRechargeView.h" #import "QXRechargeView.h"
#import "QXAppstoreHomeView.h" #import "QXAppstoreHomeView.h"
#import "QXConfig.h" #import "QXConfig.h"
#import "QXSkyPraizeView.h" #import "QXSkyPraizeView.h"
#import "QXRechargePermissionModel.h"
#import "QXNiceGiftPopView.h" //
#import "QXFirstRechargeView.h" //
@interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate> @interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate>
@property (nonatomic, strong) JXPagerView *pagingView; @property (nonatomic, strong) JXPagerView *pagingView;
@@ -42,11 +45,13 @@
@property (nonatomic,strong)UIView *headerView; @property (nonatomic,strong)UIView *headerView;
@property (nonatomic,strong)UIView *sectionView; @property (nonatomic,strong)UIView *sectionView;
@property (nonatomic,strong)UIButton *firstRechargeBtn; //@property (nonatomic,strong)UIButton *firstRechargeBtn;
@property (nonatomic,strong)UIButton *skyDownBtn; @property (nonatomic,strong)UIButton *skyDownBtn;
@property (nonatomic,strong)QXFirstRechargePopView *firstRechargeView; @property (nonatomic,strong)QXNewPeoplePopView *nPeopleRechargeView;
@property (nonatomic,strong)QXAppstoreHomeView *appStoreView; @property (nonatomic,strong)QXAppstoreHomeView *appStoreView;
@property (nonatomic,strong)SDCycleScrollView *rechargePermissionView;
@property (nonatomic,strong)NSMutableArray *rechargePermissionArray;
@end @end
@implementation QXHomeViewController @implementation QXHomeViewController
@@ -62,16 +67,6 @@
} }
- (void)initSubViews{ - (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"]) { if ([QXConfig.backgroundImage hasPrefix:@"http"] || [QXConfig.backgroundImage hasPrefix:@"https"]) {
[self updateBgImage:QXConfig.backgroundImage]; [self updateBgImage:QXConfig.backgroundImage];
}else{ }else{
@@ -130,17 +125,23 @@
[self getBanner]; [self getBanner];
}]; }];
self.firstRechargeBtn.hidden = YES; // self.firstRechargeBtn.hidden = YES;
[self.view addSubview:self.firstRechargeBtn]; // [self.view addSubview:self.firstRechargeBtn];
[self.firstRechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) { // [self.firstRechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-(TabbarContentHeight+5)); // make.bottom.mas_equalTo(-(TabbarContentHeight+5));
make.right.equalTo(self.view).offset(-17); // make.right.equalTo(self.view).offset(-17);
make.width.height.mas_equalTo(ScaleWidth(57)); // make.width.height.mas_equalTo(ScaleWidth(57));
}]; // }];
[self getBanner]; [self getBanner];
[self getFirstRechargePermission]; // [self getRechargePermission];
self.appStoreView.hidden = YES; self.appStoreView.hidden = YES;
[self.view addSubview:self.appStoreView]; [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 { - (void)viewDidLayoutSubviews {
[super 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) @weakify(self)
[QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) { [QXHomePageNetwork getRechargePermissionSuccessBlock:^(QXRechargePermissionModel * _Nonnull model) {
@strongify(self) @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) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}]; }];
} }
-(void)firstAction{ //-(void)firstAction{
[self popFirstRechargeView]; // [self popnPeopleRechargeView];
// QXSkyPraizeView *v = [[QXSkyPraizeView alloc] init]; //// QXSkyPraizeView *v = [[QXSkyPraizeView alloc] init];
// [v showInView:self.view]; //// [v showInView:self.view];
} //}
-(void)popFirstRechargeView{ -(void)popnPeopleRechargeView{
// MJWeakSelf // MJWeakSelf
// view.giftArray = @[@"",@"",@"",@"",@"",@""]; // view.giftArray = @[@"",@"",@"",@"",@"",@""];
self.firstRechargeView.closeActionBlock = ^{ self.nPeopleRechargeView.closeActionBlock = ^{
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭"); QXLOG(@"页面关闭");
}]; }];
}; };
self.firstRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) { self.nPeopleRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) {
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭"); QXLOG(@"页面关闭");
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
@@ -207,11 +245,63 @@
[recharge showInView:KEYWINDOW]; [recharge showInView:KEYWINDOW];
}]; }];
}; };
[self.firstRechargeView reloadData]; [self.nPeopleRechargeView reloadData];
[[QXGlobal shareGlobal] showView:self.firstRechargeView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{ [[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 #pragma mark - JXPagingViewDelegate
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { - (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
@@ -334,6 +424,23 @@
[[QXGlobal shareGlobal] logOut]; [[QXGlobal shareGlobal] logOut];
return; 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]; QXBanner *banner = self.bannerArry[index];
if ([banner.type isEqualToString:@"2"]) { if ([banner.type isEqualToString:@"2"]) {
QXBaseWebViewController *webVc = [[QXBaseWebViewController alloc] init]; QXBaseWebViewController *webVc = [[QXBaseWebViewController alloc] init];
@@ -482,28 +589,33 @@
} }
return _bannerArry; return _bannerArry;
} }
-(UIButton *)firstRechargeBtn{ //-(UIButton *)firstRechargeBtn{
if (!_firstRechargeBtn) { // if (!_firstRechargeBtn) {
_firstRechargeBtn = [[UIButton alloc] init]; // _firstRechargeBtn = [[UIButton alloc] init];
[_firstRechargeBtn setBackgroundImage:[UIImage imageNamed:@"first_recharge_icon"] forState:(UIControlStateNormal)]; // [_firstRechargeBtn setBackgroundImage:[UIImage imageNamed:@"first_recharge_icon"] forState:(UIControlStateNormal)];
[_firstRechargeBtn addTarget:self action:@selector(firstAction) forControlEvents:(UIControlEventTouchUpInside)]; // [_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{ -(NSMutableArray *)rechargePermissionArray{
if (!_skyDownBtn) { if (!_rechargePermissionArray) {
_skyDownBtn = [[UIButton alloc] init]; _rechargePermissionArray = [NSMutableArray array];
[_skyDownBtn setBackgroundImage:[UIImage imageNamed:@"sky_down_gift_icon"] forState:(UIControlStateNormal)];
} }
return _skyDownBtn; return _rechargePermissionArray;
} }
-(QXFirstRechargePopView *)firstRechargeView{
if (!_firstRechargeView) {
_firstRechargeView = [[QXFirstRechargePopView alloc] init];
}
return _firstRechargeView;
}
-(QXAppstoreHomeView *)appStoreView{ -(QXAppstoreHomeView *)appStoreView{
if (!_appStoreView) { if (!_appStoreView) {

View File

@@ -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

View File

@@ -0,0 +1,226 @@
//
// QXRedBagRecordViewController.m
// QXLive
//
// Created by on 2025/10/11.
//
#import "QXRedBagRecordViewController.h"
@class QXRedBagRecordCell;
@interface QXRedBagRecordViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UIView *topView;
@property (nonatomic,strong)UIImageView *topImageView;
@property (nonatomic,strong)UIImageView *senderHeaderImageView;
@property (nonatomic,strong)UILabel *senderNameLabel;
@property (nonatomic,strong)UILabel *remarkLabel;
@property (nonatomic,strong)UILabel *moneyLabel;
@property (nonatomic,strong)UILabel *bottomLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UITableView *tableView;
@end
@implementation QXRedBagRecordViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)initSubViews{
self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(308))];
self.topImageView = [[UIImageView alloc] init];
self.topImageView.image = [UIImage imageNamed:@"red_bag_record_top_bg"];
[self.topView addSubview:self.topImageView];
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.left.right.equalTo(self.topView);
}];
self.senderNameLabel = [[UILabel alloc] init];
self.senderNameLabel.textColor = RGB16(0xffffff);
self.senderNameLabel.font = [UIFont systemFontOfSize:18];
self.senderNameLabel.text = @"傻狗涛的红包";
[self.topView addSubview:self.senderNameLabel];
[self.senderNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.topView).offset(41);;
make.top.equalTo(self.topView).offset(92);
}];
self.senderHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.senderHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.senderHeaderImageView addRoundedCornersWithRadius:20.5];
[self.topView addSubview:self.senderHeaderImageView];
[self.senderHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.senderNameLabel.mas_left).offset(-13);
make.centerY.equalTo(self.senderNameLabel);
make.width.height.mas_equalTo(41);
}];
self.remarkLabel = [[UILabel alloc] init];
self.remarkLabel.text = @"恭喜发财大吉大利";
self.remarkLabel.textColor = RGB16(0xffffff);
self.remarkLabel.font = [UIFont systemFontOfSize:13];
[self.topView addSubview:self.remarkLabel];
[self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.senderHeaderImageView.mas_bottom).offset(5);
make.height.mas_equalTo(26);
make.centerX.equalTo(self.topView);
}];
self.moneyLabel = [[UILabel alloc] init];
self.moneyLabel.font = [UIFont boldSystemFontOfSize:19];
self.moneyLabel.textColor = RGB16(0xffffff);
self.moneyLabel.text = @"5000金币";
[self.topView addSubview:self.moneyLabel];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.topView);
make.top.equalTo(self.remarkLabel.mas_bottom);
}];
self.bottomLabel = [[UILabel alloc] init];
self.bottomLabel.textColor = RGB16(0xffffff);
self.bottomLabel.text = @"已存入金币";
self.bottomLabel.font = [UIFont systemFontOfSize:13];
[self.topView addSubview:self.bottomLabel];
[self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.topView);
make.top.equalTo(self.moneyLabel.mas_bottom);
}];
self.countLabel = [[UILabel alloc] init];
self.countLabel.textColor = RGB16(0x999999);
self.countLabel.font = [UIFont systemFontOfSize:13];
self.countLabel.text = @"已领取0/0";
[self.topView addSubview:self.countLabel];
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo (15);
make.bottom.mas_equalTo(-10);
}];
[self.view addSubview:self.topView];
[self.dataArray addObject:@""];
[self.dataArray addObject:@""];
[self.dataArray addObject:@""];
[self.dataArray addObject:@""];
[self.dataArray addObject:@""];
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
self.tableView.dataSource = self;
self.tableView.delegate = self;
self.tableView.backgroundColor = RGB16(0xffffff);
self.tableView.rowHeight = 67;
// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.top.equalTo(self.topView.mas_bottom);
}];
UIButton*backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 44, 44)];
[backBtn setImage:[[UIImage imageNamed:@"back"] imageByTintColor:UIColor.whiteColor] forState:(UIControlStateNormal)];
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
[backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.view addSubview:backBtn];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXRedBagRecordCell *cell = [QXRedBagRecordCell cellWithTabelView:tableView];
return cell;
}
-(void)backAction{
[self.navigationController popViewControllerAnimated:YES];
}
@end
@interface QXRedBagRecordCell()
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *userHeaderImageView;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,strong)UILabel *timeLabel;
@property (nonatomic,strong)UILabel *moneyLabel;
@end
@implementation QXRedBagRecordCell
+(instancetype)cellWithTabelView:(UITableView *)tableView{
static NSString *cellId = @"QXRedBagRecordCell";
QXRedBagRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[QXRedBagRecordCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
}
return cell;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.bgView = [[UIView alloc] init];
[self.contentView addSubview:self.bgView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
make.height.mas_equalTo(52);
make.centerY.equalTo(self.contentView);
}];
self.userHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.userHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.userHeaderImageView addRoundedCornersWithRadius:24.5];
[self.bgView addSubview:self.userHeaderImageView];
[self.userHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.centerY.equalTo(self.bgView);
make.width.height.mas_equalTo(49);
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.textColor = RGB16(0x666666);
self.nameLabel.text = @"大家好,我是傻狗涛";
self.nameLabel.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.userHeaderImageView.mas_right).offset(13);
make.top.equalTo(self.userHeaderImageView);
make.height.mas_equalTo(26);
}];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.textColor = RGB16(0x999999);
self.timeLabel.font = [UIFont systemFontOfSize:14];
self.timeLabel.text = @"00:61";
[self.bgView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.userHeaderImageView.mas_right).offset(13);
make.bottom.equalTo(self.userHeaderImageView);
make.height.mas_equalTo(26);
}];
self.moneyLabel = [[UILabel alloc] init];
self.moneyLabel.textColor = RGB16(0x333333);
self.moneyLabel.text = @"0 金币";
self.moneyLabel.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:self.moneyLabel];
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.bgView);
make.centerY.equalTo(self.bgView);
}];
}
@end

View File

@@ -30,6 +30,10 @@
#import "QXRoomSubsidyViewController.h" #import "QXRoomSubsidyViewController.h"
#import "QXRoomViewController+Friend.h" #import "QXRoomViewController+Friend.h"
#import "QXAllRoomHourRankView.h" #import "QXAllRoomHourRankView.h"
#import "QXRedBagSendView.h"
#import "QXRedBagTagView.h"
#import "QXRedBagDrawView.h"
#import "QXRedBagListView.h"
@interface QXRoomViewController ()< @interface QXRoomViewController ()<
QXRoomBottomViewDelegate, QXRoomBottomViewDelegate,
@@ -76,6 +80,11 @@ QXRoomUserInfoViewDelegate
@property (nonatomic,strong)QXAllRoomHourRankView *hourRankView; @property (nonatomic,strong)QXAllRoomHourRankView *hourRankView;
@property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView; @property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView;
///
@property (nonatomic,strong)QXRedBagTagView *redBagTagView;
@property (nonatomic,strong)QXRedBagDrawView *redbagDrawView;
@property (nonatomic,strong)QXRedBagListView *redbagListView;
@end @end
@implementation QXRoomViewController @implementation QXRoomViewController
@@ -202,6 +211,7 @@ QXRoomUserInfoViewDelegate
} }
[self.view addSubview:self.hourRankIconView]; [self.view addSubview:self.hourRankIconView];
// [self.view addSubview:self.redBagTagView];
[self setupEffectView]; [self setupEffectView];
// [self.view addSubview:self.headlineView]; // [self.view addSubview:self.headlineView];
@@ -1177,46 +1187,6 @@ QXRoomUserInfoViewDelegate
QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:vc]; QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:vc];
na.modalPresentationStyle = UIModalPresentationFormSheet; na.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:na animated:YES completion:nil]; [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; break;
case QXRoomBottomViewEventTypePK:{ case QXRoomBottomViewEventTypePK:{
@@ -1403,20 +1373,13 @@ QXRoomUserInfoViewDelegate
break; break;
} }
} }
- (void)dismissHalfScreenView { -(void)didSendMessage:(NSString *)message redpacketModel:(nonnull QXRedPacketModel *)redpacketModel{
UIViewController *halfScreenVC = self.childViewControllers.lastObject; if (redpacketModel) {
UIView *dimmingView = [self.view viewWithTag:212]; self.redbagDrawView.type = QXRedBagDrawTypeOpen;
[self.redbagDrawView showInView:self.view];
[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];
}];
} }
}
#pragma mark - #pragma mark -
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{ -(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{
if (isPkRoom) { if (isPkRoom) {
@@ -1530,7 +1493,11 @@ QXRoomUserInfoViewDelegate
[self.navigationController pushViewController:reportVC animated:YES]; [self.navigationController pushViewController:reportVC animated:YES];
} }
break; break;
case QXRoomSettingTypeSendRedBag:{
QXRedBagSendView *redbagView = [[QXRedBagSendView alloc] init];
[redbagView showInView:self.view];
}
break;
default: default:
break; break;
@@ -1955,5 +1922,45 @@ QXRoomUserInfoViewDelegate
} }
return _hourRankView; 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 @end

View File

@@ -0,0 +1,51 @@
//
// QXNiceGiftRechargeModel.h
// QXLive
//
// Created by 启星 on 2025/10/12.
//
#import <UIKit/UIKit.h>
#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 <QXGiftModel*>*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 <QXGiftModel*>*gift_list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,28 @@
//
// QXNiceGiftRechargeModel.m
// QXLive
//
// Created by on 2025/10/12.
//
#import "QXNiceGiftRechargeModel.h"
@implementation QXNiceGiftRechargeModel
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"gift_list" : @"QXGiftModel"
};
}
@end
@implementation QXFirstRechargeModel
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"gift_list" : @"QXGiftModel"
};
}
@end

View File

@@ -0,0 +1,27 @@
//
// QXRechargePermissionModel.h
// QXLive
//
// Created by 启星 on 2025/10/12.
//
#import <Foundation/Foundation.h>
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

View File

@@ -0,0 +1,18 @@
//
// QXRechargePermissionModel.m
// QXLive
//
// Created by on 2025/10/12.
//
#import "QXRechargePermissionModel.h"
@implementation QXRechargePermissionModel
@end
@implementation QXRechargeTypeModel
@end

View File

@@ -0,0 +1,27 @@
//
// QXRedPacketModel.h
// QXLive
//
// Created by 启星 on 2025/10/11.
//
#import <Foundation/Foundation.h>
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

View File

@@ -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

View File

@@ -10,6 +10,8 @@
#import "QXBanner.h" #import "QXBanner.h"
#import "QXRankModel.h" #import "QXRankModel.h"
#import "QXGiftModel.h" #import "QXGiftModel.h"
#import "QXRechargePermissionModel.h"
#import "QXNiceGiftRechargeModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -78,7 +80,21 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
+(void)getFirstRechargePermissionSuccessBlock:(void (^)(BOOL isShow))successBlock +(void)getFirstRechargePermissionSuccessBlock:(void (^)(BOOL isShow))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock; 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<QXNiceGiftRechargeModel*> * list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -131,6 +131,38 @@
failBlock(error,msg); 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<QXNiceGiftRechargeModel*> * 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"; //static NSString * QXAppFirstRechargeGiftList = @"api/Activities/first_charge_gift";
/// ///

View File

@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "QXRoomModel.h" #import "QXRoomModel.h"
#import "NoitceAndKey.h" #import "NoitceAndKey.h"
#import "QXRedPacketModel.h"
typedef NS_ENUM(NSInteger) { typedef NS_ENUM(NSInteger) {
/// 静音 /// 静音
@@ -35,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected; -(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected;
-(void)didSendMessage:(NSString*)message redpacketModel:(QXRedPacketModel*)redpacketModel;
@end @end
@interface QXRoomBottomView : UIView @interface QXRoomBottomView : UIView
@@ -48,6 +50,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign)BOOL isCabinRoom; @property (nonatomic,assign)BOOL isCabinRoom;
-(void)atUserWithName:(NSString*)nickname; -(void)atUserWithName:(NSString*)nickname;
-(void)inputMessageWithName:(NSString*)message redpacketModel:(QXRedPacketModel*)redpacketModel;
/// 是否静音 1 不静音 0 静音 /// 是否静音 1 不静音 0 静音
-(void)setPlayAudioStatus:(BOOL)status; -(void)setPlayAudioStatus:(BOOL)status;
/// 是否闭麦 0 未闭麦 1 已闭麦 /// 是否闭麦 0 未闭麦 1 已闭麦

View File

@@ -29,6 +29,8 @@
@property (nonatomic,assign)QXRoomRoleType roleType; @property (nonatomic,assign)QXRoomRoleType roleType;
@property (nonatomic,strong)QXDynamicCommentInputView *commentView; @property (nonatomic,strong)QXDynamicCommentInputView *commentView;
@property (nonatomic,assign)QXRedPacketModel* redpacketModel;
@end @end
@implementation QXRoomBottomView @implementation QXRoomBottomView
@@ -346,6 +348,12 @@
[self.vc.view addSubview:self.commentView]; [self.vc.view addSubview:self.commentView];
[self.commentView.textField becomeFirstResponder]; [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 - #pragma mark -
-(void)didClickSendWithText:(NSString*)text model:(nonnull QXDynamicCommentListModel *)model{ -(void)didClickSendWithText:(NSString*)text model:(nonnull QXDynamicCommentListModel *)model{
if (self.roomModel.user_info.is_mute.intValue == 1) { if (self.roomModel.user_info.is_mute.intValue == 1) {
@@ -357,7 +365,13 @@
[[QXRoomMessageManager shared] sendChatMessage:text messageType:(QXRoomMessageTypeText) needInsertMessage:YES]; [[QXRoomMessageManager shared] sendChatMessage:text messageType:(QXRoomMessageTypeText) needInsertMessage:YES];
self.commentView.textField.text = @""; self.commentView.textField.text = @"";
[self.vc.view endEditing:YES]; [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 { - (void)keyboardWillHide:(NSNotification *)notification {

View File

@@ -185,15 +185,15 @@ NSInteger maxMessageCount = 20;
if (model.messageType == QXRoomChatMessageTypeGift) { if (model.messageType == QXRoomChatMessageTypeGift) {
[self.giftArray addObject:model]; [self.giftArray addObject:model];
} }
if (self.dataArray.count>maxMessageCount) { // if (self.dataArray.count>maxMessageCount) {
[self.dataArray removeFirstObject]; // [self.dataArray removeFirstObject];
} // }
if (self.chatArray.count>maxMessageCount) { // if (self.chatArray.count>maxMessageCount) {
[self.chatArray removeFirstObject]; // [self.chatArray removeFirstObject];
} // }
if (self.giftArray.count>maxMessageCount) { // if (self.giftArray.count>maxMessageCount) {
[self.giftArray removeFirstObject]; // [self.giftArray removeFirstObject];
} // }
[self.tableView reloadData]; [self.tableView reloadData];
if (self.isDragging) { if (self.isDragging) {
self.messageCount++; self.messageCount++;

View File

@@ -0,0 +1,48 @@
//
// QXRedBagDrawView.h
// QXLive
//
// Created by 启星 on 2025/10/11.
//
#import <UIKit/UIKit.h>
#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

View File

@@ -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

View File

@@ -0,0 +1,23 @@
//
// QXRedBagListView.h
// QXLive
//
// Created by 启星 on 2025/10/11.
//
#import <UIKit/UIKit.h>
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

View File

@@ -0,0 +1,164 @@
//
// QXRedBagListView.m
// QXLive
//
// Created by on 2025/10/11.
//
#import "QXRedBagListView.h"
@interface QXRedBagListView()<UICollectionViewDelegate,UICollectionViewDataSource>
@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

View File

@@ -0,0 +1,17 @@
//
// QXRedBagSendView.h
// QXLive
//
// Created by 启星 on 2025/10/10.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRedBagSendView : UIView
-(void)showInView:(UIView*)view;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,847 @@
//
// QXRedBagSendView.m
// QXLive
//
// Created by on 2025/10/10.
//
#import "QXRedBagSendView.h"
#import <WebKit/WebKit.h>
@interface QXRedBagSendView()<UITextFieldDelegate>
@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<UITouch *> *)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

View File

@@ -0,0 +1,17 @@
//
// QXRedBagTagView.h
// QXLive
//
// Created by 启星 on 2025/10/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRedBagTagView : UIView
@property (nonatomic,copy)void(^startBlock)(BOOL isList);
@property (nonatomic,strong)NSString *count;
@end
NS_ASSUME_NONNULL_END

View File

@@ -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

View File

@@ -54,6 +54,8 @@ typedef NS_ENUM(NSInteger) {
QXRoomSettingTypeRoomReport = 26, QXRoomSettingTypeRoomReport = 26,
/// 关闭飘屏 /// 关闭飘屏
QXRoomSettingTypeDrifPop = 27, QXRoomSettingTypeDrifPop = 27,
/// 发红包
QXRoomSettingTypeSendRedBag = 28,
}QXRoomSettingType; }QXRoomSettingType;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class QXRoomSettingModel; @class QXRoomSettingModel;

View File

@@ -74,6 +74,8 @@
@property (nonatomic,strong)QXRoomSettingModel *roomReport; @property (nonatomic,strong)QXRoomSettingModel *roomReport;
/// ///
@property (nonatomic,strong)QXRoomSettingModel *drifPop; @property (nonatomic,strong)QXRoomSettingModel *drifPop;
///
@property (nonatomic,strong)QXRoomSettingModel *redBag;
/// ///
@@ -176,7 +178,8 @@
/// ///
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage]; toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend]; 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]; // 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]; // moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
}else{ }else{
@@ -184,7 +187,8 @@
/// ///
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage]; toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend]; 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]; // 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]; // moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
} }
@@ -196,7 +200,8 @@
// //
roomTypeArr = @[]; roomTypeArr = @[];
toolsArr = @[]; 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(@"更多操作")]; self.titles = @[QXText(@"更多操作")];
} }
break; break;
@@ -218,7 +223,8 @@
toolsArr = @[self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage]; toolsArr = @[self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
} }
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend]; 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]; // 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]; // roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")]; 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.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,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.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(@"更多操作")]; self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
} }
break; break;
@@ -574,6 +581,15 @@
} }
return _drifPop; 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{ -(QXDirectListView *)directView{
if (!_directView) { if (!_directView) {
_directView = [[QXDirectListView alloc] init]; _directView = [[QXDirectListView alloc] init];

View File

@@ -0,0 +1,35 @@
//
// QXRedPacketManager.h
// QXLive
//
// Created by 启星 on 2025/10/11.
//
#import <Foundation/Foundation.h>
#import "QXRedPacketModel.h"
@class QXRedPacketManager;
@protocol QXRedPacketManagerDelegate <NSObject>
- (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<QXRedPacketManagerDelegate> delegate;
+ (instancetype)sharedManager;
// 添加红包
- (void)addRedPacket:(QXRedPacketModel *)redPacket;
// 移除红包
- (void)removeRedPacket:(NSString *)packetId;
// 获取所有红包
- (NSArray<QXRedPacketModel *> *)allRedPackets;
// 根据位置获取红包
- (QXRedPacketModel *)redPacketAtPosition:(NSInteger)position;
// 检查并更新红包状态
- (void)checkAndUpdateRedPackets;
@end

View File

@@ -0,0 +1,101 @@
//
// QXRedPacketManager.m
// QXLive
//
// Created by on 2025/10/11.
//
#import "QXRedPacketManager.h"
@interface QXRedPacketManager ()
@property (nonatomic, strong) NSMutableDictionary<NSString *, QXRedPacketModel *> *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<QXRedPacketModel *> *)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

View File

@@ -54,18 +54,4 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *time; @property (nonatomic,strong)NSString *time;
@end @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 <QXGiftModel*>*gift_list;
@end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -23,13 +23,3 @@
@end @end
@implementation QXFirstRechargeModel
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"gift_list" : @"QXGiftModel"
};
}
@end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -5,12 +5,11 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "sky_down_gift@2x.png", "filename" : "draw_redbag_btn@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "sky_down_gift@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "first_recharge_icon@2x.png", "filename" : "red_bag_btn_bg_nor@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "first_recharge_icon@3x.png", "filename" : "red_bag_btn_bg_nor@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -5,7 +5,7 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Group 7229@2x.png", "filename" : "蒙版组 99@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Some files were not shown because too many files have changed in this diff Show More