相亲动画
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#import "UserInfoModel.h"
|
||||
#import "MicroStateModel.h"
|
||||
#import "RoomInfoModel.h"
|
||||
#import "DatingInfoModel.h"
|
||||
|
||||
#import "NetImageView.h"
|
||||
|
||||
@@ -74,6 +75,8 @@
|
||||
return [self createRoomInfoUpdateAttribute:attachment];
|
||||
} else if(first == CustomMessageType_Collection_Room) {
|
||||
return [self createCollectRoomAttribute:attachment];
|
||||
} else if(first == CustomMessageType_RoomPlay_Dating) {
|
||||
return [self createRoomDatingAttribute:attachment];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
@@ -108,7 +111,7 @@
|
||||
/// 房间tips消息
|
||||
/// @param message 消息的实体
|
||||
- (NSAttributedString*)makeTipsAttribute:(NIMMessage *)message {
|
||||
return [self createTextAttribute:message.text color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont];
|
||||
return [self createTextAttribute:message.text color:UIColorFromRGB(0xFE5D7F) font:kRoomMessageDefalutFont];
|
||||
}
|
||||
|
||||
/// 房间通知类消息
|
||||
@@ -142,9 +145,18 @@
|
||||
return attribute;
|
||||
}
|
||||
break;
|
||||
case NIMChatroomEventTypeInfoUpdated:{
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
if (self.hostDelegate.getRoomInfo.isOpenRoomDating) {
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"相亲玩法已开启,请点击主持人麦位选择主持人" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
return attribute;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return nil;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark - 收藏房间
|
||||
@@ -188,6 +200,43 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark - 相亲
|
||||
- (NSAttributedString *)createRoomDatingAttribute:(AttachmentModel *)attachment {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
if(attachment.second == Custom_Message_Sub_Room_Play_Dating_Pick_Heart) {
|
||||
DatingInfoModel * datingModel = [DatingInfoModel modelWithDictionary:attachment.data];
|
||||
NSString * targetGender = datingModel.targetGender == GenderType_Male ? @"男" : @"女";
|
||||
NSString * pickString = [NSString stringWithFormat:@"%d号%@嘉宾:", (datingModel.targetPosition + 1), targetGender];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"本轮你选择了" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:pickString color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
NSString * targetNick = datingModel.targetNickname ? datingModel.targetNickname : @"";
|
||||
[attribute appendAttributedString:[self createNickAtrribute:targetNick uid:datingModel.targetUid]];
|
||||
NSString * heartContent = @"作为你的心动对象";
|
||||
[attribute appendAttributedString:[self createTextAttribute:heartContent color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
} else if(attachment.second == Custom_Message_Sub_Room_Play_Dating_Result_Mutual) {///互选
|
||||
DatingInfoModel * datingModel = [DatingInfoModel modelWithDictionary:attachment.data];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"恭喜" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
NSString * nick = datingModel.nickname ? datingModel.nickname : @"";
|
||||
[attribute appendAttributedString:[self createNickAtrribute:nick uid:datingModel.uid]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"和" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
NSString * targetNick = datingModel.targetNickname ? datingModel.targetNickname : @"";
|
||||
[attribute appendAttributedString:[self createNickAtrribute:targetNick uid:datingModel.targetUid]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"牵手成功,让我们见证他们幸福的开端" color:UIColorFromRGB(0xF84C95) font:kRoomMessageDefalutFont]];
|
||||
} else if (attachment.second == Custom_Message_Sub_Room_Play_Dating_Result_Not_Mutual) {///不是互选
|
||||
DatingInfoModel * datingModel = [DatingInfoModel modelWithDictionary:attachment.data];
|
||||
NSString * nick = datingModel.nickname ? datingModel.nickname : @"";
|
||||
[attribute appendAttributedString:[self createNickAtrribute:nick uid:datingModel.uid]];
|
||||
if (datingModel.hasSelectUser) {//选择的有人
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"的心动对象是" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
NSString * targetNick = datingModel.targetNickname ? datingModel.targetNickname : @"";
|
||||
[attribute appendAttributedString:[self createNickAtrribute:targetNick uid:datingModel.targetUid]];
|
||||
} else {///没有选择人
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"未选择心动对象" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
}
|
||||
}
|
||||
return attribute;
|
||||
}
|
||||
|
||||
#pragma mark - 排麦
|
||||
- (NSAttributedString *)createArrangeMicAttribute:(AttachmentModel *)attachment {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
|
Reference in New Issue
Block a user