优化提交
This commit is contained in:
@@ -81,6 +81,14 @@
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *rCell = (QXHomeRoomCell *)cell;
|
||||
[rCell startAnimating];
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *rCell = (QXHomeRoomCell *)cell;
|
||||
[rCell endAnimating];
|
||||
}
|
||||
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return CGSizeMake((SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0);
|
||||
|
||||
@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeViewController : QXBaseViewController
|
||||
-(void)giftScrollViewShowWithModel:(QXGiftScrollModel*)model;
|
||||
-(void)giftScrollViewShowWithModelList:(NSArray<QXGiftScrollModel*>*)list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -252,6 +252,17 @@
|
||||
self.giftScrollView.model = model;
|
||||
self.isShowGiftScrollView = YES;
|
||||
}
|
||||
-(void)giftScrollViewShowWithModelList:(NSArray<QXGiftScrollModel*>*)list{
|
||||
if (self.isShowGiftScrollView == NO) {
|
||||
self.bannerScrollView.top = self.giftScrollView.bottom+12;
|
||||
self.headerView.height += 12+self.giftScrollView.height;
|
||||
[self.headerView addSubview:self.giftScrollView];
|
||||
[self.pagingView resizeTableHeaderViewHeightWithAnimatable:YES duration:0.1 curve:UIViewAnimationCurveLinear];
|
||||
}
|
||||
++self.page;
|
||||
self.giftScrollView.list = list;
|
||||
self.isShowGiftScrollView = YES;
|
||||
}
|
||||
-(void)didClickGiftScrollView:(QXGiftScrollView *)giftScrollView index:(NSInteger)index model:(QXGiftScrollModel *)model{
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.roomId isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 是否为最小化房间进来
|
||||
@property (nonatomic,assign)BOOL isReJoin;
|
||||
|
||||
|
||||
@property (nonatomic,strong)QXRoomModel* roomModel;
|
||||
/// 麦位视图
|
||||
@property (nonatomic,strong)QXRoomSeatView *seatContentView;
|
||||
/// 聊天列表
|
||||
|
||||
@@ -51,7 +51,6 @@ QXRoomUserInfoViewDelegate
|
||||
/// 排麦按钮
|
||||
@property (nonatomic,strong)QXUpSeatCountView *micTeamView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomModel* roomModel;
|
||||
/// 礼物特效
|
||||
@property (nonatomic,strong)UIView *bgEffectView;
|
||||
/// 设置
|
||||
@@ -84,7 +83,6 @@ QXRoomUserInfoViewDelegate
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
@@ -107,8 +105,7 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
-(void)viewDidDisappear:(BOOL)animated{
|
||||
[super viewDidDisappear:animated];
|
||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||
[[QXGiftPlayerManager shareManager] stopPlay];
|
||||
// [[QXGiftPlayerManager shareManager] stopPlay];
|
||||
self.continuousView.hidden = YES;
|
||||
}
|
||||
|
||||
@@ -218,27 +215,14 @@ QXRoomUserInfoViewDelegate
|
||||
BOOL isClose = [[NSUserDefaults standardUserDefaults] boolForKey:kEffectsCLose];
|
||||
[[QXGiftPlayerManager shareManager] openOrCloseEffectViewWith:!isClose];
|
||||
}
|
||||
#pragma mark - 获取房间信息
|
||||
-(void)joinRoom{
|
||||
-(void)setRoomModel:(QXRoomModel *)roomModel{
|
||||
_roomModel = roomModel;
|
||||
}
|
||||
-(void)setRoomId:(NSString *)roomId{
|
||||
_roomId = roomId;
|
||||
[self.chatListView insertNoitce];
|
||||
[[QXRoomMessageManager shared] joinGroupWithRoomId:self.roomId];
|
||||
MJWeakSelf
|
||||
[QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
// roomModel.room_info.pk_room_id = @"33";
|
||||
weakSelf.roomModel = roomModel;
|
||||
[weakSelf resetSubviews];
|
||||
[weakSelf configRoomDataIsJoin:YES];
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
}];
|
||||
|
||||
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
||||
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
||||
[arr addObjectsFromArray:offPitList];
|
||||
@@ -246,6 +230,27 @@ QXRoomUserInfoViewDelegate
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - 获取房间信息
|
||||
-(void)joinRoom{
|
||||
|
||||
[self resetSubviews];
|
||||
[self configRoomDataIsJoin:YES];
|
||||
// [QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
//// roomModel.room_info.pk_room_id = @"33";
|
||||
//
|
||||
//
|
||||
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
// showToast(msg);
|
||||
// [[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// [weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
// });
|
||||
//
|
||||
// }];
|
||||
|
||||
|
||||
|
||||
}
|
||||
-(void)getUserOnlineStatusWithUserIds:(NSString*)userIds{
|
||||
[QXMineNetwork roomUserOnlineStatusWithUserIds:userIds roomId:self.roomId successBlock:^(NSArray<QXUserModel *> * _Nonnull list) {
|
||||
@@ -283,7 +288,7 @@ QXRoomUserInfoViewDelegate
|
||||
}else{
|
||||
self.roomBgImageView.image = [UIImage imageNamed:@"cp_room_bg"];
|
||||
}
|
||||
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) {
|
||||
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) {
|
||||
// 点唱房
|
||||
if (self.roomModel.room_info.label_id.intValue == 1) {
|
||||
|
||||
@@ -414,7 +419,7 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
}
|
||||
self.seatContentView.roomModel = self.roomModel;
|
||||
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.label_id.intValue == 2){
|
||||
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){
|
||||
/// k歌房没有背景音乐
|
||||
[QXAgoraEngine sharedEngine].isPlayBgMusic = NO;
|
||||
}else{
|
||||
@@ -439,7 +444,7 @@ QXRoomUserInfoViewDelegate
|
||||
if (isJoin) {
|
||||
MJWeakSelf
|
||||
[[QXAgoraEngine sharedEngine] joinChannel:self.roomId withRoom:self agora_token:self.roomModel.user_info.agora_token agora_rtm_token:self.roomModel.user_info.agora_rtm_token isUpSeat:self.seatContentView.myPitNumber>0 successBock:^{
|
||||
if (weakSelf.roomModel.song_user_info && (weakSelf.roomModel.room_info.type_id.intValue == 1 || weakSelf.roomModel.room_info.type_id.intValue == 3 || weakSelf.roomModel.room_info.type_id.intValue == 4) && weakSelf.roomModel.room_info.label_id.intValue == 2) {
|
||||
if (weakSelf.roomModel.song_user_info && (weakSelf.roomModel.room_info.type_id.intValue == 1 || weakSelf.roomModel.room_info.type_id.intValue == 3 || weakSelf.roomModel.room_info.type_id.intValue == 4 || weakSelf.roomModel.room_info.type_id.intValue == 8) && weakSelf.roomModel.room_info.label_id.intValue == 2) {
|
||||
if ([weakSelf.roomModel.song_user_info.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
// [[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
// [[QXAgoraEngine sharedEngine] ktv_StartSing:YES withSong:weakSelf.roomModel.song_user_info];
|
||||
@@ -477,7 +482,7 @@ QXRoomUserInfoViewDelegate
|
||||
}];
|
||||
|
||||
}else{
|
||||
if (self.roomModel.song_user_info && (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.label_id.intValue == 2) {
|
||||
if (self.roomModel.song_user_info && (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) {
|
||||
if ([self.roomModel.song_user_info.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
self.seatContentView.songInfo = self.roomModel.song_user_info;
|
||||
self.seatContentView.nextInfo = self.roomModel.nextInfo;
|
||||
@@ -491,7 +496,7 @@ QXRoomUserInfoViewDelegate
|
||||
[QXAgoraEngine sharedEngine].delegate = self;
|
||||
|
||||
|
||||
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) {
|
||||
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) {
|
||||
// 点唱房
|
||||
if (self.roomModel.room_info.label_id.intValue == 1) {
|
||||
if (self.roomModel.pk_info.pk_id.intValue>0) {
|
||||
@@ -534,11 +539,11 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
self.bottomView.roomModel = self.roomModel;
|
||||
BOOL hasPK = NO;
|
||||
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.label_id.intValue == 1) {
|
||||
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 == 1) {
|
||||
hasPK = YES;
|
||||
}
|
||||
BOOL hasSong = NO;
|
||||
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){
|
||||
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){
|
||||
hasSong = YES;
|
||||
}
|
||||
/// 暂时不要pk
|
||||
@@ -634,7 +639,7 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
// 演唱者歌曲播放回调
|
||||
-(void)rtcEngineSongProgress:(NSUInteger)progress{
|
||||
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.label_id.intValue == 2) {
|
||||
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) {
|
||||
self.seatContentView.progress = progress;
|
||||
}else{
|
||||
self.musicView.progress = progress;
|
||||
@@ -782,6 +787,9 @@ QXRoomUserInfoViewDelegate
|
||||
-(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)userInfo{
|
||||
[self.seatContentView setSeatCharmWithUser:userInfo];
|
||||
}
|
||||
-(void)didRecieveGiftWithWithUserInfos:(NSArray<QXUserHomeModel *> *)userInfos{
|
||||
[self.seatContentView setSeatCharmWithUsers:userInfos];
|
||||
}
|
||||
/// 拍卖者上麦
|
||||
-(void)auctionUpSeatWithUserInfo:(QXUserHomeModel *)userInfo isUpSeat:(BOOL)isUpSeat{
|
||||
[self.seatContentView didAuctiontUpDownSeatWithUser:userInfo isUpSeat:isUpSeat];
|
||||
@@ -1065,6 +1073,7 @@ QXRoomUserInfoViewDelegate
|
||||
-(void)recieveHeadline:(QXHeadLineModel *)headline{
|
||||
if (_headlineView) {
|
||||
self.headlineView.model = headline;
|
||||
[self.view addSubview:self.headlineView];
|
||||
}else{
|
||||
self.headlineView.model = headline;
|
||||
[self.view addSubview:self.headlineView];
|
||||
@@ -1083,7 +1092,7 @@ QXRoomUserInfoViewDelegate
|
||||
case QXRoomBottomViewEventTypeMuteAudio:{
|
||||
if (!isSelected) {
|
||||
/// 静音时麦圈停止
|
||||
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.label_id.intValue == 1) {
|
||||
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 == 1) {
|
||||
// QXRoomSeatContentView *seatContentView = self.seatContentView.normalSeatView.mySeatView;
|
||||
// if (seatContentView.isSeatSpeaking) {
|
||||
// [seatContentView stopAudioAnimation];
|
||||
@@ -1164,7 +1173,7 @@ QXRoomUserInfoViewDelegate
|
||||
|
||||
break;
|
||||
case QXRoomBottomViewEventTypeMusic:{
|
||||
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.label_id.intValue == 1){
|
||||
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 == 1){
|
||||
MJWeakSelf
|
||||
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
||||
al.type = QXAlertViewTypeApplySong;
|
||||
@@ -1198,14 +1207,17 @@ QXRoomUserInfoViewDelegate
|
||||
if (self.roomModel.room_info.pit_list.count == 10) {
|
||||
QXRoomPitModel *md = self.roomModel.room_info.pit_list[8];
|
||||
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
||||
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
||||
lastMd.isSelected = NO;
|
||||
[pitArr addObject:lastMd];
|
||||
}
|
||||
}else{
|
||||
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
||||
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
||||
lastMd.isSelected = NO;
|
||||
[pitArr addObject:lastMd];
|
||||
}
|
||||
}
|
||||
@@ -1261,6 +1273,7 @@ QXRoomUserInfoViewDelegate
|
||||
md.user_id = self.roomModel.song_user_info.user_id;
|
||||
md.avatar = self.roomModel.song_user_info.avatar;
|
||||
md.pit_number = @"9999";
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
@@ -1270,6 +1283,7 @@ QXRoomUserInfoViewDelegate
|
||||
continue;
|
||||
}
|
||||
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
@@ -1282,6 +1296,7 @@ QXRoomUserInfoViewDelegate
|
||||
md.user_id = self.roomModel.room_auction.auction_user.user_id;
|
||||
md.avatar = self.roomModel.room_auction.auction_user.avatar;
|
||||
md.pit_number = @"9999";
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
if (self.roomModel.room_auction.auction_list.count > 0) {
|
||||
@@ -1290,6 +1305,7 @@ QXRoomUserInfoViewDelegate
|
||||
continue;
|
||||
}
|
||||
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
[self addSubview:self.closeBtn];
|
||||
}
|
||||
-(void)show{
|
||||
[KEYWINDOW.rootViewController.view addSubview:self];
|
||||
[UIApplication.sharedApplication.keyWindow.rootViewController.view addSubview:self];
|
||||
}
|
||||
|
||||
-(void)setRoomCoverImage:(NSString *)roomCoverImage{
|
||||
|
||||
@@ -74,6 +74,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
@property (nonatomic,strong)QXUserHomeModel* FromUserInfo;
|
||||
@property (nonatomic,strong)QXUserHomeModel* ToUserInfo;
|
||||
|
||||
@property (nonatomic,strong)NSArray<QXUserHomeModel* >* ToUserInfos;
|
||||
|
||||
/// 当前音乐
|
||||
@property (nonatomic,strong)QXSongListModel* songInfo;
|
||||
/// 下一首音乐
|
||||
|
||||
@@ -346,7 +346,18 @@ NSInteger maxMessageCount = 20;
|
||||
|
||||
-(void)setMessage:(QXRoomChatListModel *)message{
|
||||
_message = message;
|
||||
self.titleLabel.text = message.text;
|
||||
// self.titleLabel.text = message.text;
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
||||
if ([message.FromUserInfo.nickname isExist]) {
|
||||
[attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
||||
}
|
||||
if ([message.ToUserInfo.nickname isExist]) {
|
||||
[attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.ToUserInfo.nickname]];
|
||||
}
|
||||
if ([message.GiftInfo.gift_name isExist]) {
|
||||
[attr yy_setColor:RGB16(0x00C8FF) range:[message.text rangeOfString:message.GiftInfo.gift_name]];
|
||||
}
|
||||
self.titleLabel.attributedText = attr;
|
||||
self.nameLabel.text = message.FromUserInfo.nickname;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:message.FromUserInfo.avatar]];
|
||||
self.iconBgView.hidden = YES;
|
||||
@@ -416,7 +427,7 @@ NSInteger maxMessageCount = 20;
|
||||
// UIImage *image = [UIImage imageWithContentsOfFile:path];
|
||||
// image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(20, 40, 20 , 40) resizingMode:(UIImageResizingModeStretch)];
|
||||
// self.bubbleImageView.image = image;
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0x000000, 0.4);
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0xFFFFFF, 0.2);
|
||||
|
||||
|
||||
|
||||
@@ -466,7 +477,7 @@ NSInteger maxMessageCount = 20;
|
||||
if (!self.message.havBubble) {
|
||||
[self.bubbleImageView sd_cancelLatestImageLoad];
|
||||
self.bubbleImageView.image = nil;
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0x000000, 0.4);
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0xFFFFFF, 0.2);
|
||||
[self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.titleLabel).offset(-8);
|
||||
make.top.equalTo(self.titleLabel).offset(-6);
|
||||
@@ -525,7 +536,7 @@ NSInteger maxMessageCount = 20;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)headerAction{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
|
||||
@@ -535,7 +546,18 @@ NSInteger maxMessageCount = 20;
|
||||
|
||||
-(void)setMessage:(QXRoomChatListModel *)message{
|
||||
_message = message;
|
||||
self.titleLabel.text = message.text;
|
||||
// self.titleLabel.text = message.text;
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
||||
if ([message.FromUserInfo.nickname isExist]) {
|
||||
[attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
||||
}
|
||||
if ([message.ToUserInfo.nickname isExist]) {
|
||||
[attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.ToUserInfo.nickname]];
|
||||
}
|
||||
if ([message.GiftInfo.gift_name isExist]) {
|
||||
[attr yy_setColor:RGB16(0x00C8FF) range:[message.text rangeOfString:message.GiftInfo.gift_name]];
|
||||
}
|
||||
self.titleLabel.attributedText = attr;
|
||||
self.nameLabel.text = message.FromUserInfo.nickname;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:message.FromUserInfo.avatar]];
|
||||
self.iconBgView.hidden = YES;
|
||||
@@ -604,7 +626,7 @@ NSInteger maxMessageCount = 20;
|
||||
// UIImage *image = [UIImage imageWithContentsOfFile:path];
|
||||
// image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(20, 40, 20 , 40) resizingMode:(UIImageResizingModeStretch)];
|
||||
// self.bubbleImageView.image = image;
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0x000000, 0.4);
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0xFFFFFF, 0.2);
|
||||
|
||||
|
||||
|
||||
@@ -654,7 +676,7 @@ NSInteger maxMessageCount = 20;
|
||||
if (!self.message.havBubble) {
|
||||
[self.bubbleImageView sd_cancelLatestImageLoad];
|
||||
self.bubbleImageView.image = nil;
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0x000000, 0.4);
|
||||
self.bubbleImageView.backgroundColor = RGB16A(0xFFFFFF, 0.2);
|
||||
[self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.titleLabel).offset(-8);
|
||||
make.top.equalTo(self.titleLabel).offset(-6);
|
||||
@@ -718,12 +740,32 @@ NSInteger maxMessageCount = 20;
|
||||
|
||||
-(void)setMessage:(QXRoomChatListModel *)message{
|
||||
_message = message;
|
||||
self.titleLabel.text = message.text;
|
||||
// NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
||||
// if ([message.FromUserInfo.nickname isExist]) {
|
||||
// [attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
||||
// }
|
||||
// if ([message.ToUserInfo.nickname isExist]) {
|
||||
// [attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.ToUserInfo.nickname]];
|
||||
// }
|
||||
//// self.titleLabel.text = message.text;
|
||||
// self.titleLabel.attributedText = attr;
|
||||
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
||||
if ([message.FromUserInfo.nickname isExist]) {
|
||||
[attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.FromUserInfo.nickname]];
|
||||
}
|
||||
if ([message.ToUserInfo.nickname isExist]) {
|
||||
[attr yy_setColor:RGB16(0xFFE309) range:[message.text rangeOfString:message.ToUserInfo.nickname]];
|
||||
}
|
||||
if ([message.GiftInfo.gift_name isExist]) {
|
||||
[attr yy_setColor:RGB16(0x00C8FF) range:[message.text rangeOfString:message.GiftInfo.gift_name]];
|
||||
}
|
||||
self.titleLabel.attributedText = attr;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.bgView = [[UIView alloc] init];
|
||||
self.bgView.backgroundColor = RGB16A(0x000000, 0.4);
|
||||
self.bgView.backgroundColor = RGB16A(0xFFFFFF, 0.2);
|
||||
[self.bgView addRoundedCornersWithRadius:6];
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -734,8 +776,8 @@ NSInteger maxMessageCount = 20;
|
||||
}];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.textColor = RGB16(0XD1A9FE);
|
||||
// self.titleLabel.textColor = QXConfig.themeColor;
|
||||
// self.titleLabel.textColor = RGB16(0XD1A9FE);
|
||||
self.titleLabel.textColor = UIColor.whiteColor;
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.titleLabel.numberOfLines = 0;
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
@@ -756,6 +798,8 @@ NSInteger maxMessageCount = 20;
|
||||
@"FromUserInfo":@"QXUserHomeModel",
|
||||
@"nextInfo":@"QXSongListModel",
|
||||
@"songInfo":@"QXSongListModel",
|
||||
@"ToUserInfo":@"QXUserHomeModel",
|
||||
@"ToUserInfos":@"QXUserHomeModel",
|
||||
@"friend_user":@"QXRoomFriendRelationModel"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,10 +33,11 @@
|
||||
self.endBtn.hidden = YES;
|
||||
}else{
|
||||
if (self.isCompere) {
|
||||
self.endBtn.hidden = YES;
|
||||
self.endBtn.hidden = NO;
|
||||
[self.endBtn setTitle:isSearch?QXText(@"点歌"):QXText(@"置顶") forState:(UIControlStateNormal)];
|
||||
}else{
|
||||
self.endBtn.hidden = YES;
|
||||
self.upBtn.hidden = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
self.nameLabel.text = model.nickname;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.scaleLabel.text = [NSString stringWithFormat:@"%.2f%%",model.ratio.doubleValue];
|
||||
self.priceLabel.text = [NSString stringWithFormat:@"%.4f%%",model.earnings.doubleValue];
|
||||
self.priceLabel.text = [NSString stringWithFormat:@"%.4f",model.earnings.doubleValue];
|
||||
}
|
||||
- (IBAction)setScaleAction:(id)sender {
|
||||
QXDirectSetScaleView *scaleView = [[QXDirectSetScaleView alloc] init];
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "QXHeadlineView.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXTimer.h"
|
||||
|
||||
@interface QXHeadlineView()
|
||||
|
||||
@@ -23,6 +24,9 @@
|
||||
@property (nonatomic,strong)UIButton *trampleBtn;
|
||||
@property (nonatomic,strong)UIButton *closeBtn;
|
||||
@property (nonatomic,assign)BOOL isSmall;
|
||||
@property (nonatomic,assign)long startTime;
|
||||
|
||||
@property (nonatomic,strong)QXTimer *timer;
|
||||
@end
|
||||
|
||||
@implementation QXHeadlineView
|
||||
@@ -166,6 +170,7 @@
|
||||
self.nameLabel.text = model.nickname;
|
||||
[self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.contentLabel.text = model.content;
|
||||
[self startTimer];
|
||||
if (self.isSmall) {
|
||||
[UIView animateWithDuration:0.15 animations:^{
|
||||
// self.headLineBgView.width = self.width-self.iconImageView.right-6;
|
||||
@@ -178,8 +183,34 @@
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)startTimer{
|
||||
MJWeakSelf
|
||||
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
|
||||
// 将秒转换为毫秒
|
||||
long long milliseconds = (long long)(timeInterval);
|
||||
self.startTime = self.model.end_time.longLongValue - milliseconds;
|
||||
if (self.startTime <= 0) {
|
||||
//时间错误不进行倒计时
|
||||
[self removeFromSuperview];
|
||||
return;
|
||||
}
|
||||
[self stopTimer];
|
||||
_timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
weakSelf.startTime--;
|
||||
if (weakSelf.startTime<=0) {
|
||||
[weakSelf stopTimer];
|
||||
[weakSelf removeFromSuperview];
|
||||
}
|
||||
});
|
||||
}];
|
||||
}
|
||||
-(void)stopTimer{
|
||||
if (_timer) {
|
||||
[self->_timer invalidate];
|
||||
self->_timer= nil;
|
||||
}
|
||||
}
|
||||
-(void)handlePan:(UIPanGestureRecognizer*)recognizer{
|
||||
if (recognizer.state == UIGestureRecognizerStateEnded) {
|
||||
NSLog(@"拖动结束");
|
||||
|
||||
@@ -20,6 +20,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
QXRoomSettingTypeRoomTypeGirl = 13,
|
||||
/// 交友房
|
||||
QXRoomSettingTypeRoomTypeFriend = 14,
|
||||
/// 互娱
|
||||
QXRoomSettingTypeRoomTypeFunny = 100,
|
||||
|
||||
/// 常用工具
|
||||
/// 房间补贴
|
||||
|
||||
@@ -34,8 +34,11 @@
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeBoy;
|
||||
/// 女神房
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeGirl;
|
||||
/// 交友房
|
||||
/// 交友房 以前的交友换成互娱
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeFriend;
|
||||
/// 互娱 曾经的男神女神合并为交友
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeFunny;
|
||||
|
||||
|
||||
/// 常用工具
|
||||
/// 房间补贴
|
||||
@@ -178,14 +181,16 @@
|
||||
// }else{
|
||||
// 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.label_id.intValue == 2) {
|
||||
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];
|
||||
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];
|
||||
// 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.roomReport];
|
||||
}else{
|
||||
toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
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];
|
||||
// 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.roomReport];
|
||||
}
|
||||
@@ -208,13 +213,14 @@
|
||||
// }else{
|
||||
// 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.label_id.intValue == 2) {
|
||||
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];
|
||||
}else{
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
}
|
||||
|
||||
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];
|
||||
// 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.roomReport];
|
||||
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
|
||||
@@ -227,12 +233,13 @@
|
||||
// }else{
|
||||
// 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.label_id.intValue == 2) {
|
||||
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];
|
||||
}else{
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
}
|
||||
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];
|
||||
// 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.roomReport];
|
||||
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
|
||||
@@ -315,7 +322,7 @@
|
||||
// [self.welcomeView showInView:self.viewController.view];
|
||||
return;
|
||||
}
|
||||
if (model.type == QXRoomSettingTypeRoomTypeAuction || model.type == QXRoomSettingTypeRoomTypeSing || model.type == QXRoomSettingTypeRoomTypeBoy || model.type == QXRoomSettingTypeRoomTypeGirl || model.type == QXRoomSettingTypeRoomTypeFriend) {
|
||||
if (model.type == QXRoomSettingTypeRoomTypeAuction || model.type == QXRoomSettingTypeRoomTypeSing || model.type == QXRoomSettingTypeRoomTypeBoy || model.type == QXRoomSettingTypeRoomTypeGirl || model.type == QXRoomSettingTypeRoomTypeFriend || model.type == QXRoomSettingTypeRoomTypeFunny) {
|
||||
self.alertView.message = [NSString stringWithFormat:@"您确定要修改为%@房吗?",model.name];
|
||||
[[QXGlobal shareGlobal] showView:self.alertView controller:self.viewController popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
@@ -343,6 +350,8 @@
|
||||
type = @"4";
|
||||
}else if (roomType == QXRoomSettingTypeRoomTypeFriend) {
|
||||
type = @"7";
|
||||
}else if (roomType == QXRoomSettingTypeRoomTypeFunny) {
|
||||
type = @"8";
|
||||
}
|
||||
[QXMineNetwork changeRoomTypeWithRoomId:self.roomModel.room_info.room_id type:type successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
@@ -407,13 +416,21 @@
|
||||
-(QXRoomSettingModel *)roomTypeFriend{
|
||||
if (!_roomTypeFriend) {
|
||||
_roomTypeFriend = [[QXRoomSettingModel alloc] init];
|
||||
_roomTypeFriend.name = QXText(@"交友");
|
||||
_roomTypeFriend.name = QXText(@"互娱");
|
||||
_roomTypeFriend.type = QXRoomSettingTypeRoomTypeFriend;
|
||||
_roomTypeFriend.icon = @"room_set_room_type_friend";
|
||||
}
|
||||
return _roomTypeFriend;
|
||||
}
|
||||
|
||||
-(QXRoomSettingModel *)roomTypeFunny{
|
||||
if (!_roomReport) {
|
||||
_roomReport = [[QXRoomSettingModel alloc] init];
|
||||
_roomReport.name = QXText(@"交友");
|
||||
_roomReport.type = QXRoomSettingTypeRoomTypeFunny;
|
||||
_roomReport.icon = @"room_set_room_type_funny";
|
||||
}
|
||||
return _roomReport;
|
||||
}
|
||||
-(QXRoomSettingModel *)roomSubsidy{
|
||||
if (!_roomSubsidy) {
|
||||
_roomSubsidy = [[QXRoomSettingModel alloc] init];
|
||||
|
||||
@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 设置多人魅力
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel*>*)users;
|
||||
/// 设置麦位锁麦状态
|
||||
-(void)setSeatIsLock:(NSString*)isLock pitNumber:(NSString*)pitNumber;
|
||||
/// 房间内换麦
|
||||
|
||||
@@ -306,6 +306,9 @@
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
|
||||
[self.leftSeatView setSeatCharmWithUser:model];
|
||||
}
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel *> *)users{
|
||||
[self.leftSeatView setSeatCharmWithUsers:users];
|
||||
}
|
||||
|
||||
-(void)startAction{
|
||||
self.timeSetView.pkId = self.roomModel.pk_info.pk_id;
|
||||
|
||||
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)auctionTypeDidChanged:(NSString *)type;
|
||||
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 设置多人魅力
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel*>*)users;
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
|
||||
@@ -867,6 +867,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel *> *)users{
|
||||
for (QXUserHomeModel*model in users) {
|
||||
[self setSeatCharmWithUser:model];
|
||||
}
|
||||
}
|
||||
-(void)clearCharm{
|
||||
for (int i = 0; i < self.roomModel.room_auction.auction_list.count; i++) {
|
||||
if (i < 6) {
|
||||
|
||||
@@ -341,11 +341,9 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
na.viewControllers = viewControllers;
|
||||
[na popViewControllerAnimated:YES];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
});
|
||||
QXGlobal.shareGlobal.superRoomId = @"";
|
||||
}else{
|
||||
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomModel.room_info.room_id];
|
||||
|
||||
@@ -49,6 +49,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
|
||||
/// 设置多人魅力
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel*>*)users;
|
||||
/// 用户信息发生改变
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
|
||||
/// 房间内换麦
|
||||
|
||||
@@ -1116,6 +1116,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel *> *)users{
|
||||
for (QXUserHomeModel*model in users) {
|
||||
[self setSeatCharmWithUser:model];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{
|
||||
for (id object in self.allSeatViewArray) {
|
||||
|
||||
@@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 设置多人魅力
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel*>*)users;
|
||||
/// 设置麦位锁麦状态
|
||||
-(void)setSeatIsLock:(NSString*)isLock pitNumber:(NSString*)pitNumber;
|
||||
|
||||
|
||||
@@ -355,6 +355,12 @@ static NSInteger maxSeat = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel *> *)users{
|
||||
for (QXUserHomeModel*model in users) {
|
||||
[self setSeatCharmWithUser:model];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
|
||||
if (fromPitNumber == 0 || toPitNumber == 0) {
|
||||
return;
|
||||
|
||||
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 设置多人魅力
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel*>*)users;
|
||||
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
|
||||
/// 榜单发生变化
|
||||
|
||||
@@ -560,6 +560,13 @@ QXRoomSeatDelegate
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel *> *)users{
|
||||
for (QXUserHomeModel*model in users) {
|
||||
[self setSeatCharmWithUser:model];
|
||||
}
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{
|
||||
QXRoomPitModel *singerModel = self.singerSeatView.pitModel;
|
||||
if ([singerModel.user_id isEqualToString:user.user_id]) {
|
||||
|
||||
@@ -53,6 +53,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
|
||||
/// 设置魅力(多个用户)
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel*>*)users;
|
||||
/// 设置麦位锁麦状态
|
||||
-(void)setSeatIsLock:(NSString*)isLock pitNumber:(NSString*)pitNumber;
|
||||
|
||||
|
||||
@@ -842,6 +842,9 @@
|
||||
}
|
||||
/// 拍卖类型发生变化
|
||||
-(void)auctionTypeDidChanged:(NSString *)type{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionTypeDidChanged:type];
|
||||
return;
|
||||
@@ -853,6 +856,9 @@
|
||||
}
|
||||
}
|
||||
-(void)clearCharm{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView clearCharm];
|
||||
@@ -877,6 +883,9 @@
|
||||
}
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView roomClearUserCharmWithUserId:userId];
|
||||
@@ -901,6 +910,9 @@
|
||||
}
|
||||
/// 房间内换麦
|
||||
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
|
||||
@@ -923,6 +935,9 @@
|
||||
}
|
||||
}
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView setSeatCharmWithUser:model];
|
||||
@@ -947,7 +962,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setSeatCharmWithUsers:(NSArray<QXUserHomeModel *> *)users{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView setSeatCharmWithUsers:users];
|
||||
break;
|
||||
case QXRoomSeatViewTypeSing:
|
||||
[self.songView setSeatCharmWithUsers:users];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
[self.auctionView setSeatCharmWithUsers:users];
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
// self.cabinView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView setSeatCharmWithUsers:users];
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
[self.roomFriendView setSeatCharmWithUsers:users];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView setSeatIsLock:isLock pitNumber:pitNumber];
|
||||
@@ -970,11 +1016,17 @@
|
||||
}
|
||||
|
||||
-(void)pkStartWithPkEndTimes:(NSString *)pk_end_times pk_id:(NSString*)pk_id{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
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 (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
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];
|
||||
}
|
||||
@@ -986,6 +1038,9 @@
|
||||
victory_cover:(NSString*)victory_cover
|
||||
defeated_name:(NSString*)defeated_name
|
||||
defeated_cover:(NSString*)defeated_cover{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
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];
|
||||
}
|
||||
@@ -994,6 +1049,9 @@
|
||||
#pragma mark - 交友房
|
||||
/// 交友房阶段发生变化 step 阶段 1等待 2心动 3牵手 friend_id 场次id
|
||||
-(void)friendPartDidChangedWithType:(NSString*)step friend_id:(NSString*)friend_id end_time:(NSString*)end_time relationModel:(QXRoomFriendRelationModel*)relationModel{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendPartDidChangedWithType:step friend_id:friend_id end_time:end_time relationModel:relationModel];
|
||||
@@ -1005,6 +1063,9 @@
|
||||
}
|
||||
/// 交友房时间发生延时 end_time 截止时间
|
||||
-(void)friendTimeDelayWithTime:(NSString*)end_time{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendTimeDelayWithTime:end_time];
|
||||
@@ -1015,6 +1076,9 @@
|
||||
}
|
||||
}
|
||||
-(void)friendSeatDidChanged:(NSArray<QXRoomPitModel *> *)pitArray{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendSeatDidChanged:pitArray];
|
||||
@@ -1025,6 +1089,9 @@
|
||||
}
|
||||
}
|
||||
-(void)friendHeartNumberDidChanged:(NSArray<QXRoomFriendHeartListModel *> *)heartArray{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendHeartNumberDidChanged:heartArray];
|
||||
@@ -1036,6 +1103,9 @@
|
||||
}
|
||||
/// 关系创建完成
|
||||
-(void)friendRelationIsCreatedWithrelationModel:(QXRoomFriendRelationModel*)relationModel{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendRelationIsCreatedWithrelationModel:relationModel];
|
||||
@@ -1070,6 +1140,9 @@
|
||||
|
||||
/// 助力
|
||||
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString *)heartId{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
if ([self.delegate respondsToSelector:@selector(friendPowerSendGiftWithUser:heartId:)]) {
|
||||
[self.delegate friendPowerSendGiftWithUser:user heartId:heartId];
|
||||
}
|
||||
@@ -1108,6 +1181,9 @@
|
||||
[self showOnlineListWithPitNumber:pitNumber];
|
||||
}
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeNormal:
|
||||
[self.normalSeatView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
@@ -1138,17 +1214,26 @@
|
||||
}
|
||||
|
||||
-(void)auctionStartOrEndIsStart:(BOOL)isStart user:(QXRoomAuctionUser *)user getUser:(QXRoomAuctionUser *)getUser{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionStartOrEndIsStart:isStart user:user getUser:getUser];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)auctionListDidChanged:(NSArray<QXRoomPitModel *> *)list{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionListDidChanged:list];
|
||||
}
|
||||
}
|
||||
-(void)auctionDelayTimeWithEndTime:(NSString *)endTime{
|
||||
if (self.roomModel == nil) {
|
||||
return;
|
||||
}
|
||||
if (_auctionView) {
|
||||
[self.auctionView auctionDelayTimeWithEndTime:endTime];
|
||||
}
|
||||
|
||||
@@ -21,6 +21,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 礼物、坐骑【全屏位置】特效 加载
|
||||
- (void)displayFullEffectView:(NSString *)gift;
|
||||
|
||||
/// 礼物数组
|
||||
- (void)displayFullEffectViewWithMorePlayImages:(NSArray *)playImages;
|
||||
|
||||
/// 坐骑【公屏信息流位置】特效 加载
|
||||
- (void)displayChatEffectView:(NSString *)gift;
|
||||
|
||||
@@ -31,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)destroyEffectSvga;
|
||||
|
||||
-(void)stopPlay;
|
||||
|
||||
-(void)startPlay;
|
||||
@end
|
||||
|
||||
|
||||
@@ -38,9 +43,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong) VAPView *playerMp4View;
|
||||
@property (nonatomic, strong) dispatch_queue_t queue;
|
||||
- (void)displayEffectView:(NSString *)play_image;
|
||||
- (void)displayEffectViewWithMorePlayImages:(NSArray *)playImages;
|
||||
- (void)openOrCloseEffectViewWith:(BOOL)isShow;
|
||||
@property (nonatomic,assign) BOOL isShow;
|
||||
- (void)destroyEffectView;
|
||||
-(void)stopPlay;
|
||||
-(void)startPlay;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -29,7 +29,7 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
manager = [[QXGiftPlayerManager alloc] init];
|
||||
// [manager creatDatabase];
|
||||
// [manager creatDatabase];
|
||||
});
|
||||
return manager;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
// NSString *dbFilePath = [documentPath stringByAppendingPathComponent:@"qx_gift.db"];
|
||||
// return dbFilePath;
|
||||
//}
|
||||
//
|
||||
//
|
||||
////创建数据库
|
||||
//- (void)creatDatabase
|
||||
//{
|
||||
@@ -127,11 +127,12 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
}
|
||||
|
||||
- (void)displayFullEffectView:(NSString *)gift {
|
||||
// [self insertGiftWithPlayImage:gift];
|
||||
// [self insertGiftWithPlayImage:gift];
|
||||
[self.fullEffectView displayEffectView:gift];
|
||||
}
|
||||
|
||||
|
||||
- (void)displayFullEffectViewWithMorePlayImages:(NSArray *)playImages{
|
||||
[self.fullEffectView displayEffectViewWithMorePlayImages:playImages];
|
||||
}
|
||||
|
||||
- (void)displayChatEffectView:(NSString *)gift {
|
||||
[self.chatEffectView displayEffectView:gift];
|
||||
@@ -160,6 +161,10 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
[self.fullEffectView stopPlay];
|
||||
[self.chatEffectView stopPlay];
|
||||
}
|
||||
-(void)startPlay{
|
||||
[self.fullEffectView startPlay];
|
||||
[self.chatEffectView startPlay];
|
||||
}
|
||||
- (UIView *)bgEffectView {
|
||||
if (!_bgEffectView) {
|
||||
_bgEffectView = [[UIView alloc] init];
|
||||
@@ -252,6 +257,30 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
}
|
||||
});
|
||||
}
|
||||
/// 礼物特效进来 gift为礼物实体类
|
||||
- (void)displayEffectViewWithMorePlayImages:(NSArray *)playImages {
|
||||
dispatch_async(self.queue, ^{
|
||||
/// 如果play_image不存在return
|
||||
if (playImages.count == 0) {
|
||||
return;
|
||||
}
|
||||
/// 锁住list
|
||||
[self.lock lock];
|
||||
/// 添加礼物进list
|
||||
[self.giftArray addObjectsFromArray:playImages];
|
||||
NSLog(@"当前礼物有---%ld个",self.giftArray.count);
|
||||
/// 解锁
|
||||
[self.lock unlock];
|
||||
|
||||
/// 如果没有在加载则开始加载
|
||||
if (self.isLoadEffect == NO) {
|
||||
/// 更改加载状态标记
|
||||
self.isLoadEffect = YES;
|
||||
[self loadStartSVGAPlayer];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)openOrCloseEffectViewWith:(BOOL)isShow {
|
||||
_isShow = isShow;
|
||||
[self removeSvgaQueueData];
|
||||
@@ -264,13 +293,18 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
[self setHidden:!isShow];
|
||||
}
|
||||
-(void)stopPlay{
|
||||
[self removeSvgaQueueData];
|
||||
|
||||
// [self removeSvgaQueueData];
|
||||
self.isLoadEffect = NO;
|
||||
[self.svagView stopEffectSvgaPlay];
|
||||
// [self.playerView stop];
|
||||
[self.playerMp4View stopHWDMP4];
|
||||
// [self.alphaVideoView stop];
|
||||
self.playerMp4View.hidden = YES;
|
||||
self.svagView.hidden = YES;
|
||||
}
|
||||
|
||||
-(void)startPlay{
|
||||
[self loadStartSVGAPlayer];
|
||||
}
|
||||
-(void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@@ -280,6 +314,14 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
[self loadStartSVGAPlayer];
|
||||
});
|
||||
}
|
||||
-(void)viewDidFailPlayMP4:(NSError *)error{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.playerMp4View.hidden = YES;
|
||||
});
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self loadStartSVGAPlayer];
|
||||
});
|
||||
}
|
||||
- (void)loadStartSVGAPlayer {
|
||||
if (!_isShow) {
|
||||
/// isshow 为是否开启特效 如果未开启则return
|
||||
@@ -311,7 +353,7 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
weakSelf.playerMp4View.hidden = NO;
|
||||
weakSelf.svagView.hidden = YES;
|
||||
});
|
||||
|
||||
[weakSelf.playerMp4View stopHWDMP4];
|
||||
[weakSelf.playerMp4View playHWDMP4:videoPath delegate:self];
|
||||
}];
|
||||
}else if ([play_image hasSuffix:@"svg"] || [play_image hasSuffix:@"svga"]) {
|
||||
@@ -329,6 +371,7 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
[self.lock lock];
|
||||
self.isLoadEffect = NO;
|
||||
[self.lock unlock];
|
||||
[self loadStartSVGAPlayer];
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -382,7 +425,7 @@ static NSString *PLAY_IMAGE = @"play_image";
|
||||
-(VAPView *)playerMp4View{
|
||||
if (!_playerMp4View) {
|
||||
_playerMp4View = [[VAPView alloc] initWithFrame:CGRectZero];
|
||||
_playerMp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypePauseAndResume;
|
||||
_playerMp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypeStop;
|
||||
_playerMp4View.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_playerMp4View.userInteractionEnabled = NO;
|
||||
_playerMp4View.backgroundColor = [UIColor clearColor];
|
||||
|
||||
@@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiftScrollView : UIView
|
||||
@property (nonatomic,strong)QXGiftScrollModel *model;
|
||||
@property (nonatomic,strong)NSArray<QXGiftScrollModel *>* list;
|
||||
@property (nonatomic,weak)id<QXGiftScrollViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
|
||||
@@ -46,6 +46,27 @@ static NSInteger maxCount = 5;
|
||||
}
|
||||
self.cycleScrollView.imageURLStringsGroup = self.titles;
|
||||
}
|
||||
-(void)setList:(NSArray<QXGiftScrollModel *> *)list{
|
||||
_list = list;
|
||||
if (list.count >= 5) {
|
||||
[self.dataArray removeAllObjects];
|
||||
[self.titles removeAllObjects];
|
||||
for (int i = 0; i < 5; i++) {
|
||||
QXGiftScrollModel*md = list[i];
|
||||
[self.dataArray addObject:md];
|
||||
[self.titles addObject:md.fromUserName];
|
||||
}
|
||||
}else{
|
||||
for (QXGiftScrollModel*md in list) {
|
||||
[self.dataArray removeLastObject];
|
||||
[self.titles removeLastObject];
|
||||
[self.dataArray insertObject:md atIndex:0];
|
||||
[self.titles insertObject:md.fromUserName atIndex:0];
|
||||
|
||||
}
|
||||
}
|
||||
self.cycleScrollView.imageURLStringsGroup = self.titles;
|
||||
}
|
||||
- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view{
|
||||
return [QXGiftScrollViewCell class];
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomListModel.h"
|
||||
#import "QXSearchModel.h"
|
||||
#import "MarqueeLabel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeRoomCell : UICollectionViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *coverImageView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *displayMaskView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *IDLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet MarqueeLabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *roomTypeView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *animateImageView;
|
||||
@@ -23,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (strong, nonatomic) QXSearchModel *searchModel;
|
||||
@property (assign, nonatomic) BOOL isAppStore;
|
||||
|
||||
-(void)startAnimating;
|
||||
-(void)endAnimating;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -28,10 +28,15 @@
|
||||
// self.roomTypeView.image = [UIImage imageNamed:@"Group 7156"];
|
||||
// }
|
||||
[self.roomTypeView sd_setImageWithURL:[NSURL URLWithString:model.label_icon]];
|
||||
self.animateImageView.animationDuration = 1;
|
||||
self.animateImageView.animationImages = self.imgs;
|
||||
|
||||
|
||||
}
|
||||
-(void)startAnimating{
|
||||
[self.animateImageView startAnimating];
|
||||
}
|
||||
-(void)endAnimating{
|
||||
[self.animateImageView stopAnimating];
|
||||
}
|
||||
-(void)setHistoryModel:(QXMyRoomHistory *)historyModel{
|
||||
_historyModel = historyModel;
|
||||
[self.coverImageView sd_setImageWithURL:[NSURL URLWithString:historyModel.room_cover]];
|
||||
@@ -90,6 +95,8 @@
|
||||
}else{
|
||||
[self.displayMaskView setTopToBottomGradientBackgroundWithColors:@[[UIColor colorWithHexString:@"#00000000"],[UIColor colorWithHexString:@"#00000096"]] frame:CGRectMake(0, 0, (SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0)];
|
||||
}
|
||||
self.animateImageView.animationDuration = 1;
|
||||
self.animateImageView.animationImages = self.imgs;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -109,11 +109,19 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V8F-du-Rah">
|
||||
<rect key="frame" x="8" y="258" width="31" height="14.333333333333314"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="张三李四王" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V8F-du-Rah" customClass="MarqueeLabel">
|
||||
<rect key="frame" x="8" y="258" width="65" height="14.333333333333314"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="65" id="4bC-3c-1jm"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="marqueeType">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
</subviews>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user