This commit is contained in:
启星
2025-09-08 08:49:04 +08:00
parent ddeec09ea5
commit 349cab1499
290 changed files with 8627 additions and 760 deletions

View File

@@ -748,6 +748,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8798G5VMH9;
@@ -779,14 +780,15 @@
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
PRODUCT_BUNDLE_IDENTIFIER = com.xscm.midi;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
@@ -808,6 +810,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8798G5VMH9;
@@ -839,14 +842,15 @@
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
PRODUCT_BUNDLE_IDENTIFIER = com.xscm.midi;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
@@ -1063,7 +1067,7 @@
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.QXLiveScreen;
PRODUCT_BUNDLE_IDENTIFIER = com.xscm.midi.QXLiveScreen;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -1089,7 +1093,7 @@
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.QXLiveScreen;
PRODUCT_BUNDLE_IDENTIFIER = com.xscm.midi.QXLiveScreen;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -1188,7 +1192,7 @@
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -1252,7 +1256,7 @@
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View File

@@ -16,22 +16,6 @@
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8CF1AB09-BCFD-4EF7-A939-87C9337AC28F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/Config/QXRoomMessageManager.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "680"
endingLineNumber = "680"
landmarkName = "-sendC2CMessage:messageType:userId:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
@@ -163,48 +147,16 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "5926F40B-C857-4536-B22D-487870969718"
uuid = "D881CAF8-64EA-4BD0-8B32-68181DE6C199"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/Config/QXAgoraEngine.m"
filePath = "QXLive/&#x6d3b;&#x52a8;/&#x5de1;&#x4e50;&#x4f1a;/QXMeetActivityRecordView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "133"
endingLineNumber = "133"
landmarkName = "-rtcEngine:tokenPrivilegeWillExpire:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "897CAB7A-F71C-4864-A033-9F767C0D5118"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/Config/QXRoomMessageManager.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "524"
endingLineNumber = "524"
landmarkName = "-onReceiveRESTCustomData:data:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "1BE577E6-D501-443A-89C9-60CABA7923F0"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/HomePage(&#x58f0;&#x64ad;)/View/&#x623f;&#x95f4;/&#x9ea6;&#x4f4d;&#x89c6;&#x56fe;/QXRoomSeatTypeFrientView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "772"
endingLineNumber = "772"
landmarkName = "-configPowerBtn"
startingLineNumber = "130"
endingLineNumber = "130"
landmarkName = "-collectionView:cellForItemAtIndexPath:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>

View File

@@ -47,6 +47,8 @@ typedef void (^showFinishBlock)(void);
@property (nonatomic,strong) QXRoomViewController *roomVC;
@property (nonatomic,strong)NSString *superRoomId;
-(void)miniRoomWithRoomId:(NSString*)roomId roomCover:(NSString*)roomCover;

View File

