送礼物的公屏的显示

This commit is contained in:
fengshuo
2021-11-17 19:29:14 +08:00
parent 1a4b6b537a
commit 1247fa92c5
49 changed files with 555 additions and 143 deletions

View File

@@ -44,8 +44,6 @@
@property (nonatomic,strong) UIView * placeHolderView;
///
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
///
@property (nonatomic,weak) XPSendGiftView *giftView;
@end
@@ -82,9 +80,10 @@
break;
case XPRoomMenuItemType_Gift: {
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid delegate:self.delegate];
[giftView updateMicro:[self.delegate getMicroQueue].allValues];
self.giftView = giftView;
XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid];
giftView.delegate = self.delegate;
NSArray * giftUses = [self configGiftUsers:[self.delegate getMicroQueue]];
[giftView configGiftUsers:giftUses];
[TTPopup popupView:giftView style:TTPopupStyleActionSheet];
}
break;
@@ -94,20 +93,6 @@
}
}
#pragma mark - RoomGuestDelegate
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
MicroQueueModel * model = [self findMySelfMicro:queue];
if (model) {
self.micButton.hidden = NO;
self.micButton.selected = model.microState.micState == MicroMicStateType_Close ? YES : [RtcManager instance].isLocalMuted;
self.micButton.enabled = model.microState.micState == MicroMicStateType_Open;
} else {
self.micButton.hidden = YES;
}
[self.giftView updateMicro:queue.allValues];
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.stackView];
@@ -136,14 +121,19 @@
}];
}
- (MicroQueueModel *)findMySelfMicro:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
NSString * uid = [AccountInfoStorage instance].getUid;
- (NSArray<XPGiftUserInfoModel *> *)configGiftUsers:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
NSMutableArray * array = [NSMutableArray array];
for (MicroQueueModel * microModel in queue.allValues) {
if (microModel.userInfo && microModel.userInfo.uid == uid.integerValue) {
return microModel;
if (microModel.userInfo && microModel.userInfo.uid >0) {
UserInfoModel * userInfo = microModel.userInfo;
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = userInfo.avatar;
userModel.position = microModel.microState.position;
userModel.uid = userInfo.uid;
[array addObject:userModel];
}
}
return nil;
return array;
}
#pragma mark - Getters And Setters