个播房主位声波动画,请求上麦的弹窗优化

This commit is contained in:
chenguilong
2022-02-17 11:47:09 +08:00
parent 3866a06237
commit 53ee9fbaa1
6 changed files with 100 additions and 13 deletions

View File

@@ -147,16 +147,8 @@
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
if (attachment.first == CustomMessageType_AnchorRoom_AudienceUpMic) {
UserInfoModel *model = [UserInfoModel modelWithJSON:attachment.data];
XPAnchorAudienceUpMicView *upMicView = [[XPAnchorAudienceUpMicView alloc] initWithFrame:CGRectMake(0, 0, 300, 226) delegate:self.delegate];
upMicView.info = model;
TTPopupConfig *config = [[TTPopupConfig alloc] init];
config.filterIdentifier = @"audienceRequestUpMic";
config.shouldFilterPopup = YES;
config.contentView = upMicView;
config.style = TTPopupStyleAlert;
[TTPopup popupWithConfig:config];
if (attachment.first == CustomMessageType_AnchorRoom_AudienceUpMic) {
[self showAskForUpMic:attachment.data];
} else if(attachment.first == CustomMessageType_Room_GiftValue && attachment.second == Custom_Message_Sub_Room_GiftValue_Sync) {
[self handleAnchorGiftValue:attachment.data];
} else if(attachment.first == CustomMessageType_Gift && (attachment.second == Custom_Message_Sub_Gift_Send || attachment.second == Custom_Message_Sub_Gift_LuckySend || attachment.second == Custom_Message_Sub_Gift_ChannelNotify)) {
@@ -262,6 +254,23 @@
} uid:roomUid];
}
///
- (void)showAskForUpMic:(NSDictionary *)dict {
NSString *roomUid = [NSString stringWithFormat:@"%zd", self.delegate.getRoomInfo.uid];
if (![roomUid isEqualToString:[AccountInfoStorage instance].getUid]) {
return;
}
UserInfoModel *model = [UserInfoModel modelWithJSON:dict];
XPAnchorAudienceUpMicView *upMicView = [[XPAnchorAudienceUpMicView alloc] initWithFrame:CGRectMake(0, 0, 300, 226) delegate:self.delegate];
upMicView.info = model;
TTPopupConfig *config = [[TTPopupConfig alloc] init];
config.filterIdentifier = @"audienceRequestUpMic";
config.shouldFilterPopup = YES;
config.contentView = upMicView;
config.style = TTPopupStyleAlert;
[TTPopup popupWithConfig:config];
}
- (void)handleAnchorGiftValue:(NSDictionary *)dict {
if (self.delegate.getRoomInfo.type != RoomType_Anchor) {//
return;