@@ -193,6 +193,7 @@
[[QXGlobal shareGlobal] logOut];
return;
}
[UIApplication sharedApplication].idleTimerDisabled = NO;
navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController;
// navagationController.interactivePopGestureRecognizer.enabled = NO;
if (_miniView) {
@@ -265,6 +266,7 @@
[[QXRoomMessageManager shared] quitGroupWithRoomId:roomId];
if (_roomVC) {
[_roomVC.seatContentView destroyViews];
[_roomVC destroyViews];
}
self.roomId = nil;
_roomVC = nil;

View File

@@ -9,7 +9,8 @@
#import "MQTTClient.h"
#import "MQTTSessionManager.h"
#import <CommonCrypto/CommonHMAC.h>
static NSString * _Nonnull qx_room_topic = @"qx_room_topic";
static NSString * _Nonnull qx_ac_topic = @"qx_xunlehui";
NS_ASSUME_NONNULL_BEGIN
@protocol MQTTClientModelDelegate <NSObject>
@optional

View File

@@ -77,7 +77,8 @@
switch (newState) {
case MQTTSessionManagerStateConnected:
QXLOG(@"eventCode -- 连接成功");
[self subscribeTopic:@"qx_room_topic"];
[self subscribeTopic:qx_room_topic];
[self subscribeTopic:qx_ac_topic];
[self reConnectForStateError];
break;

View File

@@ -97,7 +97,7 @@ typedef NS_ENUM(NSInteger) {
QXRoomMessageTypeRoomPkNeedAgree = 1037,
/// 房间盲盒开礼物文字消息
QXRoomMessageTypeRoomBlindBox = 1038,
/// 房间已被封禁
/// 房间内换麦
QXRoomMessageTypeRoomDidFire = 1039,
/// 交友房阶段发生变化
@@ -114,6 +114,11 @@ typedef NS_ENUM(NSInteger) {
QXRoomMessageTypeHeartDidChanged = 1054,
/// 交友房私密小屋有人退出房间
QXRoomMessageTypeFriendRoomQuit = 1055,
/// 巡乐会盘进度更新
QXRoomMessageTypeMeetActivityProgressUpdate = 1056,
/// 巡乐会盘抽奖结果更新
QXRoomMessageTypeMeetActivityDrawGift = 1057,
}QXRoomMessageType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXRoomMessageManagerDelegate <NSObject>
@@ -131,6 +136,9 @@ NS_ASSUME_NONNULL_BEGIN
-(void)aplayMicInLineNumberDidChanged:(NSString*)number;
/// 清空消息
-(void)didClearAllMessage;
/// 有人发起点歌
-(void)applySongWaitAgreeWithUserNickname:(NSString*)nickname;
/// 主持人拒绝点歌
@@ -168,6 +176,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)roomOnlineNumberDidChangedIsAdd:(BOOL)isAdd;
/// 10秒自动校正在线人数
-(void)roomOnlineNumberDidChangedOnlineNumber:(NSString*)onlineNumber;
/// 房间换麦
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber;
@@ -229,6 +239,11 @@ NS_ASSUME_NONNULL_BEGIN
/// 私密小屋时间发生延时
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time;
/// 巡乐会进度更新
-(void)meetActivityProgressIsUpdate:(NSDictionary*)updateDict;
/// 巡乐会礼物发生变化
-(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel*)giftInfo;
@end
@interface QXRoomMessageManager : NSObject
@property (nonatomic,weak)id<QXRoomMessageManagerDelegate>delegate;

View File

@@ -13,6 +13,7 @@
@interface QXRoomMessageManager() <V2TIMGroupListener,V2TIMSimpleMsgListener,V2TIMAdvancedMsgListener>
@property (nonatomic,strong)NSString *groupId;
@property (nonatomic,strong)NSString *roomId;
@end
@implementation QXRoomMessageManager
+ (instancetype)shared {
@@ -35,6 +36,7 @@
[[V2TIMManager sharedInstance] joinGroup:groupId msg:@"大家好,我来啦" succ:^{
QXLOG(@"腾讯IM加入聊天室成功");
weakSelf.groupId = groupId;
weakSelf.roomId = roomId;
} fail:^(int code, NSString *desc) {
//
QXLOG(@"腾讯IM加入聊天室失败-code%d-原因%@",code,desc);
@@ -42,8 +44,8 @@
}
-(void)quitGroupWithRoomId:(NSString *)roomId{
MJWeakSelf
// [QXMineNetwork quitRoomWithRoomId:<#(nonnull NSString *)#> user_id:<#(nonnull NSString *)#> successBlock:<#^(NSDictionary * _Nonnull dict)successBlock#> failBlock:<#^(NSError * _Nonnull error, NSString * _Nonnull msg)failBlock#>];
self.groupId = nil;
self.roomId = nil;
[[V2TIMManager sharedInstance] removeGroupListener:self];
[[V2TIMManager sharedInstance] removeSimpleMsgListener:self];
[[V2TIMManager sharedInstance] removeAdvancedMsgListener:self];
@@ -534,7 +536,7 @@
}
break;
case QXRoomMessageTypeRoomFriendCreateRelation:{
QXRoomFriendRelationModel *relationModel = [QXRoomFriendRelationModel yy_modelWithJSON:msg.Text[@"relation"]];
QXRoomFriendRelationModel *relationModel = [QXRoomFriendRelationModel yy_modelWithJSON:msg.Text];
if (self.delegate && [self.delegate respondsToSelector:@selector(friendRelationIsCreatedWithrelationModel:)]) {
[self.delegate friendRelationIsCreatedWithrelationModel:relationModel];
}
@@ -553,6 +555,33 @@
}
}
break;
case QXRoomMessageTypeMeetActivityProgressUpdate:{
NSDictionary *progressDict = msg.Text;
if (self.delegate && [self.delegate respondsToSelector:@selector(meetActivityProgressIsUpdate:)]) {
[self.delegate meetActivityProgressIsUpdate:progressDict];
}
}
break;
case QXRoomMessageTypeMeetActivityDrawGift:{
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
if (self.delegate && [self.delegate respondsToSelector:@selector(meetActivityGiftInfoIsUpdate:)]) {
[self.delegate meetActivityGiftInfoIsUpdate:model];
}
}
break;
case QXRoomMessageTypeRoomDidFire:{
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
NSInteger fromPitNumber = [msg.Text[@"from_pit_number"] integerValue];
NSInteger toPitNumber = [msg.Text[@"to_pit_number"] integerValue];
if (self.delegate && [self.delegate respondsToSelector:@selector(roomSeatExchangedWithFromPitNumber:toPitNumber:)]) {
[self.delegate roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
model.messageType = QXRoomChatMessageTypeSystem;
[self.delegate didInsertMessge:model];
}
}
break;
default:
break;
}
@@ -593,6 +622,7 @@
-(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]) {
NSInteger meesageType = msg.MsgType.integerValue;
if (meesageType == QXRoomMessageTypeText) {
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
@@ -625,12 +655,13 @@
userInfo.volume = 0;
[[NSNotificationCenter defaultCenter] postNotificationName:noticeUserSpeak object:userInfo];
}
}
}
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage{
NSDictionary *dict = @{
@"RoomId":self.groupId?self.groupId:@"",
@"RoomId":self.roomId?self.roomId:@"",
@"MsgType":[NSNumber numberWithInteger:messageType],
@"Text":@{
@"FromUserInfo":@{
@@ -670,7 +701,7 @@
-(void)sendC2CMessage:(NSString *)message messageType:(QXRoomMessageType)messageType userId:(NSString *)userId{
NSDictionary *dict = @{
@"RoomId":self.groupId?self.groupId:@"",
@"RoomId":self.roomId?self.roomId:@"",
@"MsgType":[NSNumber numberWithInteger:messageType],
@"Text":@{
@"FromUserInfo":@{

View File

@@ -381,6 +381,7 @@
[weakSelf.sendView hide];
self->_sendView = nil;
};
self.sendView.vc = weakSelf.viewController;
[self.sendView showInView:KEYWINDOW];
// al.modalPresentationStyle = UIModalPresentationOverFullScreen;

View File

@@ -45,6 +45,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString* auctionId;
/// 交友房助力id
@property (nonatomic,strong)NSString* heartId;
/// 跳转活动
@property (nonatomic,copy)void(^jumpActivityGiftBlock)(QXGiftModel *gift,NSString*userIds);
@property (nonatomic,copy)void(^sendSuccessBlock)(NSString*dynamicId);
@@ -60,8 +62,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,strong)NSString *giftLabelId;
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,assign)NSInteger selectedIndex;
@property (nonatomic,copy)void(^selectetGiftBlock)(QXGiftModel *gift);
@property (nonatomic,assign)QXSendGiftViewType type;
@end
@interface QXSendGiftUserView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>

View File

@@ -90,6 +90,8 @@
[_pitUserListView removeFromSuperview];
_pitUserListView = nil;
}
self.cornLabel.textColor = RGB16(0x333333);
[self.countBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.bgView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(429)+kSafeAreaBottom);
self.bgView.backgroundColor = [UIColor whiteColor];
self.bgImageView.hidden = YES;
@@ -200,7 +202,7 @@
self.cornLabel = [[UILabel alloc] init];
self.cornLabel.font = [UIFont systemFontOfSize:14];
self.cornLabel.textColor = QXConfig.textColor;
self.cornLabel.textColor = RGB16(0xffffff);
self.cornLabel.text = @"0";
[self.bgView addSubview:self.cornLabel];
[self.cornLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -238,7 +240,7 @@
self.countBtn = [[UIButton alloc] init];
[self.countBtn setTitle:@"X1" forState:(UIControlStateNormal)];
[self.countBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.countBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
self.countBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.countBtn addTarget:self action:@selector(selectedCount:) forControlEvents:(UIControlEventTouchUpInside)];
[self.sendBgView addSubview:self.countBtn];
@@ -283,10 +285,12 @@
_dynamicId = dynamicId;
self.userListView.dynamicId = dynamicId;
self.rechargeBtn.hidden = !QXGlobal.shareGlobal.isOpenRecharge;
[self getMyWallet];
}
///
-(void)sendAction{
MJWeakSelf
__block NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
if (self.type == QXSendGiftViewTypeRoom) {
if (self.giftModel==nil) {
showToast(@"请选择礼物");
@@ -300,24 +304,27 @@
self.auctionId = @"";
/// 2
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
[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) {
[weakSelf hide];
if (type.intValue == 1) {
if (weakSelf.roomSendSuccessBlock) {
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,@"");
}
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg)
}];
}else if (self.type == QXSendGiftViewTypeAuction) {
self.heartId = @"";
/// 2
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
[QXMineNetwork roomAuctionJoinWithAuctionId:self.auctionId user_id:[QXGlobal shareGlobal].loginModel.user_id gift_id:self.giftModel.gift_id num:self.giftCount type:type successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
if (type.intValue == 1) {
if (weakSelf.roomSendSuccessBlock) {
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,[QXGlobal shareGlobal].loginModel.user_id,weakSelf.auctionId);
}
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
@@ -328,9 +335,11 @@
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
[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) {
[weakSelf hide];
if (type.intValue == 1) {
if (weakSelf.roomSendSuccessBlock) {
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,weakSelf.heartId);
}
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg)
}];
@@ -358,10 +367,12 @@
MJWeakSelf
switch (self.type) {
case QXSendGiftViewTypeFind:{
[self.viewController dismissViewControllerAnimated:YES completion:^{
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
[weakSelf.vc.navigationController pushViewController:vc animated:YES];
}];
// [self.viewController dismissViewControllerAnimated:YES completion:^{
[self hide];
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
recharge.isPop = YES;
[recharge showInView:KEYWINDOW];
// }];
}
break;
case QXSendGiftViewTypeRoom:{
@@ -456,10 +467,24 @@
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
QXSendGiftCollectionView *subGiftView = [[QXSendGiftCollectionView alloc] initWithFrame:listContainerView.bounds];
QXGiftLabelModel *md = self.titles[index];
subGiftView.roomId = self.roomId;
subGiftView.giftLabelId = md.id;
subGiftView.type = self.type;
MJWeakSelf
subGiftView.selectetGiftBlock = ^(QXGiftModel * _Nonnull gift) {
weakSelf.giftModel = gift;
if ([gift.activities_id isEqualToString:@"5"]) {
if (weakSelf.pitUserListView.selectedArray.count == 0) {
showToast(@"请选择送礼对象");
return;
}
NSString *userIds = [weakSelf.pitUserListView.selectedArray componentsJoinedByString:@","];
if (weakSelf.jumpActivityGiftBlock) {
weakSelf.jumpActivityGiftBlock(gift,userIds);
}
return;
}
if (gift.gift_bag_name.length > 0) {
weakSelf.funnyView.hidden = NO;
weakSelf.titleLabel.text = gift.gift_bag_name;
@@ -493,13 +518,17 @@
if (weakSelf.userListView.dataArray.count == 0) {
return;
}else{
QXAlertViewController *al = (QXAlertViewController *)weakSelf.viewController;
[al hideViewFinishBlock:^{
// QXAlertViewController *al = (QXAlertViewController *)weakSelf.viewController;
// [al hideViewFinishBlock:^{
[weakSelf hide];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
QXGiveGiftListView *listView = [[QXGiveGiftListView alloc] init];
listView.dynamicId = weakSelf.dynamicId;
listView.vc = weakSelf.vc;
[listView showInView:KEYWINDOW];
}];
});
// }];
}
}];
}
@@ -558,7 +587,7 @@
-(void)getGiftListWithLabel:(NSString*)label{
MJWeakSelf
self.selectedIndex = -1;
[QXMineNetwork giftListWithLabel:label successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[QXMineNetwork giftListWithLabel:label roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.collectionView reloadData];
@@ -586,19 +615,41 @@
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
cell.cellType = QXGiftCellTypeLive;
cell.roomGiftModel = self.dataArray[indexPath.row];
if (self.type == QXSendGiftViewTypeFind) {
cell.giftNameLabel.textColor = RGB16(0x333333);
[cell.cornBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
if (self.selectedIndex == indexPath.row) {
cell.selecteBtn.selected = YES;
}else{
cell.selecteBtn.selected = NO;
}
}else{
if (self.selectedIndex == indexPath.row) {
cell.selecteBtn.selected = YES;
cell.giftNameLabel.textColor = RGB16(0x333333);
[cell.cornBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
}else{
cell.selecteBtn.selected = NO;
cell.giftNameLabel.textColor = RGB16(0xffffff);
[cell.cornBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
}
}
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
QXGiftModel *model = self.dataArray[indexPath.row];
if ([model.activities_id isEqualToString:@"5"]) {
///
if (self.selectetGiftBlock) {
self.selectetGiftBlock(model);
}
return;
}
if (indexPath.row == self.selectedIndex) {
return;
}
self.selectedIndex = indexPath.row;
QXGiftModel *model = self.dataArray[indexPath.row];
if (self.selectetGiftBlock) {
self.selectetGiftBlock(model);
}

View File

@@ -78,10 +78,36 @@
/// 退
-(void)friendCabinRoomIsQuit{
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
for (int i = 0; i < viewControllers.count; i++) {
UIViewController *vc = [viewControllers objectAtIndex:i];
if ([vc isEqual:self]) {
QXRoomViewController *roomVc = [[QXRoomViewController alloc] init];
roomVc.roomId = QXGlobal.shareGlobal.superRoomId;
[viewControllers insertObject:roomVc atIndex:i];
break;
}
}
self.navigationController.viewControllers = viewControllers;
[self.navigationController popViewControllerAnimated:YES];
QXGlobal.shareGlobal.superRoomId = @"";
// [self.navigationController popViewControllerAnimated:YES];
}
///
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time{
[self.seatContentView friendCabinRoomTimeDelayWithTime:end_time];
}
-(void)meetActivityProgressIsUpdate:(NSDictionary *)updateDict{
QXXLHModel *model = [QXXLHModel yy_modelWithJSON:updateDict[@"xlh_data"]];
[self.skyView updateProgress:model];
[self.ageView updateProgress:model];
[self.timeView updateProgress:model];
}
-(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel *)giftInfo{
[self.meetView updateUserAndGiftInfoWithModel:giftInfo];
}
@end

View File

@@ -13,6 +13,12 @@
#import "QXRoomBottomView.h"
#import "QXRoomMessageManager.h"
#import "QXSendGiftView.h"
/// 活动
#import "QXSkyPraizeView.h"/// 天空之境
#import "QXAgePraizeView.h"/// 岁月之城
#import "QXTimePraizeView.h"/// 时空之巅
#import "QXMeetActivityView.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomViewController : QXBaseViewController<QXRoomMessageManagerDelegate,QXRoomSeatDelegate>
@@ -32,7 +38,16 @@ NS_ASSUME_NONNULL_BEGIN
/// 发送礼物
@property (nonatomic,strong)QXSendGiftView *sendGiftView;
@property (nonatomic,strong)QXSkyPraizeView *skyView;
@property (nonatomic,strong)QXAgePraizeView *ageView;
@property (nonatomic,strong)QXTimePraizeView *timeView;
/// 巡乐会
@property (nonatomic,strong)QXMeetActivityView *meetView;
-(void)configBottomTools;
-(void)destroyViews;
@end
NS_ASSUME_NONNULL_END

View File

@@ -278,6 +278,7 @@ QXRoomUserInfoViewDelegate
}
-(void)resetSubviews{
[UIApplication sharedApplication].idleTimerDisabled = NO;
if (self.roomModel.room_info.type_id.intValue != 6) {
[self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_background]];
}else{
@@ -397,6 +398,10 @@ QXRoomUserInfoViewDelegate
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];
}else{
if (self.roomModel.user_info.pit_number.intValue > 0) {
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
[[QXAgoraEngine sharedEngine] enableAudio:NO];
@@ -408,6 +413,7 @@ QXRoomUserInfoViewDelegate
[[QXAgoraEngine sharedEngine] enableAudio:NO];
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:YES];
}
}
self.seatContentView.roomModel = self.roomModel;
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2){
/// k
@@ -464,6 +470,9 @@ QXRoomUserInfoViewDelegate
//// _movieView = nil;
//// }
[[QXAgoraEngine sharedEngine] startPreViewWithUid:uid view:self.movieView.videoView];
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
[[QXAgoraEngine sharedEngine] enableAudio:NO];
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
}
}];
@@ -481,10 +490,7 @@ QXRoomUserInfoViewDelegate
}
[QXRoomMessageManager shared].delegate = self;
[QXAgoraEngine sharedEngine].delegate = self;
if (self.roomModel.room_info.type_id.intValue == 6) {
self.bottomView.isCabinRoom = YES;
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
}
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) {
//
@@ -523,6 +529,10 @@ QXRoomUserInfoViewDelegate
}
-(void)configBottomTools{
if (self.roomModel.room_info.type_id.intValue == 6) {
self.bottomView.isCabinRoom = YES;
return;
}
self.bottomView.roomModel = self.roomModel;
BOOL hasPK = NO;
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1) {
@@ -731,6 +741,9 @@ QXRoomUserInfoViewDelegate
}
}
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
[self.seatContentView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
}
//
-(void)userDidTakeOffWithUserInfo:(QXUserHomeModel *)userInfo{
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
@@ -1606,6 +1619,28 @@ QXRoomUserInfoViewDelegate
}
};
_sendGiftView.jumpActivityGiftBlock = ^(QXGiftModel * _Nonnull gift, NSString * _Nonnull userIds) {
if (gift.gift_bag.intValue == 10) {
weakSelf.skyView.giftModel = gift;
weakSelf.skyView.roomId = weakSelf.roomId;
weakSelf.skyView.userIds = userIds;
[weakSelf.sendGiftView hide];
[weakSelf.skyView showInView:weakSelf.view];
}else if(gift.gift_bag.intValue == 11) {
weakSelf.ageView.giftModel = gift;
weakSelf.ageView.roomId = weakSelf.roomId;
weakSelf.ageView.userIds = userIds;
[weakSelf.sendGiftView hide];
[weakSelf.ageView showInView:weakSelf.view];
}else if(gift.gift_bag.intValue == 12) {
weakSelf.timeView.giftModel = gift;
weakSelf.timeView.roomId = weakSelf.roomId;
weakSelf.timeView.userIds = userIds;
[weakSelf.sendGiftView hide];
[weakSelf.timeView showInView:weakSelf.view];
}
};
}
return _sendGiftView;
}
@@ -1727,6 +1762,62 @@ QXRoomUserInfoViewDelegate
}
return _micTeamView;
}
//
-(QXSkyPraizeView *)skyView{
if (!_skyView) {
_skyView = [[QXSkyPraizeView alloc] init];
MJWeakSelf
_skyView.startBlock = ^{
[weakSelf.skyView hide];
weakSelf.meetView.roomId = weakSelf.roomId;
[weakSelf.meetView showInView:weakSelf.view];
};
}
return _skyView;
}
-(QXAgePraizeView *)ageView{
if (!_ageView) {
_ageView = [[QXAgePraizeView alloc] init];
MJWeakSelf
_ageView.startBlock = ^{
[weakSelf.ageView hide];
weakSelf.meetView.roomId = weakSelf.roomId;
[weakSelf.meetView showInView:weakSelf.view];
};
}
return _ageView;
}
-(QXTimePraizeView *)timeView{
if (!_timeView) {
_timeView = [[QXTimePraizeView alloc] init];
MJWeakSelf
_timeView.startBlock = ^{
[weakSelf.timeView hide];
weakSelf.meetView.roomId = weakSelf.roomId;
[weakSelf.meetView showInView:weakSelf.view];
};
}
return _timeView;
}
-(QXMeetActivityView *)meetView{
if (!_meetView) {
_meetView = [[QXMeetActivityView alloc] init];
_meetView.roomId = self.roomId;
}
return _meetView;
}
-(void)destroyViews{
if (_skyView) {
[_skyView destroyViews];
_skyView = nil;
}
if (_ageView) {
[_ageView destroyViews];
_ageView = nil;
}
if (_timeView) {
[_timeView destroyViews];
_timeView = nil;
}
}
@end

View File

@@ -88,5 +88,8 @@ typedef NS_ENUM(NSInteger) {
@property (nonatomic,strong)NSString* end_time;
@property (nonatomic,strong)QXRoomFriendRelationModel* friend_user;
/// 礼物数量 巡乐会
@property (nonatomic,strong)NSString *gift_num;
@end
NS_ASSUME_NONNULL_END

View File

@@ -147,7 +147,11 @@ NSInteger maxMessageCount = 20;
[self scrollToBottom];
}
-(void)insertMessage:(QXRoomChatListModel *)model{
///
if (model.messageType != QXRoomChatMessageTypeGift) {
[self.dataArray addObject:model];
}
if (model.messageType == QXRoomChatMessageTypeChat) {
[self.chatArray addObject:model];
}

View File

@@ -71,7 +71,10 @@
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)didHugSeatWithModel:(QXRoomUserInfoModel *)model{
-(void)didHugSeatWithModel:(QXRoomUserInfoModel *)model isUpSeat:(BOOL)isUpSeat{
if (isUpSeat) {
return;
}
MJWeakSelf
[QXMineNetwork roomCompereApplyPitWithRoomId:self.roomId pit_number:self.pitNumber user_id:model.user_id type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
@@ -117,7 +120,11 @@
}else{
cell.cellType = QXBlackListCellTypeOnline;
}
if (indexPath.section == 0) {
cell.isUpSeat = YES;
}else{
cell.isUpSeat = NO;
}
NSMutableArray *arr = self.dataArray[indexPath.section];
cell.onlineUser = arr[indexPath.row];
cell.delegate = self;

View File

@@ -366,10 +366,12 @@
-(void)closeAction{
MJWeakSelf
UIAlertController *al = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
if (![self.roomModel.room_info.type_id isEqualToString:@"6"]) {
[al addAction:[UIAlertAction actionWithTitle:@"最小化房间" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
[weakSelf miniRoom];
[[QXGlobal shareGlobal] miniRoomWithRoomId:weakSelf.roomId roomCover:weakSelf.roomModel.room_info.room_cover];
}]];
}
[al addAction:[UIAlertAction actionWithTitle:@"退出房间" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
[weakSelf leaveRoom];
}]];
@@ -384,9 +386,25 @@
[self.navigationController popViewControllerAnimated:YES];
}
-(void)leaveRoom{
if ([self.roomModel.room_info.type_id isEqualToString:@"6"] && [self.roomModel.room_info.label_id isEqualToString:@"5"]) {
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomId];
// self.navigationController.interactivePopGestureRecognizer.enabled = YES;
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
for (int i = 0; i < viewControllers.count; i++) {
UIViewController *vc = [viewControllers objectAtIndex:i];
if ([vc isEqual:self.viewController]) {
QXRoomViewController *roomVc = [[QXRoomViewController alloc] init];
roomVc.roomId = QXGlobal.shareGlobal.superRoomId;
[viewControllers insertObject:roomVc atIndex:i];
break;
}
}
self.navigationController.viewControllers = viewControllers;
[self.navigationController popViewControllerAnimated:YES];
QXGlobal.shareGlobal.superRoomId = @"";
}else{
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomId];
[self.navigationController popViewControllerAnimated:YES];
}
}

