动态删除的通知view

This commit is contained in:
fengshuo
2022-08-26 20:56:05 +08:00
parent c1b62f6426
commit 93bbfda422
3 changed files with 25 additions and 7 deletions

View File

@@ -36,6 +36,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
CustomMessageType_Update_RoomInfo = 20, CustomMessageType_Update_RoomInfo = 20,
///应用内分享 ///应用内分享
CustomMessageType_Application_Share = 22, CustomMessageType_Application_Share = 22,
///系统通知,自定义布局消息(带确认、取消)
CustomMessageType_Message_Handle = 23,
///用户升级 ///用户升级
CustomMessageType_User_UpGrade = 24, CustomMessageType_User_UpGrade = 24,
///糖果树 ///糖果树
@@ -195,6 +197,13 @@ typedef NS_ENUM(NSInteger, CustomMessageSubApplicationShare) {
Custom_Message_Sub_Application_Share_Room = 221, Custom_Message_Sub_Application_Share_Room = 221,
}; };
///first = CustomMessageType_Applica
typedef NS_ENUM(NSInteger, CustomMessageSubMessageHandle) {
Custom_Message_Sub_Message_Handle_Content = 231, //文本
Custom_Message_Sub_Message_Handle_Bussiness = 232, //业务
};
///first = CustomMessageType_User_UpGrade ///first = CustomMessageType_User_UpGrade
typedef NS_ENUM(NSInteger, CustomMessageSubUserUpgrade) { typedef NS_ENUM(NSInteger, CustomMessageSubUserUpgrade) {
///用户等级 ///用户等级

View File

@@ -23,7 +23,7 @@
@implementation MessageContentMonentsAutoView @implementation MessageContentMonentsAutoView
+ (CGFloat)measureHeight:(NIMMessage *)message { + (CGFloat)measureHeight:(NIMMessage *)message {
return (CONTENT_PADDING_V_TOTAL + 144); return (CONTENT_PADDING_V_TOTAL + 120);
} }
- (void)initSubViews { - (void)initSubViews {
@@ -38,7 +38,7 @@
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[super initSubViewConstraints]; [super initSubViewConstraints];
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) { [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(200, 144)); make.size.mas_equalTo(CGSizeMake(250, 120));
}]; }];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -260,7 +260,9 @@
return @"MessageContentRiskAlertView"; return @"MessageContentRiskAlertView";
}else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) { }else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) {
return @"MessageContentMonentsView"; return @"MessageContentMonentsView";
}else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Approved) { }else if(attachment.first == CustomMessageType_Monents && (attachment.second == Custom_Message_Sub_Monents_Approved | attachment.second == Custom_Message_Sub_Monents_Ban_Delete)) {
return @"MessageContentMonentsAutoView";
} else if(attachment.first == CustomMessageType_Message_Handle && attachment.second == Custom_Message_Sub_Message_Handle_Content) {
return @"MessageContentMonentsAutoView"; return @"MessageContentMonentsAutoView";
}else { }else {
return @"MessageContentOpenLiveView"; return @"MessageContentOpenLiveView";
@@ -305,7 +307,9 @@
return [MessageContentRiskAlertView measureHeight:message]; return [MessageContentRiskAlertView measureHeight:message];
} else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) { } else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) {
return [MessageContentMonentsView measureHeight:message]; return [MessageContentMonentsView measureHeight:message];
} else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Approved) { } else if(attachment.first == CustomMessageType_Monents && (attachment.second == Custom_Message_Sub_Monents_Approved | attachment.second == Custom_Message_Sub_Monents_Ban_Delete)) {
return [MessageContentMonentsAutoView measureHeight:message];
}else if(attachment.first == CustomMessageType_Message_Handle && attachment.second == Custom_Message_Sub_Message_Handle_Content) {
return [MessageContentMonentsAutoView measureHeight:message]; return [MessageContentMonentsAutoView measureHeight:message];
} else { } else {
return [MessageContentUnSupportView measureHeight:message]; return [MessageContentUnSupportView measureHeight:message];
@@ -372,7 +376,12 @@
return self.messageContent; return self.messageContent;
} }
return [[MessageContentMonentsView alloc] init]; return [[MessageContentMonentsView alloc] init];
}else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Approved) { }else if(attachment.first == CustomMessageType_Monents && (attachment.second == Custom_Message_Sub_Monents_Approved | attachment.second == Custom_Message_Sub_Monents_Ban_Delete)) {
if ([self.messageContent isKindOfClass:[MessageContentMonentsAutoView class]]) {
return self.messageContent;
}
return [[MessageContentMonentsAutoView alloc] init];
}else if(attachment.first == CustomMessageType_Message_Handle && attachment.second == Custom_Message_Sub_Message_Handle_Content) {
if ([self.messageContent isKindOfClass:[MessageContentMonentsAutoView class]]) { if ([self.messageContent isKindOfClass:[MessageContentMonentsAutoView class]]) {
return self.messageContent; return self.messageContent;
} }