This commit is contained in:
启星
2026-01-08 18:31:27 +08:00
parent 5ab030701c
commit 796f64f5e3
129 changed files with 5425 additions and 230 deletions

View File

@@ -65,6 +65,9 @@
} fail:^(int code, NSString * _Nullable msg) {
QXLOG(@"腾讯im退出登录失败");
}];
if (self.roomId) {
[self quitRoomWithRoomId:self.roomId removeListener:YES];
}
self.isLogin = NO;
[self removeLocalData];
[self removeMemory];
@@ -306,7 +309,6 @@
}
weakSelf.isClickJoinRoom = YES;
[QXMineNetwork beforeJoinRoomWithRoomId:roomId successBlock:^(NSDictionary * _Nonnull dict) {
weakSelf.isClickJoinRoom = NO;
if (self != nil) {
if (self->_miniView) {
[self->_miniView removeFromSuperview];
@@ -315,6 +317,7 @@
}
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
weakSelf.isClickJoinRoom = NO;
if (weakSelf.roomId && ![weakSelf.roomId isEqualToString:roomId]) {
[weakSelf quitRoomWithRoomId:weakSelf.roomId removeListener:NO];
}
@@ -329,10 +332,12 @@
[navagationController pushViewController:weakSelf.roomVC animated:YES];
weakSelf.roomId = roomId;
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;
[weakSelf showAlertWithMessage:msg roomId:roomId];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
// hideLoadingInView(KEYWINDOW)
weakSelf.isClickJoinRoom = NO;
}];
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;

View File

@@ -394,7 +394,11 @@
/// 2
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
@weakify(self)
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
NSString *giftBag = @"";
if (self.giftModel.activities_id.intValue == 4) {
giftBag = self.giftModel.gift_bag;
}
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" gift_bag_id:giftBag successBlock:^(NSDictionary * _Nonnull dict) {
@strongify(self)
if (type.intValue == 1) {
if (self.roomSendSuccessBlock) {
@@ -438,7 +442,11 @@
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
// NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
@weakify(self)
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
NSString *giftBag = @"";
if (self.giftModel.activities_id.intValue == 4) {
giftBag = self.giftModel.gift_bag;
}
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" gift_bag_id:giftBag successBlock:^(NSDictionary * _Nonnull dict) {
@strongify(self)
if (type.intValue == 1) {
@@ -1271,9 +1279,13 @@
-(void)sendAction{
[self startAnimation];
[[QXGlobal shareGlobal] vibrationFeedback];
NSString *giftBag = @"";
if (self.giftModel.activities_id.intValue == 4) {
giftBag = self.giftModel.gift_bag;
}
switch (self.sendType) {
case QXSendGiftViewTypeRoom:
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:self.userId heart_id:self.heartId type:@"1" pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:self.userId heart_id:self.heartId type:@"1" pit_number:@"" gift_bag_id:giftBag successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg)
@@ -1287,7 +1299,7 @@
}];
break;
case QXSendGiftViewTypeFriend:
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:self.userId heart_id:self.heartId type:@"1" pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:self.userId heart_id:self.heartId type:@"1" pit_number:@"" gift_bag_id:giftBag successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg)

View File

@@ -561,7 +561,7 @@
@"position":[NSNumber numberWithInteger:positionMs],
};
NSString *jsonStr = [dict jsonStringEncoded];
[[QXRoomMessageManager shared] sendChatMessage:jsonStr messageType:(QXRoomMessageTypeSongLrc) needInsertMessage:NO];
[[QXRoomMessageManager shared] sendChatMessage:jsonStr messageType:(QXRoomMessageTypeSongLrc) needInsertMessage:NO isSuperRoom:NO];
// if (self.roomInfo.is_xiangqin == 1){

View File

@@ -166,6 +166,15 @@ typedef NS_ENUM(NSInteger) {
/// 爆币推送特效
QXRoomMessageTypeCoinBoomEffect = 1100,
/// 撩人礼物特效
QXRoomMessageTypeSeductionEffect = 1200,
/// 约她成功
QXRoomMessageTypeJoinBarCabinRoom = 1201,
/// 收到要被抱上麦
QXRoomMessageTypeBarRoomHugPit = 1202,
/// 麦上用户设置了自定义礼物
QXRoomMessageTypeBarRoomSetCustomGift = 1203,
}QXRoomMessageType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXRoomMessageManagerDelegate <NSObject>
@@ -176,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 根据用户userid 插入消息
-(void)didInsertMessge:(QXRoomChatListModel*)message userId:(NSString*)userId;
/// 上下麦
-(void)didUpDownSeatWithUser:(QXUserHomeModel*)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number isPK:(BOOL)isPK;
-(void)didUpDownSeatWithUser:(QXUserHomeModel*)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number isPK:(BOOL)isPK end_time:(NSString*)end_time;
/// 上麦模式发生变化 2 自由麦 | 1 排麦
-(void)aplayPitModeDidChanged:(NSString*)upMicType;
/// 排麦人数发生变化
@@ -323,6 +332,18 @@ NS_ASSUME_NONNULL_BEGIN
/// 主持邀请上签约麦
-(void)signSeatInviteWithUserId:(NSString*)userId content:(NSString*)content;
/// 酒吧房
/// 收到撩他特效
-(void)barRoomSeductionEffectWithModel:(QXRoomChatListModel*)model;
/// 需要进入小黑屋
-(void)barRoomJoinCabinRoomWithRoomId:(NSString*)room_id user_id:(NSString*)user_id meet_user_id:(NSString*)meet_user_id;
/// 收到要被抱上麦了
-(void)barRoomHugPitWithUserId:(NSString*)userId pit_number:(NSString*)pit_number;
/// 设置了自定义礼物
-(void)barRoomSetCustomGiftWithUserId:(NSString*)userId had_custom_gift:(BOOL)had_custom_gift;
@end
@interface QXRoomMessageManager : NSObject
@property (nonatomic,weak)id<QXRoomMessageManagerDelegate>delegate;
@@ -334,12 +355,16 @@ NS_ASSUME_NONNULL_BEGIN
/// 加入房间群组
-(void)joinGroupWithRoomId:(NSString*)roomId;
-(void)joinExGroupWithRoomId:(NSString*)roomId;
/// 退出
-(void)quitExGroup;
/// 退出房间群组
-(void)quitGroupWithRoomId:(NSString*)roomId removeListener:(BOOL)removeListener;
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage;
/// 发送消息
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage isSuperRoom:(BOOL)isSuperRoom;
/// 发送表情
-(void)sendChatEmoji:(QXEmojiModel *)emoji;
-(void)sendChatEmoji:(QXEmojiModel *)emoji isSuperRoom:(BOOL)isSuperRoom;
-(void)sendC2CMessage:(NSString *)message messageType:(QXRoomMessageType)messageType userId:(NSString*)userId;

View File

@@ -19,6 +19,8 @@
@interface QXRoomMessageManager() <V2TIMGroupListener,V2TIMSimpleMsgListener,V2TIMAdvancedMsgListener>
@property (nonatomic,strong)NSString *groupId;
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)NSString *exRoomId;
@property (nonatomic,strong)NSString *exGroupId;
@end
@implementation QXRoomMessageManager
+ (instancetype)shared {
@@ -60,6 +62,24 @@
[QXLogger infoWithTag:@"房间日志" format:@"腾讯IM加入聊天室失败-code%d-原因%@",code,desc];
}];
}
-(void)joinExGroupWithRoomId:(NSString *)roomId{
[[V2TIMManager sharedInstance] addGroupListener:self];
[[V2TIMManager sharedInstance] addAdvancedMsgListener:self];
NSString *exGroupId = [NSString stringWithFormat:@"room%@",roomId];
self.exGroupId = exGroupId;
self.exRoomId = roomId;
[[V2TIMManager sharedInstance] joinGroup:exGroupId msg:@"大家好,我来啦" succ:^{
QXLOG(@"腾讯IM小黑屋加入聊天室成功");
// weakSelf.groupId = groupId;
// weakSelf.roomId = roomId;
[QXLogger infoWithTag:@"房间日志" format:@"腾讯IM小黑屋加入聊天室成功房间id=%@",roomId];
} fail:^(int code, NSString *desc) {
//
QXLOG(@"腾讯IM小黑屋加入聊天室失败-code%d-原因%@",code,desc);
[QXLogger infoWithTag:@"房间日志" format:@"腾讯IM小黑屋加入聊天室失败-code%d-原因%@",code,desc];
}];
}
-(void)quitGroupWithRoomId:(NSString *)roomId removeListener:(BOOL)removeListener{
if (removeListener) {
self.groupId = nil;
@@ -75,6 +95,10 @@
}];
}
-(void)quitExGroup{
self.exGroupId = nil;
self.exRoomId = nil;
}
//
-(void)onMemberEnter:(NSString *)groupID memberList:(NSArray<V2TIMGroupMemberInfo *> *)memberList{
@@ -103,7 +127,8 @@
QXRoomMessage *msg = [QXRoomMessage yy_modelWithJSON:jsonStr];
NSString *groupId = [NSString stringWithFormat:@"room%@",msg.RoomId];
[QXLogger infoWithTag:@"推送日志" format:@"房间id=%@收到系统推送%@",msg.RoomId,jsonStr];
if ([groupId isEqualToString:self.groupId]) {
if ([groupId isEqualToString:self.groupId] || [groupId isEqualToString:self.exGroupId]) {
BOOL isSuperRoom = [self.exGroupId isEqualToString:groupId];
//
NSInteger meesageType = msg.MsgType.integerValue;
switch (meesageType) {
@@ -116,15 +141,23 @@
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
model.messageType = QXRoomChatMessageTypeSystem;
NSString *jia_jia = [NSString stringWithFormat:@"%@",msg.Text[@"jia_jia"]];
if (([jia_jia hasPrefix:@"http"] || [jia_jia hasPrefix:@"https"]) && ([jia_jia hasSuffix:@"svga"] || [jia_jia hasSuffix:@"mp4"])) {
// QXGiftModel *md = [[QXGiftModel alloc] init];
// md.play_image = jia_jia;
[[QXGiftPlayerManager shareManager] displayChatEffectView:jia_jia];
if ([self.exRoomId isExist] && [self.roomId isExist]) {
///
if ([groupId isEqualToString:self.groupId]){
if (([jia_jia hasPrefix:@"http"] || [jia_jia hasPrefix:@"https"]) && ([jia_jia hasSuffix:@"svga"] || [jia_jia hasSuffix:@"mp4"])) {
[[QXGiftPlayerManager shareManager] displayChatEffectView:jia_jia];
}
}
}else{
if (([jia_jia hasPrefix:@"http"] || [jia_jia hasPrefix:@"https"]) && ([jia_jia hasSuffix:@"svga"] || [jia_jia hasSuffix:@"mp4"])) {
[[QXGiftPlayerManager shareManager] displayChatEffectView:jia_jia];
}
}
if ([model.FromUserInfo.enter_image isExist]) {
[[QXDrifNobilityJoinRoomView shareView] addNobilityUserModel:model];
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
if ([model.FromUserInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
@@ -146,11 +179,21 @@
///
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
model.messageType = QXRoomChatMessageTypeGift;
if ([model.GiftInfo.play_image isExist]) {
NSArray *arr = [model.GiftInfo.play_image componentsSeparatedByString:@","];
[[QXGiftPlayerManager shareManager] displayFullEffectViewWithMorePlayImages:arr];
if ([self.exRoomId isExist] && [self.roomId isExist]) {
///
if ([groupId isEqualToString:self.groupId]){
NSArray *arr = [model.GiftInfo.play_image componentsSeparatedByString:@","];
[[QXGiftPlayerManager shareManager] displayFullEffectViewWithMorePlayImages:arr];
[[QXGiftDisplayManager sharedManager] receiveGift:model];
}
}else{
if ([model.GiftInfo.play_image isExist]) {
NSArray *arr = [model.GiftInfo.play_image componentsSeparatedByString:@","];
[[QXGiftPlayerManager shareManager] displayFullEffectViewWithMorePlayImages:arr];
}
[[QXGiftDisplayManager sharedManager] receiveGift:model];
}
[[QXGiftDisplayManager sharedManager] receiveGift:model];
if (model.ToUserInfos.count>0) {
if (self.delegate && [self.delegate respondsToSelector:@selector(didRecieveGiftWithWithUserInfos:)]) {
[self.delegate didRecieveGiftWithWithUserInfos:model.ToUserInfos];
@@ -164,6 +207,7 @@
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}
@@ -184,12 +228,13 @@
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
if (!model.is_pk) {
// pk
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didUpDownSeatWithUser:isUpSeat:pit_number:isPK:)]) {
if (self.delegate && [self.delegate respondsToSelector:@selector(didUpDownSeatWithUser:isUpSeat:pit_number:isPK:end_time:)]) {
NSString *pit_number = [NSString stringWithFormat:@"%@",msg.Text[@"pit_number"]];
[self.delegate didUpDownSeatWithUser:model.FromUserInfo isUpSeat:YES pit_number:pit_number.integerValue isPK:model.is_pk];
[self.delegate didUpDownSeatWithUser:model.FromUserInfo isUpSeat:YES pit_number:pit_number.integerValue isPK:model.is_pk end_time:model.end_time];
}
}
break;
@@ -200,12 +245,13 @@
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
if (!model.is_pk) {
// pk
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didUpDownSeatWithUser:isUpSeat:pit_number:isPK:)]) {
if (self.delegate && [self.delegate respondsToSelector:@selector(didUpDownSeatWithUser:isUpSeat:pit_number:isPK:end_time:)]) {
NSString *pit_number = [NSString stringWithFormat:@"%@",msg.Text[@"pit_number"]];
[self.delegate didUpDownSeatWithUser:model.FromUserInfo isUpSeat:NO pit_number:pit_number.integerValue isPK:model.is_pk];
[self.delegate didUpDownSeatWithUser:model.FromUserInfo isUpSeat:NO pit_number:pit_number.integerValue isPK:model.is_pk end_time:model.end_time];
}
}
break;
@@ -744,10 +790,54 @@
NSString *jia_jia = [NSString stringWithFormat:@"%@",msg.Text[@"play_image"]];
[[QXGiftPlayerManager shareManager] displayChatEffectView:jia_jia];
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}
break;
case QXRoomMessageTypeSeductionEffect:{
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
if (self.delegate && [self.delegate respondsToSelector:@selector(barRoomSeductionEffectWithModel:)]) {
[self.delegate barRoomSeductionEffectWithModel:model];
}
}
break;
case QXRoomMessageTypeJoinBarCabinRoom:{
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
NSString *cabinRoomId = [NSString stringWithFormat:@"%@",msg.Text[@"room_id"]];
NSString *user_id = [NSString stringWithFormat:@"%@",msg.Text[@"user_id"]];
NSString *meet_user_id = [NSString stringWithFormat:@"%@",msg.Text[@"meet_user_id"]];
if (self.delegate && [self.delegate respondsToSelector:@selector(barRoomJoinCabinRoomWithRoomId:user_id:meet_user_id:)]) {
[self.delegate barRoomJoinCabinRoomWithRoomId:cabinRoomId user_id:user_id meet_user_id:meet_user_id];
}
}
break;
case QXRoomMessageTypeBarRoomHugPit:{
NSString *user_id = [NSString stringWithFormat:@"%@",msg.Text[@"user_id"]];
NSString *pit_number = [NSString stringWithFormat:@"%@",msg.Text[@"pit_number"]];
if (self.delegate && [self.delegate respondsToSelector:@selector(barRoomHugPitWithUserId:pit_number:)]) {
[self.delegate barRoomHugPitWithUserId:user_id pit_number:pit_number];
}
}
break;
case QXRoomMessageTypeBarRoomSetCustomGift:{
NSString *user_id = [NSString stringWithFormat:@"%@",msg.Text[@"user_id"]];
NSString *type = [NSString stringWithFormat:@"%@",msg.Text[@"type"]];
if (self.delegate && [self.delegate respondsToSelector:@selector(barRoomSetCustomGiftWithUserId:had_custom_gift:)]) {
[self.delegate barRoomSetCustomGiftWithUserId:user_id had_custom_gift:type.intValue==1];
}
}
break;
default:
break;
}
@@ -871,12 +961,16 @@
-(void)onRecvGroupCustomMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info customData:(NSData *)data{
NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
QXRoomMessage *msg = [QXRoomMessage yy_modelWithJSON:jsonStr];
if ([groupID isEqualToString:self.groupId]) {
NSString *groupId = [NSString stringWithFormat:@"room%@",msg.RoomId];
[QXLogger infoWithTag:@"推送日志" format:@"房间id=%@收到系统推送%@",msg.RoomId,jsonStr];
if ([groupId isEqualToString:self.groupId] || [groupId isEqualToString:self.exGroupId]) {
BOOL isSuperRoom = [self.exGroupId isEqualToString:groupId];
NSInteger meesageType = msg.MsgType.integerValue;
if (meesageType == QXRoomMessageTypeText) {
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
model.messageType = QXRoomChatMessageTypeChat;
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}else if (meesageType == QXRoomMessageTypeClearMessage) {
@@ -907,6 +1001,7 @@
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
model.messageType = QXRoomChatMessageTypeEmoji;
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}
@@ -914,9 +1009,9 @@
}
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage{
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage isSuperRoom:(BOOL)isSuperRoom{
NSDictionary *dict = @{
@"RoomId":self.roomId?self.roomId:@"",
@"RoomId":isSuperRoom?self.exRoomId?:@"":self.roomId?:@"",
@"MsgType":[NSNumber numberWithInteger:messageType],
@"Text":@{
@"FromUserInfo":@{
@@ -945,22 +1040,23 @@
model.FromUserInfo = userInfo;
model.messageType = QXRoomChatMessageTypeChat;
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
}
NSString *jsonStr = [dict jsonStringEncoded];
NSData *data =[jsonStr dataUsingEncoding:NSUTF8StringEncoding];
[[V2TIMManager sharedInstance] sendGroupCustomMessage:data to:self.groupId priority:V2TIM_PRIORITY_NORMAL succ:^{
[[V2TIMManager sharedInstance] sendGroupCustomMessage:data to:isSuperRoom?self.exGroupId?:@"":self.groupId?:@"" priority:V2TIM_PRIORITY_NORMAL succ:^{
QXLOG(@"发送自定义消息成功");
} fail:^(int code, NSString * _Nullable desc) {
QXLOG(@"发送自定义消息失败");
}];
}
-(void)sendChatEmoji:(QXEmojiModel *)emoji{
-(void)sendChatEmoji:(QXEmojiModel *)emoji isSuperRoom:(BOOL)isSuperRoom{
NSDictionary *dict = @{
@"RoomId":self.roomId?self.roomId:@"",
@"RoomId":isSuperRoom?self.exRoomId?:@"":self.roomId?:@"",
@"MsgType":[NSNumber numberWithInteger:QXRoomMessageTypeEmoji],
@"Text":@{
@"FromUserInfo":@{
@@ -993,11 +1089,12 @@
model.messageType = QXRoomChatMessageTypeEmoji;
model.emoji = emoji;
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.isSuperRoom = isSuperRoom;
[self.delegate didInsertMessge:model];
}
NSString *jsonStr = [dict jsonStringEncoded];
NSData *data =[jsonStr dataUsingEncoding:NSUTF8StringEncoding];
[[V2TIMManager sharedInstance] sendGroupCustomMessage:data to:self.groupId priority:V2TIM_PRIORITY_NORMAL succ:^{
[[V2TIMManager sharedInstance] sendGroupCustomMessage:data to:isSuperRoom?self.exGroupId?:@"":self.groupId?:@"" priority:V2TIM_PRIORITY_NORMAL succ:^{
QXLOG(@"发送自定义消息成功");
} fail:^(int code, NSString * _Nullable desc) {
QXLOG(@"发送自定义消息失败");

View File

@@ -16,6 +16,7 @@
@property (nonatomic,strong)NSString* startTime;
@property (nonatomic,strong)NSString* endTime;
@property (nonatomic,strong)NSString* last_id;
@end
@implementation QXCornRecordSubViewController
@@ -32,7 +33,7 @@
[dateBg addSubview:self.dateView];
[self.view addSubview:dateBg];
[self.view addSubview:self.tableView];
self.page = 1;
self.last_id = @"";
}
-(void)getData{
// [self.dataArray addObject:@""];
@@ -41,15 +42,17 @@
// [self.tableView reloadData];
//
__weak typeof(self) weakSelf = self;
[QXMineNetwork roomCoinOrDiamondDetailWithPage:self.page in_out_type:[NSString stringWithFormat:@"%ld",self.type+1] start_time:self.startTime end_time:self.endTime gift_type:[NSString stringWithFormat:@"%ld",self.waterType+1] successBlock:^(NSArray<QXCoinDetailModel *> * _Nonnull list) {
[QXMineNetwork roomCoinOrDiamondDetailWithLastId:self.last_id in_out_type:[NSString stringWithFormat:@"%ld",self.type+1] start_time:self.startTime end_time:self.endTime gift_type:[NSString stringWithFormat:@"%ld",self.waterType+1] successBlock:^(NSArray<QXCoinDetailModel *> * _Nonnull list) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
return;
}
if (strongSelf.page == 1) {
if (strongSelf.last_id.length == 0) {
[strongSelf.dataArray removeAllObjects];
}
QXCoinDetailModel *lastModel = list.lastObject;
weakSelf.last_id = lastModel.id;
[strongSelf.dataArray addObjectsFromArray:list];
[strongSelf.tableView reloadData];
if (list.count == 0) {
@@ -83,7 +86,7 @@
QXLOG(@"开始时间-%@ 结束时间-%@",startDateString,endDateString);
self.startTime = startDateString;
self.endTime = endDateString;
self.page = 1;
self.last_id = @"";
[self getData];
}
@@ -106,11 +109,10 @@
_tableView.rowHeight = UITableViewAutomaticDimension;
MJWeakSelf
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 1;
weakSelf.last_id = @"";
[weakSelf getData];
}];
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getData];
}];
}

View File

@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *remarks;
/// 时间
@property (nonatomic,strong)NSString *createtime;
/// 最后一个id
@property (nonatomic,strong)NSString *id;
@end

View File

@@ -14,7 +14,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *num;
/// 礼物名称
@property (nonatomic,strong)NSString *gift_name;
/// 礼物图片
/// 设置自定义礼物名称
@property (nonatomic,strong)NSString *gift_remark_name;
/// 礼物图片as
@property (nonatomic,strong)NSString *base_image;
/// 礼物特效
@property (nonatomic,strong)NSString *play_image;
@@ -41,6 +43,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 是否为师徒标签
@property (nonatomic,strong)NSString *is_teacher;
/// 当前钱包余额
@property (nonatomic,strong)NSString *user_wallet_coin;
@property (nonatomic,assign)BOOL isSelected;
@end

View File

@@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *room_cover;
/// 房间公告
@property (nonatomic,strong)NSString *room_intro;
/// 房间类型 type_id 1 点唱 2 拍卖 3男神 4女神 6小黑屋 7 交友房
/// 房间类型 type_id 1k歌+普通 2 拍卖 3男神 4女神 6小黑屋 7 交友房 9点唱 10签约房 11 酒吧房
@property (nonatomic,strong)NSString *type_id;
/// 房间子类型 label_id 1聊天 2 k歌 拍卖时 1真爱 2亲密
@property (nonatomic,strong)NSString *label_id;
@@ -82,6 +82,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *last_pk_room_id;
/// 排麦人数
@property (nonatomic,strong)NSString *queue_number;
/// 酒吧房撩人所需金币数
@property (nonatomic,strong)NSString *sexy_coin;
@end
@@ -128,6 +130,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *nickname_color;
@property (nonatomic,strong)NSString *is_online;
/// 酒吧房
/// 酒吧房麦位时长
@property (nonatomic,strong)NSString *end_time;
/// 是否有设置自定义礼物 0 没设置 1已设置
@property (nonatomic,assign)NSInteger had_custom_gift;
@property (nonatomic,assign)BOOL isSelected;
@end

View File

@@ -140,6 +140,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXUserHomeModel *master;
@property (nonatomic,assign)NSInteger had_custom_gift;
-(instancetype)copyModel;
@end

View File

@@ -0,0 +1,21 @@
//
// QXRoomSeatTimeModel.h
// QXLive
//
// Created by 启星 on 2026/1/6.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomSeatTimeModel : NSObject
/// 时间
@property (nonatomic,strong)NSString *time;
/// 时间字符串
@property (nonatomic,strong)NSString *time_str;
@property (nonatomic,assign)BOOL isSelected;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// QXRoomSeatTimeModel.m
// QXLive
//
// Created by on 2026/1/6.
//
#import "QXRoomSeatTimeModel.h"
@implementation QXRoomSeatTimeModel
@end

View File

@@ -33,6 +33,7 @@
#import "QXFamilyModel.h"
#import "QXRoomActivityStatusModel.h"
#import "QXConfig.h"
#import "QXRoomSeatTimeModel.h"
NS_ASSUME_NONNULL_BEGIN
@@ -354,6 +355,7 @@ NS_ASSUME_NONNULL_BEGIN
heart_id:(NSString*)heart_id
type:(NSString*)type
pit_number:(NSString*)pit_number
gift_bag_id:(NSString*)gift_bag_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@@ -378,6 +380,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
+(void)roomUpSeatWithRoomId:(NSString*)room_id
pit_number:(NSString*)pit_number
gift_id:(NSString*)gift_id
isUpSeat:(BOOL)isUpSeat
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@@ -831,7 +834,7 @@ NS_ASSUME_NONNULL_BEGIN
gift_type 1金币2收益钻石
in_out_type 1收入2支出
*/
+(void)roomCoinOrDiamondDetailWithPage:(NSInteger)page
+(void)roomCoinOrDiamondDetailWithLastId:(NSString*)last_id
in_out_type:(NSString*)in_out_type
start_time:(NSString*)start_time
end_time:(NSString*)end_time
@@ -1493,6 +1496,81 @@ NS_ASSUME_NONNULL_BEGIN
num:(NSString*)num
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
#pragma mark - 酒吧房
/**
label 礼物标签(类型)不传返回所有礼物,拍卖 传99 酒吧房自定义礼物 14 酒吧房普通礼物15 酒吧房小黑屋礼物 16 酒吧房撩TA礼物17
type 类型位置1-房间送礼礼物2-排麦设置插麦礼物3-拍卖位选择拍卖礼物4-歌手添加歌单礼物5-动态打赏礼物 6酒吧房
新礼物列表
*/
+(void)getRoomNewGiftListWithLabel:(NSString*)label
type:(NSString*)type
successBlock:(void (^)(NSArray<QXGiftModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
获取自定义礼物列表
*/
+(void)getRoomCustomGiftWithUserId:(NSString*)userId
successBlock:(void (^)(NSArray<QXGiftModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
设置自定义礼物
*/
+(void)setRoomCustomGiftWithGiftId:(NSString*)gift_id
roomId:(NSString*)roomId
newGiftName:(NSString*)new_gift_name
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
获取酒吧房麦位时间列表
*/
+(void)getRoomSeatTimeListSuccessBlock:(void (^)(NSArray<QXRoomSeatTimeModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
房间麦位时长设置
*/
+(void)setRoomSeatTimeWithRoomId:(NSString*)roomId
time:(NSString*)time
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
约Ta礼物详情
*/
+(void)roomAskUserGiftWithRoomId:(NSString*)roomId
toUserId:(NSString*)toUserId
successBlock:(void (^)(QXGiftModel* model))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
撩他
*/
+(void)roomSeductionWithRoomId:(NSString*)roomId
to_user_id:(NSString*)to_user_id
type:(NSString*)type
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
约他
*/
+(void)roomBarAskWithRoomId:(NSString*)roomId
user_id:(NSString*)user_id
gift_id:(NSString*)gift_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end

View File

@@ -617,7 +617,7 @@
+(void)joinRoomWithRoomId:(NSString *)room_id successBlock:(nonnull void (^)(QXRoomModel * _Nonnull))successBlock roomErrorBlock:(nonnull void (^)(NSString * _Nonnull, NSString * _Nonnull))roomErrorBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@"room_id":room_id
@"room_id":room_id?:@""
};
[[QXRequset shareInstance] postWithUrl:QXJoinRoom parameters:parameters needCache:NO success:^(id responseObject) {
int code = [responseObject[@"code"] intValue];
@@ -719,6 +719,7 @@
heart_id:(NSString*)heart_id
type:(NSString*)type
pit_number:(NSString*)pit_number
gift_bag_id:(NSString*)gift_bag_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@@ -728,7 +729,8 @@
@"to_uid":to_uid?to_uid:@"",
@"type":type?type:@"",
@"pit_number":pit_number?pit_number:@"",
@"heart_id":heart_id?heart_id:@""
@"heart_id":heart_id?heart_id:@"",
@"gift_bag_id":gift_bag_id?:@"",
};
__block NSString *userId = to_uid;
[[QXRequset shareInstance] postWithUrl:QXSendGift parameters:parameters needCache:NO success:^(id responseObject) {
@@ -795,12 +797,14 @@
+(void)roomUpSeatWithRoomId:(NSString*)room_id
pit_number:(NSString*)pit_number
gift_id:(NSString*)gift_id
isUpSeat:(BOOL)isUpSeat
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"room_id":room_id,
@"pit_number":pit_number?pit_number:@""
@"pit_number":pit_number?pit_number:@"",
@"gift_id":gift_id?:@""
};
[[QXRequset shareInstance] postWithUrl:isUpSeat?QXRoomUpSeat:QXRoomDownSeat parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
@@ -1642,7 +1646,7 @@
}];
}
+(void)roomCoinOrDiamondDetailWithPage:(NSInteger)page
+(void)roomCoinOrDiamondDetailWithLastId:(NSString*)last_id
in_out_type:(NSString *)in_out_type
start_time:(NSString *)start_time
end_time:(NSString *)end_time
@@ -1650,11 +1654,11 @@
successBlock:(void (^)(NSArray<QXCoinDetailModel *> * _Nonnull))successBlock
failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@"page":[NSNumber numberWithInteger:page],
@"last_id":last_id?:@"",
@"gift_type":gift_type?gift_type:@"",
@"start_time":start_time?start_time:@"",
@"end_time":end_time?end_time:@"",
@"in_out_type":in_out_type?in_out_type:@""
@"in_out_type":in_out_type?in_out_type:@"",
};
[[QXRequset shareInstance] postWithUrl:QXRoomCoinDetail parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
@@ -3035,4 +3039,162 @@
failBlock(error,msg);
}];
}
#pragma mark -
+(void)getRoomNewGiftListWithLabel:(NSString*)label
type:(NSString*)type
successBlock:(void (^)(NSArray<QXGiftModel *> * _Nonnull))successBlock
failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
[[QXRequset shareInstance] getWithUrl:QXRoomNewGiftList parameters:@{@"label":label?:@"",@"type":type?:@""} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray*list = [NSArray yy_modelArrayWithClass:[QXGiftModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)getRoomCustomGiftWithUserId:(NSString*)userId
successBlock:(void (^)(NSArray<QXGiftModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"user_id":userId?:@"",
};
[[QXRequset shareInstance] getWithUrl:QXRoomCustomGiftList parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray*list = [NSArray yy_modelArrayWithClass:[QXGiftModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)setRoomCustomGiftWithGiftId:(NSString*)gift_id
roomId:(NSString*)roomId
newGiftName:(NSString*)new_gift_name
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"gift_id":gift_id?:@"",
@"gift_remark_name":new_gift_name?:@""
};
[[QXRequset shareInstance] postWithUrl:QXRoomSetCustom parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)getRoomSeatTimeListSuccessBlock:(void (^)(NSArray<QXRoomSeatTimeModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXRoomSeatTimeList parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray*list = [NSArray yy_modelArrayWithClass:[QXRoomSeatTimeModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)setRoomSeatTimeWithRoomId:(NSString*)roomId
time:(NSString*)time
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"room_id":roomId?:@"",
@"time":time?:@""
};
[[QXRequset shareInstance] postWithUrl:QXRoomSetSeatTime parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
Ta
*/
+(void)roomAskUserGiftWithRoomId:(NSString*)roomId
toUserId:(NSString*)toUserId
successBlock:(void (^)(QXGiftModel* model))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"room_id":roomId?:@"",
@"to_user_id":toUserId?:@""
};
[[QXRequset shareInstance] getWithUrl:QXRoomGetSeatGift parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
QXGiftModel *model = [QXGiftModel yy_modelWithJSON:responseObject[@"data"]];
successBlock(model);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)roomSeductionWithRoomId:(NSString*)roomId
to_user_id:(NSString*)to_user_id
type:(NSString*)type
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"room_id":roomId?:@"",
@"to_user_id":to_user_id?:@"",
@"type":type?:@""
};
[[QXRequset shareInstance] postWithUrl:QXRoomBarSeduction parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)roomBarAskWithRoomId:(NSString *)roomId
user_id:(nonnull NSString *)user_id
gift_id:(nonnull NSString *)gift_id
successBlock:(nonnull void (^)(NSDictionary * _Nonnull))successBlock
failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@"room_id":roomId?:@"",
@"user_id":user_id?:@"",
@"gift_id":gift_id?:@""
};
[[QXRequset shareInstance] postWithUrl:QXRoomBarAsk parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end

View File

@@ -57,6 +57,7 @@
#import "QXHomePageNetwork.h"
#import "QXRoomNavigationController.h"
#import "QXInvitePopView.h"
#import "QGVAPLogger.h"
#if DEBUG
#import <LLDebugTool.h>
#endif

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_cabin_heart@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_cabin_heart@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_set_room_type_bar@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_set_room_type_bar@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

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

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_cabin_room_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_ask_ta@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_ask_ta@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_cabin_gift_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_cabin_gift_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_close_privite@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_close_privite@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_custom_gift@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_custom_gift@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_open_privite@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_open_privite@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_sea_king@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_sea_king@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_seduction_all@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_seduction_all@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_seduction_ta@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_seduction_ta@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_set_custom_gift@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_set_custom_gift@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_set_seat_time@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_set_seat_time@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bar_room_time_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bar_room_time_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_bar_ask_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_bar_ask_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_bar_cabin_cover@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_bar_cabin_cover@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

View File

@@ -121,6 +121,8 @@ static NSString *const kIsCanChat = @"kIsCanChat";
static NSString *const kIsCanChatMoney = @"kIsCanChatMoney";
/// 是否开启隐身进入
static NSString *const kIsCloseDrifNobility = @"kIsCloseDrifNobility";
/// 撩人是否弹窗
static NSString *const kIsCloseSeductionAlert = @"kIsCloseSeductionAlert";
// 微信登录

View File

@@ -269,7 +269,7 @@ static NSString * QXGiftList = @"api/Gift/get_gift_list";
/// 礼物标签列表
static NSString * QXGiftLabel = @"api/Gift/get_gift_label";
/// 直播间送礼
static NSString * QXSendGift = @"api/Room/room_give_gift";
static NSString * QXSendGift = @"api/SendGift/send_gift";
/// 在线列表
static NSString * QXOnlineList = @"api/Room/room_online_list";
/// 用户头像
@@ -593,4 +593,25 @@ static NSString * QXShopDressList = @"api/Decorate/get_decorate_list";
static NSString * QXShopDressDetail = @"api/Decorate/get_decorate_detail";
/// 购买装扮
static NSString * QXShopBuyDress = @"api/Decorate/pay_decorate";
/// 酒吧房
/// 新礼物列表
static NSString * QXRoomNewGiftList = @"api/GiftNew/get_gift_list";
/// 自定义礼物列表
static NSString * QXRoomCustomGiftList = @"api/GiftNew/get_custom_gift_list";
/// 设置自定义礼物
static NSString * QXRoomSetCustom = @"api/GiftNew/set_custom_gift";
/// 酒吧房麦位时长列表
static NSString * QXRoomSeatTimeList = @"api/BarRoom/get_pit_time_list";
///酒吧房麦位时长设置
static NSString * QXRoomSetSeatTime = @"api/BarRoom/set_pit_time";
/// 约她礼物详情
static NSString * QXRoomGetSeatGift = @"api/BarRoom/get_gift_info_ta";
/// 获取撩他所需金币
static NSString * QXRoomGetSeductionCoin = @"api/BarRoom/get_liao_ta_coin";
/// 撩他
static NSString * QXRoomBarSeduction = @"api/BarRoom/liao_ta";
/// 约他
static NSString * QXRoomBarAsk = @"api/BarRoom/meeting_ta";
#endif /* Api_h */

Binary file not shown.

View File

@@ -0,0 +1,16 @@
//
// QXRoomViewController+Bar.h
// QXLive
//
// Created by 启星 on 2026/1/7.
//
#import "QXRoomViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomViewController (Bar)
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,25 @@
//
// QXRoomViewController+Bar.m
// QXLive
//
// Created by on 2026/1/7.
//
#import "QXRoomViewController+Bar.h"
@implementation QXRoomViewController (Bar)
-(void)barRoomSeductionEffectWithModel:(QXRoomChatListModel*)model{
[self.seatContentView barRoomSeductionEffectWithModel:model];
}
-(void)barRoomJoinCabinRoomWithRoomId:(NSString *)room_id user_id:(NSString *)user_id meet_user_id:(NSString *)meet_user_id{
[self.seatContentView barRoomJoinCabinRoomWithRoomId:room_id user_id:user_id meet_user_id:meet_user_id];
}
-(void)barRoomHugPitWithUserId:(NSString *)userId pit_number:(nonnull NSString *)pit_number{
if ([userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
[self.seatContentView barRoomUpseatActionWithPitNumber:pit_number];
}
}
-(void)barRoomSetCustomGiftWithUserId:(NSString *)userId had_custom_gift:(BOOL)had_custom_gift{
[self.seatContentView barRoomSetCustomGiftWithUserId:userId had_custom_gift:had_custom_gift];
}
@end

View File

@@ -96,6 +96,7 @@
self.navigationController.viewControllers = viewControllers;
[self.navigationController popViewControllerAnimated:YES];
QXGlobal.shareGlobal.superRoomId = @"";
[[QXRoomMessageManager shared] quitExGroup];
// [self.navigationController popViewControllerAnimated:YES];
}
///

View File

@@ -49,7 +49,7 @@
al.type = QXAlertViewTypeSignSeat;
al.message = content;
al.commitBlock = ^{
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:@"1" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:@"1" gift_id:@"" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);

View File

@@ -46,7 +46,8 @@
QXRoomBottomViewDelegate,
QXRoomSettingViewDelegate,
QXAgoraEngineMediaPlayerDelegate,
QXRoomUserInfoViewDelegate
QXRoomUserInfoViewDelegate,
QXUpSeatViewDelegate
>
@property (nonatomic,strong)UIImageView *roomBgImageView;
@property (nonatomic,strong)UIView *roomBgCoverView;
@@ -104,9 +105,9 @@ QXRoomUserInfoViewDelegate
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
if (QXGlobal.shareGlobal.isOpenRecharge) {
self.dayTaskTagView.hidden = NO;
}
// if (QXGlobal.shareGlobal.isOpenRecharge) {
// self.dayTaskTagView.hidden = NO;
// }
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
@@ -381,7 +382,12 @@ QXRoomUserInfoViewDelegate
if (self.roomModel.room_info.type_id.intValue != 6) {
[self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_background]];
}else{
self.roomBgImageView.image = [UIImage imageNamed:@"cp_room_bg"];
if ([self.roomModel.room_info.label_id isEqualToString:@"11"]) {
self.roomBgImageView.image = [UIImage imageNamed:@"bar_cabin_room_bg"];
}else{
self.roomBgImageView.image = [UIImage imageNamed:@"cp_room_bg"];
}
///bar_cabin_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 || self.roomModel.room_info.type_id.intValue == 8) {
//
@@ -454,23 +460,41 @@ QXRoomUserInfoViewDelegate
make.width.mas_equalTo(ScaleWidth(280));
}];
}else if (self.roomModel.room_info.type_id.intValue == 6) {
//
[self.seatContentView setType:(QXRoomSeatViewTypeCabin)];
///
self.dayTaskTagView.hidden = YES;
self.titleView.hidden = YES;
self.upSeatBtn.hidden = YES;
self.bottomView.isCabinRoom = YES;
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.mas_equalTo(kSafeAreaTop);
make.height.mas_equalTo(ScaleWidth(380));
}];
[self.chatListView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.bottomView.mas_top);
make.left.equalTo(self.view);
make.top.equalTo(self.seatContentView.mas_bottom);
make.width.mas_equalTo(ScaleWidth(280));
}];
[self.view insertSubview:self.movieView atIndex:0];
if ([self.roomModel.room_info.label_id isEqualToString:@"11"]) {
self.bottomView.isBarCabinRoom = YES;
[self.seatContentView setType:(QXRoomSeatViewTypeBarCabin)];
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.mas_equalTo(kSafeAreaTop);
make.height.mas_equalTo(ScaleWidth(380));
}];
[self.chatListView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.bottomView.mas_top);
make.left.equalTo(self.view);
make.top.equalTo(self.seatContentView.mas_bottom);
make.width.mas_equalTo(ScaleWidth(280));
}];
}else{
self.bottomView.isCabinRoom = YES;
//
[self.seatContentView setType:(QXRoomSeatViewTypeCabin)];
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.mas_equalTo(kSafeAreaTop);
make.height.mas_equalTo(ScaleWidth(380));
}];
[self.chatListView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.bottomView.mas_top);
make.left.equalTo(self.view);
make.top.equalTo(self.seatContentView.mas_bottom);
make.width.mas_equalTo(ScaleWidth(280));
}];
[self.view insertSubview:self.movieView atIndex:0];
}
}else if (self.roomModel.room_info.type_id.intValue == 7) {
///
[self resetFriendViews];
@@ -478,7 +502,22 @@ QXRoomUserInfoViewDelegate
[self resetSingerViews];
}else if (self.roomModel.room_info.type_id.intValue == 10) {
[self resetSignViews];
}else if (self.roomModel.room_info.type_id.intValue == 11){
[self.seatContentView setType:(QXRoomSeatViewTypeBar)];
CGFloat seatHeight = (ScaleWidth(60-10)+51-ScaleWidth(15)-5 + ScaleWidth(12+14)-5)*2+12+ScaleWidth(65-10+32)+51-ScaleWidth(15);
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.mas_equalTo(self.titleView.bottom+12);
make.height.mas_equalTo(seatHeight);
}];
[self.chatListView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.bottomView.mas_top);
make.left.equalTo(self.view);
make.top.equalTo(self.seatContentView.mas_bottom);
make.width.mas_equalTo(ScaleWidth(280));
}];
}
if (self.roomModel.room_info.last_pk_room_id.isExist) {
if (![self.roomModel.room_info.last_pk_room_id isEqualToString:self.roomModel.pk_info.pk_room_id]) {
@@ -503,15 +542,22 @@ QXRoomUserInfoViewDelegate
-(void)configRoomDataIsJoin:(BOOL)isJoin{
self.seatContentView.hidden = NO;
self.bottomView.hidden = NO;
NSMutableArray *userIds = [NSMutableArray array];
// NSMutableArray *userIds = [NSMutableArray array];
// [self getUserOnlineStatusWithUserIds:[userIds componentsJoinedByString:@","]];
self.micTeamView.countLabel.text = self.roomModel.room_info.queue_number;
self.titleView.roomModel = self.roomModel;
if (self.roomModel.room_info.type_id.intValue == 6) {
self.bottomView.isCabinRoom = YES;
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
if ([self.roomModel.room_info.label_id isEqualToString:@"11"]) {
/// im
self.bottomView.isBarCabinRoom = YES;
[[QXRoomMessageManager shared] joinExGroupWithRoomId:QXGlobal.shareGlobal.superRoomId];
}else{
self.bottomView.isCabinRoom = YES;
}
}else{
if (self.roomModel.user_info.pit_number.intValue > 0) {
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
@@ -652,7 +698,12 @@ QXRoomUserInfoViewDelegate
-(void)configBottomTools{
if (self.roomModel.room_info.type_id.intValue == 6) {
self.bottomView.isCabinRoom = YES;
if ([self.roomModel.room_info.label_id isEqualToString:@"11"]) {
self.bottomView.isBarCabinRoom = YES;
[[QXRoomMessageManager shared] joinExGroupWithRoomId:QXGlobal.shareGlobal.superRoomId];
}else{
self.bottomView.isCabinRoom = YES;
}
return;
}
self.bottomView.roomModel = self.roomModel;
@@ -839,8 +890,8 @@ QXRoomUserInfoViewDelegate
}
}
///
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number isPK:(BOOL)isPK{
[self.seatContentView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number isPK:isPK];
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number isPK:(BOOL)isPK end_time:(NSString *)end_time{
[self.seatContentView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number isPK:isPK end_time:end_time];
if ([user.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
///
@@ -1271,7 +1322,7 @@ QXRoomUserInfoViewDelegate
}
#pragma mark - QXRoomBottomViewDelegate
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected{
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected isSuperRoom:(BOOL)isSuperRoom{
switch (type) {
case QXRoomBottomViewEventTypePlayAudio:{
@@ -1303,7 +1354,7 @@ QXRoomUserInfoViewDelegate
@"is_mute":[NSNumber numberWithInteger:0],
};
NSString *jsonStr = [dict jsonStringEncoded];
[[QXRoomMessageManager shared] sendChatMessage:jsonStr messageType:(QXRoomMessageTypeMuteLocalAudio) needInsertMessage:NO];
[[QXRoomMessageManager shared] sendChatMessage:jsonStr messageType:(QXRoomMessageTypeMuteLocalAudio) needInsertMessage:NO isSuperRoom:NO];
}
// [[QXAgoraEngine sharedEngine] muteLocalAudioStream:!isSelected];
@@ -1497,6 +1548,7 @@ QXRoomUserInfoViewDelegate
}
break;
case QXRoomBottomViewEventTypeEmoji:{
self.emojiView.isSuperRoom = isSuperRoom;
[self.emojiView showInView:self.view];
}
break;
@@ -1561,7 +1613,7 @@ QXRoomUserInfoViewDelegate
-(void)didClickSetModel:(QXRoomSettingModel *)model{
switch (model.type) {
case QXRoomSettingTypeRoomClearMessage:{
[[QXRoomMessageManager shared] sendChatMessage:@"" messageType:(QXRoomMessageTypeClearMessage) needInsertMessage:NO];
[[QXRoomMessageManager shared] sendChatMessage:@"" messageType:(QXRoomMessageTypeClearMessage) needInsertMessage:NO isSuperRoom:NO];
[self.chatListView clearMessage];
[self.settingView hide];
showToast(@"清除消息成功");
@@ -1742,10 +1794,40 @@ QXRoomUserInfoViewDelegate
-(void)micTeamAction{
self.upSeatView.isCompere = (self.seatContentView.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1);
self.upSeatView.roomId = self.roomId;
self.upSeatView.delegate = self;
[self.upSeatView showInView:self.view];
}
-(void)didClickUpSeat{
[self.seatContentView barRoomUpseatActionWithPitNumber:@""];
}
-(void)upSeatFinish{
self.upSeatView.roomId = self.roomId;
}
-(void)upDownSeatNetworkWithPitNum:(NSString*)pitNum isUpSeat:(BOOL)isUpSeat{
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:pitNum isUpSeat:isUpSeat successBlock:^(NSDictionary * _Nonnull dict) {
if ([self.roomModel.room_info.type_id isEqualToString:@"11"]) {
if (pitNum.intValue == 9 || pitNum.intValue == 10) {
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:pitNum gift_id:@"" isUpSeat:isUpSeat successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else{
if (isUpSeat) {
[self.seatContentView barRoomUpseatActionWithPitNumber:pitNum];
}else{
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:pitNum gift_id:@"" isUpSeat:isUpSeat successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
return;
}
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:pitNum gift_id:@"" isUpSeat:isUpSeat successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
@@ -2144,7 +2226,7 @@ QXRoomUserInfoViewDelegate
-(QXRoomDayTaskTagView *)dayTaskTagView{
if (!_dayTaskTagView) {
_dayTaskTagView = [[QXRoomDayTaskTagView alloc] init];
_dayTaskTagView.hidden = YES;
// _dayTaskTagView.hidden = YES;
MJWeakSelf
_dayTaskTagView.startBlock = ^{
QXTaskViewController *vc = [[QXTaskViewController alloc] init];

View File

@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
@optional
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected;
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected isSuperRoom:(BOOL)isSuperRoom;
-(void)didSendMessage:(NSString*)message redpacketModel:(QXRedPacketModel*)redpacketModel;
@end
@@ -50,7 +50,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)setRoleType:(QXRoomRoleType)roleType hasPK:(BOOL)hasPK hasSong:(BOOL)hasSong;
/// 是否是小黑屋
@property (nonatomic,assign)BOOL isCabinRoom;
/// 是否是酒吧房小黑屋
@property (nonatomic,assign)BOOL isBarCabinRoom;
-(void)atUserWithName:(NSString*)nickname;
-(void)inputMessageWithName:(NSString*)message redpacketModel:(QXRedPacketModel*)redpacketModel;

View File

@@ -32,6 +32,10 @@
@property (nonatomic,strong)QXDynamicCommentInputView *commentView;
@property (nonatomic,strong)QXRedPacketModel* redpacketModel;
@property (nonatomic,strong)UIButton* openCabinBtn;
@property (nonatomic,strong)UIButton* micBtn;
@property (nonatomic,strong)UIButton* voiceBtn;
@end
@implementation QXRoomBottomView
@@ -140,6 +144,8 @@
[self.setBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];;
self.setBtn.hidden = YES;
[self addSubview:self.setBtn];
[self addSubview:self.openCabinBtn];
}
-(void)setRoomModel:(QXRoomModel *)roomModel{
_roomModel = roomModel;
@@ -156,6 +162,39 @@
btn.hidden = YES;
}
}
-(void)setIsBarCabinRoom:(BOOL)isBarCabinRoom{
_isBarCabinRoom = isBarCabinRoom;
CGFloat btnWidth = 35;
[self.sayBg mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.equalTo(self);
make.height.mas_equalTo(36);
make.right.mas_equalTo(-(60+btnWidth*2+16));
}];
self.audioBtn.hidden = NO;
self.playAudioBtn.hidden = NO;
self.openCabinBtn.hidden = NO;
[self.openCabinBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.centerY.equalTo(self.sayBg);
make.width.mas_equalTo(40);
make.height.mas_equalTo(35);
}];
[self.audioBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.openCabinBtn.mas_left).offset(-5);
make.centerY.equalTo(self.sayBg);
make.width.mas_equalTo(40);
make.height.mas_equalTo(35);
}];
[self.playAudioBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.audioBtn.mas_left);
make.centerY.equalTo(self.sayBg);
make.width.mas_equalTo(40);
make.height.mas_equalTo(35);
}];
}
-(void)noticeUnreadNumberDidChanged:(NSNotification*)notice{
NSNumber *number = notice.object;
[self.messageBtn.unreadView setNum:number.longValue];
@@ -328,6 +367,10 @@
[self.vc.view addSubview:self.commentView];
[self.commentView.textField becomeFirstResponder];
}
-(void)openCabinAction{
self.openCabinBtn.selected = !self.openCabinBtn.selected;
}
-(void)eventAction:(UIButton*)sender{
if (sender == self.audioBtn) {
@@ -340,8 +383,8 @@
if (sender == self.playAudioBtn) {
sender.selected = !sender.selected;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickEventType:isSelected:)]) {
[self.delegate didClickEventType:sender.tag isSelected:sender.selected];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickEventType:isSelected:isSuperRoom:)]) {
[self.delegate didClickEventType:sender.tag isSelected:sender.selected isSuperRoom:!self.openCabinBtn.selected];
}
}
-(void)atUserWithName:(NSString *)nickname{
@@ -367,7 +410,7 @@
return;
}
[[QXGlobal shareGlobal] finishTask];
[[QXRoomMessageManager shared] sendChatMessage:text messageType:(QXRoomMessageTypeText) needInsertMessage:YES];
[[QXRoomMessageManager shared] sendChatMessage:text messageType:(QXRoomMessageTypeText) needInsertMessage:YES isSuperRoom:!self.openCabinBtn.selected];
self.commentView.textField.text = @"";
if (self.redpacketModel == nil) {
@@ -434,4 +477,16 @@
}
return _inputBigBgView;
}
-(UIButton *)openCabinBtn{
if (!_openCabinBtn) {
_openCabinBtn = [[UIButton alloc] init];
[_openCabinBtn setImage:[UIImage imageNamed:@"bar_room_close_privite"] forState:(UIControlStateNormal)];
[_openCabinBtn setImage:[UIImage imageNamed:@"bar_room_open_privite"] forState:(UIControlStateSelected)];
[_openCabinBtn addTarget:self action:@selector(openCabinAction) forControlEvents:(UIControlEventTouchUpInside)];
_openCabinBtn.hidden = YES;
_openCabinBtn.selected = YES;
}
return _openCabinBtn;
}
@end

View File

@@ -101,6 +101,7 @@ typedef NS_ENUM(NSInteger) {
@interface QXRoomChatListModel : NSObject
@property (nonatomic,assign)QXRoomChatMessageType messageType;
@property (nonatomic,assign)BOOL isSuperRoom;
@property (nonatomic,strong)NSString* text;
@property (nonatomic,strong)NSString* rights_icon;
@property (nonatomic,strong)QXGiftModel* GiftInfo;

View File

@@ -13,6 +13,7 @@
#define messageNameColor RGB16(0x00C8FF)
#define messageGiftColor RGB16(0xFFE309)
#define messageBubbleColor RGB16A(0x000000, 0.3)
#define superRoomMessageColor RGB16(0x6B647E)
#define messageBubbleMargin 2
NSArray<NSValue *> *findAllOccurrencesOfString(NSString *fullString, NSString *substring) {
NSMutableArray<NSValue *> *occurrences = [NSMutableArray array];
@@ -54,6 +55,7 @@ NSInteger maxMessageCount = 20;
@property (nonatomic,strong)UILabel *messageLabel;
@property (nonatomic,strong)UIButton *messageCountBtn;
@property (nonatomic,strong)AVSpeechSynthesizer *synthesizer;
@property (nonatomic,assign)BOOL isSuperRoom;
@end
@implementation QXRoomChatListView
@@ -470,36 +472,42 @@ NSInteger maxMessageCount = 20;
_message = message;
// self.titleLabel.text = message.text;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
if ([message.FromUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
}
if ([message.ToUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.ToUserInfo.nickname]];
}
if ([message.GiftInfo.gift_name isExist]) {
NSArray *arr = [message.GiftInfo.gift_name componentsSeparatedByString:@","];
for (NSString*gift_name in arr) {
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, gift_name);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageGiftColor range:range];
if (message.isSuperRoom) {
self.nameLabel.textColor = superRoomMessageColor;
[attr yy_setColor:superRoomMessageColor range:NSMakeRange(0, attr.length)];
}else{
self.nameLabel.textColor = messageNameColor;
if ([message.FromUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
}
if ([message.ToUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.ToUserInfo.nickname]];
}
if ([message.GiftInfo.gift_name isExist]) {
NSArray *arr = [message.GiftInfo.gift_name componentsSeparatedByString:@","];
for (NSString*gift_name in arr) {
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, gift_name);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageGiftColor range:range];
}
}
}
}
if (message.GiftInfos.count > 0) {
for (QXGiftModel*gift in message.GiftInfos) {
if ([gift.gift_name isExist]) {
[attr yy_setColor:messageGiftColor range:[message.text rangeOfString:gift.gift_name]];
if (message.GiftInfos.count > 0) {
for (QXGiftModel*gift in message.GiftInfos) {
if ([gift.gift_name isExist]) {
[attr yy_setColor:messageGiftColor range:[message.text rangeOfString:gift.gift_name]];
}
}
}
}
if (message.ToUserInfos.count > 0) {
for (int i = 0; i < message.ToUserInfos.count; i++) {
QXUserHomeModel*md = message.ToUserInfos[i];
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, md.nickname);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageNameColor range:range];
if (message.ToUserInfos.count > 0) {
for (int i = 0; i < message.ToUserInfos.count; i++) {
QXUserHomeModel*md = message.ToUserInfos[i];
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, md.nickname);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageNameColor range:range];
}
}
}
}
@@ -729,36 +737,40 @@ NSInteger maxMessageCount = 20;
_message = message;
// self.titleLabel.text = message.text;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
if ([message.FromUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
}
if ([message.ToUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.ToUserInfo.nickname]];
}
if ([message.GiftInfo.gift_name isExist]) {
NSArray *arr = [message.GiftInfo.gift_name componentsSeparatedByString:@","];
for (NSString*gift_name in arr) {
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, gift_name);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageGiftColor range:range];
if (message.isSuperRoom) {
[attr yy_setColor:superRoomMessageColor range:NSMakeRange(0, attr.length)];
}else{
if ([message.FromUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
}
if ([message.ToUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.ToUserInfo.nickname]];
}
if ([message.GiftInfo.gift_name isExist]) {
NSArray *arr = [message.GiftInfo.gift_name componentsSeparatedByString:@","];
for (NSString*gift_name in arr) {
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, gift_name);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageGiftColor range:range];
}
}
}
}
if (message.GiftInfos.count > 0) {
for (QXGiftModel*gift in message.GiftInfos) {
if ([gift.gift_name isExist]) {
[attr yy_setColor:messageGiftColor range:[message.text rangeOfString:gift.gift_name]];
if (message.GiftInfos.count > 0) {
for (QXGiftModel*gift in message.GiftInfos) {
if ([gift.gift_name isExist]) {
[attr yy_setColor:messageGiftColor range:[message.text rangeOfString:gift.gift_name]];
}
}
}
}
if (message.ToUserInfos.count > 0) {
for (int i = 0; i < message.ToUserInfos.count; i++) {
QXUserHomeModel*md = message.ToUserInfos[i];
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, md.nickname);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageNameColor range:range];
if (message.ToUserInfos.count > 0) {
for (int i = 0; i < message.ToUserInfos.count; i++) {
QXUserHomeModel*md = message.ToUserInfos[i];
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, md.nickname);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageNameColor range:range];
}
}
}
}
@@ -882,7 +894,7 @@ NSInteger maxMessageCount = 20;
}
-(void)layoutSubviews{
[super layoutSubviews];
[self.bgView addRoundedCornersWithRadius:self.bgView.height/2];
[self.bgView addRoundedCornersWithRadius:10];
}
-(void)loadBubble{
// if ([self.message.FromUserInfo.chat_bubble isExist]) {
@@ -953,12 +965,12 @@ NSInteger maxMessageCount = 20;
}
-(void)setMessage:(QXRoomChatListModel *)message{
_message = message;
if (message.isSuperRoom) {
self.nameLabel.textColor = superRoomMessageColor;
}else{
self.nameLabel.textColor = messageNameColor;
}
self.nameLabel.text = message.FromUserInfo.nickname;
// if ([message.FromUserInfo.nickname_color isExist]) {
// self.nameLabel.textColor = [UIColor colorWithHexString:message.FromUserInfo.nickname_color];
// }else{
// self.nameLabel.textColor = RGB16(0xDED6ED);
// }
[self.headerImageView setHeadIcon:message.FromUserInfo.avatar dress:@""];
[self.headerImageView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:message.FromUserInfo.nobility_image]];
self.iconBgView.hidden = YES;
@@ -1200,47 +1212,51 @@ NSInteger maxMessageCount = 20;
if (self.message.messageType == QXRoomChatMessageTypeNotice) {
[self.bgView addRoundedCornersWithRadius:8];
}else{
[self.bgView addRoundedCornersWithRadius:self.bgView.height/2];
[self.bgView addRoundedCornersWithRadius:10];
}
}
-(void)setMessage:(QXRoomChatListModel *)message{
_message = message;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
if ([message.FromUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
}
if ([message.ToUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.ToUserInfo.nickname]];
}
if ([message.GiftInfo.gift_name isExist]) {
NSArray *arr = [message.GiftInfo.gift_name componentsSeparatedByString:@","];
for (NSString*gift_name in arr) {
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, gift_name);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageGiftColor range:range];
if (message.isSuperRoom) {
[attr yy_setColor:superRoomMessageColor range:NSMakeRange(0, attr.length)];
}else{
if ([message.FromUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.FromUserInfo.nickname]];
}
if ([message.ToUserInfo.nickname isExist]) {
[attr yy_setColor:messageNameColor range:[message.text rangeOfString:message.ToUserInfo.nickname]];
}
if ([message.GiftInfo.gift_name isExist]) {
NSArray *arr = [message.GiftInfo.gift_name componentsSeparatedByString:@","];
for (NSString*gift_name in arr) {
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, gift_name);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageGiftColor range:range];
}
}
}
}
if (message.GiftInfos.count > 0) {
for (QXGiftModel*gift in message.GiftInfos) {
if ([gift.gift_name isExist]) {
[attr yy_setColor:messageGiftColor range:[message.text rangeOfString:gift.gift_name]];
if (message.GiftInfos.count > 0) {
for (QXGiftModel*gift in message.GiftInfos) {
if ([gift.gift_name isExist]) {
[attr yy_setColor:messageGiftColor range:[message.text rangeOfString:gift.gift_name]];
}
}
}
}
if (message.ToUserInfos.count > 0) {
for (int i = 0; i < message.ToUserInfos.count; i++) {
QXUserHomeModel*md = message.ToUserInfos[i];
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, md.nickname);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageNameColor range:range];
if (message.ToUserInfos.count > 0) {
for (int i = 0; i < message.ToUserInfos.count; i++) {
QXUserHomeModel*md = message.ToUserInfos[i];
NSArray<NSValue *> *occurrences = findAllOccurrencesOfString(message.text, md.nickname);
for (NSValue *rangeValue in occurrences) {
NSRange range = [rangeValue rangeValue];
[attr yy_setColor:messageNameColor range:range];
}
}
}
}
if (message.messageType == QXRoomChatMessageTypeNotice) {
[attr yy_setColor:messageNoticeColor range:NSMakeRange(0, attr.length)];
if (message.messageType == QXRoomChatMessageTypeNotice) {
[attr yy_setColor:messageNoticeColor range:NSMakeRange(0, attr.length)];
}
}
self.titleLabel.attributedText = attr;
}