View File

@@ -93,7 +93,7 @@
-(void)getGiftList{
MJWeakSelf
[QXMineNetwork giftListWithLabel:@"0" successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[QXMineNetwork giftListWithLabel:@"0" roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
weakSelf.selectedIndex = -1;
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];

View File

@@ -134,7 +134,7 @@
-(void)getGiftList{
MJWeakSelf
[QXMineNetwork giftListWithLabel:@"99" successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[QXMineNetwork giftListWithLabel:@"99" roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[weakSelf.giftArray removeAllObjects];
[weakSelf.giftArray addObjectsFromArray:list];
[weakSelf.collectionView reloadData];

View File

@@ -23,7 +23,7 @@ typedef NS_ENUM(NSInteger) {
/// 常用工具
/// 房间补贴
QXRoomSettingTypeRoomSubsidy = 14,
QXRoomSettingTypeRoomSubsidy = 9,
/// 主持设置
QXRoomSettingTypeRoomCompere = 15,
/// 清空消息

View File

@@ -601,6 +601,7 @@
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
[self.collectionView registerClass:[QXRoomSettingSubCell class] forCellWithReuseIdentifier:@"QXRoomSettingSubCell"];
self.collectionView.delegate = self;
self.collectionView.backgroundColor = [UIColor clearColor];
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.bounces = NO;

View File

@@ -77,6 +77,18 @@
make.height.equalTo(self.noUserImageView.mas_width);
}];
[self addSubview:self.micSvgaView];
[self.micSvgaView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-8);
make.right.bottom.equalTo(self.headerView).offset(8);
}];
[self addSubview:self.micMp4View];
[self.micMp4View mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-8);
make.right.bottom.equalTo(self.headerView).offset(8);
}];
self.muteImageView.hidden = YES;
[self addSubview:self.muteImageView];
[self.muteImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
@@ -162,17 +174,7 @@
make.centerX.equalTo(self.charmBgView).offset(7);
}];
[self addSubview:self.micSvgaView];
[self.micSvgaView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-8);
make.right.bottom.equalTo(self.headerView).offset(8);
}];
[self addSubview:self.micMp4View];
[self.micMp4View mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-8);
make.right.bottom.equalTo(self.headerView).offset(8);
}];
}
-(void)onlineStatusDidChanged:(NSNotification*)notice{
NSDictionary *parm = notice.object;
@@ -300,7 +302,7 @@
make.left.right.equalTo(self);
}];
self.nameLabel.textColor = RGB16(0xEFEAFF);
// self.numberLabel.backgroundColor = RGB16(0xdb7fff);
self.numberLabel.textColor = RGB16(0xEFEAFF);
[self.numberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.charmBgView.mas_bottom).offset(0);
make.centerX.equalTo(self.noUserImageView);

View File

@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
/// 设置麦位锁麦状态
-(void)setSeatIsLock:(NSString*)isLock pitNumber:(NSString*)pitNumber;
/// 房间内换麦
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber;
/// pk开始
-(void)pkStartWithPkEndTimes:(NSString *)pk_end_times pk_id:(NSString*)pk_id;

View File

@@ -288,7 +288,9 @@
}
[self.leftSeatView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
}
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
[self.leftSeatView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
}
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{
[self.leftSeatView roomUserInfoDidChanged:user];
}

View File

@@ -31,7 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)auctionTypeDidChanged:(NSString *)type;
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
/// 清除魅力
-(void)clearCharm;
/// 房间内用户信息发生变化
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;

View File

