1.0.30 封版
This commit is contained in:
@@ -186,9 +186,9 @@ PIUniversalBannerViewDelegate>
|
||||
@property (nonatomic, strong) AttachmentModel *cpAttachment;
|
||||
|
||||
@property(nonatomic, strong) GiftReceiveInfoModel *mp4TempReceiveInfoModel;
|
||||
@property(nonatomic, strong) NetImageView *mp4AvatarLoader_1;
|
||||
@property(nonatomic, strong) NetImageView *mp4AvatarLoader_2;
|
||||
@property(nonatomic, strong) NSMutableArray *embeddedTargetDatas;
|
||||
//@property(nonatomic, strong) NetImageView *mp4AvatarLoader_1;
|
||||
//@property(nonatomic, strong) NetImageView *mp4AvatarLoader_2;
|
||||
@property(nonatomic, strong) NSMutableArray *avatarLoaders;
|
||||
|
||||
@end
|
||||
|
||||
@@ -308,6 +308,20 @@ PIUniversalBannerViewDelegate>
|
||||
GiftReceiveInfoModel * receiveInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
|
||||
|
||||
if (attachment.second == Custom_Message_Sub_Gift_EmbeddedStyle) {
|
||||
if (receiveInfo.giftVo) {
|
||||
receiveInfo.gift = receiveInfo.giftVo;
|
||||
// receiveInfo.targetUid = receiveInfo.recvUserUid;
|
||||
// receiveInfo.targetNick = receiveInfo.recvUserNick;
|
||||
// receiveInfo.targetUids = @[receiveInfo.recvUserUid];
|
||||
// if (<#condition#>) {
|
||||
// <#statements#>
|
||||
// }
|
||||
// [data setObject:[[obj objectForKey:@"uid"] stringValue] forKey:@"targetUid"];
|
||||
// [data setObject:[obj objectForKey:@"nick"] forKey:@"targetNick"];
|
||||
// [data setObject:[obj objectForKey:@"avatar"] forKey:@"targetAvatar"];
|
||||
}
|
||||
|
||||
// TODO: 只送一个人时背包礼物有问题
|
||||
receiveInfo.targetUid = [[attachment.data objectForKey:@"recvUserUid"] stringValue];
|
||||
receiveInfo.targetNick = [attachment.data objectForKey:@"recvUserNick"];
|
||||
receiveInfo.targetAvatar = [attachment.data objectForKey:@"recvUserAvatar"];
|
||||
@@ -327,11 +341,7 @@ PIUniversalBannerViewDelegate>
|
||||
receiveInfo.targetUids = @[@(receiveInfo.uid.integerValue)];
|
||||
}
|
||||
}
|
||||
|
||||
if (!_embeddedTargetDatas) {
|
||||
_embeddedTargetDatas = @[].mutableCopy;
|
||||
}
|
||||
|
||||
|
||||
receiveInfo.isLuckyBagGift = attachment.second == Custom_Message_Sub_Gift_LuckySend;
|
||||
receiveInfo.isBatch = (attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend);
|
||||
receiveInfo.isComboBatch = attachment.second == Custom_Message_Sub_AllMicroSend;
|
||||
@@ -350,16 +360,12 @@ PIUniversalBannerViewDelegate>
|
||||
}
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (receiveInfo.gift.notifyFull) {
|
||||
return;
|
||||
}
|
||||
[self receiveGift:receiveInfo];
|
||||
});
|
||||
} else {
|
||||
if (receiveInfo.gift.notifyFull) {
|
||||
if (receiveInfo.gift.notifyFull && attachment.second == Custom_Message_Sub_Gift_Send) {
|
||||
return;
|
||||
}
|
||||
[self.embeddedTargetDatas insertObject:receiveInfo atIndex:0];
|
||||
[self receiveGift:receiveInfo];
|
||||
}
|
||||
} else if (attachment.first == CustomMessageType_AllMicroSend) { //发送全麦礼物 或者多人礼物
|
||||
@@ -385,15 +391,9 @@ PIUniversalBannerViewDelegate>
|
||||
}
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (receiveInfo.gift.notifyFull) {
|
||||
return;
|
||||
}
|
||||
[self receiveGift:receiveInfo];
|
||||
});
|
||||
} else {
|
||||
if (receiveInfo.gift.notifyFull) {
|
||||
return;
|
||||
}
|
||||
[self receiveGift:receiveInfo];
|
||||
}
|
||||
} else if (attachment.first == CustomMessageType_LuckyBag ) {//福袋消息厅内展示
|
||||
@@ -1114,18 +1114,28 @@ PIUniversalBannerViewDelegate>
|
||||
|
||||
#pragma mark - 进房动画 XXX来了
|
||||
- (void)userEnterRoom:(NIMChatroomNotificationContent *)content ext:(XPMessageRemoteExtModel *)extModel {
|
||||
NSString *userName = content.source.nick;
|
||||
if ([NSString isEmpty:userName] && content.source.userId.intValue == self.delegate.getUserInfo.uid) {
|
||||
userName = self.delegate.getUserInfo.nick;
|
||||
} else if ([NSString isEmpty:userName]) {
|
||||
userName = extModel.nick;
|
||||
} else if ([NSString isEmpty:userName]) {
|
||||
userName = @"";
|
||||
}
|
||||
|
||||
if(extModel.enterRoomEffects.length > 0){
|
||||
NSString * title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomAnimationView0"), content.source.nick];
|
||||
NSString * title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomAnimationView0"), userName];
|
||||
if (self.enterEffectQueue.count ==0) {
|
||||
[self playUserEnterRoomAnimation:title experLevelSeq:extModel.experLevelSeq effectPath:extModel.enterRoomEffects];
|
||||
}
|
||||
NSDictionary * dic= @{@"title":title, @"experLevelSeq":[NSString stringWithFormat:@"%ld", extModel.experLevelSeq], @"effectPath" : extModel.enterRoomEffects.length ? extModel.enterRoomEffects : @""};
|
||||
[self.enterEffectQueue addObject:dic];
|
||||
return;
|
||||
} else if (extModel.experLevelSeq < 30) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (extModel.experLevelSeq < 30) return;
|
||||
NSString * title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomAnimationView0"), content.source.nick];
|
||||
|
||||
NSString * title = [NSString stringWithFormat:YMLocalizedString(@"XPRoomAnimationView0"), userName];
|
||||
if (self.enterEffectQueue.count ==0) {
|
||||
[self playUserEnterRoomAnimation:title experLevelSeq:extModel.experLevelSeq effectPath:extModel.enterRoomEffects];
|
||||
}
|
||||
@@ -1141,14 +1151,17 @@ PIUniversalBannerViewDelegate>
|
||||
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:26], NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||
[attribute setYy_alignment:NSTextAlignmentLeft];
|
||||
|
||||
BOOL needRemoveHandly = NO;
|
||||
|
||||
if (effectPath.length > 0) {
|
||||
needRemoveHandly = YES;
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithURL:[NSURL URLWithString:effectPath] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.enterEffectView.loops = 2;
|
||||
self.enterEffectView.loops = 0;
|
||||
self.enterEffectView.hidden = NO;
|
||||
self.enterEffectView.clearsAfterStop = NO;
|
||||
self.enterEffectView.clearsAfterStop = YES;
|
||||
self.enterEffectView.alpha = 1;
|
||||
self.enterEffectView.videoItem = videoItem;
|
||||
[self.enterEffectView setAttributedText:attribute forKey:@"room_text"];
|
||||
@@ -1191,9 +1204,21 @@ PIUniversalBannerViewDelegate>
|
||||
NSLog(@"%@", error);
|
||||
}];
|
||||
}
|
||||
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.enterEffectView.frame = CGRectMake(0, 339 + kSafeAreaTopHeight, KScreenWidth, effectPath.length ? 75 : 40);
|
||||
} completion:^(BOOL finished) {
|
||||
if (needRemoveHandly) {
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// [self.enterEffectView stopAnimation];
|
||||
// });
|
||||
[UIView animateWithDuration:0.5 delay:1 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
self.enterEffectView.frame = CGRectMake(-KScreenWidth, 339 + kSafeAreaTopHeight, KScreenWidth, effectPath.length ? 75 : 40);
|
||||
} completion:^(BOOL finished) {
|
||||
[self.enterEffectView stopAnimation];
|
||||
[self svgaPlayerDidFinishedAnimation:self.enterEffectView];
|
||||
}];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -2287,7 +2312,7 @@ PIUniversalBannerViewDelegate>
|
||||
@kWeakify(self);
|
||||
dispatch_source_set_event_handler(_timer, ^{
|
||||
@kStrongify(self)
|
||||
NSLog(@"******************* 当前队列个数: %@", @(self.svgaQueue.count));
|
||||
NSLog(@"******************* 当前队列个数: %@,image loader 个数: %@", @(self.svgaQueue.count), @(self.avatarLoaders.count));
|
||||
if (self.svgaQueue.count > 0) {
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
if(self.isLargeGiftAnimating == NO){
|
||||
@@ -2474,6 +2499,9 @@ PIUniversalBannerViewDelegate>
|
||||
NSString *encodingUrl = [vapUrl pureURLString];
|
||||
NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject];
|
||||
NSString *fullPath = [self.GiftDynamicEffectListPath stringByAppendingPathComponent:fileName];
|
||||
|
||||
self.avatarLoaders = @[].mutableCopy;
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){
|
||||
vapUrl = fullPath;
|
||||
|
||||
@@ -2833,6 +2861,9 @@ PIUniversalBannerViewDelegate>
|
||||
if (self.mp4TempReceiveInfoModel) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
QGVAPSourceInfo *info = (QGVAPSourceInfo *)context[@"resource"];
|
||||
|
||||
NSLog(@" MP4 的 key - info.contentTag : %@", info.contentTag);
|
||||
|
||||
if ([info.contentTag isEqualToString:@"avatar1"]) {
|
||||
if ([NSString isEmpty:self.mp4TempReceiveInfoModel.avatar]) {
|
||||
completionBlock(kImage(@"common_avatar"), nil, @"dafeult image");
|
||||
@@ -2851,24 +2882,29 @@ PIUniversalBannerViewDelegate>
|
||||
return;
|
||||
break;
|
||||
}
|
||||
self.mp4AvatarLoader_1 = [[NetImageView alloc] init];
|
||||
[self.mp4AvatarLoader_1 loadImageWithUrl:path completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
|
||||
NetImageView *avatar_1_Loader = [[NetImageView alloc] init];
|
||||
[avatar_1_Loader loadImageWithUrl:path completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
completionBlock(image, nil, urlStr);
|
||||
}];
|
||||
|
||||
[self.avatarLoaders addObject:avatar_1_Loader];
|
||||
}
|
||||
}
|
||||
else if ([info.contentTag isEqualToString:@"avatar2"] ) {
|
||||
GiftReceiveInfoModel *infoModel = self.mp4TempReceiveInfoModel;// [self.embeddedTargetDatas lastObject];
|
||||
if (!infoModel || [NSString isEmpty:infoModel.targetAvatar]) {
|
||||
if (!infoModel || [NSString isEmpty:infoModel.targetAvatar]) {
|
||||
completionBlock(kImage(@"common_avatar"), nil, @"dafeult image");
|
||||
} else {
|
||||
self.mp4AvatarLoader_2 = [[NetImageView alloc] init];
|
||||
[self.mp4AvatarLoader_2 loadImageWithUrl:infoModel.targetAvatar completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
|
||||
NetImageView *avatar_2_Loader = [[NetImageView alloc] init];
|
||||
[avatar_2_Loader loadImageWithUrl:infoModel.targetAvatar completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
completionBlock(image, nil, urlStr);
|
||||
}];
|
||||
[self.avatarLoaders addObject:avatar_2_Loader];
|
||||
}
|
||||
} else {
|
||||
completionBlock(nil, nil, @"completionBlock");
|
||||
completionBlock(kImage(@"common_avatar"), nil, @"completionBlock");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2877,11 +2913,11 @@ PIUniversalBannerViewDelegate>
|
||||
- (NSString *)contentForVapTag:(NSString *)tag resource:(QGVAPSourceInfo *)info {
|
||||
NSString *name1 = @"";
|
||||
switch (self.mp4TempReceiveInfoModel.gift.showAvatarType) {
|
||||
case 1: // 只使用 avatar
|
||||
case 1:
|
||||
case 3:
|
||||
name1 = self.mp4TempReceiveInfoModel.nick;
|
||||
break;
|
||||
case 2: // 只使用 target avatar
|
||||
case 2:
|
||||
name1 = self.mp4TempReceiveInfoModel.targetNick;
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user