View File

@@ -14,7 +14,7 @@
#import "QXRoomMessageManager.h"
#import "QXMineNetwork.h"
#import "QXDynamicNetwork.h"
#import "QXRoomBarCabinListView.h"
@interface QXRoomTitleView()<QXRoomSeatDelegate>
///
@property (nonatomic,strong) UIView *leftBgView;
@@ -39,6 +39,8 @@
@property (nonatomic,strong) UIButton *noticeBtn;
///
@property (nonatomic,strong)UIButton *clearCharmBtn;
///
@property (nonatomic,strong)UIButton *cabinRoom;
@property (nonatomic,strong) QXRoomOnlineUserListView *onlineListView;
@@ -209,6 +211,23 @@
make.left.equalTo(self.noticeBtn.mas_right).offset(12);
make.top.equalTo(self.leftBgView.mas_bottom).offset(12);
}];
self.cabinRoom = [[UIButton alloc] init];
self.cabinRoom.hidden = YES;
[self.cabinRoom setTitle:[NSString stringWithFormat:@" %@",@"交友小屋"] forState:(UIControlStateNormal)];
self.cabinRoom.titleLabel.font = [UIFont systemFontOfSize:12];
[self.cabinRoom setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
[self.cabinRoom addTarget:self action:@selector(cabinAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.cabinRoom setImage:[UIImage imageNamed:@"room_clear_charm"] forState:(UIControlStateNormal)];
self.cabinRoom.backgroundColor = RGB16A(0xFFFFFF,0.2);
[self.cabinRoom addRoundedCornersWithRadius:ScaleWidth(11)];
[self addSubview:self.cabinRoom];
[self.cabinRoom mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(78));
make.height.mas_equalTo(ScaleWidth(22));
make.left.equalTo(self.noticeBtn.mas_right).offset(12);
make.top.equalTo(self.leftBgView.mas_bottom).offset(12);
}];
}
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
@@ -350,6 +369,12 @@
self.roomModel.user_info.is_collect = isCollect?@"1":@"0";
self.followBtn.selected = isCollect?YES:NO;
}
-(void)cabinAction{
QXRoomBarCabinListView *cabinListView = [[QXRoomBarCabinListView alloc] init];
[cabinListView showInView:self.viewController.view];
}
-(void)followAction:(UIButton*)sender{
MJWeakSelf
[QXDynamicNetwork followWithUserId:self.roomId type:@"2" successBlock:^(NSDictionary * _Nonnull dict) {

View File

@@ -288,15 +288,15 @@
}
-(void)commitAction{
// if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUpSeat)]) {
// [self.delegate didClickUpSeat];
// }
MJWeakSelf
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:@"" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf setRoomId:weakSelf.roomId];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUpSeat)]) {
[self.delegate didClickUpSeat];
}
// MJWeakSelf
// [QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:@"" gift_id:@"" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
// [weakSelf setRoomId:weakSelf.roomId];
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
// showToast(msg);
// }];
}
-(void)clearAction{

View File

@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h>
#import "QXRoomRelationModel.h"
#import "QXUserDressModel.h"
#import "QXRoomSeatTimeModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXSelectAuctionInfoView : UIView
@@ -27,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong) QXRoomRelationModel *model;
@property (nonatomic,strong) QXRoomRelationModel *timeModel;
@property (nonatomic,strong) QXRoomSeatTimeModel *seatTimeModel;
@property (nonatomic,strong) QXShopDressPriceModel *priceModel;
@property (nonatomic,strong) UIButton *selectedBtn;
@end