@@ -95,6 +95,7 @@
[self.endBtn addTarget:self action:@selector(endAuction) forControlEvents:(UIControlEventTouchUpInside)];
[self.endBtn addRoundedCornersWithRadius:ScaleWidth(11)];
self.endBtn.backgroundColor = RGB16(0x333333);
self.endBtn.hidden = YES;
[self addSubview:self.endBtn];
[self.endBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
@@ -110,6 +111,7 @@
[self.delayBtn addRoundedCornersWithRadius:ScaleWidth(11)];
[self.delayBtn addTarget:self action:@selector(delayAction) forControlEvents:(UIControlEventTouchUpInside)];
self.delayBtn.backgroundColor = QXConfig.themeColor;
self.delayBtn.hidden = YES;
[self addSubview:self.delayBtn];
[self.delayBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.endBtn.mas_left).offset(-5);
@@ -569,6 +571,7 @@
break;
}
}
self.myPitNumber = roomModel.user_info.pit_number;
if (self.roomModel.room_auction.auction_user) {
QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
model.user_id = self.roomModel.room_auction.auction_user.user_id;
@@ -623,13 +626,6 @@
}
-(void)upDateBtnShowOrHide{
if (self.myPitNumber == 9 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
self.delayBtn.hidden = NO;
self.endBtn.hidden = NO;
}else{
self.delayBtn.hidden = YES;
self.endBtn.hidden = YES;
}
if ([self.roomModel.room_auction.auction_user.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
self.auctionBtn.hidden = YES;
}else{
@@ -639,6 +635,19 @@
self.auctionBtn.hidden = YES;
}
}
if (self.myPitNumber == 9 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
if (self.myPitNumber == 9){
self.delayBtn.hidden = NO;
}else{
self.delayBtn.hidden = YES;
}
self.endBtn.hidden = NO;
}else{
self.delayBtn.hidden = YES;
self.endBtn.hidden = YES;
}
}
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
@@ -827,6 +836,28 @@
}
}
}
-(void)clearCharm{
for (int i = 0; i < self.roomModel.room_auction.auction_list.count; i++) {
if (i < 6) {
QXRoomPitModel*pitModel = self.roomModel.room_auction.auction_list[i];
pitModel.charm = @"0";
UIView *contentView = self.seatArray[i];
if ([contentView isKindOfClass:[QXRoomAuctionSeatView class]]) {
QXRoomAuctionSeatView *seatView = (QXRoomAuctionSeatView *)contentView;
seatView.pitModel = pitModel;
}
}
}
QXRoomPitModel*model1 = self.compereView.pitModel;
model1.charm = @"0";
self.compereView.pitModel = model1;
QXRoomPitModel*model2 = self.auctionView.pitModel;
model2.charm = @"0";
self.auctionView.pitModel = model2;
}
-(void)auctionListDidChanged:(NSArray<QXRoomPitModel *> *)list{
[self reSetPitList];

View File

@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
-(void)cabinRoomHotValueDidChanged:(NSString*)hot_value;
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time;
-(void)friendCabinRoomIsQuit;
-(void)destroyViews;
@end

View File

@@ -96,7 +96,7 @@
self.numberLabel.font = [UIFont fontWithName:@"DIN Alternate" size:18];
[self addSubview:self.numberLabel];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.heartCenterImageView).offset(-18);
make.centerY.equalTo(self.heartCenterImageView).offset(-5);
make.centerX.equalTo(self.heartCenterImageView);
}];
@@ -106,7 +106,7 @@
make.right.equalTo(self.heartCenterImageView.mas_left);
make.width.mas_equalTo(ScaleWidth(75));
make.height.mas_equalTo(ScaleWidth(75)+25);
make.top.equalTo(self.heartCenterImageView).offset(-5);
make.top.equalTo(self.heartCenterImageView).offset(-7);
}];
self.rightSeatView = [[QXRoomSeatContentView alloc] init];
@@ -132,7 +132,7 @@
self.timeDownBgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_cabin_timedown_bg"]];
self.timeDownBgView.contentMode = UIViewContentModeScaleToFill;
[self addSubview:self.timeDownBgView];
[self insertSubview:self.timeDownBgView belowSubview:self.timeDownLabel];
[self.timeDownBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.timeDownLabel);
}];
@@ -140,7 +140,7 @@
CGFloat margin = (SCREEN_WIDTH-77*3)/4;
CGFloat margin = (SCREEN_WIDTH-88*3)/4;
self.micBtn = [[UIButton alloc] init];
[self.micBtn setImage:[UIImage imageNamed:@"room_cabin_open"] forState:(UIControlStateNormal)];
[self.micBtn setImage:[UIImage imageNamed:@"room_cabin_close"] forState:(UIControlStateSelected)];
@@ -149,8 +149,8 @@
[self.micBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(0);
make.left.mas_equalTo(margin);
make.width.mas_equalTo(77);
make.height.mas_equalTo(119);
make.width.mas_equalTo(88);
make.height.mas_equalTo(108);
}];
@@ -161,8 +161,8 @@
[self.giftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.micBtn);
make.left.equalTo(self.micBtn.mas_right).offset(margin);
make.width.mas_equalTo(77);
make.height.mas_equalTo(119);
make.width.mas_equalTo(88);
make.height.mas_equalTo(108);
}];
@@ -173,8 +173,8 @@
[self.movieBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.giftBtn.mas_right).offset(margin);
make.bottom.equalTo(self.micBtn);
make.width.mas_equalTo(77);
make.height.mas_equalTo(119);
make.width.mas_equalTo(88);
make.height.mas_equalTo(108);
}];
// [[QXAgoraEngine sharedEngine].agoraKit muteAllRemoteVideoStreams:NO];
// [[QXAgoraEngine sharedEngine] startPreViewWithUid:54 view:self];
@@ -224,20 +224,20 @@
}
if (![roomModel.room_owner.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
self.movieBtn.hidden = YES;
CGFloat margin = (SCREEN_WIDTH-77*2)/3;
CGFloat margin = (SCREEN_WIDTH-88*2)/3;
[self.micBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(0);
make.left.mas_equalTo(margin);
make.width.mas_equalTo(77);
make.height.mas_equalTo(119);
make.width.mas_equalTo(88);
make.height.mas_equalTo(108);
}];
[self.giftBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.micBtn);
make.left.equalTo(self.micBtn.mas_right).offset(margin);
make.width.mas_equalTo(77);
make.height.mas_equalTo(119);
make.width.mas_equalTo(88);
make.height.mas_equalTo(108);
}];
}
@@ -307,10 +307,10 @@
-(void)closeAction{
MJWeakSelf
UIAlertController *al = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
[al addAction:[UIAlertAction actionWithTitle:@"最小化房间" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
[weakSelf miniRoom];
[[QXGlobal shareGlobal] miniRoomWithRoomId:weakSelf.roomModel.room_info.room_id roomCover:weakSelf.roomModel.room_info.room_cover];
}]];
// [al addAction:[UIAlertAction actionWithTitle:@"最小化房间" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
// [weakSelf miniRoom];
// [[QXGlobal shareGlobal] miniRoomWithRoomId:weakSelf.roomModel.room_info.room_id roomCover:weakSelf.roomModel.room_info.room_cover];
// }]];
[al addAction:[UIAlertAction actionWithTitle:@"退出房间" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
[weakSelf leaveRoom];
}]];
@@ -319,15 +319,36 @@
}]];
[self.viewController presentViewController:al animated:YES completion:nil];
}
-(void)friendCabinRoomIsQuit{
}
-(void)miniRoom{
// self.navigationController.interactivePopGestureRecognizer.enabled = YES;
[self.navigationController popViewControllerAnimated:YES];
}
-(void)leaveRoom{
UINavigationController *na = (UINavigationController *)KEYWINDOW.rootViewController;
if ([self.roomModel.room_info.type_id isEqualToString:@"6"] && [self.roomModel.room_info.label_id isEqualToString:@"5"]) {
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomModel.room_info.room_id];
// self.navigationController.interactivePopGestureRecognizer.enabled = YES;
[self.navigationController popViewControllerAnimated:YES];
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:na.viewControllers];
for (int i = 0; i < viewControllers.count; i++) {
UIViewController *vc = [viewControllers objectAtIndex:i];
if ([vc isEqual:self.viewController]) {
QXRoomViewController *roomVc = [[QXRoomViewController alloc] init];
roomVc.roomId = QXGlobal.shareGlobal.superRoomId;
[viewControllers insertObject:roomVc atIndex:i];
break;
}
}
na.viewControllers = viewControllers;
[na popViewControllerAnimated:YES];
QXGlobal.shareGlobal.superRoomId = @"";
}else{
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomModel.room_info.room_id];
// self.navigationController.interactivePopGestureRecognizer.enabled = YES;
[na popViewControllerAnimated:YES];
}
}
-(void)destroyViews{
if (_leftSeatView) {

View File

@@ -42,13 +42,15 @@ typedef NS_ENUM(NSInteger) {
-(void)friendRelationIsCreatedWithrelationModel:(QXRoomFriendRelationModel*)relationModel;
/// 清除魅力
-(void)clearCharm;
/// 设置魅力
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
/// 用户信息发生改变
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
/// 房间内换麦
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber;
/// 销毁视图
-(void)destroyViews;
@end

View File

@@ -296,6 +296,7 @@
self.startBtn = [[UIButton alloc] init];
self.startBtn.needEventInterval = 0.5;
[self.startBtn setTitle:@"开始" forState:(UIControlStateNormal)];
self.startBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.startBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
@@ -343,6 +344,7 @@
self.endBtn = [[UIButton alloc] init];
self.endBtn.hidden = YES;
self.endBtn.needEventInterval = 0.5;
[self.endBtn setTitle:@"结束" forState:(UIControlStateNormal)];
self.endBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.endBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
@@ -701,6 +703,7 @@
self.heartCenterValueBgImageView.hidden = YES;
self.heartCenterLinePlayer.hidden = YES;
[self.heartCenterLinePlayer stopAnimation];
self.centerIsAnimate = NO;
}
if (md2.heartNum.longValue>0) {
self.heartTopLabel.text = md2.heartNum;
@@ -724,6 +727,7 @@
self.heartTopLabel.hidden = YES;
self.heartTopLinePlayer.hidden = YES;
[self.heartTopLinePlayer stopAnimation];
self.topIsAnimate = NO;
}
if (md3.heartNum.longValue>0) {
self.heartBottomLabel.text = md3.heartNum;
@@ -747,6 +751,7 @@
self.heartBottomLabel.hidden = YES;
self.heartBottomLinePlayer.hidden = YES;
[self.heartBottomLinePlayer stopAnimation];
self.bottomIsAnimate = NO;
}
}
@@ -864,6 +869,26 @@
contentView.pitModel = model;
[self configGameOptionBtn];
}
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
if (fromPitNumber == 0 || toPitNumber == 0) {
return;
}
id object1 = self.allSeatViewArray[fromPitNumber-1];
id object2 = self.allSeatViewArray[fromPitNumber-1];
if ([object1 isKindOfClass:[QXRoomSeatContentView class]] && [object2 isKindOfClass:[QXRoomSeatContentView class]]) {
QXRoomSeatContentView *fromSeatView = self.allSeatViewArray[fromPitNumber-1];
QXRoomSeatContentView *toSeatView = self.allSeatViewArray[toPitNumber-1];
QXRoomPitModel *fromPitModel = fromSeatView.pitModel;
QXRoomPitModel *totModel = toSeatView.pitModel;
NSString* tmpPitNum = [NSString stringWithFormat:@"%@",fromPitModel.pit_number];
fromPitModel.pit_number = totModel.pit_number;
totModel.pit_number = tmpPitNum;
toSeatView.pitModel = fromPitModel;
fromSeatView.pitModel = totModel;
}
}
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{
NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ;
@@ -997,7 +1022,11 @@
self.myPitNumber = -1;
}
for (QXRoomPitModel*model in pitArray) {
QXRoomSeatContentView *contentView = self.allSeatViewArray[model.pit_number.intValue-1];
id object = self.allSeatViewArray[model.pit_number.intValue-1];
if (![object isKindOfClass:[QXRoomSeatContentView class]]) {
continue;
}
QXRoomSeatContentView *contentView = (QXRoomSeatContentView *)object;
QXRoomPitModel *md = contentView.pitModel;
md.user_id = model.user_id;
md.avatar = model.avatar;
@@ -1020,6 +1049,7 @@
-(void)friendPartDidChangedWithType:(NSString*)step friend_id:(NSString*)friend_id end_time:(NSString*)end_time relationModel:(nonnull QXRoomFriendRelationModel *)relationModel{
if (step.intValue == 1) {
self.roomModel.friend_info.heart_list = @[];
self.tenSecondLabel.hidden = YES;
}
self.roomModel.friend_info.step = [NSString stringWithFormat:@"%@",step];
self.roomModel.friend_info.friend_id = friend_id;
@@ -1068,31 +1098,38 @@
}
}
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
for (QXRoomSeatContentView *seatView in self.allSeatViewArray) {
QXRoomPitModel *md = seatView.pitModel;
for (id object in self.allSeatViewArray) {
if ([object isKindOfClass:[QXRoomSeatContentView class]]) {
QXRoomSeatContentView *contentView = (QXRoomSeatContentView *)object;
QXRoomPitModel *md = contentView.pitModel;
if ([model.user_id isEqualToString:md.user_id]) {
md.charm = model.charm;
seatView.pitModel = md;
contentView.pitModel = md;
break;
}
}
}
}
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{
for (QXRoomSeatContentView *seatView in self.allSeatViewArray) {
QXRoomPitModel *md = seatView.pitModel;
for (id object in self.allSeatViewArray) {
if ([object isKindOfClass:[QXRoomSeatContentView class]]) {
QXRoomSeatContentView *contentView = (QXRoomSeatContentView *)object;
QXRoomPitModel *md = contentView.pitModel;
if ([user.user_id isEqualToString:md.user_id]) {
md.dress = user.dress;
md.nickname = user.nickname;
md.sex = user.sex;
md.avatar = user.avatar;
seatView.pitModel = md;
contentView.pitModel = md;
break;
}
}
}
}
-(void)animateIsFinishedWithModel:(QXRoomFriendRelationModel *)model{
if ([model.room_id isExist]) {
QXGlobal.shareGlobal.superRoomId = self.roomModel.room_info.room_id;
if ([model.user1_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id] || [model.user2_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.viewController.navigationController];
}
@@ -1156,6 +1193,7 @@
[self->_timer invalidate];
self->_timer= nil;
}
self.tenSecondLabel.hidden = YES;
}
//- (SVGAPlayer *)svgaPlayer {

View File

@@ -36,6 +36,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 房间内用户信息发生变化
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
/// 房间内换麦
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber;
-(void)destroyViews;
@end

View File

@@ -334,6 +334,22 @@ static NSInteger maxSeat = 8;
}
}
}
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
if (fromPitNumber == 0 || toPitNumber == 0) {
return;
}
QXRoomSeatContentView *fromSeatView = self.seatArray[fromPitNumber-1];
QXRoomSeatContentView *toSeatView = self.seatArray[toPitNumber-1];
QXRoomPitModel *fromPitModel = fromSeatView.pitModel;
QXRoomPitModel *totModel = toSeatView.pitModel;
NSString* tmpPitNum = [NSString stringWithFormat:@"%@",fromPitModel.pit_number];
fromPitModel.pit_number = totModel.pit_number;
totModel.pit_number = tmpPitNum;
toSeatView.pitModel = fromPitModel;
fromSeatView.pitModel = totModel;
}
-(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{
NSInteger pit_number = pitNumber.integerValue;

View File

@@ -57,6 +57,8 @@ typedef NS_ENUM(NSInteger) {
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
/// 房间内用户信息发生变化
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
/// 房间内换麦
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber;

View File

@@ -863,6 +863,29 @@
break;
}
}
///
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
switch (self.type) {
case QXRoomSeatViewTypeNormal:
[self.normalSeatView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
break;
case QXRoomSeatViewTypeSing:
// [self.songView clearCharm];
break;
case QXRoomSeatViewTypeAuction:
break;
case QXRoomSeatViewTypeCabin:
break;
case QXRoomSeatViewTypePK:
[self.roomPkView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
break;
case QXRoomSeatViewTypeFriend:
[self.roomFriendView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber];
break;
default:
break;
}
}
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
switch (self.type) {
case QXRoomSeatViewTypeNormal:
@@ -988,7 +1011,14 @@
}
/// 退
-(void)friendCabinRoomIsQuit{
switch (self.type) {
case QXRoomSeatViewTypeCabin:{
[self.cabinView friendCabinRoomIsQuit];
}
break;
default:
break;
}
}
///
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time{

View File

@@ -28,10 +28,12 @@ static NSInteger maxCount = 5;
// [self addRoundedCornersWithRadius:15.5];
// self.layer.borderWidth = 2;
// self.layer.borderColor = RGB16(0x333333).CGColor;
self.backgroundColor = UIColor.clearColor;
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:self.bounds delegate:self placeholderImage:nil];
self.cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleNone;
self.cycleScrollView.scrollDirection = UICollectionViewScrollDirectionVertical;
self.cycleScrollView.delegate = self;
self.cycleScrollView.backgroundColor = UIColor.clearColor;
[self addSubview:self.cycleScrollView];
}
-(void)setModel:(QXGiftScrollModel *)model{

View File

@@ -4,7 +4,7 @@
<dict>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.qxcm.qxlive.task</string>
<string>com.xscm.midi.task</string>
</array>
<key>CFBundleURLTypes</key>
<array>
@@ -13,7 +13,7 @@
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>qxlive</string>
<string>midilive</string>
</array>
</dict>
<dict>
@@ -23,7 +23,7 @@
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxc7681513be9f926b</string>
<string>wxef1289d8a89b41d4</string>
</array>
</dict>
</array>

View File

@@ -97,8 +97,8 @@
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
if (self.type == 0) {
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
cell.cellType = QXGiftCellTypeBackpack;
cell.roomGiftModel = self.dataArray[indexPath.row];
cell.cellType = QXGiftCellTypeBackpack;
return cell;
}else{
QXBackpackRecordCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXBackpackRecordCell" forIndexPath:indexPath];

View File

@@ -26,6 +26,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *rule;
@property (nonatomic,strong)NSString *gift_bag_name;
@property (nonatomic,strong)NSString *rule_url;
/// 活动id 5 跳转对应活动
@property (nonatomic,strong)NSString *activities_id;
/// 活动类型 10 天空之境 11 岁月之城 12时空之巅
@property (nonatomic,strong)NSString *gift_bag;
@property (nonatomic,assign)BOOL isSelected;
@end

View File

@@ -314,6 +314,7 @@ NS_ASSUME_NONNULL_BEGIN
礼物列表
*/
+(void)giftListWithLabel:(NSString*)label
roomId:(NSString*)roomId
successBlock:(void (^)(NSArray<QXGiftModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;

View File

@@ -639,10 +639,12 @@
*/
+(void)giftListWithLabel:(NSString*)label
roomId:(NSString*)roomId
successBlock:(void (^)(NSArray<QXGiftModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"label":label
@"label":label,
@"room_id":roomId?roomId:@""
};
[[QXRequset shareInstance] postWithUrl:QXGiftList parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {

View File

@@ -110,6 +110,7 @@
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.backgroundColor = UIColor.clearColor;
[self.collectionView registerClass:[QXTagImageCell class] forCellWithReuseIdentifier:@"QXTagImageCell"];
[self addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -152,6 +153,7 @@
self.inCollectionView.delegate = self;
self.inCollectionView.dataSource = self;
self.inCollectionView.showsHorizontalScrollIndicator = NO;
self.inCollectionView.backgroundColor = UIColor.clearColor;
[self.inCollectionView registerClass:[QXSearchCell class] forCellWithReuseIdentifier:@"QXSearchCell"];
[self addSubview:self.inCollectionView];
[self.inCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -184,9 +186,9 @@
}];
self.playBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.playBtn.left-6-91, self.whiteBgView.top+10, 91, 35)];
[self.playBtn setTitle:QXText(@"私信") forState:(UIControlStateNormal)];
[self.playBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.playBtn.backgroundColor = RGB16(0x333333);
// [self.playBtn setTitle:QXText(@"私信") forState:(UIControlStateNormal)];
// [self.playBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
// self.playBtn.backgroundColor = RGB16(0x333333);
self.playBtn.hidden = YES;
self.playBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.playBtn addRoundedCornersWithRadius:17.5];

View File

@@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
-(void)didClickLoginWithModel:(QXLoginModel*)model;
-(void)didHugSeatWithModel:(QXRoomUserInfoModel*)model;
-(void)didHugSeatWithModel:(QXRoomUserInfoModel*)model isUpSeat:(BOOL)isUpSeat;
@end
@interface QXBlackListCell : UITableViewCell
@@ -55,6 +55,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *roleLabel;
@property (nonatomic,assign)BOOL isUpSeat;
@property (nonatomic,strong)QXRoomUserInfoModel *onlineUser;
@property (nonatomic,strong)QXRoomOnlineList *rankModel;

View File

@@ -41,8 +41,8 @@
}
break;
case QXBlackListCellTypeHugSeat:{
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithModel:)]) {
[self.delegate didHugSeatWithModel:self.onlineUser];
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithModel:isUpSeat:)]) {
[self.delegate didHugSeatWithModel:self.onlineUser isUpSeat:self.isUpSeat];
}
}
break;
@@ -52,6 +52,9 @@
}
}
-(void)setIsUpSeat:(BOOL)isUpSeat{
_isUpSeat = isUpSeat;
}
-(void)setLoginModel:(QXLoginModel *)loginModel{
_loginModel = loginModel;

View File

@@ -26,18 +26,22 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// for (NSString *str in [UIFont familyNames]) {
//
// NSLog(@"UIFont_Name:%@",str);
//
NSArray *array = [UIFont familyNames];
for (NSString * familyname in array) {
NSLog(@"Family:%@" ,familyname);
// NSArray *fontnames = [UIFont fontNamesForFamilyName:familyname];
// for (NSString *name in fontnames) {
// NSLog(@"Font Name:%@" ,name);
// }
}
// Override point for customization after application launch.
[QXConfig defaultConfig];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
QXAppStartViewController *startVC = [[QXAppStartViewController alloc] init];
self.window.rootViewController = startVC;
[Bugly startWithAppId:@"38d154fc5f"];
[Bugly startWithAppId:@"65efebcd8f"];
SDImageWebPCoder *webPCoder = [SDImageWebPCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:webPCoder];
[self configThirdPartLogin];

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "room_cabin_close@2x.png",
"filename" : "Frame 1321316235@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_cabin_close@3x.png",
"filename" : "Frame 1321316235@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "room_cabin_gift@2x.png",
"filename" : "Frame 1321316063@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_cabin_gift@3x.png",
"filename" : "Frame 1321316063@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Group 7425@2x.png",
"filename" : "小爱心@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 7425@3x.png",
"filename" : "小爱心@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "room_cabin_movie@2x.png",
"filename" : "Frame 1321316064@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_cabin_movie@3x.png",
"filename" : "Frame 1321316064@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "room_cabin_open@2x.png",
"filename" : "Frame 1321316062@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_cabin_open@3x.png",
"filename" : "Frame 1321316062@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Frame 942@2x.png",
"filename" : "Frame 1321316289@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 942@3x.png",
"filename" : "Frame 1321316289@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -18,10 +18,11 @@ typedef NS_ENUM(NSInteger) {
QXRoomRoleTypeAudience,
}QXRoomRoleType;
// 三方平台
#if DEVELOPENT == 1
static NSString *const WechatAppId = @"wx9b6db036ca1073a2";
static NSString *const WechatAppSecret = @"c07c5f21fc8bf655617f1468ab95419f";
static NSString *const WechatUniversalLink = @"https://chat.qxmier.com/";
static NSString *const WechatAppId = @"wxef1289d8a89b41d4";
static NSString *const WechatAppSecret = @"229b6a2a75d8343676a3cc6aa3930213";
static NSString *const WechatUniversalLink = @"https://mdh.xscmmidi.site/";
/// 人脸核身
static NSString *const FaceAuthId = @"TIDAxpO9";
@@ -29,10 +30,10 @@ static NSString *const FaceAuthSecret = @"DcnCE33XLLfSYPTWU21lCjn9Tw14L8DtBPypZQ
static NSString *const FaceAuthLicense = @"Af9QYHMCQ+OeFGTY+2sAST8E4CGao8Ytj74vPaFIM7wMclK/Bm2Zf9DIT6ke0kpeTLORUxE++QRJJ1HZYNYlmA802cQvga/C0HouDiUTul7KBT9LkMUfYp53D1nTiYcIQ6Jh9YEraH1zlJnEqmzeKBfY6TqsX5e1j6K0pMOZShVlGUhL0DgM+lrrpYPeds3E1/rerH1tARtRmCCD8LrpLDTBP84AqCpg2PtzVWJrDwm7rMeyZm0yeed9pN3LH9D2FiFju+yhtj930D1CEk3n4WZwLvjO8c/lPmycze6jAKE+XfAEa7jK8twUe3YHweNfAzzN55mVpK0K4gTEsbGzHg==";
/// 腾讯IM
static NSInteger const TencentIMID = 1600096890;
static NSString *const TencentIMSecret = @"d9a5b8088ed39113d0c92ae434bc37528c4715c1f1d2eaedb172134eacd06103";
static NSInteger const TencentIMID = 1600101474;
static NSString *const TencentIMSecret = @"96d9453fbdc23f5326f351c83e27fc65db0ea6cdc0ac706770bfbeeaf6c89456";
static NSString *const AddressOfMQTTServer = @"47.120.21.132";
static NSString *const AddressOfMQTTServer = @"1.13.181.248";
static NSInteger const AddressOfMQTTPort = 1883;
static NSInteger const AppPushId = 46164;
@@ -43,29 +44,29 @@ static NSString *const AuthSDKKey = @"Q8xhyn+MAyHw8FQLjKOWU8ZrZMXsuflPGSxDvwKu8U
#else
static NSString *const WechatAppId = @"wxc7681513be9f926b";
static NSString *const WechatAppSecret = @"37afd7c6b9135b642bd01190305868fe";
static NSString *const WechatUniversalLink = @"https://chat.qxmier.com/";
static NSString *const WechatAppId = @"wxef1289d8a89b41d4";
static NSString *const WechatAppSecret = @"229b6a2a75d8343676a3cc6aa3930213";
static NSString *const WechatUniversalLink = @"https://mdh.xscmmidi.site/";
/// 人脸核身
static NSString *const FaceAuthId = @"IDAxzBMV";
static NSString *const FaceAuthSecret = @"lrFr0W6U88JEoXIP0Cdk1Bc1c3EoiQgSr4LqPATKoeHofde6tGudnLApr3JGq3jC";
static NSString *const FaceAuthLicense = @"mjOBs0dOQXvt2Mwnenv0KYr2FbI8vl/sQmTH5Y33YiLFPnrZkJtyuSw/aYDW3lFU8Dd/bxBn2ymlqW32wpiUM6anJw7tyoNg2XeY3scvChHUGC271eu+qVWXVCon5LeWtfy9NiTKqobvN++c5GbcE3uKxOAqAGeeibt1/kSkIVJlGUhL0DgM+lrrpYPeds3E1/rerH1tARtRmCCD8LrpLDTBP84AqCpg2PtzVWJrDwm7rMeyZm0yeed9pN3LH9D2FiFju+yhtj930D1CEk3n4WZwLvjO8c/lPmycze6jAKE+XfAEa7jK8twUe3YHweNfAzzN55mVpK0K4gTEsbGzHg==";
static NSString *const FaceAuthId = @"IDA8YkL0";
static NSString *const FaceAuthSecret = @"RqNCp7PoY77oJqVu9hFEDM0Ol2DNDQQQ97vy9CbZx6qw6iDSPZtRfotXvQgq7xA2";
static NSString *const FaceAuthLicense = @"P6N+VYfdu1Op5p+QwUGdI4y64PqOnxMzChX2SWWvrXjKi5gSKTKYnksyPYGpdDoEiZGUuvidfW3fJx0DHobAmD/MMpCxdzRyvyn4Z0d7Ccno6TEO2eigEbAOL4rrM8xZHE6+POuORUrmDjRR7yKwT6yVJoMa96ULUZ54tAHY5TAMBPhZad80QU40PM+28QcOtufSd6QQwyKyjM/vCo8gnR8v9lTewz7y7GWkISVoymwW8BQMIkvWEXiGoi6u3mCuj2gn7cwGcb2HCXvM0EIzSLgKSwMFrIKYVmbEQ0ZIwUqCAk7IJv5V2VyGPUc1VIli0lWWPhwaL+1kVhpPytiK5A==";
/// 腾讯IM
static NSInteger const TencentIMID = 1600096860;
static NSString *const TencentIMSecret = @"448a3259085924f89957c1884c761974e8fded64b9ab1c67b8e0a5a1c4b68f3f";
static NSInteger const TencentIMID = 1600101474;
static NSString *const TencentIMSecret = @"96d9453fbdc23f5326f351c83e27fc65db0ea6cdc0ac706770bfbeeaf6c89456";
static NSString *const AddressOfMQTTServer = @"81.70.45.221";
static NSString *const AddressOfMQTTServer = @"62.234.12.147";
static NSInteger const AddressOfMQTTPort = 1883;
static NSInteger const AppPushId = 46163;
///声网
static NSString *const AgoraAuthId = @"4a521d6f1c6343998b1c8fd425dea02a";
static NSString *const AgoraAuthId = @"a3f0f0c78307434fa1c697c3429fbdcf";
//一键登录AuthSDKInfo
static NSString *const AuthSDKKey = @"hKYFcoI6vIdz9/yOCs3XJ/fUQ0u3DHGa5UPONdSJfSccjVtn3sHBRecwepn5iNIgOYWq8xgUc4LtWqSjpveHIYzJx0YcQm/j5IXdVKe74RI+4vT00UwP8oQSZ2w0a18Sbbd8uKgFys8CUyQZWfMZXHIVuHmNBHRHZ1xoX2sCCCl56U3vQ11ZSpJdeZW4wvQ8qeQ56Q4wyW5hyo/yFU1sxohn1ApS6FbbXXwroWV57aK1R9+zaBOqn41NCKlvKsSD";
static NSString *const AuthSDKKey = @"Qyj6q/o52PnGW8NJE48dN4ha+0KWDVyuF05Xj9HRV85u8YBs4xIkelP44/5xEv3+cMVs5aDf5/1ESuDp6rWq3tcbDoaUSaNya8S31LDrNfajmXBRucTnIpfp02T2NWjzQmKrhQVJUwH2UWp3p63fxfxE7AzA38qKtqjXKPWt+pqeeMO6lBzB0jrZv+aGPj4IsEdVw0lAW4yO0QPqKORWJNHQgEbB4sWl17Ryby4UzYzHc4gN6kAJh74ickyuKp3j";
#endif
/// 声网
@@ -78,10 +79,10 @@ static NSString *const kUserLoginData = @"LoginData";
//阿里云文件上传
static NSString *const OSS_BUCKET_NAME = @"qx-yusheng";
static NSString *const OSSAccessKeyId = @"LTAI5tJ2UYfFNF7K3F4e1siv";
static NSString *const OSSAccessKeySecret = @"DhpCS82gaigZljYqsWsUWUAZ20dREz";
static NSString *const OSSEndPoint = @"oss-cn-hangzhou.aliyuncs.com";
static NSString *const OSS_BUCKET_NAME = @"midi01";
static NSString *const OSSAccessKeyId = @"LTAI5tKgrfcFQxH46ZwWYgFW";
static NSString *const OSSAccessKeySecret = @"ZOjTqAJmUL563EKFKySrUwAHtx4hKt";
static NSString *const OSSEndPoint = @"oss-cn-beijing.aliyuncs.com";
//文件路径
@@ -122,4 +123,6 @@ static NSString *const noticeUnreadNumberDidChanged = @"noticeUnreadNumberDidCha
static NSString *const noticeTencentLogin = @"noticeTencentLogin";
static NSString *const noticeUserLogin = @"noticeUserLogin";
/// 活动盘进度更新
static NSString *const noticeActivityUpdate = @"noticeActivityUpdate";
#endif /* NoitceAndKey_h */

