福袋送礼物优化

This commit is contained in:
fengshuo
2022-06-15 14:20:09 +08:00
parent 4d00ec64c7
commit 1de93d73e2
11 changed files with 802 additions and 60 deletions

View File

@@ -33,6 +33,7 @@
#import "RoomPKChooseUserModel.h"
#import "RoomPKInfoModel.h"
#import "CandyTreeResultModel.h"
#import "XPGiftBigPrizeModel.h"
#import "NetImageView.h"
@@ -105,6 +106,8 @@
return [self createKickUserAttribute:attachment info:kickModel];
} else if (first == CustomMessageType_Room_PK) {///PK
return [self createRoomPKAttribute:attachment];
} else if (first == CustomMessageType_LuckyBag) {///
return [self createRoomLuckyBigPrizeAttribute:attachment];
}
return nil;
}
@@ -261,6 +264,19 @@
return nil;
}
#pragma mark -
- (NSAttributedString *)createRoomLuckyBigPrizeAttribute:(AttachmentModel *)attachment {
XPGiftBigPrizeModel * info= [XPGiftBigPrizeModel modelWithDictionary:attachment.data];
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
[attribute appendAttributedString:[self createTextAttribute:@"恭喜" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:info.nick color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:@"在" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:info.roomTitle color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"通过%@", info.luckyBagName] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@",开出%@", info.giftName] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
return attribute;
}
#pragma mark - PK
- (NSAttributedString *)createRoomPKAttribute:(AttachmentModel *)attachment {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];