提交
This commit is contained in:
47
QXLive/HomePage(声播)/View/房间/QXAllRoomHourRankView.h
Normal file
47
QXLive/HomePage(声播)/View/房间/QXAllRoomHourRankView.h
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// QXAllRoomHourRankView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/9/29.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomHourRankModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXAllRoomHourRankView : UIView
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@interface QXAllRoomHourRankCell : UICollectionViewCell
|
||||
@property (nonatomic,strong)UIImageView *rankNumberImageView;
|
||||
@property (nonatomic,strong)UILabel *rankNumberLabel;
|
||||
@property (nonatomic,strong)UIImageView *roomCoverImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UIImageView *animationView;
|
||||
@property (nonatomic,strong)UIImageView *labelImageView;
|
||||
@property (nonatomic,strong)UIImageView *hotImageView;
|
||||
@property (nonatomic,strong)UILabel *hotLabel;
|
||||
|
||||
|
||||
@property (nonatomic,strong)UIView *activityBgView;
|
||||
@property (nonatomic,strong)UIImageView *activityImageView;
|
||||
@property (nonatomic,strong)UIImageView *activityStatusBgImageView;
|
||||
@property (nonatomic,strong)UILabel *statusLabel;
|
||||
|
||||
|
||||
@property (nonatomic,assign)NSInteger rankNumber;
|
||||
@property (nonatomic,strong)QXRoomHourRankSubModel *model;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXAllRoomHourRankTagView : UIView
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *button;
|
||||
|
||||
@property (nonatomic,copy)void(^startBlock)(void);
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
422
QXLive/HomePage(声播)/View/房间/QXAllRoomHourRankView.m
Normal file
422
QXLive/HomePage(声播)/View/房间/QXAllRoomHourRankView.m
Normal file
@@ -0,0 +1,422 @@
|
||||
//
|
||||
// QXAllRoomHourRankView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/9/29.
|
||||
//
|
||||
|
||||
#import "QXAllRoomHourRankView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "NSString+QX.h"
|
||||
|
||||
@interface QXAllRoomHourRankView()<UICollectionViewDelegate,UICollectionViewDataSource,UIGestureRecognizerDelegate>
|
||||
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
/// 顶部视图
|
||||
/// 顶部容器
|
||||
@property (nonatomic,strong)UIView *topView;
|
||||
/// 顶部背景视图
|
||||
@property (nonatomic,strong)UIImageView *topImageView;
|
||||
/// 帮助按钮
|
||||
@property (nonatomic,strong)UIButton *helpBtn;
|
||||
/// 时间背景
|
||||
@property (nonatomic,strong)UIImageView *timeBgImageView;
|
||||
/// 时间标签
|
||||
@property (nonatomic,strong)UILabel *timeLabel;
|
||||
|
||||
/// 列表视图
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,assign)NSInteger page;
|
||||
@end
|
||||
|
||||
@implementation QXAllRoomHourRankView
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
self.page = 1;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
|
||||
tap.delegate = self;
|
||||
[self addGestureRecognizer:tap];
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
|
||||
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(256), self.height)];
|
||||
self.bgView.backgroundColor = RGB16(0x32057F);
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
|
||||
self.topView = [[UIView alloc] init];
|
||||
[self.bgView addSubview:self.topView];
|
||||
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.left.right.equalTo(self.bgView);
|
||||
make.height.mas_equalTo(ScaleWidth(ScaleWidth(281)));
|
||||
}];
|
||||
|
||||
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_hour_rank_top_bg"]];
|
||||
[self.topView addSubview:self.topImageView];
|
||||
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.topView);
|
||||
}];
|
||||
|
||||
self.timeBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_hour_rank_top_time_bg"]];
|
||||
[self.topView addSubview:self.timeBgImageView];
|
||||
|
||||
[self.timeBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView);
|
||||
make.top.mas_equalTo(ScaleWidth(119));
|
||||
make.height.mas_equalTo(ScaleWidth(23));
|
||||
make.width.mas_equalTo(ScaleWidth(150));
|
||||
}];
|
||||
|
||||
self.timeLabel = [[UILabel alloc] init];
|
||||
self.timeLabel.text = @"榜单时间";
|
||||
self.timeLabel.font = [UIFont systemFontOfSize:12];
|
||||
self.timeLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.timeLabel.textColor = RGB16(0xffffff);
|
||||
[self.bgView addSubview:self.timeLabel];
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.timeBgImageView);
|
||||
}];
|
||||
|
||||
self.helpBtn = [[UIButton alloc] init];
|
||||
[self.helpBtn setImage:[UIImage imageNamed:@"room_hour_rank_help"] forState:(UIControlStateNormal)];
|
||||
[self.bgView addSubview:self.helpBtn];
|
||||
[self.helpBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.bgView);
|
||||
make.top.mas_equalTo(ScaleWidth(40));
|
||||
make.height.mas_equalTo(ScaleWidth(24));
|
||||
make.width.mas_equalTo(ScaleWidth(24));
|
||||
}];
|
||||
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 4;
|
||||
layout.minimumInteritemSpacing = 4;
|
||||
layout.itemSize = CGSizeMake(self.bgView.width, 88);
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
self.collectionView.bounces = YES;
|
||||
self.collectionView.backgroundColor = [UIColor clearColor];
|
||||
MJWeakSelf
|
||||
self.collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getRankList];
|
||||
}];
|
||||
self.collectionView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getRankList];
|
||||
}];
|
||||
[self.collectionView registerClass:[QXAllRoomHourRankCell class] forCellWithReuseIdentifier:@"QXAllRoomHourRankCell"];
|
||||
[self.bgView addSubview:self.collectionView];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.bgView);
|
||||
make.top.equalTo(self.topView.mas_bottom).offset(10);
|
||||
make.bottom.equalTo(self.bgView);
|
||||
}];
|
||||
}
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
-(void)getRankList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomHourRankWithPage:self.page successBlock:^(QXRoomHourRankModel * _Nonnull model) {
|
||||
if (weakSelf.page == 0) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
weakSelf.timeLabel.text = [NSString stringWithFormat:@"榜单时间 %@",model.time_range];
|
||||
[weakSelf.dataArray addObjectsFromArray:model.lists];
|
||||
[weakSelf.collectionView reloadData];
|
||||
if (model.lists.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXAllRoomHourRankCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXAllRoomHourRankCell" forIndexPath:indexPath];
|
||||
cell.rankNumber = indexPath.row;
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomHourRankSubModel *model = self.dataArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
|
||||
-(void)showInView:(UIView *)view{
|
||||
[self getRankList];
|
||||
self.bgView.x = SCREEN_WIDTH;
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.x = SCREEN_WIDTH-ScaleWidth(256);
|
||||
}];
|
||||
}
|
||||
-(void)hide{
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.x = SCREEN_WIDTH;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXAllRoomHourRankCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.rankNumberImageView = [[UIImageView alloc] init];
|
||||
[self.contentView addSubview:self.rankNumberImageView];
|
||||
[self.rankNumberImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(5);
|
||||
make.top.equalTo(self.contentView);
|
||||
make.width.mas_equalTo(32);
|
||||
make.height.mas_equalTo(32);
|
||||
}];
|
||||
|
||||
self.rankNumberLabel = [[UILabel alloc] init];
|
||||
self.rankNumberLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.rankNumberLabel.textColor = RGB16(0xA6A77E);
|
||||
self.rankNumberLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self.contentView addSubview:self.rankNumberLabel];
|
||||
[self.rankNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.rankNumberImageView);
|
||||
}];
|
||||
|
||||
self.roomCoverImageView = [[UIImageView alloc] init];
|
||||
self.roomCoverImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.roomCoverImageView.layer.borderWidth = 1;
|
||||
self.roomCoverImageView.layer.borderColor = RGB16(0xD000FF).CGColor;
|
||||
[self.contentView addSubview:self.roomCoverImageView];
|
||||
[self.roomCoverImageView addRoundedCornersWithRadius:6];
|
||||
[self.roomCoverImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(21);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
make.width.height.mas_equalTo(64);
|
||||
}];
|
||||
|
||||
self.animationView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"activity_room_animate"]];
|
||||
[self.contentView addSubview:self.animationView];
|
||||
[self.animationView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.roomCoverImageView.mas_right).offset(-3);
|
||||
make.top.equalTo(self.roomCoverImageView.mas_top).offset(3);
|
||||
make.width.height.mas_equalTo(12);
|
||||
}];
|
||||
|
||||
self.activityBgView = [[UIView alloc] init];
|
||||
[self.contentView addSubview:self.activityBgView];
|
||||
[self.activityBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.right.mas_equalTo(-5);
|
||||
make.top.mas_equalTo(8);
|
||||
make.width.mas_equalTo(44);
|
||||
make.height.mas_equalTo(48);
|
||||
}];
|
||||
|
||||
self.activityStatusBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"activity_status_ing"]];
|
||||
// self.activityStatusBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"activity_status_will"]];
|
||||
[self.activityBgView addSubview:self.activityStatusBgImageView];
|
||||
[self.activityStatusBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.equalTo(self.activityBgView);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
|
||||
self.statusLabel = [[UILabel alloc] init];
|
||||
self.statusLabel.font = [UIFont systemFontOfSize:10];
|
||||
self.statusLabel.textColor = RGB16(0xffffff);
|
||||
self.statusLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self.activityBgView addSubview:self.statusLabel];
|
||||
[self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.activityStatusBgImageView);
|
||||
}];
|
||||
|
||||
|
||||
self.activityImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_tag_icon"]];
|
||||
[self.activityBgView addSubview:self.activityImageView];
|
||||
[self.activityImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.activityBgView);
|
||||
make.centerX.equalTo(self.activityBgView);
|
||||
make.width.height.mas_equalTo(36);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = RGB16(0xffffff);
|
||||
self.nameLabel.font = [UIFont boldSystemFontOfSize:12];
|
||||
[self.contentView addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.roomCoverImageView.mas_right).offset(8);
|
||||
make.right.equalTo(self.activityBgView.mas_left).offset(-8);
|
||||
make.top.equalTo(self.roomCoverImageView);
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
self.labelImageView = [[UIImageView alloc] init];
|
||||
[self.contentView addSubview:self.labelImageView];
|
||||
[self.labelImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(44);
|
||||
make.height.mas_equalTo(24);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
make.left.equalTo(self.nameLabel);
|
||||
}];
|
||||
|
||||
self.hotImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_hot_icon"]];
|
||||
[self.contentView addSubview:self.hotImageView];
|
||||
[self.hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(15);
|
||||
make.bottom.equalTo(self.roomCoverImageView.mas_bottom).offset(2);
|
||||
make.left.equalTo(self.nameLabel);
|
||||
}];
|
||||
|
||||
self.hotLabel = [[UILabel alloc] init];
|
||||
self.hotLabel.font = [UIFont systemFontOfSize:12];
|
||||
self.hotLabel.textColor = RGB16(0xffffff);
|
||||
[self.contentView addSubview:self.hotLabel];
|
||||
[self.hotLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.hotImageView);
|
||||
make.left.equalTo(self.hotImageView.mas_right);
|
||||
}];
|
||||
|
||||
[self.contentView bringSubviewToFront:self.rankNumberImageView];
|
||||
[self.contentView bringSubviewToFront:self.rankNumberLabel];
|
||||
[self.contentView bringSubviewToFront:self.activityStatusBgImageView];
|
||||
[self.contentView bringSubviewToFront:self.statusLabel];
|
||||
}
|
||||
-(void)setRankNumber:(NSInteger)rankNumber{
|
||||
_rankNumber = rankNumber;
|
||||
if (rankNumber == 0) {
|
||||
self.rankNumberLabel.hidden = YES;
|
||||
self.rankNumberImageView.image = [UIImage imageNamed:@"activity_room_rank_first"];
|
||||
return;
|
||||
}
|
||||
if (rankNumber == 1) {
|
||||
self.rankNumberLabel.hidden = YES;
|
||||
self.rankNumberImageView.image = [UIImage imageNamed:@"activity_room_rank_second"];
|
||||
return;
|
||||
}
|
||||
if (rankNumber == 2) {
|
||||
self.rankNumberLabel.hidden = YES;
|
||||
self.rankNumberImageView.image = [UIImage imageNamed:@"activity_room_rank_third"];
|
||||
return;
|
||||
}
|
||||
|
||||
self.rankNumberLabel.hidden = NO;
|
||||
self.rankNumberLabel.text = [NSString stringWithFormat:@"%ld",rankNumber+1];
|
||||
self.rankNumberImageView.image = [UIImage imageNamed:@"activity_room_rank_other"];
|
||||
}
|
||||
-(void)setModel:(QXRoomHourRankSubModel *)model{
|
||||
_model = model;
|
||||
[self.roomCoverImageView sd_setImageWithURL:[NSURL URLWithString:model.room_cover]];
|
||||
self.nameLabel.text = model.room_name;
|
||||
[self.labelImageView sd_setImageWithURL:[NSURL URLWithString:model.label_icon]];
|
||||
self.hotLabel.text = [NSString qx_showHotCountNum:model.total_price.longLongValue];
|
||||
if (model.xlh_status == 0) {
|
||||
self.activityBgView.hidden = YES;
|
||||
}else if (model.xlh_status == 2){
|
||||
self.activityBgView.hidden = NO;
|
||||
self.activityStatusBgImageView.image = [UIImage imageNamed:@"activity_status_will"];
|
||||
self.statusLabel.text = @"即将开始";
|
||||
}else{
|
||||
self.activityBgView.hidden = NO;
|
||||
self.activityStatusBgImageView.image = [UIImage imageNamed:@"activity_status_ing"];
|
||||
self.statusLabel.text = @"进行中";
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation QXAllRoomHourRankTagView
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(SCREEN_WIDTH-60, NavContentHeight, 60, 25);
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
|
||||
[self addGestureRecognizer:panRecognizer];
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_hour_rank_icon"]];
|
||||
[self addSubview:self.bgImageView];
|
||||
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:11];
|
||||
self.titleLabel.text = @"小时榜";
|
||||
self.titleLabel.textColor = RGB16(0xffffff);
|
||||
self.titleLabel.textAlignment = NSTextAlignmentRight;
|
||||
[self addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
|
||||
self.button = [[UIButton alloc] init];
|
||||
[self.button addTarget:self action:@selector(buttonAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.button];
|
||||
[self.button mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)buttonAction{
|
||||
if (self.startBlock) {
|
||||
self.startBlock();
|
||||
}
|
||||
}
|
||||
|
||||
-(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(SCREEN_WIDTH-60/2,
|
||||
recognizer.view.center.y + translation.y);
|
||||
[recognizer setTranslation:CGPointZero inView:self.viewController.view];
|
||||
}
|
||||
@end
|
||||
@@ -171,13 +171,17 @@
|
||||
// 主持
|
||||
case QXRoomRoleTypeCompere:{
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
/// 暂时不需要房间补贴
|
||||
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
|
||||
moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
|
||||
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
|
||||
}else{
|
||||
toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
// toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
/// 暂时不需要房间补贴
|
||||
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
|
||||
moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
|
||||
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
@@ -203,10 +207,14 @@
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// }
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
/// 暂时不需要房间补贴
|
||||
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
}else{
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
/// 暂时不需要房间补贴
|
||||
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
}
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
|
||||
moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
|
||||
@@ -223,10 +231,14 @@
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// }
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
/// 暂时不需要房间补贴
|
||||
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
}else{
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
// toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
/// 暂时不需要房间补贴
|
||||
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
}
|
||||
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
|
||||
|
||||
@@ -200,6 +200,7 @@
|
||||
NSDictionary *parm = notice.object;
|
||||
NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]];
|
||||
BOOL isOnline = [[parm objectForKey:@"is_online"] boolValue];
|
||||
[QXGlobal.shareGlobal.offLineDict setObject:[NSNumber numberWithBool:!isOnline] forKey:uid];
|
||||
if ([uid isEqualToString:self.pitModel.user_id]) {
|
||||
if (isOnline) {
|
||||
self.offlineImageView.hidden = YES;
|
||||
@@ -208,6 +209,7 @@
|
||||
[self stopAudioAnimation];
|
||||
}
|
||||
}
|
||||
QXLOG(@"在线状态%@",QXGlobal.shareGlobal.offLineDict);
|
||||
}
|
||||
-(void)speakInfo:(NSNotification*)notice{
|
||||
id object = notice.object;
|
||||
@@ -219,6 +221,7 @@
|
||||
if ((info.uid == self.pitModel.user_id.longLongValue)) {
|
||||
if (info.volume > 0) {
|
||||
self.offlineImageView.hidden = YES;
|
||||
[QXGlobal.shareGlobal.offLineDict setObject:[NSNumber numberWithBool:NO] forKey:[NSString stringWithFormat:@"%ld",info.uid]];
|
||||
[self startAudioAnimation];
|
||||
}else{
|
||||
[self stopAudioAnimation];
|
||||
@@ -358,8 +361,14 @@
|
||||
}else{
|
||||
self.lockImageView.hidden = YES;
|
||||
}
|
||||
|
||||
if (pitModel.user_id.longValue > 0) {
|
||||
self.noUserImageView.hidden = YES;
|
||||
BOOL is_offline = [[[QXGlobal shareGlobal].offLineDict objectForKey:pitModel.user_id?pitModel.user_id:@"0"] boolValue];
|
||||
if (is_offline) {
|
||||
self.offlineImageView.hidden = NO;
|
||||
}else{
|
||||
self.offlineImageView.hidden = YES;
|
||||
}
|
||||
self.numberLabel.hidden = YES;
|
||||
self.headerView.hidden = NO;
|
||||
self.nameLabel.hidden = NO;
|
||||
|
||||
@@ -198,6 +198,7 @@
|
||||
//
|
||||
self.helpBtn = [[UIButton alloc] init];
|
||||
[self.helpBtn setImage:[UIImage imageNamed:@"room_auction_help"] forState:(UIControlStateNormal)];
|
||||
[self.helpBtn addTarget:self action:@selector(helpAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.bgView addSubview:self.helpBtn];
|
||||
[self.helpBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(5);
|
||||
@@ -1047,6 +1048,20 @@
|
||||
[self.rankView showInView:self.viewController.view];
|
||||
}
|
||||
|
||||
-(void)helpAction{
|
||||
NSString *Id = @"";
|
||||
if ([self.roomModel.room_info.label_id isEqualToString:@"1"]) {
|
||||
/// 真爱
|
||||
Id = @"23";
|
||||
}else{
|
||||
/// 亲密
|
||||
Id = @"22";
|
||||
}
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",ServerUrl,Id];
|
||||
QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init];
|
||||
vc.urlStr = urlString;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)changeAuctionWithType:(UIButton*)sender{
|
||||
NSString *type = @"";
|
||||
@@ -1075,6 +1090,7 @@
|
||||
}
|
||||
|
||||
-(void)auctionTypeDidChanged:(NSString *)type{
|
||||
self.roomModel.room_info.label_id = type;
|
||||
if ([type isEqualToString:@"2"]) {
|
||||
self.realLoveBtn.selected = NO;
|
||||
self.intimacyBtn.selected = YES;
|
||||
|
||||
@@ -881,6 +881,29 @@
|
||||
self.myPitNumber = toPitNumber;
|
||||
}
|
||||
}
|
||||
/// 循环麦位视图数组
|
||||
for (UIView *view in self.allSeatViewArray) {
|
||||
/// 如果当前视图的类型为麦位视图
|
||||
if ([view isKindOfClass:[QXRoomSeatContentView class]]) {
|
||||
QXRoomSeatContentView *seatView = (QXRoomSeatContentView*)view;
|
||||
/// 如果换麦的用户id等于视图上当前绑定的用户id
|
||||
if ([userInfo.user_id isEqualToString:seatView.pitModel.user_id]) {
|
||||
/// 如果视图的麦位号不是目标麦位号 (为了处理后端推送异常是产生多个同一个用户)
|
||||
if (seatView.pitModel.pit_number.intValue != toPitNumber) {
|
||||
/// 置空麦位用户
|
||||
QXRoomPitModel *model = seatView.pitModel;
|
||||
model.user_id = @"0";
|
||||
model.avatar = @"";
|
||||
model.dress = @"";
|
||||
model.sex = @"";
|
||||
model.nickname = @"";
|
||||
model.user_code = @"";
|
||||
model.charm = @"";
|
||||
seatView.pitModel = model;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
|
||||
|
||||
@@ -1145,6 +1168,7 @@
|
||||
if ([model.room_id isExist]) {
|
||||
QXGlobal.shareGlobal.superRoomId = self.roomModel.room_info.room_id;
|
||||
if ([model.user1_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id] || [model.user2_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomModel.room_info.room_id];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.viewController.navigationController];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ static NSInteger maxSeat = 8;
|
||||
}
|
||||
}
|
||||
|
||||
-(void) didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
||||
if (pit_number > 10) {
|
||||
return;
|
||||
}
|
||||
@@ -379,6 +379,29 @@ static NSInteger maxSeat = 8;
|
||||
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
self.myPitNumber = toPitNumber;
|
||||
}
|
||||
/// 循环麦位视图数组
|
||||
for (UIView *view in self.seatArray) {
|
||||
/// 如果当前视图的类型为麦位视图
|
||||
if ([view isKindOfClass:[QXRoomSeatContentView class]]) {
|
||||
QXRoomSeatContentView *seatView = (QXRoomSeatContentView*)view;
|
||||
/// 如果换麦的用户id等于视图上当前绑定的用户id
|
||||
if ([userInfo.user_id isEqualToString:seatView.pitModel.user_id]) {
|
||||
/// 如果视图的麦位号不是目标麦位号 (为了处理后端推送异常是产生多个同一个用户)
|
||||
if (seatView.pitModel.pit_number.intValue != toPitNumber) {
|
||||
/// 置空麦位用户
|
||||
QXRoomPitModel *model = seatView.pitModel;
|
||||
model.user_id = @"0";
|
||||
model.avatar = @"";
|
||||
model.dress = @"";
|
||||
model.sex = @"";
|
||||
model.nickname = @"";
|
||||
model.user_code = @"";
|
||||
model.charm = @"";
|
||||
seatView.pitModel = model;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{
|
||||
|
||||
Reference in New Issue
Block a user