增加换肤功能
This commit is contained in:
874
QXLive/HomePage(声播)/View/房间/麦位视图/QXRoomSeatView.m
Normal file
874
QXLive/HomePage(声播)/View/房间/麦位视图/QXRoomSeatView.m
Normal file
@@ -0,0 +1,874 @@
|
||||
//
|
||||
// QXRoomSeatView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/7.
|
||||
//
|
||||
|
||||
#import "QXRoomSeatView.h"
|
||||
#import "QXRoomSeatTypeSongView.h"
|
||||
#import "QXRoomSeatTypeAuctionView.h"
|
||||
#import "QXAgoraEngine.h"
|
||||
#import "QXRoomOnlineUserListView.h"
|
||||
#import "QXRoomSeatTypeCabinView.h"
|
||||
#import "QXRoomSeatPKView.h"
|
||||
|
||||
@interface QXRoomSeatView()<QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)QXRoomSeatTypeNormalView *normalSeatView;
|
||||
@property (nonatomic,strong)QXRoomSeatTypeSongView *songView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatTypeAuctionView *auctionView;
|
||||
|
||||
@property (nonatomic,strong) QXRoomOnlineUserListView *onlineListView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatTypeCabinView *cabinView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatPKView *roomPkView;
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXRoomSeatView
|
||||
|
||||
- (instancetype)initWithType:(QXRoomSeatViewType)type
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_type = type;
|
||||
[self setType:type];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
//初始化普通视图
|
||||
-(void)initNomarlView{
|
||||
// if (_songView) {
|
||||
// [_songView removeFromSuperview];
|
||||
// _songView = nil;
|
||||
// }
|
||||
//
|
||||
if (_songView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
_songView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_songView destroyViews];
|
||||
[self->_songView removeFromSuperview];
|
||||
self->_songView = nil;
|
||||
[self addSubview:self.normalSeatView];
|
||||
[self.normalSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.normalSeatView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_auctionView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
_auctionView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_auctionView destroyViews];
|
||||
[self->_auctionView removeFromSuperview];
|
||||
self->_auctionView = nil;
|
||||
[self addSubview:self.normalSeatView];
|
||||
[self.normalSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.normalSeatView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_roomPkView) {
|
||||
_roomPkView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_roomPkView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_roomPkView destroyViews];
|
||||
[self->_roomPkView removeFromSuperview];
|
||||
self->_roomPkView = nil;
|
||||
[self addSubview:self.normalSeatView];
|
||||
[self.normalSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.normalSeatView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
[self addSubview:self.normalSeatView];
|
||||
[self.normalSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
//初始化拍卖视图
|
||||
-(void)initAuctionView{
|
||||
if (_normalSeatView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
_normalSeatView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_normalSeatView destroyViews];
|
||||
[self->_normalSeatView removeFromSuperview];
|
||||
self->_normalSeatView = nil;
|
||||
[self addSubview:self.auctionView];
|
||||
[self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.auctionView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_songView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
_songView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_songView destroyViews];
|
||||
[self->_songView removeFromSuperview];
|
||||
self->_songView = nil;
|
||||
[self addSubview:self.auctionView];
|
||||
[self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.auctionView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_roomPkView) {
|
||||
_roomPkView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_roomPkView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_roomPkView destroyViews];
|
||||
[self->_roomPkView removeFromSuperview];
|
||||
self->_roomPkView = nil;
|
||||
[self addSubview:self.auctionView];
|
||||
[self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.auctionView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
[self addSubview:self.auctionView];
|
||||
[self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
//初始化点唱
|
||||
-(void)initSingView{
|
||||
if (_normalSeatView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
_normalSeatView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_normalSeatView destroyViews];
|
||||
[self->_normalSeatView removeFromSuperview];
|
||||
self->_normalSeatView = nil;
|
||||
[self addSubview:self.songView];
|
||||
[self.songView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.songView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.songView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_auctionView) {
|
||||
_auctionView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_auctionView destroyViews];
|
||||
[self->_auctionView removeFromSuperview];
|
||||
self->_auctionView = nil;
|
||||
[self addSubview:self.songView];
|
||||
[self.songView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.songView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.songView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_roomPkView) {
|
||||
_roomPkView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_roomPkView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_roomPkView destroyViews];
|
||||
[self->_roomPkView removeFromSuperview];
|
||||
self->_roomPkView = nil;
|
||||
[self addSubview:self.songView];
|
||||
[self.songView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.songView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.songView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
[self addSubview:self.songView];
|
||||
[self.songView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initRoomPKView{
|
||||
if (_normalSeatView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
_normalSeatView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_normalSeatView destroyViews];
|
||||
[self->_normalSeatView removeFromSuperview];
|
||||
self->_normalSeatView = nil;
|
||||
[self addSubview:self.roomPkView];
|
||||
[self.roomPkView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.roomPkView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.roomPkView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_songView) {
|
||||
// [_normalSeatView removeFromSuperview];
|
||||
// _normalSeatView = nil;
|
||||
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
_songView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_songView destroyViews];
|
||||
[self->_songView removeFromSuperview];
|
||||
self->_songView = nil;
|
||||
[self addSubview:self.roomPkView];
|
||||
[self.roomPkView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.roomPkView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.roomPkView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
[self addSubview:self.roomPkView];
|
||||
[self.roomPkView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initCabinView{
|
||||
self.cabinView = [[QXRoomSeatTypeCabinView alloc] init];
|
||||
self.cabinView.delegate = self;
|
||||
[self addSubview:self.cabinView];
|
||||
[self.cabinView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)setMyPitNumber:(NSInteger)myPitNumber{
|
||||
_myPitNumber = myPitNumber;
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
self.normalSeatView.myPitNumber = myPitNumber;
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
self.songView.myPitNumber = myPitNumber;
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
self.auctionView.myPitNumber = myPitNumber;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
self.roomPkView.myPitNumber = myPitNumber;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setType:(QXRoomSeatViewType)type{
|
||||
_type = type;
|
||||
switch (type) {
|
||||
case QXRoomSeatViewTypeNone:{
|
||||
|
||||
}
|
||||
break;
|
||||
case QXRoomSeatViewTypeNormal:{
|
||||
[self initNomarlView];
|
||||
}
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:{
|
||||
[self initAuctionView];
|
||||
}
|
||||
break;
|
||||
|
||||
case QXRoomSeatViewTypeSing:{
|
||||
[self initSingView];
|
||||
}
|
||||
break;
|
||||
|
||||
case QXRoomSeatViewTypeCabin:{
|
||||
[self initCabinView];
|
||||
}
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:{
|
||||
[self initRoomPKView];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setLrcUrl:(NSString *)lrcUrl{
|
||||
if (_songView) {
|
||||
_lrcUrl = lrcUrl;
|
||||
self.songView.lrcUrl = lrcUrl;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setProgress:(NSUInteger)progress{
|
||||
if (_songView) {
|
||||
_progress = progress;
|
||||
self.songView.progress = progress;
|
||||
}
|
||||
}
|
||||
-(void)setSpeakerPitch:(double)speakerPitch{
|
||||
if (_songView) {
|
||||
_speakerPitch = speakerPitch;
|
||||
self.songView.speakerPitch = speakerPitch;
|
||||
}
|
||||
}
|
||||
-(void)setSongInfo:(QXSongListModel *)songInfo{
|
||||
if (_songView) {
|
||||
_songInfo = songInfo;
|
||||
self.songView.songInfo = songInfo;
|
||||
}
|
||||
|
||||
}
|
||||
-(void)setNextInfo:(QXSongListModel *)nextInfo{
|
||||
if (_songView) {
|
||||
_nextInfo = nextInfo;
|
||||
self.songView.nextInfo = nextInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)setRoomModel:(QXRoomModel *)roomModel{
|
||||
_roomModel = roomModel;
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
self.normalSeatView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
self.songView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
self.auctionView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
self.cabinView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
self.roomPkView.roomModel = roomModel;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)setPkRoomModel:(QXRoomModel *)pkRoomModel{
|
||||
_pkRoomModel = pkRoomModel;
|
||||
if (_roomPkView) {
|
||||
self.roomPkView.pkRoomModel = pkRoomModel;
|
||||
}
|
||||
}
|
||||
-(void)previewUserInfoWithUserId:(NSString *)userId{
|
||||
[self.onlineListView hide];
|
||||
_onlineListView = nil;
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
QXRoomOwnerModel *md = [QXRoomOwnerModel new];
|
||||
md.user_id = userId;
|
||||
[self.delegate didClickUserHeaderWithPitModel:nil userModel:md isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
[self.delegate didClickUserHeaderWithPitModel:pitModel userModel:userModel isPkRoom:isPkRoom pkRoomId:pkRoomId isNoTakeOff:isNoTakeOff];
|
||||
}
|
||||
}
|
||||
-(void)auctionGiftAction:(QXRoomPitModel *)user auctionId:(NSString *)auctionId{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(auctionGiftAction:auctionId:)]) {
|
||||
[self.delegate auctionGiftAction:user auctionId:auctionId];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)sendGiftWithUser:(QXRoomPitModel *)user{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(sendGiftWithUser:)]) {
|
||||
[self.delegate sendGiftWithUser:user];
|
||||
}
|
||||
}
|
||||
/// 拍卖类型发生变化
|
||||
-(void)auctionTypeDidChanged:(NSString *)type{
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionTypeDidChanged:type];
|
||||
return;
|
||||
}
|
||||
}
|
||||
-(void)cabinRoomHotValueDidChanged:(NSString *)hot_value{
|
||||
if (_cabinView) {
|
||||
[self.cabinView cabinRoomHotValueDidChanged:hot_value];
|
||||
}
|
||||
}
|
||||
-(void)clearCharm{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView clearCharm];
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
[self.songView clearCharm];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView clearCharm];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView setSeatCharmWithUser:model];
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
[self.songView setSeatCharmWithUser:model];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
[self.auctionView setSeatCharmWithUser:model];
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
// self.cabinView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView setSeatCharmWithUser:model];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView setSeatIsLock:isLock pitNumber:pitNumber];
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
// [self.songView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
// [self.auctionView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
// self.cabinView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView setSeatIsLock:isLock pitNumber:pitNumber];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)pkStartWithPkEndTimes:(NSString *)pk_end_times pk_id:(NSString*)pk_id{
|
||||
if (_roomPkView) {
|
||||
[self.roomPkView pkStartWithPkEndTimes:pk_end_times pk_id:pk_id];
|
||||
}
|
||||
}
|
||||
-(void)roomPKValueDidChangedWithRoomIdA:(NSString*)room_id_a create_value_a:(NSString*)create_value_a room_id_b:(NSString*)room_id_b receive_value_b:(NSString*)receive_value_b{
|
||||
if (_roomPkView) {
|
||||
[self.roomPkView roomPKValueDidChangedWithRoomIdA:room_id_a create_value_a:create_value_a room_id_b:room_id_b receive_value_b:receive_value_b];
|
||||
}
|
||||
}
|
||||
/// pk结果
|
||||
-(void)pkResultWithIsVictory:(NSInteger)isVictory
|
||||
end_time:(NSString*)end_time
|
||||
victory_name:(NSString*)victory_name
|
||||
victory_cover:(NSString*)victory_cover
|
||||
defeated_name:(NSString*)defeated_name
|
||||
defeated_cover:(NSString*)defeated_cover{
|
||||
if (_roomPkView) {
|
||||
[self.roomPkView pkResultWithIsVictory:isVictory end_time:end_time victory_name:victory_name victory_cover:victory_cover defeated_name:defeated_name defeated_cover:defeated_cover];
|
||||
}
|
||||
}
|
||||
|
||||
-(QXRoomSeatTypeNormalView *)normalSeatView{
|
||||
if (!_normalSeatView) {
|
||||
_normalSeatView = [[QXRoomSeatTypeNormalView alloc] init];
|
||||
_normalSeatView.delegate = self;
|
||||
}
|
||||
return _normalSeatView;
|
||||
}
|
||||
|
||||
-(QXRoomSeatTypeSongView *)songView{
|
||||
if (!_songView) {
|
||||
_songView = [[QXRoomSeatTypeSongView alloc] init];
|
||||
_songView.delegate = self;
|
||||
}
|
||||
return _songView;
|
||||
}
|
||||
|
||||
-(UIView*)getCurrentSeatView{
|
||||
if (_normalSeatView) {
|
||||
return _normalSeatView;
|
||||
}
|
||||
if (_songView) {
|
||||
return _songView;
|
||||
}
|
||||
if (_auctionView) {
|
||||
return _auctionView;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(void)didHugSeatWithPitNumber:(NSString *)pitNumber{
|
||||
[self showOnlineListWithPitNumber:pitNumber];
|
||||
}
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
[self.songView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
[self.auctionView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
// self.cabinView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)didAuctiontUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat{
|
||||
if (_auctionView) {
|
||||
[self.auctionView didAuctiontUpDownSeatWithUser:user isUpSeat:isUpSeat];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)auctionStartOrEndIsStart:(BOOL)isStart user:(QXRoomAuctionUser *)user getUser:(QXRoomAuctionUser *)getUser{
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionStartOrEndIsStart:isStart user:user getUser:getUser];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)auctionListDidChanged:(NSArray<QXRoomPitModel *> *)list{
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionListDidChanged:list];
|
||||
}
|
||||
}
|
||||
-(void)auctionDelayTimeWithEndTime:(NSString *)endTime{
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionDelayTimeWithEndTime:endTime];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)songRoomCharmRankListDidChanged:(NSArray<QXRoomPitModel *> *)list{
|
||||
if (_songView) {
|
||||
[self.songView songRoomCharmRankListDidChanged:list];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)showOnlineListWithPitNumber:(NSString*)pitNumber{
|
||||
self.onlineListView.isHugSeat = YES;
|
||||
self.onlineListView.pitNumber = pitNumber;
|
||||
self.onlineListView.roomId = self.roomModel.room_info.room_id;
|
||||
[self.onlineListView showInView:self.viewController.view];
|
||||
}
|
||||
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{
|
||||
// if (_normalSeatView) {
|
||||
// [self.normalSeatView roomUserInfoDidChanged:user];
|
||||
// return;
|
||||
// }
|
||||
// if (_songView) {
|
||||
// [self.songView roomUserInfoDidChanged:user];
|
||||
// return;
|
||||
// }
|
||||
// if (_auctionView) {
|
||||
// [self.auctionView roomUserInfoDidChanged:user];
|
||||
// return;
|
||||
// }
|
||||
// if (_roomPkView) {
|
||||
// [self.roomPkView roomUserInfoDidChanged:user];
|
||||
// return;
|
||||
// }
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView roomUserInfoDidChanged:user];
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
[self.songView roomUserInfoDidChanged:user];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
[self.auctionView roomUserInfoDidChanged:user];
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
// self.cabinView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView roomUserInfoDidChanged:user];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)destroyViews{
|
||||
if (_normalSeatView) {
|
||||
[self.normalSeatView destroyViews];
|
||||
}
|
||||
if (_songView) {
|
||||
[self.songView destroyViews];
|
||||
}
|
||||
if (_auctionView) {
|
||||
[self.auctionView destroyViews];
|
||||
}
|
||||
if (_roomPkView) {
|
||||
[self.roomPkView destroyViews];
|
||||
}
|
||||
}
|
||||
|
||||
-(QXRoomOnlineUserListView *)onlineListView{
|
||||
if (!_onlineListView) {
|
||||
_onlineListView = [[QXRoomOnlineUserListView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
_onlineListView.delegate = self;
|
||||
}
|
||||
return _onlineListView;
|
||||
}
|
||||
|
||||
-(QXRoomSeatTypeAuctionView *)auctionView{
|
||||
if (!_auctionView) {
|
||||
_auctionView = [[QXRoomSeatTypeAuctionView alloc] init];
|
||||
_auctionView.delegate = self;
|
||||
}
|
||||
return _auctionView;
|
||||
}
|
||||
-(QXRoomSeatPKView *)roomPkView{
|
||||
if (!_roomPkView) {
|
||||
_roomPkView = [[QXRoomSeatPKView alloc] init];
|
||||
_roomPkView.delegate = self;
|
||||
}
|
||||
return _roomPkView;
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user