房间公屏聊天调整
This commit is contained in:
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 生成本地一个图片的富文本
|
/// 生成本地一个图片的富文本
|
||||||
|
Reference in New Issue
Block a user