View File

@@ -7,12 +7,20 @@
#ifndef Api_h
#define Api_h
//正式:
//mdh.xscmmidi.site --H5
//admin.xscmmidi.site --管理后台
//md.xscmmidi.site -- 这是接口 api
//测试:
//tmdh.xscmmidi.site --H5
//tadmin.xscmmidi.site --管理后台
//tmd.xscmmidi.site -- 这是接口 api
#if DEVELOPENT == 1
static NSString* ServerUrl = @"http://tmd.qixing2.top/";
static NSString* H5ServerUrl = @"https://chatvespa.qxmier.com/";
static NSString* ServerUrl = @"https://tmd.xscmmidi.site/";
static NSString* H5ServerUrl = @"https://tmdh.xscmmidi.site/";
#else
static NSString* ServerUrl = @"https://chat.qxmier.com/";
static NSString* H5ServerUrl = @"https://vespa.qxmier.com/";
static NSString* ServerUrl = @"https://md.xscmmidi.site/";
static NSString* H5ServerUrl = @"https://mdh.xscmmidi.site/";
#endif
#pragma mark - 引导页
/// 引导页

Binary file not shown.

View File

@@ -23,7 +23,7 @@
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxc7681513be9f926b</string>
<string>wxef1289d8a89b41d4</string>
</array>
</dict>
</array>

View File

@@ -29,9 +29,12 @@
#import <ImSDK_Plus/ImSDK_Plus.h>
#import "QXMessageServices.h"
#import "QXMeetActivityDriftView.h" //
@interface QXTabbarController ()<UITabBarControllerDelegate,QXTabBarDelegate,UINavigationControllerDelegate,MQTTClientModelDelegate,V2TIMConversationListener>
@property(nonatomic,strong) QXTabBar *customTabBar;
@property(nonatomic,strong) QXHomeViewController *homeVC;
@property(nonatomic,strong) QXMeetActivityDriftView *meetView;
@property(nonatomic,assign) BOOL isAlreadyShowChirld;
@end
@@ -254,11 +257,18 @@
}
-(void)socketManager:(NSString *)socketManager receivedMessage:(NSDictionary *)message topic:(NSString *)topic{
if ([topic isEqualToString:qx_room_topic]) {
QXGiftScrollModel *model = [QXGiftScrollModel yy_modelWithJSON:message[@"msg"][@"list"]];
[self.homeVC giftScrollViewShowWithModel:model];
[[QXGiftDriftView shareView] addGiftModel:model];
}else if([topic isEqualToString:qx_ac_topic]){
QXMeetActivityDriftModel *model = [QXMeetActivityDriftModel yy_modelWithJSON:message[@"msg"]];
[[QXMeetActivityDriftView shareView] addActivityModel:model];
}
}
//-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
// NSInteger index = [self.viewControllers indexOfObject:viewController];
// if (index == 4) {