View File

@@ -422,12 +422,23 @@
-(void)setTimeModel:(QXRoomRelationModel *)timeModel{
_timeModel = timeModel;
[self.selectedBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateSelected)];
[self.selectedBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.selectedBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.selectedBtn setTitle:timeModel.name forState:(UIControlStateNormal)];
self.selectedBtn.layer.borderColor = RGB16(0xF1F2F3).CGColor;
self.selectedBtn.layer.borderWidth = 1;
self.selectedBtn.selected = timeModel.isSelected;
}
-(void)setSeatTimeModel:(QXRoomSeatTimeModel *)seatTimeModel{
_seatTimeModel = seatTimeModel;
[self.selectedBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateSelected)];
[self.selectedBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.selectedBtn setTitle:seatTimeModel.time_str forState:(UIControlStateNormal)];
self.selectedBtn.layer.borderColor = RGB16(0xF1F2F3).CGColor;
self.selectedBtn.layer.borderWidth = 1;
self.selectedBtn.selected = seatTimeModel.isSelected;
}
-(void)setPriceModel:(QXShopDressPriceModel *)priceModel{
_priceModel = priceModel;
[self.selectedBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateSelected)];

View File

@@ -938,7 +938,7 @@
MJWeakSelf
if (sender == self.upSeatBtn) {
if ([self.userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:self.pitNumber isUpSeat:NO successBlock:^(NSDictionary * _Nonnull dict) {
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:self.pitNumber gift_id:@"" isUpSeat:NO successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);

View File

@@ -100,7 +100,7 @@
showToast(@"请选择您要展示的才艺");
return;
}
[[QXRoomMessageManager shared] sendChatMessage:[NSString stringWithFormat:@"选择的才艺是 %@",self.selectedModel.name] messageType:(QXRoomMessageTypeText) needInsertMessage:YES];
[[QXRoomMessageManager shared] sendChatMessage:[NSString stringWithFormat:@"选择的才艺是 %@",self.selectedModel.name] messageType:(QXRoomMessageTypeText) needInsertMessage:YES isSuperRoom:NO];
[self hide];
}

View File

@@ -10,6 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomEmojiView : UIView
@property (nonatomic,assign)BOOL isSuperRoom;
-(void)showInView:(UIView *)view;
@end

View File

@@ -82,10 +82,13 @@
}];
}
-(void)setIsSuperRoom:(BOOL)isSuperRoom{
_isSuperRoom = isSuperRoom;
}
-(void)didSelectedEmoji:(QXEmojiModel *)model{
[self hide];
[[QXRoomMessageManager shared] sendChatEmoji:model];
[[QXRoomMessageManager shared] sendChatEmoji:model isSuperRoom:self.isSuperRoom];
}
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
return self.dataArray.count;

