修复了糖果树开出多个礼物的话不显示个数的问题

This commit is contained in:
fengshuo
2022-06-01 10:34:36 +08:00
parent 4851cb6c1e
commit 86cd39cc77
7 changed files with 51 additions and 17 deletions

View File

@@ -32,6 +32,7 @@
#import "GuildSuperAdminInfoModel.h"
#import "RoomPKChooseUserModel.h"
#import "RoomPKInfoModel.h"
#import "CandyTreeResultModel.h"
#import "NetImageView.h"
@@ -558,17 +559,12 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
//action
[attribute appendAttributedString:[self createTextAttribute:@"厉害了 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
NSInteger uid = 0;
if ([attachment.data[@"uid"] isKindOfClass:[NSNumber class]]) {
uid = ((NSNumber *)attachment.data[@"uid"]).integerValue;
} else if ([attachment.data[@"uid"] isKindOfClass:[NSString class]]) {
uid = ((NSString *)attachment.data[@"uid"]).integerValue;
}
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"nick"] color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
CandyTreeGiftInfoModel * giftInfo = [CandyTreeGiftInfoModel modelWithDictionary:attachment.data];
[attribute appendAttributedString:[self createTextAttribute:giftInfo.nick color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:@"摘下糖果获得" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"prizeName"] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@" x %@", attachment.data[@"prizeNum"]] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[self attributeAddHihtLight:attribute uid:uid];
[attribute appendAttributedString:[self createTextAttribute:giftInfo.prizeName color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@" X %d", giftInfo.prizeNum] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[self attributeAddHihtLight:attribute uid:giftInfo.uid.integerValue];
return attribute;
}