View File

@@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIView *numberBgView;
@property (weak, nonatomic) IBOutlet UIImageView *grayCoverView;
@property (weak, nonatomic) IBOutlet UIImageView *giftNumBgImageView;
@property (weak, nonatomic) IBOutlet UIImageView *activityImageView;
@property (strong, nonatomic) QXGiftModel *roomGiftModel;
@property (strong, nonatomic) QXUserGiftWallModel *giftWall;

View File

@@ -13,7 +13,7 @@
[super awakeFromNib];
// Initialization code
[self.selecteBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xEFF2F8)] forState:(UIControlStateNormal)];
[self.selecteBtn setBackgroundImage:[UIImage imageNamed:@"mine_dress_bg"] forState:(UIControlStateSelected)];
[self.selecteBtn setBackgroundImage:[UIImage imageNamed:@"room_sound_sel"] forState:(UIControlStateSelected)];
self.giftNumBgImageView.image = [[UIImage imageNamed:@"gift_number_bg"] imageByTintColor:QXConfig.themeColor];
}
@@ -26,7 +26,10 @@
self.cornHeight.constant = 10;
self.nameLabelHeight.constant = 10;
self.giftNameLabel.font = [UIFont systemFontOfSize:8];
self.giftNameLabel.textColor = RGB16(0xffffff);
self.cornBtn.titleLabel.font = [UIFont systemFontOfSize:8];
[self.cornBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.giftNameLabel.textColor = RGB16(0x333333);
self.userHeaderView.hidden = YES;
}
break;
@@ -39,6 +42,8 @@
self.numberLabel.font = [UIFont systemFontOfSize:10];
self.cornBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.selecteBtn.selected = YES;
[self.cornBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.giftNameLabel.textColor = RGB16(0x333333);
[self.cornBtn setImage:[UIImage imageNamed:@"mine_live_gift_corn"] forState:(UIControlStateNormal)];
self.userHeaderView.hidden = YES;
}
@@ -48,6 +53,8 @@
self.numberHeightConstraint.constant = 13;
self.cornHeight.constant = 18;
self.nameLabelHeight.constant = 18;
[self.cornBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
self.giftNameLabel.textColor = RGB16(0xffffff);
self.giftNameLabel.font = [UIFont systemFontOfSize:14];
self.cornBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.cornBtn setImage:[UIImage imageNamed:@"mine_live_gift_corn"] forState:(UIControlStateNormal)];
@@ -76,7 +83,9 @@
-(void)setRoomGiftModel:(QXGiftModel *)roomGiftModel{
_roomGiftModel = roomGiftModel;
self.giftNameLabel.text = roomGiftModel.gift_name;
[self.gitfImageView sd_setImageWithURL:[NSURL URLWithString:roomGiftModel.base_image]];
NSString *encodedQuery = [roomGiftModel.base_image stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL *imageUrl = [NSURL URLWithString:encodedQuery];
[self.gitfImageView sd_setImageWithURL:imageUrl];
[self.cornBtn setTitle:[NSString stringWithFormat:@" %@",roomGiftModel.gift_price] forState:(UIControlStateNormal)];
if (roomGiftModel.num.intValue > 0) {
self.numberBgView.hidden = NO;
@@ -84,12 +93,38 @@
}else{
self.numberBgView.hidden = YES;
}
if (roomGiftModel.isSelected) {
[self.cornBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.giftNameLabel.textColor = RGB16(0x333333);
}else{
[self.cornBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
self.giftNameLabel.textColor = RGB16(0xffffff);
}
if ([roomGiftModel.activities_id isEqualToString:@"5"]) {
self.activityImageView.hidden = NO;
if (roomGiftModel.gift_bag.intValue == 10) {
self.activityImageView.image = [UIImage imageNamed:@"a_gift_sky_icon"];
[self.selecteBtn setBackgroundImage:[UIImage imageNamed:@"a_gift_sky_bg"] forState:(UIControlStateNormal)];
}else if (roomGiftModel.gift_bag.intValue == 11) {
self.activityImageView.image = [UIImage imageNamed:@"a_gift_age_icon"];
[self.selecteBtn setBackgroundImage:[UIImage imageNamed:@"a_gift_age_bg"] forState:(UIControlStateNormal)];
}else if (roomGiftModel.gift_bag.intValue == 12) {
self.activityImageView.image = [UIImage imageNamed:@"a_gift_time_icon"];
[self.selecteBtn setBackgroundImage:[UIImage imageNamed:@"a_gift_time_bg"] forState:(UIControlStateNormal)];
}
}else{
self.activityImageView.hidden = YES;
[self.selecteBtn setBackgroundImage:[UIImage imageWithColor:RGB16A(0xE9E9E9, 0.2)] forState:(UIControlStateNormal)];
}
}
- (void)setGiftWall:(QXUserGiftWallModel *)giftWall{
_giftWall = giftWall;
self.giftNameLabel.text = giftWall.gift_name;
[self.gitfImageView sd_setImageWithURL:[NSURL URLWithString:giftWall.base_image]];
NSString *encodedQuery = [giftWall.base_image stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL *imageUrl = [NSURL URLWithString:encodedQuery];
[self.gitfImageView sd_setImageWithURL:imageUrl];
self.numberLabel.text = [NSString stringWithFormat:@"x%@",giftWall.total_count];
self.grayCoverView.backgroundColor = RGB16A(0xE9E9E9, 0.8);
if (giftWall.total_count.longLongValue == 0) {

View File

@@ -20,7 +20,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QMu-c3-HcP">
<rect key="frame" x="0.0" y="0.0" width="253" height="303"/>
<subviews>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YN0-v8-SAo">
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YN0-v8-SAo">
<rect key="frame" x="0.0" y="0.0" width="253" height="303"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
</button>
@@ -89,6 +89,12 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="R17-3r-nZl">
<rect key="frame" x="0.0" y="255.66666666666663" width="253" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="qst-iu-9r5"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="YN0-v8-SAo" secondAttribute="bottom" id="0UV-vT-lSa"/>
@@ -97,6 +103,7 @@
<constraint firstItem="3d1-U7-04n" firstAttribute="leading" secondItem="1oa-XB-z2H" secondAttribute="leading" id="8De-gE-33I"/>
<constraint firstItem="rHb-Od-M4a" firstAttribute="top" secondItem="1oa-XB-z2H" secondAttribute="bottom" id="8dO-90-EcR"/>
<constraint firstItem="fxQ-G1-4U5" firstAttribute="top" secondItem="QMu-c3-HcP" secondAttribute="top" constant="4" id="AaP-Bh-HJO"/>
<constraint firstAttribute="trailing" secondItem="R17-3r-nZl" secondAttribute="trailing" id="CD1-15-DjJ"/>
<constraint firstAttribute="bottom" secondItem="niZ-Xc-95T" secondAttribute="bottom" id="Hcq-Ev-Yt1"/>
<constraint firstAttribute="trailing" secondItem="1oa-XB-z2H" secondAttribute="trailing" constant="5" id="IeP-It-gIz"/>
<constraint firstItem="YN0-v8-SAo" firstAttribute="top" secondItem="QMu-c3-HcP" secondAttribute="top" id="MM9-lD-eb5"/>
@@ -104,6 +111,8 @@
<constraint firstItem="anN-iX-rGm" firstAttribute="top" secondItem="QMu-c3-HcP" secondAttribute="top" id="QVB-1T-j7f"/>
<constraint firstAttribute="trailing" secondItem="YN0-v8-SAo" secondAttribute="trailing" id="TM5-gQ-Sjd"/>
<constraint firstItem="niZ-Xc-95T" firstAttribute="top" secondItem="QMu-c3-HcP" secondAttribute="top" id="Vx1-do-zNx"/>
<constraint firstItem="R17-3r-nZl" firstAttribute="centerY" secondItem="rHb-Od-M4a" secondAttribute="centerY" id="Ytt-7W-SM4"/>
<constraint firstItem="R17-3r-nZl" firstAttribute="leading" secondItem="QMu-c3-HcP" secondAttribute="leading" id="aSk-9n-6Ln"/>
<constraint firstAttribute="trailing" secondItem="anN-iX-rGm" secondAttribute="trailing" id="gMa-Ee-Va2"/>
<constraint firstItem="YN0-v8-SAo" firstAttribute="leading" secondItem="QMu-c3-HcP" secondAttribute="leading" id="gwM-TL-16q"/>
<constraint firstItem="rHb-Od-M4a" firstAttribute="trailing" secondItem="1oa-XB-z2H" secondAttribute="trailing" id="j58-9C-4jp"/>
@@ -132,6 +141,7 @@
</constraints>
<size key="customSize" width="253" height="303"/>
<connections>
<outlet property="activityImageView" destination="R17-3r-nZl" id="bjL-Xi-hJI"/>
<outlet property="cornBtn" destination="3d1-U7-04n" id="PLQ-JR-U9b"/>
<outlet property="cornHeight" destination="svX-z8-2v4" id="ocG-gq-4Wo"/>
<outlet property="giftNameLabel" destination="rHb-Od-M4a" id="nik-Bp-Ce4"/>
@@ -151,7 +161,7 @@
</objects>
<resources>
<image name="gift_corn" width="6" height="6"/>
<image name="gift_number_bg" width="22.666666030883789" height="8.6666669845581055"/>
<image name="user_header_placehoulder" width="40" height="40"/>
<image name="gift_number_bg" width="35" height="13"/>
<image name="user_header_placehoulder" width="60" height="60"/>
</resources>
</document>

View File

@@ -0,0 +1,33 @@
//
// QXMeetActivityDriftView.h
// QXLive
//
// Created by 启星 on 2025/8/29.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger) {
/// 即将开始
QXMeetActivityDriftTypeWillStart = 1,
/// 已经开始
QXMeetActivityDriftTypeStart = 2,
/// 落入背包
QXMeetActivityDriftTypeFinished = 3,
}QXMeetActivityDriftType;
NS_ASSUME_NONNULL_BEGIN
@class QXMeetActivityDriftModel;
@interface QXMeetActivityDriftView : UIView
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,strong)QXMeetActivityDriftModel *model;
-(void)addActivityModel:(QXMeetActivityDriftModel*)model;
+(instancetype)shareView;
@end
@interface QXMeetActivityDriftModel : NSObject
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)NSString *text;
@property (nonatomic,assign)NSInteger from_type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,129 @@
//
// QXMeetActivityDriftView.m
// QXLive
//
// Created by on 2025/8/29.
//
#import "QXMeetActivityDriftView.h"
@interface QXMeetActivityDriftView()
@property (nonatomic,assign)BOOL isPlaying;
@end
@implementation QXMeetActivityDriftView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(SCREEN_WIDTH, 0, ScaleWidth(358), ScaleWidth(136));
[self initSubviews];
}
return self;
}
+(instancetype)shareView{
static QXMeetActivityDriftView *manager = nil;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
manager = [[QXMeetActivityDriftView alloc] init];
});
return manager;
}
-(void)initSubviews{
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_start_pop_bg"]];
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont systemFontOfSize:12];
self.titleLabel.textColor = RGB16(0xFFFFFF);
[self addSubview:self.titleLabel];;
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.bgImageView).offset(15);
make.centerY.equalTo(self.bgImageView);
}];
self.userInteractionEnabled = YES;
MJWeakSelf
[self addTapBlock:^(id _Nonnull obj) {
if ([weakSelf.model.roomId isExist]) {
[[QXGlobal shareGlobal] joinRoomWithRoomId:weakSelf.model.roomId isRejoin:NO navagationController:weakSelf.viewController.navigationController];
}
}];
}
-(void)addActivityModel:(QXMeetActivityDriftModel *)model{
[self.dataArray addObject:model];
[self giftAction];
}
-(void)giftAction{
if (self.isPlaying) {
return;
}
MJWeakSelf
[QXMeetActivityDriftView shareView].isPlaying = YES;
[QXMeetActivityDriftView shareView].model = [QXMeetActivityDriftView shareView].dataArray.firstObject;
[KEYWINDOW addSubview:[QXMeetActivityDriftView shareView]];
[UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
[QXMeetActivityDriftView shareView].x = (SCREEN_WIDTH-ScaleWidth(316))/2;
} completion:^(BOOL finished) {
[weakSelf performSelector:@selector(dissmissAnimate) afterDelay:5];
}];
}
-(void)dissmissAnimate{
[UIView animateWithDuration:2 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
[QXMeetActivityDriftView shareView].x = -SCREEN_WIDTH;
} completion:^(BOOL finished) {
[QXMeetActivityDriftView shareView].x = SCREEN_WIDTH;
[[QXMeetActivityDriftView shareView] removeFromSuperview];
[[QXMeetActivityDriftView shareView].dataArray removeFirstObject];
[QXMeetActivityDriftView shareView].isPlaying = NO;
if ([QXMeetActivityDriftView shareView].dataArray.count>0) {
[[QXMeetActivityDriftView shareView] giftAction];
}
}];
}
-(void)setModel:(QXMeetActivityDriftModel *)model{
_model = model;
self.titleLabel.text = model.text;
switch (model.from_type) {
case QXMeetActivityDriftTypeWillStart:{
self.bgImageView.image = [UIImage imageNamed:@"ac_meet_will_pop_bg"];
}
break;
case QXMeetActivityDriftTypeStart:{
self.bgImageView.image = [UIImage imageNamed:@"ac_meet_start_pop_bg"];
}
break;
case QXMeetActivityDriftTypeFinished:{
self.bgImageView.image = [UIImage imageNamed:@"ac_meet_finished_pop_bg"];
}
break;
default:
break;
}
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
@end
@implementation QXMeetActivityDriftModel
@end

View File

@@ -278,7 +278,7 @@
+ (NSString *)qx_showHotCountNum:(int64_t)count {
if (count > 9999 || count < -9999) {
// return [NSString stringWithFormat:@"%@w",[self effectiveNum:(double)count/10000.0]];
return [NSString stringWithFormat:@"%.1fw",(double)count/10000.0];
return [NSString stringWithFormat:@"%.2fw",(double)count/10000.0];
}else {
return [NSString stringWithFormat:@"%lld",count];
}

View File

@@ -0,0 +1,54 @@
//
// QXDrawGiftCenterView.h
// QXLive
//
// Created by 启星 on 2025/8/27.
//
#import <UIKit/UIKit.h>
#import "QXGiftActivityModel.h"
typedef NS_ENUM(NSInteger) {
/// 等待开始
QXDrawGiftCenterTypeWait = 0,
/// 即将开始
QXDrawGiftCenterTypeWill = 2,
/// 正式开始
QXDrawGiftCenterTypeStart = 1 ,
}QXDrawGiftCenterType;
typedef NS_ENUM(NSInteger) {
/// 天空之境
QXActivityTypeSky = 10,
/// 岁月之城
QXActivityTypeAge ,
/// 时空之巅
QXActivityTypeTime ,
}QXActivityType;
NS_ASSUME_NONNULL_BEGIN
@interface QXDrawGiftCenterProgressView : UIView
@property (nonatomic, strong) UIColor *progressColor; // 进度条颜色
@property (nonatomic, assign) double progress; // 进度 0.0 - 1.0
@property (nonatomic,strong) UILabel *cycleLabel;
@end
@interface QXDrawGiftCenterView : UIView
@property (nonatomic, strong)QXDrawGiftCenterProgressView *progressView;
@property (nonatomic, assign) double progress; // 进度 0.0 - 1.0
@property (nonatomic,strong) UIImageView *bgImageView;
@property (nonatomic,strong) UIButton *startBtn;
@property (nonatomic,strong) UIView *cycleBgView;
@property (nonatomic,assign)QXDrawGiftCenterType type;
@property (nonatomic,assign)QXActivityType activityType;
@property (nonatomic,strong)QXGiftActivityModel *model;
@property (nonatomic,copy)void(^startBlock)(void);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,228 @@
//
// QXDrawGiftCenterView.m
// QXLive
//
// Created by on 2025/8/27.
//
#import "QXDrawGiftCenterView.h"
static CGFloat lineWidth = 13;
@implementation QXDrawGiftCenterProgressView
- (instancetype)init
{
self = [super init];
if (self) {
self.progressColor = RGB16(0x32F6CB);
self.backgroundColor = RGB16(0x70ADFA);
self.cycleLabel = [[UILabel alloc] init];
self.cycleLabel.font = [UIFont boldSystemFontOfSize:16];
self.cycleLabel.textColor = RGB16(0xffffff);
[self addSubview:self.cycleLabel];
[self.cycleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(self);
}];
[self bringSubviewToFront:self.cycleLabel];
}
return self;
}
-(void)drawRect:(CGRect)rect{
[super drawRect:rect];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
//
CGPoint center = CGPointMake(rect.size.width / 2, rect.size.height / 2);
CGFloat radius = MIN(ScaleWidth(70), ScaleWidth(70)) / 2 - lineWidth / 2;
//
[self drawProgressWithCenter:center radius:radius];
CGContextRestoreGState(context);
}
- (void)setProgress:(double)progress {
_progress = MAX(0.0, MIN(1.0, progress)); // 0-1
[self setNeedsDisplay];
self.cycleLabel.text = [NSString stringWithFormat:@"%d%%",(int)(progress*100)];
[self bringSubviewToFront:self.cycleLabel];
}
- (void)drawProgressWithCenter:(CGPoint)center radius:(CGFloat)radius {
if (self.progress > 0) {
//
CGFloat endAngle = -M_PI_2 + 2 * M_PI * self.progress;
UIBezierPath *progressPath = [UIBezierPath bezierPathWithArcCenter:center
radius:radius
startAngle:-M_PI_2 // -90
endAngle:endAngle
clockwise:YES];
[self.progressColor setStroke];
progressPath.lineWidth = lineWidth;
progressPath.lineCapStyle = kCGLineCapRound;
[progressPath stroke];
}
}
@end
@implementation QXDrawGiftCenterView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXGiftActivityModel *)model{
_model = model;
if (model.is_xlh.intValue == 1) {
self.hidden = NO;
}else{
self.hidden = YES;
}
double progress = (model.xlh_data.current_num.doubleValue/model.xlh_data.start_num.doubleValue);
[self setProgress:progress];
QXDrawGiftCenterType type = model.xlh_data.status.integerValue;
[self setType:type];
}
-(void)initSubviews{
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sky_status_bg"]];
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.height.equalTo(self.bgImageView.mas_width);
}];
self.cycleBgView = [[UIView alloc] init];
self.cycleBgView.backgroundColor = RGB16(0x70ADFA);
[self.cycleBgView addRoundedCornersWithRadius:ScaleWidth(35)];
[self addSubview:self.cycleBgView];
[self.cycleBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(ScaleWidth(70));
make.centerX.equalTo(self.bgImageView);
make.centerY.equalTo(self.bgImageView).offset(10);
}];
self.startBtn = [[UIButton alloc] init];
[self.startBtn addTarget:self action:@selector(startAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.startBtn];
[self.startBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(92));
make.height.mas_equalTo(ScaleWidth(54));
make.centerX.equalTo(self);
make.bottom.equalTo(self);
}];
self.progressView = [[QXDrawGiftCenterProgressView alloc] init];
[self.progressView addRoundedCornersWithRadius:ScaleWidth(35)];
[self addSubview:self.progressView];
[self.progressView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(ScaleWidth(70));
make.centerX.centerY.equalTo(self.cycleBgView);
// make.centerY.equalTo(self.bgImageView).offset(10);
}];
// [self startHide];
}
-(void)startAction{
switch (self.type) {
case QXDrawGiftCenterTypeWait:{
showToast(@"活动未开始");
}
break;
case QXDrawGiftCenterTypeWill:{
showToast(@"活动即将开始");
}
break;
case QXDrawGiftCenterTypeStart:{
if (self.startBlock) {
self.startBlock();
}
}
break;
default:
break;
}
}
-(void)startHide{
[UIView animateWithDuration:1 animations:^{
// self.bgImageView.alpha = 0;
self.alpha = 0;
} completion:^(BOOL finished) {
[self startShow];
}];
}
-(void)startShow{
[UIView animateWithDuration:1 animations:^{
// self.bgImageView.alpha = 1;
self.alpha = 1;
} completion:^(BOOL finished) {
[self startHide];
}];
}
- (void)setProgress:(CGFloat)progress {
_progress = progress;
self.progressView.progress = progress;
}
-(void)setActivityType:(QXActivityType)activityType{
_activityType = activityType;
switch (_activityType) {
case QXActivityTypeSky:{
self.bgImageView.image = [UIImage imageNamed:@"sky_status_bg"];
}
break;
case QXActivityTypeAge:{
self.bgImageView.image = [UIImage imageNamed:@"age_status_bg"];
}
break;
case QXActivityTypeTime:{
self.bgImageView.image = [UIImage imageNamed:@"time_status_bg"];
}
break;
default:
break;
}
}
-(void)setType:(QXDrawGiftCenterType)type{
_type = type;
switch (_type) {
case QXDrawGiftCenterTypeWait:{
[self.startBtn setBackgroundImage:[UIImage imageNamed:@"meet_status_wait"] forState:(UIControlStateNormal)];
}
break;
case QXDrawGiftCenterTypeWill:{
[self.startBtn setBackgroundImage:[UIImage imageNamed:@"meet_status_will"] forState:(UIControlStateNormal)];
}
break;
case QXDrawGiftCenterTypeStart:{
[self.startBtn setBackgroundImage:[UIImage imageNamed:@"meet_status_start"] forState:(UIControlStateNormal)];
[self setProgress:1];
}
break;
default:
break;
}
}
@end