View File

@@ -28,6 +28,8 @@ typedef NS_ENUM(NSInteger) {
QXRoomSettingTypeRoomTypeSinger = 300,
/// 签约房
QXRoomSettingTypeRoomTypeSign = 400,
/// 酒吧房
QXRoomSettingTypeRoomTypeBar = 500,
/// 常用工具
/// 房间补贴

View File

@@ -49,6 +49,8 @@
@property (nonatomic,strong)QXRoomSettingModel *roomTypeSinger;
///
@property (nonatomic,strong)QXRoomSettingModel *roomTypeSign;
///
@property (nonatomic,strong)QXRoomSettingModel *roomTypeBar;
@@ -188,7 +190,7 @@
NSArray *toolsArr;
NSArray *moreArr;
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFriend,self.roomTypeKSing,self.roomTypeSinger,self.roomTypeSign];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFriend,self.roomTypeSinger,self.roomTypeSign];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFriend,self.roomTypeSinger,self.roomTypeSign,self.roomTypeBar];
switch (roleType) {
//
case QXRoomRoleTypeCompere:{
@@ -372,7 +374,8 @@
|| model.type == QXRoomSettingTypeRoomTypeFunny
|| model.type == QXRoomSettingTypeRoomTypeKSing
|| model.type == QXRoomSettingTypeRoomTypeSinger
|| model.type == QXRoomSettingTypeRoomTypeSign) {
|| model.type == QXRoomSettingTypeRoomTypeSign
|| model.type == QXRoomSettingTypeRoomTypeBar) {
self.alertView.message = [NSString stringWithFormat:@"您确定要修改为%@房吗?",model.name];
[[QXGlobal shareGlobal] showView:self.alertView controller:self.viewController popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
@@ -415,6 +418,8 @@
type = @"9";
}else if (roomType == QXRoomSettingTypeRoomTypeSign) {
type = @"10";
}else if (roomType == QXRoomSettingTypeRoomTypeBar) {
type = @"11";
}
[QXMineNetwork changeRoomTypeWithRoomId:self.roomModel.room_info.room_id type:type successBlock:^(NSDictionary * _Nonnull dict) {
@@ -524,6 +529,16 @@
return _roomTypeSign;
}
-(QXRoomSettingModel *)roomTypeBar{
if (!_roomTypeBar) {
_roomTypeBar = [[QXRoomSettingModel alloc] init];
_roomTypeBar.name = @"酒吧";
_roomTypeBar.type = QXRoomSettingTypeRoomTypeBar;
_roomTypeBar.icon = @"room_set_room_type_bar";
}
return _roomTypeBar;
}
-(QXRoomSettingModel *)roomSubsidy{
if (!_roomSubsidy) {
_roomSubsidy = [[QXRoomSettingModel alloc] init];

View File

@@ -0,0 +1,29 @@
//
// QXBarAskAlertView.h
// QXLive
//
// Created by 启星 on 2026/1/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class QXBarAskAlertView;
@protocol QXBarAskAlertViewDelegate <NSObject>
@optional
-(void)askViewDidRecharge:(QXBarAskAlertView*)alertView;
-(void)askViewDidSend:(QXBarAskAlertView*)alertView pitModel:(QXRoomPitModel*)pitModel giftInfo:(QXGiftModel*)giftInfo;
@end
@interface QXBarAskAlertView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXRoomPitModel *pitModel;
@property (nonatomic,weak)id<QXBarAskAlertViewDelegate>delegate;
-(void)showInView:(UIView *)view;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,272 @@
//
// QXBarAskAlertView.m
// QXLive
//
// Created by on 2026/1/5.
//
#import "QXBarAskAlertView.h"
#import "QXMineNetwork.h"
@interface QXBarAskAlertView()<UIGestureRecognizerDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIImageView *headerImageView;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)UIView *contentView;
@property (nonatomic,strong)UIImageView *contentBgImageView;
@property (nonatomic,strong)UILabel *contentTitleLabel;
@property (nonatomic,strong)UIView *giftBgView;
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,strong)UIButton *giftCoinBtn;
@property (nonatomic,strong)UIButton *sendBtn;
@property (nonatomic,strong)UIButton *myCoinBtn;
@property (nonatomic,strong)UIButton *rechargeBtn;
@property (nonatomic,strong)QXGiftModel *giftModel;
@end
@implementation QXBarAskAlertView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = UIScreen.mainScreen.bounds;
[self initSubviews];
}
return self;
}
-(void)initSubviews{
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
self.backgroundColor = RGB16A(0x000000, 0.3);
// tap.delegate = self;
// [self addGestureRecognizer:tap];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(275))/2, 0, ScaleWidth(275), ScaleWidth(275))];
self.bgView.backgroundColor = RGB16(0xffffff);
[self.bgView addRoundedCornersWithRadius:16];
[self addSubview:self.bgView];
self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height)];
self.bgImageView.backgroundColor = RGB16(0x9722D6);
[self.bgView addSubview:self.bgImageView];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:13];
self.titleLabel.textColor = RGB16A(0xFFFFFF,0.65);
self.titleLabel.text = @"送给";
[self.bgView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.height.mas_equalTo(17);
make.top.mas_equalTo(ScaleWidth(19));
}];
self.headerImageView = [[UIImageView alloc] init];
[self.bgView addSubview:self.headerImageView];
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.headerImageView addRoundedCornersWithRadius:ScaleWidth(16)];
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.titleLabel.mas_right).offset(2);
make.height.width.mas_equalTo(ScaleWidth(32));
make.centerY.equalTo(self.titleLabel);
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.font = [UIFont boldSystemFontOfSize:13];
self.nameLabel.textColor = RGB16(0xFFFFFF);
self.nameLabel.text = @"羽声语音";
[self.bgView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerImageView.mas_right).offset(2);
make.height.mas_equalTo(17);
make.centerY.equalTo(self.titleLabel);
}];
self.closeBtn = [[UIButton alloc] init];
[self.closeBtn setImage:[[UIImage imageNamed:@"wallet_close"] imageByTintColor:RGB16(0xffffff)] forState:(UIControlStateNormal)];
[self.closeBtn addTarget:self action:@selector(hide) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.closeBtn];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(30);
make.right.mas_equalTo(-5);
make.centerY.equalTo(self.titleLabel);
}];
self.myCoinBtn = [[UIButton alloc] init];
[self.myCoinBtn setImage:[UIImage imageNamed:@"mine_live_gift_corn"] forState:(UIControlStateNormal)];
[self.myCoinBtn setTitleColor:RGB16(0xF5F24F) forState:(UIControlStateNormal)];
[self.myCoinBtn setTitle:@"0" forState:(UIControlStateNormal)];
self.myCoinBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:self.myCoinBtn];
[self.myCoinBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.titleLabel);
make.bottom.equalTo(self.bgView).offset(-8);
make.height.mas_equalTo(20);
}];
self.rechargeBtn = [[UIButton alloc] init];
[self.rechargeBtn setTitleColor:RGB16(0xF5F24F) forState:(UIControlStateNormal)];
[self.rechargeBtn setTitle:@"去充值>" forState:(UIControlStateNormal)];
self.rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.rechargeBtn addTarget:self action:@selector(rechargeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.rechargeBtn];
[self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.height.mas_equalTo(30);
make.centerY.equalTo(self.myCoinBtn);
}];
self.sendBtn = [[UIButton alloc] init];
[self.sendBtn setTitle:@"赠送并开房" forState:(UIControlStateNormal)];
[self.sendBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
self.sendBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.sendBtn.backgroundColor = QXConfig.themeColor;
[self.sendBtn addRoundedCornersWithRadius:ScaleWidth(16)];
[self.sendBtn addTarget:self action:@selector(sendAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.sendBtn];
[self.sendBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.myCoinBtn.mas_top).offset(-5);
make.width.mas_equalTo(ScaleWidth(104));
make.height.mas_equalTo(ScaleWidth(32));
make.centerX.equalTo(self.bgView);
}];
self.contentView = [[UIView alloc] init];
[self.bgView addRoundedCornersWithRadius:8];
[self.bgView addSubview:self.contentView];;
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.headerImageView.mas_bottom).offset(10);
make.bottom.equalTo(self.sendBtn.mas_top).offset(-12);
make.left.mas_equalTo(self.titleLabel);
make.right.mas_equalTo(-16);
}];
self.contentBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_bar_ask_bg"]];
self.contentBgImageView.contentMode = UIViewContentModeScaleToFill;
[self.contentView addSubview:self.contentBgImageView];
[self.contentBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.titleLabel);
make.top.equalTo(self.headerImageView.mas_bottom).offset(ScaleWidth(10));
make.bottom.equalTo(self.sendBtn.mas_top).offset(ScaleWidth(-12));
make.right.mas_equalTo(-16);
}];
self.contentTitleLabel = [[UILabel alloc] init];
self.contentTitleLabel.text = @"开启私密房间,一起甜蜜约会吧!";
self.contentTitleLabel.textColor = RGB16(0xFFD7FE);
self.contentTitleLabel.textAlignment = NSTextAlignmentCenter;
self.contentTitleLabel.font = [UIFont systemFontOfSize:ScaleWidth(12)];
[self.contentView addSubview:self.contentTitleLabel];
[self.contentTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.contentView);
make.top.mas_equalTo(9);
make.height.mas_equalTo(18);
}];
self.giftBgView = [[UIView alloc] init];
[self.giftBgView setBackgroundColor:RGB16A(0x000000, 0.65)];
[self.giftBgView addRoundedCornersWithRadius:12];
[self.contentView addSubview:self.giftBgView];
[self.giftBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.contentTitleLabel.mas_bottom).offset(8);
make.height.width.mas_equalTo(ScaleWidth(72));
make.centerX.equalTo(self.contentView);
}];
self.giftImageView = [[UIImageView alloc] init];
[self.giftBgView addSubview:self.giftImageView];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.giftBgView);
}];
self.giftNameLabel = [[UILabel alloc] init];
self.giftNameLabel.text = @"礼物名称";
self.giftNameLabel.textColor = RGB16(0xFFD7FE);
self.giftNameLabel.font = [UIFont systemFontOfSize:ScaleWidth(12)];
self.giftNameLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.contentView);
make.top.equalTo(self.giftImageView.mas_bottom).offset(4);
make.height.mas_equalTo(17);
}];
self.giftCoinBtn = [[UIButton alloc] init];
[self.giftCoinBtn setImage:[UIImage imageNamed:@"mine_live_gift_corn"] forState:(UIControlStateNormal)];
[self.giftCoinBtn setTitleColor:RGB16A(0xFFFFFF,0.85) forState:(UIControlStateNormal)];
[self.giftCoinBtn setTitle:@"0" forState:(UIControlStateNormal)];
self.giftCoinBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:self.giftCoinBtn];
[self.giftCoinBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.giftNameLabel.mas_bottom);
make.height.mas_equalTo(20);
make.centerX.equalTo(self.contentView);
}];
}
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
}
-(void)setPitModel:(QXRoomPitModel *)pitModel{
_pitModel = pitModel;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:pitModel.avatar]];
self.nameLabel.text = pitModel.nickname;
[self getGiftInfo];
}
-(void)getGiftInfo{
MJWeakSelf
[QXMineNetwork roomAskUserGiftWithRoomId:self.roomId toUserId:self.pitModel.user_id successBlock:^(QXGiftModel * _Nonnull model) {
[weakSelf.giftCoinBtn setTitle:model.gift_price forState:(UIControlStateNormal)];
weakSelf.giftNameLabel.text = model.gift_name;
[weakSelf.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
[weakSelf.myCoinBtn setTitle:model.user_wallet_coin forState:(UIControlStateNormal)];
weakSelf.giftModel = model;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
-(void)rechargeAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(askViewDidRecharge:)]) {
[self.delegate askViewDidRecharge:self];
}
}
-(void)sendAction{
if (!self.giftModel) {
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(askViewDidSend:pitModel:giftInfo:)]) {
[self.delegate askViewDidSend:self pitModel:self.pitModel giftInfo:self.giftModel];
}
}
-(void)showInView:(UIView *)view{
self.bgView.y = -view.height;
[view addSubview:self];
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = (view.height-self.bgView.height)/2.0;
} completion:^(BOOL finished) {
}];
}
-(void)hide{
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
@end

View File

@@ -0,0 +1,17 @@
//
// QXRoomBarCabinListCell.h
// QXLive
//
// Created by 启星 on 2026/1/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomBarCabinListCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *roomCoverView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,17 @@
//
// QXRoomBarCabinListCell.m
// QXLive
//
// Created by on 2026/1/5.
//
#import "QXRoomBarCabinListCell.h"
@implementation QXRoomBarCabinListCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
@end

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="QXRoomBarCabinListCell">
<rect key="frame" x="0.0" y="0.0" width="279" height="285"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="279" height="285"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="room_bar_cabin_cover" translatesAutoresizingMaskIntoConstraints="NO" id="ziD-kK-LpS">
<rect key="frame" x="0.0" y="0.0" width="279" height="285"/>
</imageView>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
<constraints>
<constraint firstItem="ziD-kK-LpS" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="73e-MI-SEH"/>
<constraint firstAttribute="bottom" secondItem="ziD-kK-LpS" secondAttribute="bottom" id="Bxd-nh-Iq9"/>
<constraint firstItem="ziD-kK-LpS" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="WSM-ci-iBV"/>
<constraint firstAttribute="trailing" secondItem="ziD-kK-LpS" secondAttribute="trailing" id="oy5-gA-mad"/>
</constraints>
<size key="customSize" width="279" height="285"/>
<connections>
<outlet property="roomCoverView" destination="ziD-kK-LpS" id="8W4-aY-wal"/>
</connections>
<point key="canvasLocation" x="313.74045801526717" y="102.46478873239437"/>
</collectionViewCell>
</objects>
<resources>
<image name="room_bar_cabin_cover" width="128" height="128"/>
</resources>
</document>

View File

@@ -0,0 +1,18 @@
//
// QXRoomBarCabinListView.h
// QXLive
//
// Created by 启星 on 2026/1/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomBarCabinListView : UIView
@property (nonatomic,strong)NSString *roomId;
-(void)showInView:(UIView *)view;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,134 @@
//
// QXRoomBarCabinListView.m
// QXLive
//
// Created by on 2026/1/5.
//
#import "QXRoomBarCabinListView.h"
#import "QXRoomBarCabinListCell.h"
#import "QXMineNetwork.h"
@interface QXRoomBarCabinListView()<UIGestureRecognizerDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)NSMutableArray *dataArray;
@end
@implementation QXRoomBarCabinListView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = UIScreen.mainScreen.bounds;
[self initSubviews];
}
return self;
}
-(void)initSubviews{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
self.backgroundColor = RGB16A(0x000000, 0.3);
tap.delegate = self;
[self addGestureRecognizer:tap];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(429)+kSafeAreaBottom)];
self.bgView.backgroundColor = RGB16(0x103E30);
[self.bgView addRoundedCornersWithRadius:14 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
// self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height)];
// self.bgImageView.image = [UIImage imageNamed:@"room_sound_bg"];
// [self.bgView addSubview:self.bgImageView];
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 16, self.bgView.width-32, 24)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
self.titleLabel.textColor = RGB16(0xffffff);
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.text = @"交友小屋";
[self.bgView addSubview:self.titleLabel];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 20;
layout.minimumInteritemSpacing = 20;
layout.sectionInset = UIEdgeInsetsMake(0, 50, 0, 50);
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+10, self.bgView.width, self.bgView.height-self.titleLabel.bottom-20) collectionViewLayout:layout];
[self.collectionView registerNib:[UINib nibWithNibName:@"QXRoomBarCabinListCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXRoomBarCabinListCell"];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.showsVerticalScrollIndicator = NO;
self.collectionView.bounces = NO;
self.collectionView.backgroundColor = [UIColor clearColor];
[self.bgView addSubview:self.collectionView];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)getGiftList{
MJWeakSelf
[QXMineNetwork giftListWithLabel:@"99" roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXRoomBarCabinListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRoomBarCabinListCell" forIndexPath:indexPath];
// cell.model = self.dataArray[indexPath.row];
return cell;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
NSInteger itemWidth = (NSInteger)(SCREEN_WIDTH-50*2-20)/4;
return CGSizeMake(itemWidth, itemWidth);
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
-(void)showInView:(UIView *)view{
[self getGiftList];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(429)-kSafeAreaBottom;
}];
}
-(void)hide{
if (!self.superview) {
NSLog(@"⚠️ View already removed from superview");
return;
}
[UIView animateWithDuration:0.3 animations:^{
if (self.bgView) {
self.bgView.y = SCREEN_HEIGHT;
}
} completion:^(BOOL finished) {
//
if (self.superview) {
[self removeFromSuperview];
}
// dealloc 访
// completion block 访
}];
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXRoomBarSendCustomGiftView.h
// QXLive
//
// Created by 启星 on 2026/1/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomBarSendCustomGiftView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXRoomPitModel *pitModel;
-(void)showInView:(UIView *)view;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,178 @@
//
// QXRoomBarSendCustomGiftView.m
// QXLive
//
// Created by on 2026/1/5.
//
#import "QXRoomBarSendCustomGiftView.h"
#import "QXRoomBarSetGiftCell.h"
#import "QXMineNetwork.h"
@interface QXRoomBarSendCustomGiftView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,QXRoomBarSetGiftCellDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIImageView *headerImageView;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)NSMutableArray *dataArray;
@end
@implementation QXRoomBarSendCustomGiftView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = UIScreen.mainScreen.bounds;
[self initSubviews];
}
return self;
}
-(void)initSubviews{
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
self.backgroundColor = RGB16A(0x000000, 0.3);
// tap.delegate = self;
// [self addGestureRecognizer:tap];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(287))/2, 0, ScaleWidth(287), ScaleWidth(300))];
self.bgView.backgroundColor = RGB16(0xffffff);
[self.bgView addRoundedCornersWithRadius:16];
[self addSubview:self.bgView];
self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height)];
self.bgImageView.backgroundColor = RGB16(0x9722D6);
[self.bgView addSubview:self.bgImageView];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:13];
self.titleLabel.textColor = RGB16A(0xFFFFFF,0.65);
self.titleLabel.text = @"送给";
[self.bgView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.height.mas_equalTo(17);
make.top.mas_equalTo(ScaleWidth(19));
}];
self.headerImageView = [[UIImageView alloc] init];
[self.bgView addSubview:self.headerImageView];
[self.headerImageView addRoundedCornersWithRadius:ScaleWidth(16)];
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.titleLabel.mas_right).offset(2);
make.height.width.mas_equalTo(ScaleWidth(32));
make.centerY.equalTo(self.titleLabel);
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.font = [UIFont boldSystemFontOfSize:13];
self.nameLabel.textColor = RGB16(0xFFFFFF);
self.nameLabel.text = @"羽声语音";
[self.bgView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerImageView.mas_right).offset(2);
make.height.mas_equalTo(17);
make.centerY.equalTo(self.titleLabel);
}];
self.closeBtn = [[UIButton alloc] init];
[self.closeBtn setImage:[[UIImage imageNamed:@"wallet_close"] imageByTintColor:RGB16(0xffffff)] forState:(UIControlStateNormal)];
[self.closeBtn addTarget:self action:@selector(hide) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.closeBtn];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(30);
make.right.mas_equalTo(-5);
make.centerY.equalTo(self.titleLabel);
}];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 12;
layout.minimumInteritemSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
[self.collectionView registerNib:[UINib nibWithNibName:@"QXRoomBarSetGiftCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXRoomBarSetGiftCell"];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.showsVerticalScrollIndicator = NO;
self.collectionView.bounces = NO;
self.collectionView.backgroundColor = [UIColor clearColor];
[self.bgView addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.bgView);
make.top.equalTo(self.headerImageView.mas_bottom).offset(10);
make.bottom.mas_equalTo(-15);
}];
}
-(void)setPitModel:(QXRoomPitModel *)pitModel{
_pitModel = pitModel;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:pitModel.avatar]];
self.nameLabel.text = pitModel.nickname;
}
-(void)getGiftList{
MJWeakSelf
[QXMineNetwork getRoomCustomGiftWithUserId:self.pitModel.user_id successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)setShowTimeGiftModel:(QXGiftModel *)giftModel{
QXLOG(@"送自定义礼物%@",giftModel.gift_name);
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:giftModel.gift_id gift_num:@"1" to_uid:self.pitModel.user_id heart_id:@"" type:@"1" pit_number:@"" gift_bag_id:giftModel.gift_bag successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXRoomBarSetGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRoomBarSetGiftCell" forIndexPath:indexPath];
cell.cellType = QXRoomBarSetGiftCellTypeSend;
cell.model = self.dataArray[indexPath.row];
cell.delegate = self;
return cell;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGFloat itemWidth = (SCREEN_WIDTH-16*2-12*3)/4;
return CGSizeMake(itemWidth, itemWidth+82+30);
}
-(void)showInView:(UIView *)view{
[self getGiftList];
self.bgView.y = -view.height;
[view addSubview:self];
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = (view.height-self.bgView.height)/2.0;
} 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];
}];
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
@end

