交友房初步完成
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomModel.h"
|
||||
#import "NoitceAndKey.h"
|
||||
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
/// 静音
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#import "QXGiftModel.h"
|
||||
#import "QXSongListModel.h"
|
||||
#import "QXRoomSeatDelegate.h"
|
||||
#import "QXRoomFriendRelationModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
@@ -80,5 +81,12 @@ typedef NS_ENUM(NSInteger) {
|
||||
@property (nonatomic,assign)BOOL havBubble;
|
||||
|
||||
@property (nonatomic,strong)NSString* total;
|
||||
|
||||
/// 交友房新增
|
||||
@property (nonatomic,strong)NSString* step;
|
||||
@property (nonatomic,strong)NSString* friend_id;
|
||||
@property (nonatomic,strong)NSString* end_time;
|
||||
|
||||
@property (nonatomic,strong)QXRoomFriendRelationModel* friend_user;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -751,7 +751,8 @@ NSInteger maxMessageCount = 20;
|
||||
return @{@"GiftInfo" : @"QXGiftModel",
|
||||
@"FromUserInfo":@"QXUserHomeModel",
|
||||
@"nextInfo":@"QXSongListModel",
|
||||
@"songInfo":@"QXSongListModel"
|
||||
@"songInfo":@"QXSongListModel",
|
||||
@"friend_user":@"QXRoomFriendRelationModel"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ typedef NS_ENUM(NSInteger) {
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomSeatSettingView : UIView
|
||||
//@property (nonatomic,assign)BOOL isLockMic;
|
||||
@property (nonatomic,assign)BOOL isNoHaveLockMic;
|
||||
//@property (nonatomic,assign)BOOL isMuteMic;
|
||||
@property (nonatomic,strong) QXRoomPitModel *pitModel;
|
||||
@property (nonatomic,strong) NSString *roomId;
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
_pitModel = pitModel;
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
-(void)setIsNoHaveLockMic:(BOOL)isNoHaveLockMic{
|
||||
_isNoHaveLockMic = isNoHaveLockMic;
|
||||
self.bgView.height = ScaleWidth(42);
|
||||
self.tableView.height = ScaleWidth(42);
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
@@ -64,24 +70,31 @@
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
// return 3;
|
||||
if (self.isNoHaveLockMic) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomSeatSettingCell *cell = [QXRoomSeatSettingCell cellWithTableView:tableView];
|
||||
cell.roomId = self.roomId;
|
||||
cell.pitModel = self.pitModel;
|
||||
if (indexPath.row == 0) {
|
||||
// cell.isOn = self.pitModel.is_mute.intValue == 1;
|
||||
// cell.settingType = QXRoomSeatSettingMuteMic;
|
||||
cell.isOn = self.pitModel.is_lock.intValue == 1;
|
||||
cell.settingType = QXRoomSeatSettingLockMic;
|
||||
}
|
||||
// else if(indexPath.row == 1){
|
||||
// cell.isOn = self.pitModel.is_lock.intValue == 1;
|
||||
// cell.settingType = QXRoomSeatSettingLockMic;
|
||||
// }
|
||||
else{
|
||||
if (self.isNoHaveLockMic) {
|
||||
cell.settingType = QXRoomSeatSettingHugMic;
|
||||
}else{
|
||||
if (indexPath.row == 0) {
|
||||
// cell.isOn = self.pitModel.is_mute.intValue == 1;
|
||||
// cell.settingType = QXRoomSeatSettingMuteMic;
|
||||
cell.isOn = self.pitModel.is_lock.intValue == 1;
|
||||
cell.settingType = QXRoomSeatSettingLockMic;
|
||||
}
|
||||
// else if(indexPath.row == 1){
|
||||
// cell.isOn = self.pitModel.is_lock.intValue == 1;
|
||||
// cell.settingType = QXRoomSeatSettingLockMic;
|
||||
// }
|
||||
else{
|
||||
cell.settingType = QXRoomSeatSettingHugMic;
|
||||
}
|
||||
}
|
||||
MJWeakSelf
|
||||
cell.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||
@@ -90,6 +103,13 @@
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.isNoHaveLockMic) {
|
||||
[self hide];
|
||||
if (self.clickHugBlock) {
|
||||
self.clickHugBlock(self.pitModel);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (indexPath.row == 1) {
|
||||
[self hide];
|
||||
if (self.clickHugBlock) {
|
||||
|
||||
25
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPSuccessView.h
Normal file
25
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPSuccessView.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// QXFriendCPSuccessView.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXFriendCPSuccessViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)animateIsFinishedWithModel:(QXRoomFriendRelationModel*)model;
|
||||
|
||||
@end
|
||||
|
||||
@interface QXFriendCPSuccessView : UIView
|
||||
@property (nonatomic,weak)id<QXFriendCPSuccessViewDelegate>delegate;
|
||||
-(void)setDataWithRelationModel:(QXRoomFriendRelationModel *)model cpName:(NSString*)cpName;
|
||||
-(void)showInView:(UIView*)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
129
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPSuccessView.m
Normal file
129
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPSuccessView.m
Normal file
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// QXFriendCPSuccessView.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/10.
|
||||
//
|
||||
|
||||
#import "QXFriendCPSuccessView.h"
|
||||
@interface QXFriendCPSuccessView()
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UIImageView *headerLeftImageView;
|
||||
@property (nonatomic,strong)UIImageView *leftNameBgImageView;
|
||||
@property (nonatomic,strong)UILabel *leftNameLabel;
|
||||
|
||||
@property (nonatomic,strong)UIImageView *headerRightImageView;
|
||||
@property (nonatomic,strong)UIImageView *rightNameBgImageView;
|
||||
@property (nonatomic,strong)UILabel *rightNameLabel;
|
||||
|
||||
/// 关系
|
||||
@property (nonatomic,strong)UILabel *relationLabel;
|
||||
|
||||
@property (nonatomic,strong)QXRoomFriendRelationModel *model;
|
||||
@end
|
||||
|
||||
@implementation QXFriendCPSuccessView
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
[self createViews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)createViews{
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(420))];
|
||||
self.bgView.centerY = self.centerY;
|
||||
self.bgView.alpha = 0;
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_friend_success_bg"]];
|
||||
self.bgImageView.frame = CGRectMake(0, 0, self.bgView.width, self.bgView.height);
|
||||
[self.bgView addSubview:self.bgImageView];
|
||||
|
||||
self.headerLeftImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.headerLeftImageView.frame = CGRectMake(self.bgView.width/2-ScaleWidth(75)-15, 60, ScaleWidth(75), ScaleWidth(75));
|
||||
self.headerLeftImageView.layer.masksToBounds = YES;
|
||||
self.headerLeftImageView.layer.cornerRadius = self.headerLeftImageView.height/2.0;
|
||||
self.headerLeftImageView.layer.borderColor = RGB16(0x7781F5).CGColor;
|
||||
self.headerLeftImageView.layer.borderWidth = 3;
|
||||
[self.bgView addSubview:self.headerLeftImageView];
|
||||
|
||||
self.leftNameBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_friend_success_name_bg"]];
|
||||
self.leftNameBgImageView.frame = CGRectMake(0, self.headerLeftImageView.bottom+5, 104, 20);
|
||||
self.leftNameBgImageView.centerX = self.headerLeftImageView.centerX;
|
||||
[self.bgView addSubview:self.leftNameBgImageView];
|
||||
|
||||
self.leftNameLabel = [[UILabel alloc] initWithFrame:self.leftNameBgImageView.frame];
|
||||
self.leftNameLabel.textColor = RGB16(0xffffff);
|
||||
self.leftNameLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.leftNameLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:14];
|
||||
[self.bgView addSubview:self.leftNameLabel];
|
||||
|
||||
|
||||
self.headerRightImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.headerRightImageView.frame = CGRectMake(self.bgView.width/2+15, self.headerLeftImageView.top, ScaleWidth(75), ScaleWidth(75));
|
||||
self.headerRightImageView.layer.masksToBounds = YES;
|
||||
self.headerRightImageView.layer.cornerRadius = self.headerRightImageView.height/2.0;
|
||||
self.headerRightImageView.layer.borderColor = RGB16(0x7781F5).CGColor;
|
||||
self.headerRightImageView.layer.borderWidth = 3;
|
||||
[self.bgView addSubview:self.headerRightImageView];
|
||||
|
||||
self.rightNameBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_friend_success_name_bg"]];
|
||||
self.rightNameBgImageView.frame = CGRectMake(0, self.headerLeftImageView.bottom+5, 104, 20);
|
||||
self.rightNameBgImageView.centerX = self.headerRightImageView.centerX;
|
||||
[self.bgView addSubview:self.rightNameBgImageView];
|
||||
|
||||
self.rightNameLabel = [[UILabel alloc] initWithFrame:self.rightNameBgImageView.frame];
|
||||
self.rightNameLabel.textColor = RGB16(0xffffff);
|
||||
self.rightNameLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.rightNameLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:14];
|
||||
[self.bgView addSubview:self.rightNameLabel];
|
||||
|
||||
[self.bgView addSubview:self.relationLabel];
|
||||
self.relationLabel.text = @"兄弟牵手成功";
|
||||
}
|
||||
|
||||
-(void)setDataWithRelationModel:(QXRoomFriendRelationModel *)model cpName:(NSString *)cpName{
|
||||
_model = model;
|
||||
[self.headerLeftImageView sd_setImageWithURL:[NSURL URLWithString:model.user1_avatar] placeholderImage:[UIImage imageNamed:@"room_friend_success_name_bg"]];
|
||||
self.leftNameLabel.text = model.user1_nickname;
|
||||
|
||||
[self.headerRightImageView sd_setImageWithURL:[NSURL URLWithString:model.user2_avatar] placeholderImage:[UIImage imageNamed:@"room_friend_success_name_bg"]];
|
||||
self.rightNameLabel.text = model.user2_nickname;
|
||||
self.relationLabel.text = [NSString stringWithFormat:@"%@牵手成功",cpName];
|
||||
}
|
||||
-(void)showInView:(UIView *)view{
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:1.5 animations:^{
|
||||
self.bgView.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
[self performSelector:@selector(hide) withObject:nil afterDelay:3];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)hide{
|
||||
[UIView animateWithDuration:1 animations:^{
|
||||
self.bgView.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(animateIsFinishedWithModel:)]) {
|
||||
[self.delegate animateIsFinishedWithModel:self.model];
|
||||
}
|
||||
}];
|
||||
}
|
||||
- (UILabel *)relationLabel{
|
||||
if (!_relationLabel) {
|
||||
_relationLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bgView.height/2, self.bgView.width, 35)];
|
||||
_relationLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_relationLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:28];
|
||||
_relationLabel.textColor = [UIColor colorWithHexString:@"#FFEBC3"];
|
||||
}
|
||||
return _relationLabel;
|
||||
}
|
||||
|
||||
@end
|
||||
29
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPView.h
Normal file
29
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPView.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// QXFriendCPView.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomFriendRelationModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXFriendCPView : UIView
|
||||
@property (nonatomic,strong)QXRoomFriendRelationModel *model;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,copy)void(^commitBlock)(QXRoomFriendRelationModel*relationModel,NSString*selectedCpId,NSString*selectedCpName);
|
||||
-(void)showInView:(UIView*)view;
|
||||
-(void)hide;
|
||||
-(void)getRelationShipList;
|
||||
@end
|
||||
|
||||
@interface QXFriendCPTypeCell : UICollectionViewCell
|
||||
/// 1 创建房间 2 礼物
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
@property (nonatomic,strong)UIButton *titleBtn;
|
||||
@property (nonatomic,strong)NSString *title;
|
||||
@property (nonatomic,assign)BOOL isSelected;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
311
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPView.m
Normal file
311
QXLive/HomePage(声播)/View/房间/交友房/QXFriendCPView.m
Normal file
@@ -0,0 +1,311 @@
|
||||
//
|
||||
// QXFriendCPView.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/10.
|
||||
//
|
||||
|
||||
#import "QXFriendCPView.h"
|
||||
#import <SVGA.h>
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@class QXFriendCPTypeCell;
|
||||
@interface QXFriendCPView()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
|
||||
@property (nonatomic,strong)UIImageView *headerLeftImageView;
|
||||
@property (nonatomic,strong)UILabel *headerLeftNameLabel;
|
||||
@property (nonatomic,strong)UIImageView *lineImageView;
|
||||
/// 心动值
|
||||
@property (nonatomic,strong)UILabel *heartValueLabel;
|
||||
@property (nonatomic,strong)UIImageView *headerRightImageView;
|
||||
@property (nonatomic,strong)UILabel *headerRightNameLabel;
|
||||
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
|
||||
@property (nonatomic,strong)UIButton *cancelBtn;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
|
||||
@property (nonatomic, strong) SVGAPlayer *svgaPlayer;
|
||||
@property (nonatomic , strong) SVGAParser *parser;
|
||||
|
||||
@end
|
||||
@implementation QXFriendCPView
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
[self createViews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)createViews{
|
||||
self.selectedIndex = -1;
|
||||
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(275))/2.0,-SCREEN_HEIGHT, ScaleWidth(275), ScaleWidth(466))];
|
||||
[self addSubview:self.bgView];
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_friend_create_relation_bg"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
self.bgImageView.frame = self.bgView.bounds;
|
||||
[self.bgView addSubview:self.bgImageView];
|
||||
[self.bgView addSubview:self.headerLeftImageView];
|
||||
[self.bgView addSubview:self.headerLeftNameLabel];
|
||||
[self.bgView addSubview:self.headerRightImageView];
|
||||
[self.bgView addSubview:self.headerRightNameLabel];
|
||||
[self.bgView addSubview:self.lineImageView];
|
||||
[self.bgView addSubview:self.heartValueLabel];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, self.headerLeftNameLabel.bottom+15, 200, 24)];
|
||||
self.titleLabel.text = @"关系列表";
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
self.titleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
|
||||
self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(16, ScaleWidth(466)-42-40, (self.bgView.width-16*3-18)/2.0, 42)];
|
||||
self.cancelBtn.backgroundColor = [UIColor colorWithHexString:@"#333333"];
|
||||
[self.cancelBtn setTitle:@"取消" forState:(UIControlStateNormal)];
|
||||
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.cancelBtn setTitleColor:[UIColor colorWithHexString:@"#ffffff"] forState:(UIControlStateNormal)];
|
||||
[self.cancelBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.cancelBtn.layer.masksToBounds = YES;
|
||||
self.cancelBtn.layer.cornerRadius = 21;
|
||||
[self.bgView addSubview:self.cancelBtn];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.cancelBtn.right+20, self.cancelBtn.top, self.cancelBtn.width, 42)];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.commitBtn setTitle:@"确认" forState:(UIControlStateNormal)];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.commitBtn.layer.masksToBounds = YES;
|
||||
self.commitBtn.layer.cornerRadius = 21;
|
||||
[self.bgView addSubview:self.commitBtn];
|
||||
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
CGFloat itemWidth = (self.bgView.width - 48 - 3*12)/3.0;
|
||||
layout.itemSize = CGSizeMake(itemWidth, 34);
|
||||
layout.minimumInteritemSpacing = 12;
|
||||
layout.minimumLineSpacing = 12;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 18, 0, 30);
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+10, self.bgView.width, self.commitBtn.top-self.titleLabel.bottom-30) collectionViewLayout:layout];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.backgroundColor = [UIColor clearColor];
|
||||
self.collectionView.dataSource = self;
|
||||
[self.collectionView registerClass:[QXFriendCPTypeCell class] forCellWithReuseIdentifier:@"QXFriendCPTypeCell"];
|
||||
[self.bgView addSubview:self.collectionView];
|
||||
[self getRelationShipList];
|
||||
}
|
||||
-(void)getRelationShipList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomRelationListWithType:@"2" successBlock:^(NSArray<QXRoomRelationModel *> * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)setModel:(QXRoomFriendRelationModel *)model{
|
||||
_model = model;
|
||||
[self.headerLeftImageView sd_setImageWithURL:[NSURL URLWithString:model.user1_avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
[self.headerRightImageView sd_setImageWithURL:[NSURL URLWithString:model.user2_avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
|
||||
self.headerLeftNameLabel.text = model.user1_nickname;
|
||||
self.headerRightNameLabel.text = model.user2_nickname;
|
||||
|
||||
self.heartValueLabel.text = model.heart_value;
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXFriendCPTypeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXFriendCPTypeCell" forIndexPath:indexPath];
|
||||
QXRoomRelationModel *model = self.dataArray[indexPath.row];
|
||||
cell.title = model.name;
|
||||
if (indexPath.row == self.selectedIndex) {
|
||||
cell.isSelected = YES;
|
||||
}else{
|
||||
cell.isSelected = NO;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
self.selectedIndex = indexPath.row;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
-(void)commitAction{
|
||||
// QXFriendCPSuccessView *successView = [[QXFriendCPSuccessView alloc] init];
|
||||
// for (UIWindow *w in [UIApplication sharedApplication].windows) {
|
||||
// if ([w isKeyWindow]) {
|
||||
// [successView showInView:w];
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
QXRoomRelationModel *md = self.dataArray[self.selectedIndex];
|
||||
if (self.commitBlock) {
|
||||
self.commitBlock(self.model,md.relation_id,md.name);
|
||||
}
|
||||
}
|
||||
|
||||
-(void)closeAction{
|
||||
[self hide];
|
||||
}
|
||||
|
||||
-(void)showInView:(UIView *)view{
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
self.bgView.centerY = self.centerY;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)hide{
|
||||
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
- (UIImageView *)headerLeftImageView{
|
||||
if (!_headerLeftImageView) {
|
||||
_headerLeftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(18, ScaleWidth(130), ScaleWidth(50), ScaleWidth(50))];
|
||||
_headerLeftImageView.image = [UIImage imageNamed:@"user_header_placehoulder"];
|
||||
_headerLeftImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_headerLeftImageView.layer.masksToBounds = YES;
|
||||
_headerLeftImageView.layer.cornerRadius = ScaleWidth(50)/2.0;
|
||||
}
|
||||
return _headerLeftImageView;
|
||||
}
|
||||
-(UILabel *)headerLeftNameLabel{
|
||||
if (!_headerLeftNameLabel) {
|
||||
_headerLeftNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.headerLeftImageView.left, self.headerLeftImageView.bottom, 100, 20)];
|
||||
_headerLeftNameLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
_headerLeftNameLabel.font = [UIFont systemFontOfSize:12];
|
||||
_headerLeftNameLabel.textAlignment = NSTextAlignmentLeft;
|
||||
}
|
||||
return _headerLeftNameLabel;
|
||||
}
|
||||
- (UIImageView *)headerRightImageView{
|
||||
if (!_headerRightImageView) {
|
||||
_headerRightImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.bgView.width-30-ScaleWidth(50), self.headerLeftImageView.top, ScaleWidth(50), ScaleWidth(50))];
|
||||
_headerRightImageView.image = [UIImage imageNamed:@"user_header_placehoulder"];
|
||||
_headerRightImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_headerRightImageView.layer.masksToBounds = YES;
|
||||
_headerRightImageView.layer.cornerRadius = ScaleWidth(50)/2.0;
|
||||
}
|
||||
return _headerRightImageView;
|
||||
}
|
||||
-(UILabel *)headerRightNameLabel{
|
||||
if (!_headerRightNameLabel) {
|
||||
_headerRightNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.headerRightImageView.right-100, self.headerLeftImageView.bottom, 100, 20)];
|
||||
_headerRightNameLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
_headerRightNameLabel.font = [UIFont systemFontOfSize:12];
|
||||
_headerRightNameLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
return _headerRightNameLabel;
|
||||
}
|
||||
-(UIImageView *)lineImageView{
|
||||
if (!_lineImageView) {
|
||||
_lineImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_friend_relation_heart"]];
|
||||
_lineImageView.frame = CGRectMake(self.headerLeftImageView.right, 0, self.headerRightImageView.left-self.headerLeftImageView.right, ScaleWidth(50));
|
||||
_lineImageView.centerY = self.headerLeftImageView.centerY;
|
||||
}
|
||||
return _lineImageView;
|
||||
}
|
||||
- (UILabel *)heartValueLabel{
|
||||
if (!_heartValueLabel) {
|
||||
_heartValueLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 80, 18)];
|
||||
_heartValueLabel.centerY = self.lineImageView.centerY;
|
||||
_heartValueLabel.centerX = self.lineImageView.centerX;
|
||||
_heartValueLabel.backgroundColor = [UIColor colorWithHexString:@"#FE8EC8"];
|
||||
_heartValueLabel.layer.masksToBounds = YES;
|
||||
_heartValueLabel.layer.cornerRadius = 9;
|
||||
_heartValueLabel.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
_heartValueLabel.layer.borderWidth = 1;
|
||||
_heartValueLabel.textColor = [UIColor whiteColor];
|
||||
_heartValueLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_heartValueLabel.font = [UIFont boldSystemFontOfSize:12];
|
||||
}
|
||||
return _heartValueLabel;
|
||||
}
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXFriendCPTypeCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self createViews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setIsSelected:(BOOL)isSelected{
|
||||
_isSelected = isSelected;
|
||||
self.titleBtn.selected = isSelected;
|
||||
if (self.isSelected) {
|
||||
self.titleBtn.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
}else{
|
||||
self.titleBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
}
|
||||
}
|
||||
-(void)setType:(NSInteger)type{
|
||||
_type = type;
|
||||
if (type == 1) {
|
||||
self.titleBtn.layer.cornerRadius = 17;
|
||||
UIImage *normalImage = [UIImage imageWithColor:[UIColor colorWithHexString:@"#F6F6F6"]];
|
||||
[self.titleBtn setBackgroundImage:normalImage forState:(UIControlStateNormal)];
|
||||
}if (type == 2){
|
||||
self.titleBtn.layer.cornerRadius = 0;
|
||||
[self.titleBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
|
||||
[self.titleBtn setTitleColor:[UIColor colorWithHexString:@"#999999"] forState:(UIControlStateNormal)];
|
||||
[self.titleBtn setTitleColor:[UIColor colorWithHexString:@"#ffffff"] forState:(UIControlStateSelected)];
|
||||
[self.titleBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
|
||||
[self.titleBtn setBackgroundImage:nil forState:(UIControlStateSelected)];
|
||||
self.titleBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
|
||||
}
|
||||
}
|
||||
-(void)setTitle:(NSString *)title{
|
||||
_title = title;
|
||||
[self.titleBtn setTitle:title forState:(UIControlStateNormal)];
|
||||
}
|
||||
-(void)createViews{
|
||||
self.titleBtn = [[UIButton alloc] init];
|
||||
UIImage *selectedImage = [UIImage imageWithColor:QXConfig.themeColor];
|
||||
UIImage *normalImage = [UIImage imageWithColor:[UIColor colorWithHexString:@"#FFFFFF"]];
|
||||
[self.titleBtn setBackgroundImage:selectedImage forState:(UIControlStateSelected)];
|
||||
[self.titleBtn setBackgroundImage:normalImage forState:(UIControlStateNormal)];
|
||||
[self.titleBtn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:(UIControlStateNormal)];
|
||||
[self.titleBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateSelected)];
|
||||
self.titleBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.titleBtn.layer.masksToBounds = YES;
|
||||
self.titleBtn.layer.cornerRadius = 4;
|
||||
[self.contentView addSubview:self.titleBtn];
|
||||
self.titleBtn.userInteractionEnabled = NO;
|
||||
[self.titleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -18,6 +18,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
QXRoomSettingTypeRoomTypeBoy = 12,
|
||||
/// 女神房
|
||||
QXRoomSettingTypeRoomTypeGirl = 13,
|
||||
/// 交友房
|
||||
QXRoomSettingTypeRoomTypeFriend = 14,
|
||||
|
||||
/// 常用工具
|
||||
/// 房间补贴
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeBoy;
|
||||
/// 女神房
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeGirl;
|
||||
/// 交友房
|
||||
@property (nonatomic,strong)QXRoomSettingModel *roomTypeFriend;
|
||||
|
||||
/// 常用工具
|
||||
/// 房间补贴
|
||||
@@ -178,12 +180,12 @@
|
||||
// }
|
||||
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) {
|
||||
toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgImage];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
|
||||
moreArr = @[self.roomLeave,self.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];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
|
||||
moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.roomReport];
|
||||
}
|
||||
@@ -212,7 +214,7 @@
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
}
|
||||
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
|
||||
moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.roomReport];
|
||||
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
|
||||
@@ -230,7 +232,7 @@
|
||||
}else{
|
||||
toolsArr = @[self.roomSubsidy,self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
|
||||
}
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl];
|
||||
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
|
||||
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
|
||||
moreArr = @[self.roomLeave,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.roomReport];
|
||||
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
|
||||
@@ -313,7 +315,7 @@
|
||||
// [self.welcomeView showInView:self.viewController.view];
|
||||
return;
|
||||
}
|
||||
if (model.type == QXRoomSettingTypeRoomTypeAuction || model.type == QXRoomSettingTypeRoomTypeSing || model.type == QXRoomSettingTypeRoomTypeBoy || model.type == QXRoomSettingTypeRoomTypeGirl) {
|
||||
if (model.type == QXRoomSettingTypeRoomTypeAuction || model.type == QXRoomSettingTypeRoomTypeSing || model.type == QXRoomSettingTypeRoomTypeBoy || model.type == QXRoomSettingTypeRoomTypeGirl || model.type == QXRoomSettingTypeRoomTypeFriend) {
|
||||
self.alertView.message = [NSString stringWithFormat:@"您确定要修改为%@房吗?",model.name];
|
||||
[[QXGlobal shareGlobal] showView:self.alertView controller:self.viewController popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
@@ -339,6 +341,8 @@
|
||||
type = @"3";
|
||||
}else if (roomType == QXRoomSettingTypeRoomTypeGirl) {
|
||||
type = @"4";
|
||||
}else if (roomType == QXRoomSettingTypeRoomTypeFriend) {
|
||||
type = @"7";
|
||||
}
|
||||
[QXMineNetwork changeRoomTypeWithRoomId:self.roomModel.room_info.room_id type:type successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
@@ -400,6 +404,16 @@
|
||||
return _roomTypeGirl;
|
||||
}
|
||||
|
||||
-(QXRoomSettingModel *)roomTypeFriend{
|
||||
if (!_roomTypeFriend) {
|
||||
_roomTypeFriend = [[QXRoomSettingModel alloc] init];
|
||||
_roomTypeFriend.name = QXText(@"交友");
|
||||
_roomTypeFriend.type = QXRoomSettingTypeRoomTypeFriend;
|
||||
_roomTypeFriend.icon = @"room_set_room_type_friend";
|
||||
}
|
||||
return _roomTypeFriend;
|
||||
}
|
||||
|
||||
-(QXRoomSettingModel *)roomSubsidy{
|
||||
if (!_roomSubsidy) {
|
||||
_roomSubsidy = [[QXRoomSettingModel alloc] init];
|
||||
|
||||
@@ -12,7 +12,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 名称名称在下显示魅力
|
||||
QXRoomSeatContentViewTypeNormal = 0,
|
||||
/// 名称在右
|
||||
QXRoomSeatContentViewTypeAuction
|
||||
QXRoomSeatContentViewTypeAuction = 1,
|
||||
/// 交友房
|
||||
QXRoomSeatContentViewTypeFriend
|
||||
}QXRoomSeatContentViewType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@@ -285,6 +285,29 @@
|
||||
}];
|
||||
}
|
||||
break;
|
||||
case QXRoomSeatContentViewTypeFriend:{
|
||||
self.charmBgView.backgroundColor = RGB16A(0x000000,0.65);
|
||||
// self.charmBgView.hidden = NO;
|
||||
[self.charmBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self);
|
||||
make.top.equalTo(self.noUserImageView.mas_bottom).offset(-8);
|
||||
make.height.mas_equalTo(ScaleWidth(15));
|
||||
}];
|
||||
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.charmBgView.mas_bottom).offset(0);
|
||||
// make.centerX.equalTo(self.noUserImageView);
|
||||
make.height.mas_equalTo(18);
|
||||
make.left.right.equalTo(self);
|
||||
}];
|
||||
self.nameLabel.textColor = RGB16(0xEFEAFF);
|
||||
// self.numberLabel.backgroundColor = RGB16(0xdb7fff);
|
||||
[self.numberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.charmBgView.mas_bottom).offset(0);
|
||||
make.centerX.equalTo(self.noUserImageView);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -27,4 +27,7 @@
|
||||
/// 查看个人信息
|
||||
-(void)previewUserInfoWithUserId:(NSString*)userId;
|
||||
|
||||
/// 助力
|
||||
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString*)heartId;
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)QXRoomModel *roomModel;
|
||||
|
||||
-(void)cabinRoomHotValueDidChanged:(NSString*)hot_value;
|
||||
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time;
|
||||
-(void)destroyViews;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatContentView *leftSeatView;
|
||||
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
|
||||
@property (nonatomic,strong)UIImageView *heartCenterImageView;
|
||||
@property (nonatomic,strong)UILabel *numberLabel;
|
||||
@@ -71,16 +72,52 @@
|
||||
make.centerY.equalTo(self.titleLabel);
|
||||
}];
|
||||
|
||||
|
||||
self.timeDownBgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_cabin_timedown_bg"]];
|
||||
self.timeDownBgView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.timeDownBgView];
|
||||
[self.timeDownBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(96);
|
||||
make.top.mas_equalTo(ScaleWidth(102));
|
||||
make.width.mas_equalTo(SCREEN_WIDTH-96*2);
|
||||
make.height.mas_equalTo(24);
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_friend_cabin_bg"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self);
|
||||
make.height.mas_equalTo(ScaleWidth(330));
|
||||
}];
|
||||
|
||||
self.heartCenterImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_cabin_heart"]];
|
||||
[self addSubview:self.heartCenterImageView];
|
||||
[self.heartCenterImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.bgImageView);
|
||||
make.centerY.equalTo(self.bgImageView);
|
||||
make.height.mas_equalTo(ScaleWidth(80));
|
||||
make.width.mas_equalTo(ScaleWidth(160));
|
||||
}];
|
||||
|
||||
self.numberLabel = [[UILabel alloc] init];
|
||||
self.numberLabel.text = @"0";
|
||||
self.numberLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.numberLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
|
||||
self.numberLabel.font = [UIFont fontWithName:@"DIN Alternate" size:18];
|
||||
[self addSubview:self.numberLabel];
|
||||
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.heartCenterImageView).offset(-18);
|
||||
make.centerX.equalTo(self.heartCenterImageView);
|
||||
}];
|
||||
|
||||
self.leftSeatView = [[QXRoomSeatContentView alloc] init];
|
||||
[self addSubview:self.leftSeatView];
|
||||
[self.leftSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.heartCenterImageView.mas_left);
|
||||
make.width.mas_equalTo(ScaleWidth(75));
|
||||
make.height.mas_equalTo(ScaleWidth(75)+25);
|
||||
make.top.equalTo(self.heartCenterImageView).offset(-5);
|
||||
}];
|
||||
|
||||
self.rightSeatView = [[QXRoomSeatContentView alloc] init];
|
||||
[self addSubview:self.rightSeatView];
|
||||
[self.rightSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.heartCenterImageView.mas_right);
|
||||
make.width.mas_equalTo(ScaleWidth(75));
|
||||
make.height.mas_equalTo(ScaleWidth(75)+25);
|
||||
make.top.equalTo(self.leftSeatView);
|
||||
}];
|
||||
|
||||
self.timeDownLabel = [[UILabel alloc] initWithFrame:self.timeDownBgView.frame];
|
||||
self.timeDownLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
|
||||
self.timeDownLabel.font = [UIFont systemFontOfSize:12];
|
||||
@@ -88,50 +125,20 @@
|
||||
self.timeDownLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self addSubview:self.timeDownLabel];
|
||||
[self.timeDownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.bottom.right.equalTo(self.timeDownBgView);
|
||||
make.centerX.equalTo(self);
|
||||
make.top.equalTo(self.heartCenterImageView.mas_bottom).offset(21);
|
||||
make.height.mas_equalTo(24);
|
||||
}];
|
||||
|
||||
self.timeDownBgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_cabin_timedown_bg"]];
|
||||
self.timeDownBgView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.timeDownBgView];
|
||||
[self.timeDownBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.timeDownLabel);
|
||||
}];
|
||||
|
||||
|
||||
self.leftSeatView = [[QXRoomSeatContentView alloc] init];
|
||||
[self addSubview:self.leftSeatView];
|
||||
[self.leftSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(36);
|
||||
make.width.mas_equalTo(ScaleWidth(65));
|
||||
make.height.mas_equalTo(ScaleWidth(65)+25);
|
||||
make.top.equalTo(self.timeDownBgView.mas_bottom).offset(24);
|
||||
}];
|
||||
|
||||
self.rightSeatView = [[QXRoomSeatContentView alloc] init];
|
||||
[self addSubview:self.rightSeatView];
|
||||
[self.rightSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.leftSeatView);
|
||||
make.left.mas_equalTo(SCREEN_WIDTH-ScaleWidth(65)-36);
|
||||
make.width.mas_equalTo(ScaleWidth(65));
|
||||
make.height.mas_equalTo(ScaleWidth(65)+25);
|
||||
|
||||
}];
|
||||
//
|
||||
//
|
||||
//
|
||||
self.heartCenterImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_cabin_heart"]];
|
||||
[self addSubview:self.heartCenterImageView];
|
||||
[self.heartCenterImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.leftSeatView.mas_right);
|
||||
make.right.equalTo(self.rightSeatView.mas_left);
|
||||
make.height.mas_equalTo(ScaleWidth(76));
|
||||
make.centerY.equalTo(self.leftSeatView).offset(-15);
|
||||
}];
|
||||
|
||||
self.numberLabel = [[UILabel alloc] init];
|
||||
self.numberLabel.text = @"0";
|
||||
self.numberLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.numberLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
|
||||
self.numberLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self addSubview:self.numberLabel];
|
||||
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.heartCenterImageView).offset(15);
|
||||
make.centerX.equalTo(self.heartCenterImageView);
|
||||
}];
|
||||
|
||||
CGFloat margin = (SCREEN_WIDTH-77*3)/4;
|
||||
self.micBtn = [[UIButton alloc] init];
|
||||
@@ -205,11 +212,16 @@
|
||||
|
||||
self.titleLabel.text = self.roomModel.room_info.room_name;
|
||||
self.numberLabel.text = self.roomModel.room_info.hot_value;
|
||||
|
||||
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
|
||||
long long milliseconds = (long long)(timeInterval);
|
||||
long long time = roomModel.cp_user.time_day.longLongValue - milliseconds;
|
||||
self.timeDownLabel.text = [NSString stringWithFormat:@"到期时间:%@",[NSString getTimeWithSecond:time]];
|
||||
|
||||
if ([self.roomModel.room_info.label_id isEqualToString:@"5"]) {
|
||||
/// 交友房私密小屋
|
||||
[self startTimer];
|
||||
}else{
|
||||
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
|
||||
long long milliseconds = (long long)(timeInterval);
|
||||
long long time = roomModel.cp_user.time_day.longLongValue - milliseconds;
|
||||
self.timeDownLabel.text = [NSString stringWithFormat:@"到期时间:%@",[NSString getTimeWithSecond:time]];
|
||||
}
|
||||
if (![roomModel.room_owner.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
self.movieBtn.hidden = YES;
|
||||
CGFloat margin = (SCREEN_WIDTH-77*2)/3;
|
||||
@@ -252,12 +264,46 @@
|
||||
// 开启屏幕采集
|
||||
[[QXAgoraEngine sharedEngine] startScreenCapture];
|
||||
}
|
||||
|
||||
|
||||
-(void)startTimer{
|
||||
MJWeakSelf
|
||||
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
|
||||
// 将秒转换为毫秒
|
||||
long long milliseconds = (long long)(timeInterval);
|
||||
self.startTime = self.roomModel.cp_user.time_day.longLongValue - milliseconds;
|
||||
if (self.startTime <= 0) {
|
||||
//时间错误不进行倒计时
|
||||
self.timeDownLabel.text = @"倒计时:00:00:00";
|
||||
return;
|
||||
}
|
||||
[self stopTimer];
|
||||
_timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
weakSelf.startTime--;
|
||||
NSInteger hour = self.startTime/60/60;
|
||||
NSInteger min = (self.startTime % 3600) / 60;
|
||||
NSInteger second = self.startTime % 60;
|
||||
weakSelf.timeDownLabel.text = [NSString stringWithFormat:@"倒计时:%02ld:%02ld:%02ld",hour,min,(long)second];
|
||||
if (weakSelf.startTime<=0) {
|
||||
[weakSelf stopTimer];
|
||||
weakSelf.timeDownLabel.text = @"00:00:00";
|
||||
}
|
||||
});
|
||||
}];
|
||||
}
|
||||
-(void)stopTimer{
|
||||
if (_timer) {
|
||||
[self->_timer invalidate];
|
||||
self->_timer= nil;
|
||||
}
|
||||
}
|
||||
-(void)cabinRoomHotValueDidChanged:(NSString *)hot_value{
|
||||
self.roomModel.room_info.hot_value = hot_value;
|
||||
self.numberLabel.text = self.roomModel.room_info.hot_value;
|
||||
}
|
||||
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time{
|
||||
self.roomModel.cp_user.time_day = end_time;
|
||||
[self startTimer];
|
||||
}
|
||||
-(void)closeAction{
|
||||
MJWeakSelf
|
||||
UIAlertController *al = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
|
||||
@@ -283,4 +329,15 @@
|
||||
// self.navigationController.interactivePopGestureRecognizer.enabled = YES;
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
-(void)destroyViews{
|
||||
if (_leftSeatView) {
|
||||
[_leftSeatView destroyViews];
|
||||
_leftSeatView = nil;
|
||||
}
|
||||
if (_rightSeatView) {
|
||||
[_rightSeatView destroyViews];
|
||||
_rightSeatView = nil;
|
||||
}
|
||||
[self stopTimer];
|
||||
}
|
||||
@end
|
||||
|
||||
65
QXLive/HomePage(声播)/View/房间/麦位视图/QXRoomSeatTypeFrientView.h
Normal file
65
QXLive/HomePage(声播)/View/房间/麦位视图/QXRoomSeatTypeFrientView.h
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// QXRoomSeatTypeFrientView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/8/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXUserModel.h"
|
||||
#import "QXRoomModel.h"
|
||||
#import "QXRoomSeatDelegate.h"
|
||||
#import "QXRoomSeatContentView.h"
|
||||
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
/// 等待
|
||||
QXSeatTypeFrientPartTypeWait = 1,
|
||||
/// 心动
|
||||
QXSeatTypeFrientPartTypeHeart = 2,
|
||||
/// 牵手
|
||||
QXSeatTypeFrientPartTypeHand = 3,
|
||||
}QXSeatTypeFrientPartType;
|
||||
|
||||
|
||||
@interface QXRoomSeatTypeFrientView : UIView
|
||||
/// 房间数据
|
||||
@property (nonatomic,strong)QXRoomModel *roomModel;
|
||||
/// 我自己的麦位
|
||||
@property (nonatomic,assign)NSInteger myPitNumber;
|
||||
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
|
||||
|
||||
/// 上下麦
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
|
||||
/// 交友房阶段发生变化 step 阶段 1等待 2心动 3牵手 friend_id 场次id
|
||||
-(void)friendPartDidChangedWithType:(NSString*)step friend_id:(NSString*)friend_id end_time:(NSString*)end_time relationModel:(QXRoomFriendRelationModel*)relationModel;
|
||||
/// 交友房时间发生延时 end_time 截止时间
|
||||
-(void)friendTimeDelayWithTime:(NSString*)end_time;
|
||||
/// 交友房麦位发生变化
|
||||
-(void)friendSeatDidChanged:(NSArray<QXRoomPitModel*>*)pitArray;
|
||||
/// 交友心动发生变化 [1000,100,50] 三组数据
|
||||
-(void)friendHeartNumberDidChanged:(NSArray<QXRoomFriendHeartListModel *> *)heartArray;
|
||||
/// 关系创建完成
|
||||
-(void)friendRelationIsCreatedWithrelationModel:(QXRoomFriendRelationModel*)relationModel;
|
||||
|
||||
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
|
||||
/// 用户信息发生改变
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
|
||||
|
||||
/// 销毁视图
|
||||
-(void)destroyViews;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXFrientSeatView : UIView
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatContentView *contentView;
|
||||
@property (nonatomic,strong)UIButton *powerBtn;
|
||||
@property (nonatomic,assign)BOOL isLeft;
|
||||
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
|
||||
@property (nonatomic,strong)QXRoomFriendHeartListModel *heartModel;
|
||||
@end
|
||||
|
||||
1349
QXLive/HomePage(声播)/View/房间/麦位视图/QXRoomSeatTypeFrientView.m
Normal file
1349
QXLive/HomePage(声播)/View/房间/麦位视图/QXRoomSeatTypeFrientView.m
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@
|
||||
#import "QXRoomSeatTypeNormalView.h"
|
||||
#import "QXRoomModel.h"
|
||||
#import "QXRoomSeatDelegate.h"
|
||||
#import "QXRoomFriendRelationModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
@@ -23,6 +24,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
QXRoomSeatViewTypeCabin,
|
||||
/// pk
|
||||
QXRoomSeatViewTypePK,
|
||||
/// 交友房
|
||||
QXRoomSeatViewTypeFriend,
|
||||
}QXRoomSeatViewType;
|
||||
|
||||
|
||||
@@ -55,6 +58,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 房间内用户信息发生变化
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
|
||||
|
||||
|
||||
|
||||
/// 拍卖位上下麦
|
||||
-(void)didAuctiontUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat;
|
||||
/// 开始拍卖
|
||||
@@ -65,6 +70,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
-(void)auctionDelayTimeWithEndTime:(NSString *)endTime;
|
||||
/// 拍卖类型发生变化
|
||||
-(void)auctionTypeDidChanged:(NSString *)type;
|
||||
|
||||
|
||||
|
||||
/// 私密小屋心动值发生变化
|
||||
-(void)cabinRoomHotValueDidChanged:(NSString*)hot_value;
|
||||
|
||||
@@ -82,6 +90,23 @@ typedef NS_ENUM(NSInteger) {
|
||||
victory_cover:(NSString*)victory_cover
|
||||
defeated_name:(NSString*)defeated_name
|
||||
defeated_cover:(NSString*)defeated_cover;
|
||||
|
||||
|
||||
|
||||
/// 交友房阶段发生变化 step 阶段 1等待 2心动 3牵手 friend_id 场次id
|
||||
-(void)friendPartDidChangedWithType:(NSString*)step friend_id:(NSString*)friend_id end_time:(NSString*)end_time relationModel:(QXRoomFriendRelationModel*)relationModel;
|
||||
/// 交友房时间发生延时 end_time 截止时间
|
||||
-(void)friendTimeDelayWithTime:(NSString*)end_time;
|
||||
/// 交友房麦位发生变化
|
||||
-(void)friendSeatDidChanged:(NSArray<QXRoomPitModel*>*)pitArray;
|
||||
/// 心动值发生变化
|
||||
-(void)friendHeartNumberDidChanged:(NSArray<QXRoomFriendHeartListModel *> *)heartArray;
|
||||
/// 关系创建完成
|
||||
-(void)friendRelationIsCreatedWithrelationModel:(QXRoomFriendRelationModel*)relationModel;
|
||||
/// 有人退出交友房私密小屋
|
||||
-(void)friendCabinRoomIsQuit;
|
||||
/// 私密小屋时间发生延时
|
||||
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#import "QXRoomOnlineUserListView.h"
|
||||
#import "QXRoomSeatTypeCabinView.h"
|
||||
#import "QXRoomSeatPKView.h"
|
||||
#import "QXRoomSeatTypeFrientView.h"
|
||||
|
||||
@interface QXRoomSeatView()<QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)QXRoomSeatTypeNormalView *normalSeatView;
|
||||
@@ -24,6 +25,8 @@
|
||||
@property (nonatomic,strong)QXRoomSeatTypeCabinView *cabinView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatPKView *roomPkView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatTypeFrientView *roomFriendView;
|
||||
@end
|
||||
|
||||
|
||||
@@ -151,6 +154,39 @@
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_roomFriendView) {
|
||||
_roomFriendView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_roomFriendView destroyViews];
|
||||
[self->_roomFriendView removeFromSuperview];
|
||||
self->_roomFriendView = 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);
|
||||
@@ -263,6 +299,39 @@
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_roomFriendView) {
|
||||
_roomFriendView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_roomFriendView destroyViews];
|
||||
[self->_roomFriendView removeFromSuperview];
|
||||
self->_roomFriendView = 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);
|
||||
@@ -372,7 +441,39 @@
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_roomFriendView) {
|
||||
_roomFriendView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
} completion:^(BOOL finished) {
|
||||
[self->_roomFriendView destroyViews];
|
||||
[self->_roomFriendView removeFromSuperview];
|
||||
self->_roomFriendView = 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);
|
||||
@@ -456,6 +557,113 @@
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
-(void)initRoomFriendView{
|
||||
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.roomFriendView];
|
||||
[self.roomFriendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.roomFriendView.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.roomFriendView];
|
||||
[self.roomFriendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.roomFriendView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (_songView) {
|
||||
_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.roomFriendView];
|
||||
[self.roomFriendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
self.roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01);
|
||||
// 弹性动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:0
|
||||
usingSpringWithDamping:0.9
|
||||
initialSpringVelocity:0.1
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.roomFriendView.transform = CGAffineTransformIdentity;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
[self addSubview:self.roomFriendView];
|
||||
[self.roomFriendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initCabinView{
|
||||
self.cabinView = [[QXRoomSeatTypeCabinView alloc] init];
|
||||
@@ -483,11 +691,15 @@
|
||||
case QXRoomSeatViewTypePK:
|
||||
self.roomPkView.myPitNumber = myPitNumber;
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
self.roomFriendView.myPitNumber = myPitNumber;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)setType:(QXRoomSeatViewType)type{
|
||||
_type = type;
|
||||
switch (type) {
|
||||
@@ -517,6 +729,10 @@
|
||||
[self initRoomPKView];
|
||||
}
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self initRoomFriendView];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -574,6 +790,9 @@
|
||||
case QXRoomSeatViewTypePK:
|
||||
self.roomPkView.roomModel = roomModel;
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
self.roomFriendView.roomModel = roomModel;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -637,6 +856,9 @@
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView clearCharm];
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
[self.roomFriendView clearCharm];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -658,6 +880,9 @@
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView setSeatCharmWithUser:model];
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
[self.roomFriendView setSeatCharmWithUser:model];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -707,6 +932,83 @@
|
||||
}
|
||||
}
|
||||
|
||||
#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{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendPartDidChangedWithType:step friend_id:friend_id end_time:end_time relationModel:relationModel];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/// 交友房时间发生延时 end_time 截止时间
|
||||
-(void)friendTimeDelayWithTime:(NSString*)end_time{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendTimeDelayWithTime:end_time];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)friendSeatDidChanged:(NSArray<QXRoomPitModel *> *)pitArray{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendSeatDidChanged:pitArray];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)friendHeartNumberDidChanged:(NSArray<QXRoomFriendHeartListModel *> *)heartArray{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendHeartNumberDidChanged:heartArray];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/// 关系创建完成
|
||||
-(void)friendRelationIsCreatedWithrelationModel:(QXRoomFriendRelationModel*)relationModel{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeFriend:{
|
||||
[self.roomFriendView friendRelationIsCreatedWithrelationModel:relationModel];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/// 有人退出交友房私密小屋
|
||||
-(void)friendCabinRoomIsQuit{
|
||||
|
||||
}
|
||||
/// 私密小屋时间发生延时
|
||||
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time{
|
||||
switch (self.type) {
|
||||
case QXRoomSeatViewTypeCabin:{
|
||||
[self.cabinView friendCabinRoomTimeDelayWithTime:end_time];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// 助力
|
||||
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString *)heartId{
|
||||
if ([self.delegate respondsToSelector:@selector(friendPowerSendGiftWithUser:heartId:)]) {
|
||||
[self.delegate friendPowerSendGiftWithUser:user heartId:heartId];
|
||||
}
|
||||
}
|
||||
|
||||
-(QXRoomSeatTypeNormalView *)normalSeatView{
|
||||
if (!_normalSeatView) {
|
||||
_normalSeatView = [[QXRoomSeatTypeNormalView alloc] init];
|
||||
@@ -756,6 +1058,9 @@
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
[self.roomFriendView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -829,6 +1134,9 @@
|
||||
case QXRoomSeatViewTypePK:
|
||||
[self.roomPkView roomUserInfoDidChanged:user];
|
||||
break;
|
||||
case QXRoomSeatViewTypeFriend:
|
||||
[self.roomFriendView roomUserInfoDidChanged:user];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -837,15 +1145,26 @@
|
||||
-(void)destroyViews{
|
||||
if (_normalSeatView) {
|
||||
[self.normalSeatView destroyViews];
|
||||
_normalSeatView = nil;
|
||||
}
|
||||
if (_songView) {
|
||||
[self.songView destroyViews];
|
||||
_songView = nil;
|
||||
}
|
||||
if (_auctionView) {
|
||||
[self.auctionView destroyViews];
|
||||
}
|
||||
if (_roomPkView) {
|
||||
[self.roomPkView destroyViews];
|
||||
_roomPkView = nil;
|
||||
}
|
||||
if (_roomFriendView) {
|
||||
[self.roomFriendView destroyViews];
|
||||
_roomFriendView = nil;
|
||||
}
|
||||
if (_cabinView) {
|
||||
[self.cabinView destroyViews];
|
||||
_cabinView = nil;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -871,4 +1190,11 @@
|
||||
}
|
||||
return _roomPkView;
|
||||
}
|
||||
-(QXRoomSeatTypeFrientView *)roomFriendView{
|
||||
if (!_roomFriendView) {
|
||||
_roomFriendView = [[QXRoomSeatTypeFrientView alloc] init];
|
||||
_roomFriendView.delegate = self;
|
||||
}
|
||||
return _roomFriendView;
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user