View File

@@ -0,0 +1,101 @@
//
// QXGiftActivityModel.h
// QXLive
//
// Created by 启星 on 2025/8/26.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class QXXLHModel,QXDrawGiftModel;
@interface QXGiftActivityModel : NSObject
@property (nonatomic,strong)NSString *title;
@property (nonatomic,strong)NSString *rule_url;
/// 抽1次的价格
@property (nonatomic,strong)NSString *box_price;
///是否开启了巡乐会 0 未开启 1已开启
@property (nonatomic,strong)NSString *is_xlh;
/// 巡乐会数据
@property (nonatomic,strong)QXXLHModel *xlh_data;
@property (nonatomic,strong)NSArray<QXDrawGiftModel*>* gift_list;
@end
@interface QXXLHModel : NSObject
///等待开始需要达到的次数
@property (nonatomic,strong)NSString *waiting_start_num;
///巡乐会开启需要达到的次数 【进度条 】
@property (nonatomic,strong)NSString *start_num;
///当前已抽奖次数 【进度条 】
@property (nonatomic,strong)NSString *current_num;
///状态 1:巡乐会开始 2:即将开始开始 0:等待开始
@property (nonatomic,strong)NSString *status;
@end
@interface QXDrawGiftModel : NSObject
/// 编号
@property (nonatomic,strong)NSString *number;
/// giftid
@property (nonatomic,strong)NSString *gift_id;
/// 礼物名称
@property (nonatomic,strong)NSString *gift_name;
/// 礼物图标
@property (nonatomic,strong)NSString *base_image;
/// 礼物特效
@property (nonatomic,strong)NSString *play_image;
/// 礼物价格
@property (nonatomic,strong)NSString *gift_price;
@property (nonatomic,strong)NSString *count;
/// 巡乐会number
@property (nonatomic,strong)NSString *gift_num;
@end
@interface QXDrawGiftResultModel : NSObject
/// 抽奖结果标识
@property (nonatomic,strong)NSString *blind_box_turntable_id;
/// giftid 和 count
@property (nonatomic,strong)NSArray <QXDrawGiftModel*> *reslut_list;
@end
@interface QXActivityRecordModel : NSObject
/// giftid
@property (nonatomic,strong)NSString *gift_id;
///中奖礼物数量
@property (nonatomic,strong)NSString *count;
///接收礼物用户Id
@property (nonatomic,strong)NSString *gift_user_id;
/// 创建时间
@property (nonatomic,strong)NSString *createtime;
///用户昵称
@property (nonatomic,strong)NSString *nickname;
/// 礼物名称
@property (nonatomic,strong)NSString *gift_name;
///礼物特效
@property (nonatomic,strong)NSString *play_image;
/// 礼物图标
@property (nonatomic,strong)NSString *base_image;
@end
@interface QXActivityXLHModel : NSObject
@property (nonatomic,strong)NSString *title;
@property (nonatomic,strong)NSString* xlh_end_time;
@property (nonatomic,strong)NSString *rule_url;
@property (nonatomic,strong)NSString *box_price;
@property (nonatomic,strong)QXDrawGiftModel* give_homeowner_gift;
@property (nonatomic,strong)QXDrawGiftModel* locking_gift;
@property (nonatomic,strong)QXUserModel* xlh_user;
@property (nonatomic,strong)NSArray<QXDrawGiftModel*>* gift_list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,60 @@
//
// QXGiftActivityModel.m
// QXLive
//
// Created by on 2025/8/26.
//
#import "QXGiftActivityModel.h"
@implementation QXGiftActivityModel
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"xlh_data" : @"QXXLHModel",
@"gift_list":@"QXDrawGiftModel"
};
}
@end
@implementation QXXLHModel
@end
@implementation QXDrawGiftModel
@end
@implementation QXDrawGiftResultModel
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"reslut_list":@"QXDrawGiftModel"
};
}
@end
@implementation QXActivityRecordModel
@end
@implementation QXActivityXLHModel
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"give_homeowner_gift" : @"QXDrawGiftModel",
@"locking_gift":@"QXDrawGiftModel",
@"xlh_user":@"QXUserModel",
@"gift_list":@"QXDrawGiftModel"
};
}
@end

View File