View File

@@ -0,0 +1,40 @@
//
// QXRoomBarSetGiftCell.h
// QXLive
//
// Created by 启星 on 2026/1/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger) {
/// 设置礼物
QXRoomBarSetGiftCellTypeSet = 0,
/// 赠送
QXRoomBarSetGiftCellTypeSend = 1,
/// 没有底部操作
QXRoomBarSetGiftCellTypeNoOption = 2,
}QXRoomBarSetGiftCellType;
@protocol QXRoomBarSetGiftCellDelegate <NSObject>
@optional
-(void)setShowTimeGiftModel:(QXGiftModel*)giftModel;
@end
@interface QXRoomBarSetGiftCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIButton *bgBtn;
@property (weak, nonatomic) IBOutlet UIImageView *giftImageView;
@property (weak, nonatomic) IBOutlet UILabel *giftNameLabel;
@property (weak, nonatomic) IBOutlet UIButton *coinBtn;
@property (weak, nonatomic) IBOutlet UILabel *remarkLabel;
@property (weak, nonatomic) IBOutlet UIButton *setBtn;
/// 是否为心愿礼物
@property (nonatomic,assign)QXRoomBarSetGiftCellType cellType;
@property (nonatomic,strong)QXGiftModel *model;
@property (nonatomic,weak)id<QXRoomBarSetGiftCellDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,85 @@
//
// QXRoomBarSetGiftCell.m
// QXLive
//
// Created by on 2026/1/4.
//
#import "QXRoomBarSetGiftCell.h"
@implementation QXRoomBarSetGiftCell
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
}
return self;
}
-(void)setCellType:(QXRoomBarSetGiftCellType)cellType{
_cellType = cellType;
/**
///
QXRoomBarSetGiftCellTypeSet = 0,
///
QXRoomBarSetGiftCellTypeSend = 1,
///
QXRoomBarSetGiftCellTypeNoOption = 2,
*/
switch (cellType) {
case QXRoomBarSetGiftCellTypeSet:{
self.setBtn.hidden = NO;
self.remarkLabel.hidden = NO;
[self.setBtn setTitle:@"设置" forState:(UIControlStateNormal)];
}
break;
case QXRoomBarSetGiftCellTypeSend:{
self.setBtn.hidden = NO;
self.remarkLabel.hidden = NO;
[self.setBtn setTitle:@"赠送" forState:(UIControlStateNormal)];
}
break;
case QXRoomBarSetGiftCellTypeNoOption:{
self.setBtn.hidden = YES;
self.remarkLabel.hidden = YES;
}
break;
default:
break;
}
}
- (IBAction)setAction:(id)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(setShowTimeGiftModel:)]) {
[self.delegate setShowTimeGiftModel:self.model];
}
}
-(void)setModel:(QXGiftModel *)model{
_model = model;
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.giftNameLabel.text = model.gift_name;
self.remarkLabel.text = [model.gift_remark_name isExist]?model.gift_remark_name:@"待设置";
[self.coinBtn setTitle:model.gift_price forState:(UIControlStateNormal)];
if (model.isSelected) {
self.bgBtn.selected = YES;
self.giftNameLabel.textColor = RGB16(0x333333);
[self.coinBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
}else{
self.bgBtn.selected = NO;
self.giftNameLabel.textColor = RGB16(0xffffff);
[self.coinBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
// self.bgView.backgroundColor = RGB16A(0xE9E9E9, 0.2);
[self.bgBtn setBackgroundImage:[UIImage imageWithColor:RGB16A(0xE9E9E9, 0.2)] forState:(UIControlStateNormal)];
[self.bgBtn setBackgroundImage:[UIImage imageNamed:@"room_sound_sel"] forState:(UIControlStateSelected)];
[self.setBtn setBackgroundColor:QXConfig.themeColor];
}
@end

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="QXRoomBarSetGiftCell">
<rect key="frame" x="0.0" y="0.0" width="249" height="426"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="249" height="426"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j9y-kf-kve">
<rect key="frame" x="0.0" y="0.0" width="249" height="298"/>
<subviews>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LGy-5R-QVG">
<rect key="frame" x="0.0" y="0.0" width="249" height="298"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
</button>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="LGy-5R-QVG" secondAttribute="bottom" id="6Pu-mi-cJ7"/>
<constraint firstAttribute="trailing" secondItem="LGy-5R-QVG" secondAttribute="trailing" id="SSz-1S-H4F"/>
<constraint firstItem="LGy-5R-QVG" firstAttribute="leading" secondItem="j9y-kf-kve" secondAttribute="leading" id="T1C-df-WUd"/>
<constraint firstItem="LGy-5R-QVG" firstAttribute="top" secondItem="j9y-kf-kve" secondAttribute="top" id="gax-cg-Ds6"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="vUD-x9-KiV">
<rect key="frame" x="5" y="10" width="239" height="239"/>
<constraints>
<constraint firstAttribute="width" secondItem="vUD-x9-KiV" secondAttribute="height" multiplier="1:1" id="bLM-nw-r4M"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="爱的抱抱" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SdB-zr-RjJ">
<rect key="frame" x="5" y="249" width="239" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="kV7-cA-gcm"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ywt-wc-bcU">
<rect key="frame" x="5" y="270" width="239" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="unq-l1-35T"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title=" 9999" image="gift_corn">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lej-72-G7U">
<rect key="frame" x="86" y="389" width="77" height="32"/>
<color key="backgroundColor" red="0.028566114604473114" green="0.39152848720550537" blue="0.096433885395526886" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="77" id="4Vm-Yt-0Xx"/>
<constraint firstAttribute="height" constant="32" id="sfd-4W-Ed4"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="设置"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="setAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="eTt-T0-akM"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="待设置" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZCc-yF-yJB">
<rect key="frame" x="10" y="367" width="229" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="UWL-bn-ke5"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
<constraints>
<constraint firstItem="lej-72-G7U" firstAttribute="centerX" secondItem="SEy-5g-ep8" secondAttribute="centerX" id="0zt-ix-hcU"/>
<constraint firstItem="lej-72-G7U" firstAttribute="top" secondItem="ZCc-yF-yJB" secondAttribute="bottom" constant="2" id="2SO-lX-fWq"/>
<constraint firstItem="Ywt-wc-bcU" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="3DS-Uh-Nv2"/>
<constraint firstAttribute="trailing" secondItem="SdB-zr-RjJ" secondAttribute="trailing" constant="5" id="I6B-3z-qRO"/>
<constraint firstItem="vUD-x9-KiV" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="KUX-vZ-Ufz"/>
<constraint firstItem="ZCc-yF-yJB" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="MOY-RK-Y76"/>
<constraint firstAttribute="trailing" secondItem="vUD-x9-KiV" secondAttribute="trailing" constant="5" id="MaY-mb-rmF"/>
<constraint firstItem="Ywt-wc-bcU" firstAttribute="top" secondItem="SdB-zr-RjJ" secondAttribute="bottom" constant="5" id="Pvi-MP-yIF"/>
<constraint firstAttribute="trailing" secondItem="j9y-kf-kve" secondAttribute="trailing" id="XYh-2Y-1SP"/>
<constraint firstItem="SdB-zr-RjJ" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="fhx-QP-CJF"/>
<constraint firstItem="vUD-x9-KiV" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="frQ-bf-j86"/>
<constraint firstItem="j9y-kf-kve" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="gSQ-MI-UCf"/>
<constraint firstAttribute="trailing" secondItem="ZCc-yF-yJB" secondAttribute="trailing" constant="10" id="i71-J0-j1I"/>
<constraint firstItem="j9y-kf-kve" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="ito-JX-xas"/>
<constraint firstAttribute="bottom" secondItem="lej-72-G7U" secondAttribute="bottom" constant="5" id="jaF-Hd-bN6"/>
<constraint firstItem="SdB-zr-RjJ" firstAttribute="top" secondItem="vUD-x9-KiV" secondAttribute="bottom" id="ojp-3B-gkg"/>
<constraint firstAttribute="trailing" secondItem="Ywt-wc-bcU" secondAttribute="trailing" constant="5" id="sy3-Us-c5g"/>
<constraint firstItem="j9y-kf-kve" firstAttribute="bottom" secondItem="Ywt-wc-bcU" secondAttribute="bottom" constant="10" id="xVi-8e-1fo"/>
</constraints>
<size key="customSize" width="249" height="426"/>
<connections>
<outlet property="bgBtn" destination="LGy-5R-QVG" id="bIs-FS-QOj"/>
<outlet property="bgView" destination="j9y-kf-kve" id="d3D-Dh-BlD"/>
<outlet property="coinBtn" destination="Ywt-wc-bcU" id="sbj-3z-7ex"/>
<outlet property="giftImageView" destination="vUD-x9-KiV" id="Q4s-dg-ouw"/>
<outlet property="giftNameLabel" destination="SdB-zr-RjJ" id="gb6-RN-sej"/>
<outlet property="remarkLabel" destination="ZCc-yF-yJB" id="2cb-Ka-cI5"/>
<outlet property="setBtn" destination="lej-72-G7U" id="qBN-mo-Q8j"/>
</connections>
<point key="canvasLocation" x="290.83969465648852" y="152.81690140845072"/>
</collectionViewCell>
</objects>
<resources>
<image name="gift_corn" width="6" height="6"/>
</resources>
</document>

View File

@@ -0,0 +1,30 @@
//
// QXRoomBarSetGiftView.h
// QXLive
//
// Created by 启星 on 2026/1/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class QXRoomBarSetGiftView;
@protocol QXRoomBarSetGiftViewDelegate <NSObject>
@optional
-(void)setGiftModelIsLikeGift:(BOOL)isLikeGift giftModel:(QXGiftModel*)giftModel pitNumber:(NSString*)pitNumber setGiftView:(QXRoomBarSetGiftView*)setGiftView;
@end
@interface QXRoomBarSetGiftView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)NSString *pitNumber;
/// 是否为心愿礼物
@property (nonatomic,assign)BOOL isLikeGift;
@property (nonatomic,weak)id<QXRoomBarSetGiftViewDelegate>delegate;
-(void)showInView:(UIView *)view;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,229 @@
//
// QXRoomBarSetGiftView.m
// QXLive
//
// Created by on 2026/1/4.
//
#import "QXRoomBarSetGiftView.h"
#import "QXRoomBarSetGiftCell.h"
#import "QXMineNetwork.h"
#import "QXRoomBarSetShowTimeView.h"
@interface QXRoomBarSetGiftView()<UIGestureRecognizerDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,QXRoomBarSetGiftCellDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *subTitleLabel;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)QXGiftModel *selectedModel;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,strong)UIButton *cancelBtn;
@property (nonatomic,strong)UIButton *commitBtn;
@end
@implementation QXRoomBarSetGiftView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = UIScreen.mainScreen.bounds;
[self initSubviews];
}
return self;
}
-(void)initSubviews{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
self.backgroundColor = RGB16A(0x000000, 0.3);
tap.delegate = self;
[self addGestureRecognizer:tap];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(429)+kSafeAreaBottom)];
self.bgView.backgroundColor = RGB16(0x103E30);
[self.bgView addRoundedCornersWithRadius:14 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
// self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height)];
// self.bgImageView.image = [UIImage imageNamed:@"room_sound_bg"];
// [self.bgView addSubview:self.bgImageView];
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 16, self.bgView.width-32, 24)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
self.titleLabel.textColor = RGB16(0xffffff);
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.text = @"设置你的自定义礼物";
[self.bgView addSubview:self.titleLabel];
self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, self.titleLabel.bottom+10, self.bgView.width-32, 24)];
self.subTitleLabel.font = [UIFont systemFontOfSize:13];
self.subTitleLabel.textColor = RGB16(0x999999);
self.subTitleLabel.textAlignment = NSTextAlignmentLeft;
self.subTitleLabel.text = @"设置每个礼物对应的表演内容,上麦位后其他人可见";
[self.bgView addSubview:self.subTitleLabel];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 12;
layout.minimumInteritemSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.subTitleLabel.bottom+10, self.bgView.width, self.bgView.height-self.subTitleLabel.bottom-20) collectionViewLayout:layout];
[self.collectionView registerNib:[UINib nibWithNibName:@"QXRoomBarSetGiftCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXRoomBarSetGiftCell"];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.showsVerticalScrollIndicator = NO;
self.collectionView.bounces = NO;
self.collectionView.backgroundColor = [UIColor clearColor];
[self.bgView addSubview:self.collectionView];
self.cancelBtn = [[UIButton alloc] init];
[self.cancelBtn setTitle:@"取消" forState:(UIControlStateNormal)];
[self.cancelBtn setTitleColor:RGB16(0x999999) forState:(UIControlStateNormal)];
[self.cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:(UIControlEventTouchUpInside)];
self.cancelBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15];
[self.bgView addSubview:self.cancelBtn];
[self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.height.mas_equalTo(30);
make.width.mas_equalTo(50);
make.centerY.equalTo(self.titleLabel);
}];
self.commitBtn = [[UIButton alloc] init];
[self.commitBtn setTitle:@"确定" forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
self.commitBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:15];
[self.bgView addSubview:self.commitBtn];
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.height.mas_equalTo(30);
make.width.mas_equalTo(50);
make.centerY.equalTo(self.titleLabel);
}];
}
-(void)setIsLikeGift:(BOOL)isLikeGift{
_isLikeGift = isLikeGift;
self.cancelBtn.hidden = !isLikeGift;
self.commitBtn.hidden = !isLikeGift;
self.titleLabel.text = isLikeGift?@"选择你的心愿礼物":@"设置你的自定义礼物";
self.subTitleLabel.text = isLikeGift?@"其他人赠送你心愿礼物,则能邀请你进入私密房间":@"设置每个礼物对应的表演内容,上麦位后其他人可见";
}
-(void)setPitNumber:(NSString *)pitNumber{
_pitNumber = pitNumber;
}
-(void)cancelAction{
[self hide];
}
-(void)commitAction{
if (!self.selectedModel) {
showToast(@"请选择礼物");
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(setGiftModelIsLikeGift:giftModel:pitNumber:setGiftView:)]) {
[self.delegate setGiftModelIsLikeGift:self.isLikeGift giftModel:self.selectedModel pitNumber:self.pitNumber setGiftView:self];
}
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)getGiftList{
MJWeakSelf
[QXMineNetwork getRoomNewGiftListWithLabel:self.isLikeGift?@"15":@"14" type:@"6" successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)setShowTimeGiftModel:(QXGiftModel *)giftModel{
QXRoomBarSetShowTimeView *view = [[QXRoomBarSetShowTimeView alloc] init];
view.roomId = self.roomId;
view.giftModel = giftModel;
MJWeakSelf
view.commitBlock = ^{
[weakSelf getGiftList];
};
[view showInView:self.superview];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXRoomBarSetGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRoomBarSetGiftCell" forIndexPath:indexPath];
cell.cellType = self.isLikeGift?QXRoomBarSetGiftCellTypeNoOption:QXRoomBarSetGiftCellTypeSet;
cell.model = self.dataArray[indexPath.row];
cell.delegate = self;
return cell;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGFloat itemWidth = (SCREEN_WIDTH-16*2-12*3)/4;
if (self.isLikeGift) {
return CGSizeMake(itemWidth, itemWidth+50);
}else{
return CGSizeMake(itemWidth, itemWidth+82+30);
}
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
if (!self.isLikeGift) {
return;
}
QXGiftModel *model = self.dataArray[indexPath.row];
if (model.isSelected) {
return;
}
if (self.selectedModel) {
self.selectedModel.isSelected = NO;
}
model.isSelected = YES;
self.selectedModel = model;
[collectionView reloadData];
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
-(void)showInView:(UIView *)view{
self.selectedModel = nil;
[self.collectionView reloadData];
[self getGiftList];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(429)-kSafeAreaBottom;
}];
}
-(void)hide{
if (!self.superview) {
NSLog(@"⚠️ View already removed from superview");
return;
}
[UIView animateWithDuration:0.3 animations:^{
if (self.bgView) {
self.bgView.y = SCREEN_HEIGHT;
}
} completion:^(BOOL finished) {
//
if (self.superview) {
[self removeFromSuperview];
}
// dealloc 访
// completion block 访
}];
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXRoomBarSetShowTimeView.h
// QXLive
//
// Created by 启星 on 2026/1/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomBarSetShowTimeView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,copy)void(^commitBlock)(void);
-(void)showInView:(UIView *)view;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

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