房间公屏聊天调整

This commit is contained in:
liyuhua
2023-07-31 11:37:19 +08:00
parent cc59db460c
commit 102c53c06b
3 changed files with 35 additions and 14 deletions

View File

@@ -52,7 +52,7 @@
- (void)accountCanceled:(NSDictionary *)data { - (void)accountCanceled:(NSDictionary *)data {
NSString *date = [NSString stringWithFormat:@"%.0f",[[data objectForKey:@"cancelDate"] doubleValue]]; NSString *date = [NSString stringWithFormat:@"%.0f",[[data objectForKey:@"cancelDate"] doubleValue]];
NSString *dateDes = [NSString stringWithFormat:@"注销时间:%@", [PLTimeUtil getDateWithYYMMDD:date]]; NSString *dateDes = [NSString stringWithFormat:@"注销时间:%@", [PLTimeUtil getDateWithYYMMDD:date]];
NSString *msg = [NSString stringWithFormat:@"%@\n\n请联系客服微信yinyoukefu01)咨询哦!", dateDes]; NSString *msg = [NSString stringWithFormat:@"%@\n\n请联系客服微信yinmeng-kefu咨询哦!", dateDes];
TTAlertMessageAttributedConfig *dateAttrConfig = [[TTAlertMessageAttributedConfig alloc] init]; TTAlertMessageAttributedConfig *dateAttrConfig = [[TTAlertMessageAttributedConfig alloc] init];
dateAttrConfig.text = dateDes; dateAttrConfig.text = dateDes;
dateAttrConfig.color = ThemeColor.appMainColor; dateAttrConfig.color = ThemeColor.appMainColor;

View File

@@ -290,7 +290,7 @@
}else{ }else{
if (self.personList.count > 0) { if (self.personList.count > 0) {
HomeRecommendRoomModel * model = [self.personList safeObjectAtIndex1:indexPath.item]; HomeRecommendRoomModel * model = [self.personList safeObjectAtIndex1:indexPath.item];
roomUid = model.roomUid; roomUid = model.roomId;
} }
} }

View File

@@ -161,7 +161,7 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init]; NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
if (model.vipIcon) {//icon if (model.vipIcon) {//icon
[attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon]]; [attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon size:CGSizeMake(26, 26)]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
[attribute appendAttributedString:[self createTextAttribute:nick color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:nick color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
@@ -172,22 +172,19 @@
if ([self isCurrentRoomSuperAdmin:message.from]) { if ([self isCurrentRoomSuperAdmin:message.from]) {
[attribute appendAttributedString:[self createLocalImageAttribute:@"common_super_admin"]]; [attribute appendAttributedString:[self createLocalImageAttribute:@"common_super_admin"]];
} }
if (model.experUrl) { if (model.experUrl) {
[attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]]; [attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
if (model.charmUrl) { if (model.charmUrl) {
[attribute appendAttributedString:[self createUrlImageAttribute:model.charmUrl]]; [attribute appendAttributedString:[self createUrlImageAttribute:model.charmUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) { // if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) { //
[attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]]; [attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} else if (model.inRoomNameplatePic.length > 0) {// } else if (model.inRoomNameplatePic.length > 0) {//
[attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]]; [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic size:CGSizeMake(18, 18)]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
[attribute appendAttributedString:[self createTextAttribute:@"\n" color:[UIColor clearColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:@"\n" color:[UIColor clearColor] font:kRoomMessageDefalutFont]];
@@ -254,7 +251,7 @@
} }
if (extModel.vipIcon.length > 0) {//icon if (extModel.vipIcon.length > 0) {//icon
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon]]; [attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon size:CGSizeMake(26, 26)]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
if (extModel.experUrl.length > 0) {// if (extModel.experUrl.length > 0) {//
@@ -465,7 +462,7 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init]; NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
if (model.vipIcon) {//icon if (model.vipIcon) {//icon
[attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon]]; [attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon size:CGSizeMake(26, 26)]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
[attribute appendAttributedString:[self createTextAttribute:nick color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:nick color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
@@ -491,7 +488,7 @@
[attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]]; [attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} else if (model.inRoomNameplatePic.length > 0) {// } else if (model.inRoomNameplatePic.length > 0) {//
[attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]]; [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic size:CGSizeMake(18, 18)]];
[attribute appendAttributedString:[self createSapceAttribute:2]]; [attribute appendAttributedString:[self createSapceAttribute:2]];
} }
[attribute appendAttributedString:[self createTextAttribute:@"\n" color:[UIColor clearColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:@"\n" color:[UIColor clearColor] font:kRoomMessageDefalutFont]];
@@ -1413,20 +1410,44 @@
CGFloat bottom = (image.size.height - 1) / 2; CGFloat bottom = (image.size.height - 1) / 2;
return [image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:UIImageResizingModeStretch]; return [image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:UIImageResizingModeStretch];
} }
///
/// @param imageUrl
- (NSMutableAttributedString *)createUrlImageAttribute:(NSString *)imageUrl size:(CGSize)size{
NetImageConfig *config = [[NetImageConfig alloc]init];
if(![imageUrl hasPrefix:@"http"]){
config.placeHolder = kImage(imageUrl);
}
///
config.autoLoad = YES;
NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageUrl config:config];
UIImage* image = imageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
imageView.bounds = CGRectMake(0, 0, size.width * scale, size.height);
} else {
imageView.bounds = CGRectMake(0, 0, size.width, size.height);
}
imageView.layer.masksToBounds = YES;
imageView.contentMode = UIViewContentModeScaleAspectFit;
NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.bounds.size.width, imageView.bounds.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
return attrString;
}
/// ///
/// @param imageUrl /// @param imageUrl
- (NSMutableAttributedString *)createUrlImageAttribute:(NSString *)imageUrl { - (NSMutableAttributedString *)createUrlImageAttribute:(NSString *)imageUrl {
NetImageConfig *config = [[NetImageConfig alloc]init]; NetImageConfig *config = [[NetImageConfig alloc]init];
if(![imageUrl hasPrefix:@"http"]){
config.placeHolder = kImage(imageUrl);
}
/// ///
config.autoLoad = YES; config.autoLoad = YES;
NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageUrl config:config]; NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageUrl config:config];
UIImage* image = imageView.image; UIImage* image = imageView.image;
if (image) { if (image) {
CGFloat scale = image.size.width / image.size.height; CGFloat scale = image.size.width / image.size.height;
imageView.bounds = CGRectMake(0, 0, 14 * scale, 14); imageView.bounds = CGRectMake(0, 0, 16 * scale, 16);
} else { } else {
imageView.bounds = CGRectMake(0, 0, 14, 14); imageView.bounds = CGRectMake(0, 0, 16, 16);
} }
imageView.layer.masksToBounds = YES; imageView.layer.masksToBounds = YES;
imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.contentMode = UIViewContentModeScaleAspectFit;
@@ -1436,7 +1457,7 @@
- (NSMutableAttributedString *)createImageAttribute:(UIImage *)image { - (NSMutableAttributedString *)createImageAttribute:(UIImage *)image {
return [self createImageAttribute:image height:14]; return [self createImageAttribute:image height:16];
} }
/// ///