@@ -1,30 +0,0 @@
//
// QXSkyPraizeView.h
// QXLive
//
// Created by 启星 on 2025/8/16.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXSkyPraizeView : UIView
-(void)showInView:(UIView *)view;
@end
@interface QXSkyPraizeSubView :UIView
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,assign)BOOL isSelected;
- (void)startPulseAnimationWithLayer;
// 停止动画
- (void)stopPulseAnimationWithLayer;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,459 +0,0 @@
//
// QXSkyPraizeView.m
// QXLive
//
// Created by on 2025/8/16.
//
#import "QXSkyPraizeView.h"
/// 12
static NSInteger giftMaxCount = 12;
/// 2
static NSInteger minRoundCount = 2;
/// 4
static NSInteger toSlowCount = 4;
@interface QXSkyPraizeView()<UIGestureRecognizerDelegate>
///
@property (nonatomic,assign)NSInteger targetIndex;
@property (nonatomic,strong)NSMutableArray* targetArrayIndex;
@property (nonatomic,strong)NSMutableArray* finishTargetArrayIndex;
///
@property (nonatomic,assign)NSInteger currentIndex;
///
@property (nonatomic,assign)NSInteger roundCount;
///
@property (nonatomic,assign)double delayTime;
/// 22 33 44 100
@property (nonatomic,assign)NSInteger startType;
@property (nonatomic,strong)QXSkyPraizeSubView *currentGiftView;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)NSMutableArray *allViewsArray;
@property (nonatomic,strong)dispatch_source_t fastTimer;
@property (nonatomic,strong)dispatch_source_t slowTimer;
@end
@implementation QXSkyPraizeView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
[self initSubviews];
}
return self;
}
-(void)initSubviews{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
tap.delegate = self;
[self addGestureRecognizer:tap];
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(520)+kSafeAreaBottom)];
self.bgView.backgroundColor = UIColor.whiteColor;
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
CGFloat topMargin = 60;
CGFloat margin = 16;
CGFloat space = 10;
CGFloat itemWidth = (SCREEN_WIDTH - margin*2 - space*3) / 4;
CGFloat itemHeight = itemWidth/7*8;;
for (int i = 0; i < giftMaxCount; i++) {
QXSkyPraizeSubView *giftView;
if (i < 4) {
/// 4
giftView = [[QXSkyPraizeSubView alloc] initWithFrame:CGRectMake(margin+(itemWidth+space)*i, topMargin, itemWidth, itemHeight)];
giftView.titleLabel.text = [NSString stringWithFormat:@"%d",i];
[self.allViewsArray replaceObjectAtIndex:i withObject:giftView];
}else if (i > 3 && i < 6){
///
if (i == 4) {
giftView = [[QXSkyPraizeSubView alloc] initWithFrame:CGRectMake(margin, topMargin+itemHeight+space, itemWidth, itemHeight)];
giftView.titleLabel.text = [NSString stringWithFormat:@"%d",11];
[self.allViewsArray replaceObjectAtIndex:11 withObject:giftView];
}else{
giftView = [[QXSkyPraizeSubView alloc] initWithFrame:CGRectMake(margin+(itemWidth+space)*3, topMargin+itemHeight+space, itemWidth, itemHeight)];
[self.allViewsArray replaceObjectAtIndex:4 withObject:giftView];
giftView.titleLabel.text = [NSString stringWithFormat:@"%d",4];
}
}else if (i > 5 && i < 8){
///
if (i == 6) {
giftView = [[QXSkyPraizeSubView alloc] initWithFrame:CGRectMake(margin, topMargin+(itemHeight+space)*2, itemWidth, itemHeight)];
[self.allViewsArray replaceObjectAtIndex:10 withObject:giftView];
giftView.titleLabel.text = [NSString stringWithFormat:@"%d",10];
}else{
giftView = [[QXSkyPraizeSubView alloc] initWithFrame:CGRectMake(margin+(itemWidth+space)*3, topMargin+(itemHeight+space)*2, itemWidth, itemHeight)];
[self.allViewsArray replaceObjectAtIndex:5 withObject:giftView];
giftView.titleLabel.text = [NSString stringWithFormat:@"%d",5];
}
}else{
giftView = [[QXSkyPraizeSubView alloc] initWithFrame:CGRectMake(margin+(itemWidth+space)*(i%4), topMargin+(itemHeight+space)*3, itemWidth, itemHeight)];
[self.allViewsArray replaceObjectAtIndex:11-(i-6) withObject:giftView];
giftView.titleLabel.text = [NSString stringWithFormat:@"%d",11-(i-6)];
}
[self.bgView addSubview:giftView];
}
[self resetViews];
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(16, 20, 100, 40)];
[btn setTitle:@"抽1次" forState:(UIControlStateNormal)];
[btn setTitleColor:UIColor.blueColor forState:(UIControlStateNormal)];
btn.tag = 22;
[btn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:btn];
UIButton *tenBtn = [[UIButton alloc] initWithFrame:CGRectMake(116, 20, 100, 40)];
[tenBtn setTitle:@"抽10次" forState:(UIControlStateNormal)];
tenBtn.tag = 33;
[tenBtn setTitleColor:UIColor.blueColor forState:(UIControlStateNormal)];
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:tenBtn];
UIButton *hundredBtn = [[UIButton alloc] initWithFrame:CGRectMake(216, 20, 100, 40)];
[hundredBtn setTitle:@"抽100次" forState:(UIControlStateNormal)];
hundredBtn.tag = 44;
[hundredBtn setTitleColor:UIColor.blueColor forState:(UIControlStateNormal)];
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:hundredBtn];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)startAction:(UIButton*)sender{
self.startType = sender.tag;
///
[self resetViews];
[self getTargetGift];
[self startFastAnimate];
}
-(void)resetViews{
self.targetIndex = -1;
self.currentIndex = -1;
self.roundCount = 0;
self.delayTime = 0.3;
[self.targetArrayIndex removeAllObjects];
[self.finishTargetArrayIndex removeAllObjects];
if (self.currentGiftView != nil) {
self.currentGiftView.isSelected = NO;
[self.currentGiftView stopPulseAnimationWithLayer];
}
for (QXSkyPraizeSubView *giftView in self.allViewsArray) {
giftView.isSelected = NO;
[giftView stopPulseAnimationWithLayer];
}
}
-(void)startFastAnimate{
self.currentGiftView = self.allViewsArray.firstObject;
self.currentGiftView.isSelected = YES;
[self stopFastAnimate];
if (_fastTimer == nil) {
_fastTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
}
// dispatch_source_set_timer(_fastTimer,
// dispatch_time(DISPATCH_TIME_NOW, 0),
// NSEC_PER_SEC * 0.06, // 0.1
// NSEC_PER_SEC * 0.01); // 0.01
dispatch_source_set_timer(_fastTimer,
dispatch_time(DISPATCH_TIME_NOW, 0.06 * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER, // 使
0.01 * NSEC_PER_SEC);
__weak typeof(self) weakSelf = self;
dispatch_source_set_event_handler(_fastTimer, ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) return;
// UI线
dispatch_async(dispatch_get_main_queue(), ^{
strongSelf.roundCount++;
if ((strongSelf.roundCount / giftMaxCount == minRoundCount) && strongSelf.startType != 22) {
BOOL has = NO;
for (NSNumber *index in self.finishTargetArrayIndex) {
if (index.integerValue == self.currentIndex) {
has = YES;
break;
}
}
self.currentGiftView.isSelected = NO;
if (has) {
QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex];
giftView.isSelected = YES;
}else{
QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex];
giftView.isSelected = NO;
}
}else{
///
strongSelf.currentGiftView.isSelected = NO;
}
///
strongSelf.currentIndex = strongSelf.roundCount%giftMaxCount;
/// view
QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex];
giftView.isSelected = YES;
/// view
strongSelf.currentGiftView = giftView;
if (strongSelf.roundCount / giftMaxCount == minRoundCount) {
/// 2
if (strongSelf.startType == 22) {
NSInteger index = strongSelf.targetIndex;
// 0 - > 11
// 1 - > 12
// 2->13
// 3->14
// 4->15
// 0-4
if (index < 5) {
index = (giftMaxCount-1) + index;
}
if ((strongSelf.currentIndex + toSlowCount) == index) {
//4
QXLOG(@"当前下标为%ld---目标为%ld",strongSelf.currentIndex,strongSelf.targetIndex);
[self stopFastAnimate];
[self startSlowAnimate];
}else{
dispatch_source_set_timer(strongSelf.fastTimer,
dispatch_time(DISPATCH_TIME_NOW, 0.06 * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER,
0.01 * NSEC_PER_SEC);
}
}else{
// for (QXSkyPraizeSubView *giftView in strongSelf.allViewsArray) {
// giftView.isSelected = NO;
// }
BOOL has = NO;
for (NSNumber *index in strongSelf.targetArrayIndex) {
if (strongSelf.currentIndex == index.integerValue) {
QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[index.integerValue];
giftView.isSelected = YES;
[giftView startPulseAnimationWithLayer];
// [strongSelf pauseGCDTimer];
[strongSelf.targetArrayIndex removeObject:index];
[strongSelf.finishTargetArrayIndex addObject:index];
has = YES;
break;
}
}
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [strongSelf resumeGCDTimer];
// });
if (has) {
dispatch_source_set_timer(strongSelf.fastTimer,
dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER,
0.01 * NSEC_PER_SEC);
}else{
dispatch_source_set_timer(strongSelf.fastTimer,
dispatch_time(DISPATCH_TIME_NOW, 0.06 * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER,
0.01 * NSEC_PER_SEC);
}
if (strongSelf.targetArrayIndex.count == 0) {
[strongSelf stopFastAnimate];
}
}
}else{
dispatch_source_set_timer(strongSelf.fastTimer,
dispatch_time(DISPATCH_TIME_NOW, 0.06 * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER,
0.01 * NSEC_PER_SEC);
}
});
});
dispatch_resume(_fastTimer);
}
-(void)startSlowAnimate{
if (_slowTimer == nil) {
_slowTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
}
// 0.1
dispatch_source_set_timer(_slowTimer,
dispatch_time(DISPATCH_TIME_NOW, self.delayTime * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER, // 使
0.01 * NSEC_PER_SEC);
__weak typeof(self) weakSelf = self;
dispatch_source_set_event_handler(_slowTimer, ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) return;
// UI线
dispatch_async(dispatch_get_main_queue(), ^{
///
strongSelf.currentGiftView.isSelected = NO;
strongSelf.roundCount++;
///
strongSelf.currentIndex = strongSelf.roundCount%giftMaxCount;
/// view
QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex];
giftView.isSelected = YES;
/// view
strongSelf.currentGiftView = giftView;
if (strongSelf.currentIndex == strongSelf.targetIndex) {
//4
QXLOG(@"礼物结束====当前下标为%ld---目标为%ld",strongSelf.currentIndex,strongSelf.targetIndex);
[strongSelf stopSlowAnimate];
[strongSelf.currentGiftView startPulseAnimationWithLayer];
}
});
strongSelf.delayTime = strongSelf.delayTime+0.1;
dispatch_source_set_timer(strongSelf.slowTimer,
dispatch_time(DISPATCH_TIME_NOW, strongSelf.delayTime * NSEC_PER_SEC),
DISPATCH_TIME_FOREVER,
0.01 * NSEC_PER_SEC);
});
dispatch_resume(_slowTimer);
}
-(void)stopFastAnimate{
if (_fastTimer != nil) {
dispatch_source_cancel(_fastTimer);
_fastTimer = nil;
}
}
- (void)pauseGCDTimer {
if (_fastTimer) {
dispatch_suspend(_fastTimer);
NSLog(@"GCD定时器已暂停");
}
}
- (void)resumeGCDTimer {
if (_fastTimer) {
dispatch_resume(_fastTimer);
NSLog(@"GCD定时器已恢复");
}
}
-(void)stopSlowAnimate{
if (_slowTimer != nil) {
dispatch_source_cancel(_slowTimer);
_slowTimer = nil;
}
}
-(void)getTargetGift{
self.targetArrayIndex = [NSMutableArray arrayWithArray:@[@3,@5,@8,@10]];
if (self.startType == 22) {
self.targetIndex = arc4random() % 12;
}else{
// NSNumber *number = self.targetArrayIndex.firstObject;
// self.targetIndex = number.integerValue;
}
}
-(void)getTenTargetGift{
}
-(NSMutableArray *)allViewsArray{
if (!_allViewsArray) {
_allViewsArray = [NSMutableArray arrayWithArray:@[@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@""]];
}
return _allViewsArray;
}
-(NSMutableArray *)finishTargetArrayIndex{
if (!_finishTargetArrayIndex) {
_finishTargetArrayIndex = [NSMutableArray array];
}
return _finishTargetArrayIndex;
}
-(void)showInView:(UIView *)view{
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(520)-kSafeAreaBottom;
}];
}
-(void)hide{
[self stopFastAnimate];
[self stopSlowAnimate];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
@end
@implementation QXSkyPraizeSubView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor cyanColor];
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:22];
self.titleLabel.textColor = UIColor.blackColor;
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
}
-(void)setIsSelected:(BOOL)isSelected{
_isSelected = isSelected;
self.backgroundColor = isSelected?[UIColor blueColor]:[UIColor cyanColor];
}
- (void)startPulseAnimationWithLayer {
CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
pulseAnimation.duration = 0.5;
pulseAnimation.fromValue = @0.9;
pulseAnimation.toValue = @1.1;
pulseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
pulseAnimation.autoreverses = YES;
pulseAnimation.repeatCount = HUGE_VALF; //
[self.layer addAnimation:pulseAnimation forKey:@"pulse"];
}
//
- (void)stopPulseAnimationWithLayer {
[self.layer removeAnimationForKey:@"pulse"];
}
@end

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