From 5fa7595965608f06ed0b45c64566a8e3d6c1d70f Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Thu, 28 Nov 2024 20:39:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=93=AD=E7=89=8C?= =?UTF-8?q?=E7=9A=84=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tool/XPRoomMessageParser.m | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index af8126c6..58f36c0d 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -299,13 +299,17 @@ [attribute appendAttributedString:[self createSapceAttribute:2]]; } }else{ - if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) { //铭牌有图片加文字 + if (model.inRoomNameplatePic.length > 0) { //铭牌有图片加文字 [attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; - } else if (model.inRoomNameplatePic.length > 0) {//铭牌只有图片 - [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; } +// 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 createSapceAttribute:2]]; +// } else if (model.inRoomNameplatePic.length > 0) {//铭牌只有图片 +// [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]]; +// [attribute appendAttributedString:[self createSapceAttribute:2]]; +// } } [attribute appendAttributedString:[self createTextAttribute:nick color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; @@ -1392,12 +1396,12 @@ NetImageConfig *config = [[NetImageConfig alloc]init]; ///先这样吧 config.autoLoad = YES; - NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageName config:config]; + NetImageView *imageView = [[NetImageView alloc] initWithUrl:imageName config:config]; UIImage* image = imageView.image; - if (image) { - CGFloat scale = image.size.width / image.size.height; - imageView.bounds = CGRectMake(0, 0, 18 * scale, 18); - } else { +// if (image) { +// CGFloat scale = image.size.width / image.size.height; +// imageView.bounds = CGRectMake(0, 0, 18 * scale, 18); +// } else { // NSURL *imgUrl = [NSURL URLWithString:imageName]; // UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]]; // if (myImage) { @@ -1410,21 +1414,24 @@ // } else { imageView.bounds = CGRectMake(0, 0, 60, 18); // } - } +// } imageView.contentMode = UIViewContentModeScaleAspectFit; // 铭牌文字 - UILabel *label = [[UILabel alloc] init]; - label.textAlignment = NSTextAlignmentCenter; - label.font = [UIFont boldSystemFontOfSize:12]; - label.adjustsFontSizeToFitWidth = YES; - label.textColor = UIColor.whiteColor; - label.text = tagName; - [imageView addSubview:label]; - [label mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(27); - make.trailing.mas_equalTo(-8); - make.centerY.mas_equalTo(0); - }]; + if (![NSString isEmpty:tagName]) { + UILabel *label = [[UILabel alloc] init]; + label.textAlignment = NSTextAlignmentCenter; + label.font = [UIFont boldSystemFontOfSize:12]; + label.adjustsFontSizeToFitWidth = YES; + label.textColor = UIColor.whiteColor; + label.text = tagName; + [imageView addSubview:label]; + [label mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(27); + make.trailing.mas_equalTo(-8); + make.centerY.mas_equalTo(0); + }]; + } + NSMutableAttributedString *string = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:imageView.bounds.size alignToFont:[UIFont boldSystemFontOfSize:12] alignment:YYTextVerticalAlignmentCenter]; return string; } From 6b2dbee88c0c883e63e30166423a7d4813164333 Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Fri, 29 Nov 2024 16:46:36 +0800 Subject: [PATCH 2/7] =?UTF-8?q?temp=20save:=20=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E6=98=BE=E7=A4=BA=E8=81=8A=E5=A4=A9=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Model/XPMessageInfoModel.h | 3 + .../Model/XPMessageInfoModel.m | 30 +- .../Tool/XPRoomMessageConstant.h | 2 +- .../Tool/XPRoomMessageParser.m | 140 ++++----- .../View/XPNetImageYYLabel.m | 6 +- .../View/XPRoomMessageTableViewCell.m | 100 +++--- .../XPRoomMessageContainerView.m | 289 ++++++++++-------- YuMi/Modules/YMRoom/View/ThemeColor+Room.m | 3 +- 8 files changed, 325 insertions(+), 248 deletions(-) diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h index fc278c97..f16481e2 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN ///cell的高度 @property (nonatomic,assign) CGFloat rowHeight; @property (nonatomic,assign) CGFloat textWidth; +@property(nonatomic, strong) YYTextLayout *textLayout; @property(nonatomic, strong) NSMutableArray *extraSizeArray; ///文本内容的 @property (nonatomic,assign) CGFloat contentLeftMargin; @@ -43,6 +44,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *boomImageUrl; +@property(nonatomic, copy) NSString *cellKey; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m index df078949..a28a1e15 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m @@ -28,8 +28,30 @@ - (void)setContent:(NSAttributedString *)content { _content = content; - self.rowHeight = [self heightForAttributedText:content - maxWidth:kRoomMessageMaxWidth]; + CGSize size = [content boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) + options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin + context:nil].size; + + YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(size.width, CGFLOAT_MAX)]; + container.maximumNumberOfRows = 0; + container.truncationType = YYTextTruncationTypeEnd; + self.textLayout = [YYTextLayout layoutWithContainer:container text:content]; + + CGSize textSize = self.textLayout.textBoundingRect.size; +// CGFloat anotherHeight = [self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth]; + self.rowHeight = ceil(textSize.height) + self.contentTopMargin + self.contentBottomMargin + self.cellBottomMargin + 20; + if (![NSString isEmpty:self.bubbleImageUrl]) { + self.rowHeight += 30; + } else { + self.rowHeight += 10; + } + + if ([self.cellKey isEqualToString:@"ChatMessage"]) { + NSLog(@" ----- 11 ----- %@ : %@", [NSValue valueWithCGSize:textSize], [NSValue valueWithCGSize:[self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth]]); + } + +// self.rowHeight = [self heightForAttributedText:content +// maxWidth:kRoomMessageMaxWidth]; // CGFloat width = isMSRTL() ? 10 : 0; ////// width = self.vipIcon.length > 0 ? width + 15 : width; @@ -41,7 +63,7 @@ // self.rowHeight = rowHeight + width ; } -- (CGFloat)heightForAttributedStringUsingTextKit:(NSAttributedString *)attributedString +- (CGSize)heightForAttributedStringUsingTextKit:(NSAttributedString *)attributedString maxWidth:(CGFloat)maxWidth { NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:attributedString]; NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:CGSizeMake(maxWidth, CGFLOAT_MAX)]; @@ -52,7 +74,7 @@ // 让布局管理器计算文本高度 [layoutManager glyphRangeForTextContainer:textContainer]; - return ceil([layoutManager usedRectForTextContainer:textContainer].size.height); // 向上取整 + return [layoutManager usedRectForTextContainer:textContainer].size; } - (CGFloat)heightForAttributedText:(NSAttributedString *)attributedText maxWidth:(CGFloat)maxWidth { diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageConstant.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageConstant.h index 8a682b25..d7de4c41 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageConstant.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageConstant.h @@ -10,7 +10,7 @@ #ifndef XPRoomMessageConstant_h #define XPRoomMessageConstant_h -#define kRoomMessageMaxWidth (KScreenWidth - 15 - 90) +#define kRoomMessageMaxWidth (KScreenWidth - 15 - 90 - 8) ///公屏文本字体的大小 static CGFloat kRoomMessageDefalutFont = 15; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 58f36c0d..685e9433 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -59,29 +59,6 @@ @implementation XPRoomMessageParser -- (XPMessageInfoModel*)parseMessageAttributeForChatHall:(NIMMessage *)message{ - NIMMessageType messageType = message.messageType; - XPMessageInfoModel * messageInfo = [[XPMessageInfoModel alloc] init]; - messageInfo.isChatHall = YES; - switch (messageType) { - case NIMMessageTypeText: - { - XPMessageInfoModel *model = [self makeChatAttribute:message messageInfo:messageInfo]; - return model != nil ? model : [XPMessageInfoModel new]; - break; - } - - case NIMMessageTypeCustom: - { - XPMessageInfoModel *model = [self makeCustomAttribute:message messageInfo:messageInfo]; - return model != nil ? model : [XPMessageInfoModel new]; - break; - } - default: - return [XPMessageInfoModel new]; - } -} - - (XPMessageInfoModel*)parseBroadcastMessageAttribute:(NIMBroadcastMessage *)message { if (message.content) { NSDictionary *msgDictionary = [message.content toJSONObject]; @@ -278,72 +255,56 @@ if ([self isCurrentRoomSuperAdmin:message.from]) { [attribute appendAttributedString:[self createLanguageImageAttribute:@"common_super_admin"]]; } - if (![NSString isEmpty:model.experUrl]) { + messageInfo.experUrl = model.experUrl; [attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; } - if (![NSString isEmpty:model.charmUrl]) {//等级 + messageInfo.charmUrl = model.charmUrl; [attribute appendAttributedString:[self createUrlImageAttribute:model.charmUrl]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; } - if (![NSString isEmpty:model.vipIcon]) { + messageInfo.vipIcon = model.vipIcon; [attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; } - if(model.isCustomWord == YES){ - if (model.inRoomNameplatePic.length > 0){ - [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; - } - }else{ - if (model.inRoomNameplatePic.length > 0) { //铭牌有图片加文字 - [attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; - } -// 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 createSapceAttribute:2]]; -// } else if (model.inRoomNameplatePic.length > 0) {//铭牌只有图片 -// [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]]; -// [attribute appendAttributedString:[self createSapceAttribute:2]]; -// } + if (model.inRoomNameplatePic.length > 0) { + [attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic + size:CGSizeMake(60, kFontRegular(kRoomMessageDefalutFont).lineHeight)]]; + [attribute appendAttributedString:[self createSapceAttribute:2]]; } - [attribute appendAttributedString:[self createTextAttribute:nick color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; + [attribute appendAttributedString:[self createTextAttribute:nick color:[UIColor colorWithWhite:1 alpha:0.7] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; id nickNameNifo = message.remoteExt[@"atNames"]; - NSMutableAttributedString *msgStr; + if (message.text) { - if(messageInfo.isChatHall == YES){ - QEmotionHelper *faceManager = [QEmotionHelper sharedEmotionHelper]; - msgStr = [faceManager attributedStringByText:message.text font:[UIFont systemFontOfSize:kRoomMessageDefalutFont]]; - [msgStr addAttributes:@{NSForegroundColorAttributeName: [DJDKMIMOMColor messageTextColor]} range:[msgStr.string rangeOfString:msgStr.string]]; - - }else{ - msgStr = [[NSMutableAttributedString alloc] initWithString:message.text]; - [msgStr addAttribute:NSForegroundColorAttributeName - value:[DJDKMIMOMColor messageTextColor] - range:NSMakeRange(0, msgStr.length)]; - if ([nickNameNifo isKindOfClass:[NSArray class]]) { - for (NSString *nick in nickNameNifo) { - NSRange range = [message.text rangeOfString:nick]; - if (range.length) { - [msgStr yy_setTextHighlightRange:range color:UIColorFromRGB(0xFD85C9) backgroundColor:[UIColor clearColor] userInfo:nil]; - } + NSMutableAttributedString *msgStr; + msgStr = [[NSMutableAttributedString alloc] initWithString:message.text]; + [msgStr addAttribute:NSForegroundColorAttributeName + value:[DJDKMIMOMColor messageTextColor] + range:NSMakeRange(0, msgStr.length)]; + [msgStr addAttribute:NSFontAttributeName + value:kFontRegular(kRoomMessageDefalutFont) + range:NSMakeRange(0, msgStr.length)]; + if ([nickNameNifo isKindOfClass:[NSArray class]]) { + for (NSString *nick in nickNameNifo) { + NSRange range = [message.text rangeOfString:nick]; + if (range.length) { + [msgStr yy_setTextHighlightRange:range color:UIColorFromRGB(0xFD85C9) backgroundColor:[UIColor clearColor] userInfo:nil]; } } } [attribute appendAttributedString:msgStr]; } - if(messageInfo.isChatHall == NO){ - [self attributeAddLongPressHihtLight:attribute uid:message.from nick:((NIMMessageChatroomExtension *)message.messageExt).roomNickname]; - } + + [self attributeAddLongPressHihtLight:attribute uid:message.from nick:((NIMMessageChatroomExtension *)message.messageExt).roomNickname]; + messageInfo.cellKey = @"ChatMessage"; messageInfo.content = attribute; - messageInfo.vipIcon = model.vipIcon; + return messageInfo; } @@ -580,7 +541,6 @@ if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){ [attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage]; } - } } messageInfo.content = attribute; @@ -1392,15 +1352,42 @@ #pragma mark - private base methods ///铭牌 -- (NSMutableAttributedString *)createNameplateAttibute:(NSString *)tagName image:(NSString *)imageName textFont:(UIFont *)textFont { +- (NSMutableAttributedString *)createNameplateAttibute:(NSString *)tagName + image:(NSString *)imageName + textFont:(UIFont *)textFont { NetImageConfig *config = [[NetImageConfig alloc]init]; ///先这样吧 + CGSize defaultSize = CGSizeMake(60, kFontRegular(kRoomMessageDefalutFont).lineHeight); config.autoLoad = YES; NetImageView *imageView = [[NetImageView alloc] initWithUrl:imageName config:config]; - UIImage* image = imageView.image; + imageView.bounds = CGRectMake(0, 0, defaultSize.width, defaultSize.height); + + // 异步加载图片 + @kWeakify(self); + [imageView loadImageWithUrl:imageName completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { + @kStrongify(self); + if (image) { + CGFloat scale = image.size.width / image.size.height; + CGSize newSize = scale > 0 ? CGSizeMake(60 * scale, kFontRegular(kRoomMessageDefalutFont).lineHeight) : defaultSize; + dispatch_async(dispatch_get_main_queue(), ^{ + imageView.bounds = CGRectMake(0, 0, newSize.width, newSize.height); + }); + } + }]; +// [imageView loadImageWithUrl:imageName completion:^(UIImage * _Nullable loadedImage) { +// @kStrongify(self); +// if (loadedImage) { +// CGFloat scale = loadedImage.size.width / loadedImage.size.height; +// CGSize newSize = scale > 0 ? CGSizeMake(18 * scale, 18) : defaultSize; +// dispatch_async(dispatch_get_main_queue(), ^{ +// imageView.bounds = CGRectMake(0, 0, newSize.width, newSize.height); +// }); +// } +// }]; + +// UIImage* image = imageView.image; // if (image) { // CGFloat scale = image.size.width / image.size.height; -// imageView.bounds = CGRectMake(0, 0, 18 * scale, 18); // } else { // NSURL *imgUrl = [NSURL URLWithString:imageName]; // UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]]; @@ -1412,9 +1399,10 @@ // imageView.bounds = CGRectMake(0, 0, 18* scale, 18); // } // } else { - imageView.bounds = CGRectMake(0, 0, 60, 18); +// imageView.bounds = CGRectMake(0, 0, 60, 18); // } // } + imageView.contentMode = UIViewContentModeScaleAspectFit; // 铭牌文字 if (![NSString isEmpty:tagName]) { @@ -1432,7 +1420,11 @@ }]; } - NSMutableAttributedString *string = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:imageView.bounds.size alignToFont:[UIFont boldSystemFontOfSize:12] alignment:YYTextVerticalAlignmentCenter]; + NSMutableAttributedString *string = [NSMutableAttributedString yy_attachmentStringWithContent:imageView + contentMode:UIViewContentModeScaleAspectFit + attachmentSize:imageView.bounds.size + alignToFont:kFontRegular(kRoomMessageDefalutFont) + alignment:YYTextVerticalAlignmentCenter]; return string; } @@ -1453,7 +1445,7 @@ } 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]; + NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.bounds.size.width, imageView.bounds.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attrString; } /// 生成一个图片的富文本 @@ -1467,7 +1459,7 @@ 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]; + NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.bounds.size.width, imageView.bounds.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attrString; } @@ -1481,7 +1473,7 @@ imaveView.image = [UIImage imageNamed:imageName]; CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height; imaveView.bounds = CGRectMake(0, 0, 16 * scale, 16); - NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter]; + NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attrString; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m index 6f0097a4..555024b4 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m @@ -68,7 +68,11 @@ size = CGSizeMake(16, 16); imageView.bounds = CGRectMake(0, 0, 16, 16); } - NSMutableAttributedString * replaceAttr = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:size alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter]; + NSMutableAttributedString * replaceAttr = [NSMutableAttributedString yy_attachmentStringWithContent:imageView + contentMode:UIViewContentModeScaleAspectFit + attachmentSize:size + alignToFont:kFontRegular(kRoomMessageDefalutFont) + alignment:YYTextVerticalAlignmentCenter]; [attributes replaceCharactersInRange:range withAttributedString:replaceAttr]; return attributes; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index 9e3821ab..27464366 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -41,8 +41,11 @@ #pragma mark - Private Method - (void)initSubViews { + self.clipsToBounds = NO; + self.contentView.clipsToBounds = NO; + self.selectionStyle = UITableViewCellSelectionStyleNone; - self.backgroundColor = [UIColor clearColor]; + self.backgroundColor = [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:0.4];//[UIColor clearColor]; [self.contentView addSubview:self.bubbleImageView]; [self.contentView addSubview:self.contentLabel]; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTap)]; @@ -56,19 +59,16 @@ - (void)initSubViewConstraints { [self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.contentLabel).offset(-12); - make.top.mas_equalTo(self.contentLabel).offset(-10); - make.bottom.mas_equalTo(self.contentLabel).offset(10); - make.trailing.mas_equalTo(self.contentLabel).offset(10); + make.leading.mas_equalTo(self.contentLabel).offset(-20); + make.top.mas_equalTo(self.contentLabel).offset(-10); + make.bottom.mas_equalTo(self.contentLabel);//.offset(10); + make.trailing.mas_equalTo(self.contentLabel).offset(20); }]; [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(12); make.bottom.mas_equalTo(-20); make.top.mas_equalTo(10); - if (isMSRTL()) { - make.width.mas_equalTo(20); - } }]; } @@ -129,50 +129,79 @@ } #pragma mark - Getters And Setters - (void)setMessageInfo:(XPMessageInfoModel *)messageInfo { + if ([messageInfo.content isEqualToAttributedString:_messageInfo.content]) { + return; + } _messageInfo = messageInfo; - if (_messageInfo) { - self.contentLabel.attributedText = _messageInfo.content; + if (messageInfo) { + +// [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { +// make.leading.mas_equalTo(self.bubbleImageView).offset(_messageInfo.contentLeftMargin); +// make.top.mas_equalTo(self.bubbleImageView).offset(_messageInfo.contentTopMargin); +// make.bottom.mas_equalTo(self.bubbleImageView).offset(-_messageInfo.contentBottomMargin); +// }]; + + self.contentLabel.attributedText = messageInfo.content; +// self.contentLabel.textLayout = messageInfo.textLayout; - if (_messageInfo.bubbleImageUrl.length) { + if (messageInfo.bubbleImageUrl.length) { @kWeakify(self); - [self.bubbleImageView loadImageWithUrl:_messageInfo.bubbleImageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + [self.bubbleImageView loadImageWithUrl:messageInfo.bubbleImageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { @kStrongify(self); UIImage *image1 = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp]; UIImage *cutImage = [image1 cropRightAndBottomPixels:2]; self.bubbleImageView.image = [self resizableImage:cutImage]; }]; - } - - if (self.isLeftBigImage) { - self.leftBigImageView.imageUrl = messageInfo.boomImageUrl; - [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); - make.trailing.mas_equalTo(-self.messageInfo.contentRightMargin - 8); -// make.centerY.mas_equalTo(self.contentView); - make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin); - make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin); -// if (isMSRTL()) { -// make.width.mas_equalTo([self RTLLabelWidth] - 65); -// } - }]; - } else { - [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentLeftMargin); - make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin); - make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin); + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentLeftMargin + 12); +// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin+20); +// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin-10); + make.top.mas_equalTo(-10); + make.bottom.mas_equalTo(0); if (isMSRTL()) { // MARK: 可能会有性能问题,但源代码已经使用了更新 layout 的方案,推测是头像框和气泡会导致卡顿 - make.width.mas_equalTo([self RTLLabelWidth]); + make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth]); } }]; + } else { + self.bubbleImageView.image = [UIImage imageWithColor:[DJDKMIMOMColor messageBubbleColor]]; + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView).inset(10); +// make.leading.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentLeftMargin + 12); +// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin+10); +// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin-20); +// if (isMSRTL()) { // MARK: 可能会有性能问题,但源代码已经使用了更新 layout 的方案,推测是头像框和气泡会导致卡顿 +// make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth]); +// } + }]; } + +// if (self.isLeftBigImage) { +// self.leftBigImageView.imageUrl = messageInfo.boomImageUrl; +// [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { +// make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); +// make.trailing.mas_equalTo(-self.messageInfo.contentRightMargin - 8); +//// make.centerY.mas_equalTo(self.contentView); +// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin); +// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin); +//// if (isMSRTL()) { +//// make.width.mas_equalTo([self RTLLabelWidth] - 65); +//// } +// }]; +// } else { + +// } - _bubbleImageView.hidden = _messageInfo.isHiddenBubble; -// [self layoutIfNeeded]; +// _bubbleImageView.hidden = _messageInfo.isHiddenBubble; + [self layoutIfNeeded]; } } - (CGFloat)RTLLabelWidth { - return MIN(self.contentLabel.textWidth + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, self.contentLabel.maxWidth); + CGSize size = [self.contentLabel.attributedText boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) + options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin + context:nil].size; + NSLog(@" ----- 11 ----- %@", [NSValue valueWithCGSize:size]); + return MIN(ceil(size.width) + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, self.contentLabel.maxWidth); } - (UIImage *)scaleToSize:(UIImage *)img { @@ -207,6 +236,7 @@ - (NetImageView *)bubbleImageView { if (!_bubbleImageView) { _bubbleImageView = [[NetImageView alloc] init]; + _bubbleImageView.clipsToBounds = NO; _bubbleImageView.userInteractionEnabled = YES; _bubbleImageView.layer.masksToBounds = YES; _bubbleImageView.layer.cornerRadius = 7; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 3600ad6b..6393a44a 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -105,7 +105,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; - (void)changeType:(NSInteger)type { self.displayType = type; - [self updateAllDataSource]; +// [self updateAllDataSource]; [self.messageTableView reloadData]; if (self.displayType == 1) { @@ -119,11 +119,15 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; }); } -- (void)updateAllDataSource { - self.datasource_chat = @[].mutableCopy; - self.datasource_gift = @[].mutableCopy; - - for (XPMessageInfoModel *model in self.datasource) { +/// 更新其他 tag 的数据源,若传入空数组,则初始化并从 datasource 中获取数据 +- (void)updateAllDataSource:(NSArray *)datas { + if (!datas || datas.count == 0) { + self.datasource_chat = @[].mutableCopy; + self.datasource_gift = @[].mutableCopy; + datas = self.datasource; + } + + for (XPMessageInfoModel *model in datas) { switch (model.first) { case NIMMessageTypeText: [self.datasource_chat addObject:model]; @@ -198,7 +202,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; [self.datasource removeObjectsInArray:needRemoveMsgArray]; - [self updateAllDataSource]; + [self updateAllDataSource:nil]; NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; for (int i = 0; i indexPath.row) { @@ -306,6 +313,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; #pragma mark - Private Method - (void)initSubViews { + self.clipsToBounds = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addCustomMessage:) name:@"message" object:nil]; [self addSubview:self.messageTableView]; [self addSubview:self.messageTipsBtn]; @@ -379,7 +387,6 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } } - if (self.isPending) { self.messageTipsBtn.hidden = NO; [self findAtMeNumber]; @@ -402,26 +409,26 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; [self.datasource removeObjectsInArray:needRemoveMsgArray]; } - // 执行插入 - // for (NIMMessage *item in self.incomingMessages) { - // XPMessageInfoModel *model = [self.messageParser parseMessageAttribute:item]; - // [self.datasource addObject:model]; - // } + + NSMutableArray *tempArray = @[].mutableCopy; + @kWeakify(self); [self.incomingMessages enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + @kStrongify(self); + id model = nil; if ([obj isKindOfClass:[NIMMessage class]]) { - XPMessageInfoModel *model = [self.messageParser parseMessageAttribute:(NIMMessage *)obj]; - [self.datasource addObject:model]; + model = [self.messageParser parseMessageAttribute:(NIMMessage *)obj]; } else if ([obj isKindOfClass:[NIMBroadcastMessage class]]) { - XPMessageInfoModel *model = [self.messageParser parseBroadcastMessageAttribute:(NIMBroadcastMessage *)obj]; - if (model) { - [self.datasource addObject:model]; - } + model = [self.messageParser parseBroadcastMessageAttribute:(NIMBroadcastMessage *)obj]; + } + if (model) { + [tempArray addObject:model]; + [self.datasource addObject:model]; } }]; - [self updateAllDataSource]; - [self.incomingMessages removeAllObjects]; + + [self updateAllDataSource:tempArray]; [self.messageTableView reloadData]; //执行插入动画并滚动 @@ -746,9 +753,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { AttachmentModel *attachment = (AttachmentModel *)obj.attachment; - if (attachment.first == CustomMessageType_Update_RoomInfo && attachment.second == Custom_Message_Sub_Update_RoomInfo_MessageState) { + if (attachment.first == CustomMessageType_Update_RoomInfo && + attachment.second == Custom_Message_Sub_Update_RoomInfo_MessageState) { [self.datasource removeAllObjects]; - [self updateAllDataSource]; + [self updateAllDataSource:nil]; [self.incomingMessages removeAllObjects]; [self.locationArray removeAllObjects]; self.atCount = 0; @@ -758,9 +766,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; [[XPRoomMiniManager shareManager] resetLocalMessage]; [self addRoomMessage:message]; return; - } else if (attachment.first == CustomMessageType_Update_RoomInfo && attachment.second == Custom_Message_Sub_Update_RoomInfo_CleanScreen) { + } else if (attachment.first == CustomMessageType_Update_RoomInfo && + attachment.second == Custom_Message_Sub_Update_RoomInfo_CleanScreen) { [self.datasource removeAllObjects]; - [self updateAllDataSource]; + [self updateAllDataSource:nil]; [self.incomingMessages removeAllObjects]; [self.locationArray removeAllObjects]; self.atCount = 0; @@ -770,7 +779,8 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; [[XPRoomMiniManager shareManager] resetLocalMessage]; [self addRoomMessage:message]; return; - } else if(attachment.first == CustomMessageType_Candy_Tree && attachment.second == Custom_Message_Sub_Candy_Tree_Me) { + } else if(attachment.first == CustomMessageType_Candy_Tree && + attachment.second == Custom_Message_Sub_Candy_Tree_Me) { CandyTreeGiftInfoModel * model = [CandyTreeGiftInfoModel modelWithDictionary:attachment.data]; if (model.uid.integerValue != [AccountInfoStorage instance].getUid.integerValue) { return; @@ -862,6 +872,50 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } } +- (void)handleFetchNewestMessage:(NIMMessage *)message { + RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; + NSString *roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; + NIMHistoryMessageSearchOption *option = [[NIMHistoryMessageSearchOption alloc] init]; + option.limit = [ClientConfig shareConfig].configInfo.roomMessageCount; + option.order = NIMMessageSearchOrderDesc; + option.messageTypes = @[@(NIMMessageTypeText),@(NIMMessageTypeCustom)]; + @kWeakify(self); + [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId + option:option + result:^(NSError * _Nullable error, NSArray * _Nullable messages) { + @kStrongify(self); + if(error != nil){ + self.isLoadHistoryMessage = NO; + } + if (self.datasource.count > kRoomMessageMaxLength) { + NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; + NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; + [self.datasource removeObjectsInArray:needRemoveMsgArray]; + } + // 执行插入 + for (NIMMessage *item in messages.reverseObjectEnumerator) { + [self dealWithHistoryDataWithMessage:item]; + } + self.isLoadHistoryMessage = NO; + BOOL hideEnter = [self handleHideEnter:message]; + if (!hideEnter) { + ///插入进房消息及房间公告提示 + [self addRoomMessage:message]; + } + if (!roomInfo.hasAnimationEffect) { + [self roomInfoNoGiftAnimationMessage:message]; + } + [self createUserEnterRoomAddRoomTopicMessage]; + + [self updateAllDataSource:nil]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.messageTableView reloadData]; + [self scrollToBottom:YES]; + }); + }]; +} + - (void)handleFetchHistoryMessage:(NIMMessage *)message { RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; NSString *roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; @@ -870,79 +924,45 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; option.startTime = self.hostDelegate.getRoomInfo.clearScreenTime / 1000.0; option.order = NIMMessageSearchOrderAsc; option.messageTypes = @[@(NIMMessageTypeText),@(NIMMessageTypeCustom)]; - [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId option:option result:^(NSError * _Nullable error, NSArray * _Nullable messages) { + [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId + option:option + result:^(NSError * _Nullable error, NSArray * _Nullable messages) { if(error != nil){ - self.isLoadHistoryMessage = NO; + self.isLoadHistoryMessage = NO; } if (messages.count) { //如果拉取的数量等于请求的数量,说明这个时间点以后的消息数量大于等于需要拉取的数量,直接拉取最新的50条 if (messages.count == [ClientConfig shareConfig].configInfo.roomMessageCount) { - NIMHistoryMessageSearchOption *option = [[NIMHistoryMessageSearchOption alloc] init]; - option.limit = [ClientConfig shareConfig].configInfo.roomMessageCount; - option.order = NIMMessageSearchOrderDesc; - option.messageTypes = @[@(NIMMessageTypeText),@(NIMMessageTypeCustom)]; - @kWeakify(self); - [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId option:option result:^(NSError * _Nullable error, NSArray * _Nullable messages) { - @kStrongify(self); - if(error != nil){ - self.isLoadHistoryMessage = NO; - } - if (self.datasource.count > kRoomMessageMaxLength) { - NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; - NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; - [self.datasource removeObjectsInArray:needRemoveMsgArray]; - } - // 执行插入 - for (NIMMessage *item in messages.reverseObjectEnumerator) { - [self dealWithHistoryDataWithMessage:item]; - } - self.isLoadHistoryMessage = NO; - BOOL hideEnter = [self handleHideEnter:message]; - if (!hideEnter) { - ///插入进房消息及房间公告提示 - [self addRoomMessage:message]; - } - if (!roomInfo.hasAnimationEffect) { - [self roomInfoNoGiftAnimationMessage:message]; - } - [self createUserEnterRoomAddRoomTopicMessage]; + [self handleFetchNewestMessage:message]; + } else { + if (self.datasource.count > kRoomMessageMaxLength) { + NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; + NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; + [self.datasource removeObjectsInArray:needRemoveMsgArray]; + } + // 执行插入 + for (NIMMessage *item in messages) { + [self dealWithHistoryDataWithMessage:item]; + } - [self updateAllDataSource]; + self.isLoadHistoryMessage = NO; + BOOL hideEnter = [self handleHideEnter:message]; + if (!hideEnter) { + ///插入进房消息及房间公告提示 + [self addRoomMessage:message]; + } + if (!roomInfo.hasAnimationEffect) { + [self roomInfoNoGiftAnimationMessage:message]; + } + [self createUserEnterRoomAddRoomTopicMessage]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.messageTableView reloadData]; - [self scrollToBottom:YES]; - }); - }]; - return; - } - if (self.datasource.count > kRoomMessageMaxLength) { - NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; - NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; - [self.datasource removeObjectsInArray:needRemoveMsgArray]; - } - // 执行插入 - for (NIMMessage *item in messages) { - [self dealWithHistoryDataWithMessage:item]; - } + [self updateAllDataSource:nil]; - self.isLoadHistoryMessage = NO; - BOOL hideEnter = [self handleHideEnter:message]; - if (!hideEnter) { - ///插入进房消息及房间公告提示 - [self addRoomMessage:message]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.messageTableView reloadData]; + [self scrollToBottom:YES]; + }); } - if (!roomInfo.hasAnimationEffect) { - [self roomInfoNoGiftAnimationMessage:message]; - } - [self createUserEnterRoomAddRoomTopicMessage]; - - [self updateAllDataSource]; - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.messageTableView reloadData]; - [self scrollToBottom:YES]; - }); }else{ dispatch_async(dispatch_get_main_queue(), ^{///回到主线程 self.isLoadHistoryMessage = NO; @@ -1013,20 +1033,22 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; self.isLoadHistoryMessage = NO; ///最小化进房 不需要请求任何接口 但是如果不加延迟的话 无法滚动到底部 原因还不知道 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + NSMutableArray *tempArray = @[].mutableCopy; NSArray * temArray = [XPRoomMiniManager shareManager].getLocalCurrentRoomMessage; [temArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + id model = nil; if ([obj isKindOfClass:[NIMMessage class]]) { - XPMessageInfoModel *model = [self.messageParser parseMessageAttribute:(NIMMessage *)obj]; - [self.datasource addObject:model]; + model = [self.messageParser parseMessageAttribute:(NIMMessage *)obj]; } else if ([obj isKindOfClass:[NIMBroadcastMessage class]]) { - XPMessageInfoModel *model = [self.messageParser parseBroadcastMessageAttribute:(NIMBroadcastMessage *)obj]; - if (model) { - [self.datasource addObject:model]; - } + model = [self.messageParser parseBroadcastMessageAttribute:(NIMBroadcastMessage *)obj]; + } + if (model) { + [tempArray addObject:model]; + [self.datasource addObject:model]; } }]; - [self updateAllDataSource]; + [self updateAllDataSource:tempArray]; [self.messageTableView reloadData]; //执行插入动画并滚动 [self scrollToBottom:YES]; @@ -1096,34 +1118,35 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; #pragma mark - UITableViewDelegate And UITableViewDataSource -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - NSArray *source = @[]; - switch (self.displayType) { - case 1: - source = self.datasource; - break; - case 2: - source = self.datasource_chat; - break; - case 3: - source = self.datasource_gift; - break; - - default: - source = self.datasource; - break; - } - - XPMessageInfoModel *model = [source xpSafeObjectAtIndex:indexPath.row]; - - // 如果 model 中有高度数据,使用 model 的高度 - if (model.rowHeight > 0) { - return model.rowHeight; - } - - // 否则,使用自适应高度 - return UITableViewAutomaticDimension; -} +//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { +// NSArray *source = @[]; +// switch (self.displayType) { +// case 1: +// source = self.datasource; +// break; +// case 2: +// source = self.datasource_chat; +// break; +// case 3: +// source = self.datasource_gift; +// break; +// +// default: +// source = self.datasource; +// break; +// } +// +// XPMessageInfoModel *model = [source xpSafeObjectAtIndex:indexPath.row]; +// +// // 如果 model 中有高度数据,使用 model 的高度 +// if (model.rowHeight > 0) { +// return model.rowHeight; +// } +// +// // 否则,使用自适应高度 +// return 100; +//// return UITableViewAutomaticDimension; +//} - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { switch (self.displayType) { @@ -1161,7 +1184,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; break; } XPMessageInfoModel *model = [source xpSafeObjectAtIndex:indexPath.row]; - NSString *cellKey = NSStringFromClass([XPRoomMessageTableViewCell class]); + NSString *cellKey = [NSString isEmpty:model.cellKey] ? NSStringFromClass([XPRoomMessageTableViewCell class]) : model.cellKey; if(model.first == CustomMessageType_Room_Album){ PIRoomMessagePhotoAlbumCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([PIRoomMessagePhotoAlbumCell class])]; cell.delegate = self; @@ -1182,7 +1205,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; return cell; } -- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { +//- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { // NSArray *source = @[]; // switch (self.displayType) { // case 1: @@ -1203,7 +1226,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; // if (model.rowHeight == 0) { // model.rowHeight = CGRectGetHeight(cell.frame); // } -} +//} #pragma mark - XPRoomMessageTableViewCellDelegate @@ -1313,18 +1336,20 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; _messageTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _messageTableView.delegate = self; _messageTableView.dataSource = self; - _messageTableView.rowHeight = UITableViewAutomaticDimension; - _messageTableView.estimatedRowHeight = 44; // 预估高度 +// _messageTableView.rowHeight = UITableViewAutomaticDimension; +// _messageTableView.estimatedRowHeight = 44; // 预估高度 _messageTableView.tableFooterView = [UIView new]; _messageTableView.separatorStyle = UITableViewCellSeparatorStyleNone; _messageTableView.backgroundColor = [UIColor clearColor]; _messageTableView.showsVerticalScrollIndicator = NO; + _messageTableView.clipsToBounds = NO; _messageTableView.tag = 666; if (@available(iOS 11.0, *)) { _messageTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } [_messageTableView registerClass:[XPRoomMessageTableViewCell class] forCellReuseIdentifier:@"XPRoomMessageTableViewCell_Boom"]; [_messageTableView registerClass:[XPRoomMessageTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPRoomMessageTableViewCell class])]; + [_messageTableView registerClass:[XPRoomMessageTableViewCell class] forCellReuseIdentifier:@"ChatMessage"]; [_messageTableView registerClass:[PIRoomMessagePhotoAlbumCell class] forCellReuseIdentifier:NSStringFromClass([PIRoomMessagePhotoAlbumCell class])]; } diff --git a/YuMi/Modules/YMRoom/View/ThemeColor+Room.m b/YuMi/Modules/YMRoom/View/ThemeColor+Room.m index 2665c7aa..4de685af 100644 --- a/YuMi/Modules/YMRoom/View/ThemeColor+Room.m +++ b/YuMi/Modules/YMRoom/View/ThemeColor+Room.m @@ -53,7 +53,8 @@ ///公屏默认背景的颜色 + (UIColor *)messageBubbleColor { - return UIColorRGBAlpha(0xFFFFFF, 0.15); +// return UIColorRGBAlpha(0xFFFFFF, 0.15); + return UIColorRGBAlpha(0x000000, 0.35); } ///公屏文字的颜色 + (UIColor *)messageTextColor { From c77bb17b03a8c07c987c126b21bed8bc8c11499e Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Fri, 29 Nov 2024 21:50:24 +0800 Subject: [PATCH 3/7] =?UTF-8?q?temp=20save:=20=E6=9B=B4=E5=A5=BD=E7=9A=84?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Model/XPMessageInfoModel.m | 19 +-- .../View/XPNetImageYYLabel.m | 12 +- .../View/XPRoomMessageTableViewCell.m | 125 ++++++++++++++---- .../XPRoomMessageContainerView.m | 58 ++++---- 4 files changed, 142 insertions(+), 72 deletions(-) diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m index a28a1e15..3efc09fc 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m @@ -38,17 +38,18 @@ self.textLayout = [YYTextLayout layoutWithContainer:container text:content]; CGSize textSize = self.textLayout.textBoundingRect.size; -// CGFloat anotherHeight = [self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth]; - self.rowHeight = ceil(textSize.height) + self.contentTopMargin + self.contentBottomMargin + self.cellBottomMargin + 20; - if (![NSString isEmpty:self.bubbleImageUrl]) { - self.rowHeight += 30; - } else { - self.rowHeight += 10; - } +// CGFloat anotherHeight = [self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth].height; - if ([self.cellKey isEqualToString:@"ChatMessage"]) { - NSLog(@" ----- 11 ----- %@ : %@", [NSValue valueWithCGSize:textSize], [NSValue valueWithCGSize:[self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth]]); + if ([NSString isEmpty:self.bubbleImageUrl]) { + self.rowHeight = ceil(textSize.height) + self.cellBottomMargin + self.contentTopMargin + 20; + } else { + self.rowHeight = ceil(textSize.height) + self.contentTopMargin + self.contentBottomMargin + self.cellBottomMargin + 20; } + self.rowHeight += 10; + +// if ([self.cellKey isEqualToString:@"ChatMessage"]) { +// NSLog(@" ----- 11 ----- %@ : %@", [NSValue valueWithCGSize:textSize], [NSValue valueWithCGSize:[self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth]]); +// } // self.rowHeight = [self heightForAttributedText:content // maxWidth:kRoomMessageMaxWidth]; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m index 555024b4..7a20ccf6 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m @@ -14,9 +14,9 @@ - (void)setAttributedText:(NSAttributedString *)attributedText { NSMutableAttributedString* attributedTextCopy = [attributedText mutableCopy]; - CGSize maxSize = CGSizeMake(kRoomMessageMaxWidth - 24, MAXFLOAT); - - self.maxWidth = maxSize.width - 8; + + CGSize maxSize = CGSizeMake(kRoomMessageMaxWidth, MAXFLOAT); + self.maxWidth = maxSize.width; CGSize size = [attributedText boundingRectWithSize:maxSize options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin @@ -50,7 +50,7 @@ } } - self.textWidth = layout.textBoundingRect.size.width; + self.textWidth = layout.textBoundingRect.size.width + 12; [super setAttributedText:attributedTextCopy]; } @@ -65,8 +65,8 @@ size = CGSizeMake(imageView.bounds.size.height * scale, imageView.bounds.size.height); imageView.bounds = CGRectMake(0, 0, size.width, size.height); }else{ - size = CGSizeMake(16, 16); - imageView.bounds = CGRectMake(0, 0, 16, 16); + size = CGSizeMake(18, 18); + imageView.bounds = CGRectMake(0, 0, 18, 18); } NSMutableAttributedString * replaceAttr = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index 27464366..ea32b006 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -27,6 +27,8 @@ @property (nonatomic,strong) XPNetImageYYLabel *contentLabel; ///点击空白区域的手势 @property (nonatomic,strong) UITapGestureRecognizer *tapEmptyRecognizer; + +@property(nonatomic, strong) UIVisualEffectView *blurEffectView; @end @implementation XPRoomMessageTableViewCell @@ -45,8 +47,9 @@ self.contentView.clipsToBounds = NO; self.selectionStyle = UITableViewCellSelectionStyleNone; - self.backgroundColor = [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:0.4];//[UIColor clearColor]; + self.backgroundColor = [UIColor clearColor]; [self.contentView addSubview:self.bubbleImageView]; + [self.contentView addSubview:self.blurEffectView]; [self.contentView addSubview:self.contentLabel]; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTap)]; tap.delegate = self; @@ -59,9 +62,9 @@ - (void)initSubViewConstraints { [self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.contentLabel).offset(-20); - make.top.mas_equalTo(self.contentLabel).offset(-10); - make.bottom.mas_equalTo(self.contentLabel);//.offset(10); + make.leading.mas_equalTo(self.contentLabel).offset(-16); + make.top.mas_equalTo(self.contentLabel).offset(0); + make.bottom.mas_equalTo(self.contentLabel).offset(10); make.trailing.mas_equalTo(self.contentLabel).offset(20); }]; @@ -70,6 +73,10 @@ make.bottom.mas_equalTo(-20); make.top.mas_equalTo(10); }]; + + [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.bubbleImageView); + }]; } - (void)setIsLeftBigImage:(BOOL)isLeftBigImage { @@ -144,34 +151,59 @@ self.contentLabel.attributedText = messageInfo.content; // self.contentLabel.textLayout = messageInfo.textLayout; - if (messageInfo.bubbleImageUrl.length) { + if (![NSString isEmpty:messageInfo.bubbleImageUrl]) { + self.blurEffectView.hidden = YES; @kWeakify(self); [self.bubbleImageView loadImageWithUrl:messageInfo.bubbleImageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { @kStrongify(self); UIImage *image1 = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp]; UIImage *cutImage = [image1 cropRightAndBottomPixels:2]; self.bubbleImageView.image = [self resizableImage:cutImage]; + + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(messageInfo.contentLeftMargin); + make.top.mas_equalTo(messageInfo.contentTopMargin); + make.bottom.mas_equalTo(- messageInfo.contentBottomMargin - messageInfo.cellBottomMargin); + +// make.centerY.mas_equalTo(self.contentView); + +// if (isMSRTL()) { + make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth] - messageInfo.contentLeftMargin); +// make.height.mas_greaterThanOrEqualTo([self RTLLabelHeight]); +// } + }]; + + [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(0); + make.leading.trailing.mas_equalTo(self.contentView).offset(0); +// make.trailing.mas_equalTo(self.contentLabel).offset(-messageInfo.contentRightMargin - 10); + }]; }]; - [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentLeftMargin + 12); -// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin+20); -// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin-10); - make.top.mas_equalTo(-10); - make.bottom.mas_equalTo(0); - if (isMSRTL()) { // MARK: 可能会有性能问题,但源代码已经使用了更新 layout 的方案,推测是头像框和气泡会导致卡顿 - make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth]); - } - }]; + } else { + self.blurEffectView.hidden = NO; self.bubbleImageView.image = [UIImage imageWithColor:[DJDKMIMOMColor messageBubbleColor]]; [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.contentView).inset(10); -// make.leading.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentLeftMargin + 12); -// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin+10); -// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin-20); -// if (isMSRTL()) { // MARK: 可能会有性能问题,但源代码已经使用了更新 layout 的方案,推测是头像框和气泡会导致卡顿 -// make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth]); -// } + make.leading.mas_equalTo(messageInfo.contentLeftMargin); + make.bottom.mas_equalTo(-messageInfo.cellBottomMargin); + make.top.mas_equalTo(messageInfo.contentTopMargin); + make.width.mas_equalTo([self RTLLabelWidth] - messageInfo.contentLeftMargin); + }]; +// [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { +//// make.top.equalTo(self.contentView).offset(10); // 距离顶部 10 点 +//// make.bottom.equalTo(self.contentView).offset(-10); // 距离底部 10 点 +//// make.trailing.equalTo(self.contentView).offset(-10); // 距离右侧 10 点 +//// make.centerY.mas_equalTo(self.contentView); +//// if (isMSRTL()) { +//// make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth]); +// make.height.mas_greaterThanOrEqualTo([self RTLLabelHeight]); +//// } +// make.leading.equalTo(self.contentView).offset(10); // 左侧有足够空间,避免过宽 +// }]; + [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.contentLabel).offset(-8); + make.trailing.mas_equalTo(self.contentLabel).offset(8); + make.bottom.mas_equalTo(self.contentLabel).offset(0); }]; } @@ -200,8 +232,16 @@ CGSize size = [self.contentLabel.attributedText boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin context:nil].size; - NSLog(@" ----- 11 ----- %@", [NSValue valueWithCGSize:size]); - return MIN(ceil(size.width) + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, self.contentLabel.maxWidth); +// NSLog(@" ----- 11 ----- %@", [NSValue valueWithCGSize:size]); +// return MIN(ceil(size.width) + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, self.contentLabel.maxWidth); + return ceil(size.width);// + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8; +} + +- (CGFloat)RTLLabelHeight { + CGSize size = [self.contentLabel.attributedText boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) + options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin + context:nil].size; + return ceil(size.height); } - (UIImage *)scaleToSize:(UIImage *)img { @@ -232,14 +272,19 @@ } } - - (NetImageView *)bubbleImageView { if (!_bubbleImageView) { _bubbleImageView = [[NetImageView alloc] init]; _bubbleImageView.clipsToBounds = NO; _bubbleImageView.userInteractionEnabled = YES; - _bubbleImageView.layer.masksToBounds = YES; - _bubbleImageView.layer.cornerRadius = 7; + [_bubbleImageView setCornerRadius:8]; +// _bubbleImageView.layer.masksToBounds = YES; +// _bubbleImageView.layer.cornerRadius = 8; + +// [_contentLabel setCornerRadius:8 +// corners:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner | kCALayerMaxXMaxYCorner | kCALayerMinXMaxYCorner +// borderWidth:1 +// borderColor:[UIColor greenColor]]; } return _bubbleImageView; } @@ -256,9 +301,15 @@ - (XPNetImageYYLabel *)contentLabel { if (!_contentLabel) { _contentLabel = [[XPNetImageYYLabel alloc] init]; - _contentLabel.preferredMaxLayoutWidth = kRoomMessageMaxWidth - 24; + _contentLabel.preferredMaxLayoutWidth = kRoomMessageMaxWidth ; _contentLabel.numberOfLines = 0; _contentLabel.userInteractionEnabled = YES; + +// [_contentLabel setCornerRadius:8 +// corners:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner | kCALayerMaxXMaxYCorner | kCALayerMinXMaxYCorner +// borderWidth:1 +// borderColor:[UIColor redColor]]; + } return _contentLabel; } @@ -270,4 +321,22 @@ } return _clickBtn; } + +- (UIVisualEffectView *)blurEffectView { + if (!_blurEffectView) { + // 创建模糊效果 + UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; // 选择模糊样式(例如:Light, Dark, ExtraLight 等) + + // 创建包含模糊效果的视图 + _blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + + // 设置模糊视图的大小与目标视图一致 + _blurEffectView.frame = CGRectMake(0, 0, KScreenWidth, 200); + _blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; // 使模糊视图适应目标视图的尺寸变化 + _blurEffectView.hidden = YES; + + [_blurEffectView setCornerRadius:8]; + } + return _blurEffectView; +} @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 6393a44a..a538610e 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -1118,35 +1118,35 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; #pragma mark - UITableViewDelegate And UITableViewDataSource -//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { -// NSArray *source = @[]; -// switch (self.displayType) { -// case 1: -// source = self.datasource; -// break; -// case 2: -// source = self.datasource_chat; -// break; -// case 3: -// source = self.datasource_gift; -// break; -// -// default: -// source = self.datasource; -// break; -// } -// -// XPMessageInfoModel *model = [source xpSafeObjectAtIndex:indexPath.row]; -// -// // 如果 model 中有高度数据,使用 model 的高度 -// if (model.rowHeight > 0) { -// return model.rowHeight; -// } -// -// // 否则,使用自适应高度 +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + NSArray *source = @[]; + switch (self.displayType) { + case 1: + source = self.datasource; + break; + case 2: + source = self.datasource_chat; + break; + case 3: + source = self.datasource_gift; + break; + + default: + source = self.datasource; + break; + } + + XPMessageInfoModel *model = [source xpSafeObjectAtIndex:indexPath.row]; + + // 如果 model 中有高度数据,使用 model 的高度 + if (model.rowHeight > 0) { + return model.rowHeight; + } + + // 否则,使用自适应高度 // return 100; -//// return UITableViewAutomaticDimension; -//} + return UITableViewAutomaticDimension; +} - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { switch (self.displayType) { @@ -1336,7 +1336,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; _messageTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _messageTableView.delegate = self; _messageTableView.dataSource = self; -// _messageTableView.rowHeight = UITableViewAutomaticDimension; + _messageTableView.rowHeight = UITableViewAutomaticDimension; // _messageTableView.estimatedRowHeight = 44; // 预估高度 _messageTableView.tableFooterView = [UIView new]; _messageTableView.separatorStyle = UITableViewCellSeparatorStyleNone; From 4d6e71450ac57e957432a978250d7fbe9404d23f Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Mon, 2 Dec 2024 16:49:16 +0800 Subject: [PATCH 4/7] =?UTF-8?q?temp=20save:=20=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E6=88=BF=E9=97=B4=E8=81=8A=E5=A4=A9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E9=AB=98=E5=BA=A6=E9=80=82=E9=85=8D?= =?UTF-8?q?=20=EF=BD=9C=20=E8=B0=83=E6=95=B4=E6=88=BF=E9=97=B4=E9=9F=B3?= =?UTF-8?q?=E4=B9=90=E9=9D=A2=E6=9D=BF=E5=85=A5=E5=8F=A3=20&=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1.0.30/menu_music.imageset/Contents.json | 21 ++ .../menu_music.imageset/房间背景@3x.png | Bin 0 -> 2735 bytes .../Features/Boom/BoomInfoViewController.m | 2 +- .../View/SubViews/XPRoomBackMusicPlayerView.m | 50 +++- .../XPRoomFunctionContainerView.h | 2 + .../XPRoomFunctionContainerView.m | 59 +++-- .../MenuContainerView/MSRoomMenuGameView.m | 23 +- .../XPRoomMenuContainerView.m | 6 +- .../Model/XPMessageInfoModel.m | 95 ++----- .../Tool/XPRoomMessageParser.m | 107 ++++---- .../View/XPNetImageYYLabel.h | 2 - .../View/XPNetImageYYLabel.m | 110 +++++--- .../View/XPRoomMessageHeaderView.m | 37 +-- .../View/XPRoomMessageTableViewCell.m | 243 ++++++++---------- .../View/MoreView/Model/XPRoomMoreItemModel.h | 2 + .../MoreView/Presenter/XPMoreMenuPresenter.h | 2 +- .../MoreView/Presenter/XPMoreMenuPresenter.m | 18 +- .../View/XPRoomMoreMenuViewController.h | 2 +- .../View/XPRoomMoreMenuViewController.m | 21 +- YuMi/Modules/YMRoom/View/RoomHostDelegate.h | 2 + .../View/SendGiftView/View/XPGiftBarView.m | 9 +- .../YMRoom/View/XPRoomViewController.m | 14 +- 22 files changed, 444 insertions(+), 383 deletions(-) create mode 100644 YuMi/Assets.xcassets/1.0.30/menu_music.imageset/Contents.json create mode 100644 YuMi/Assets.xcassets/1.0.30/menu_music.imageset/房间背景@3x.png diff --git a/YuMi/Assets.xcassets/1.0.30/menu_music.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.30/menu_music.imageset/Contents.json new file mode 100644 index 00000000..ac659e41 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.30/menu_music.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "房间背景@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.30/menu_music.imageset/房间背景@3x.png b/YuMi/Assets.xcassets/1.0.30/menu_music.imageset/房间背景@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..bd55b684d26ba67289717f943776c3533c5b5d36 GIT binary patch literal 2735 zcmV;g3Q+ZlP)Px542qGy>>AkI1d)waI-d1nvU0uKPKKr%b^PY3|u%5NgKHm39 zPVQ~*-fOS@-_QO(<61jtBobr1hotIvZ%O0Xk89mA~mONx^2lJp<@{a4aH z`#b->KZL-aOBW`-G>I_+-hnkh?^6RdXI_ANr~P;cfWI$KOv`;y|1BqPhIg z@^j1!RodDhXP> z3rg|!R$PIOF~Y%zNV?wu2CmctM8o$=+8siG!(GG;=oljuv5Hze4@mfXR|o;nvn3no z7$e@q0}bTt35{@on?1NY3+Nal(c6*cQH&5HmnlIdw@bP{C*bJ~w1NE45xQ(H=*}4A z4oTPc1-lo}X7nCn;c}@P8{@cy@YnS*lAVDzkRQB)uAA3`!$|(CE7+ZYHoADk7S!bF zhlFNd-GxS41HA<~x#UjaduH-->y zY`W)0;9`t~(+_JJXp8?lZXZdhxv~)GZ4aZh`ZRhXbAh%j9Bv#rjBRN~;1-J>XVxee z0gd5D)cJI zgCxC1(iw9+BLKfx(nXR;5|t7tWXG&r_B^2RGMM}-2%3Ca%CNn?AzCG=|944Wk@RD$ zke9f>n?ndUOb@&X=olkf{BY}|C@~T5F^`t?4a*|78Jk!9m&x{=E9oDS2s}K6YWqJ! z2ph)T0JK%BsZ#S>6>dHyRdYVl1F7pJ{Z!HqCH=t~ae551=@incRM@F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ules/YMRoom/Features/Boom/BoomInfoViewController.m b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m index 62d29392..62cca94e 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m +++ b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m @@ -419,7 +419,7 @@ [progressBG addSubview:self.progressBar]; [self.progressBar mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(progressBG).offset(21); + make.leading.mas_equalTo(progressBG).offset(isMSRTL() ? 18 : 21); make.bottom.mas_equalTo(progressBG).offset(kGetScaleWidth(-35)); make.width.mas_equalTo(18); make.height.mas_equalTo(kGetScaleWidth(180)).multipliedBy(1); diff --git a/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m b/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m index e0c64a03..495a5182 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m @@ -52,6 +52,8 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; @property (nonatomic,strong) XPRoomMusicLibraryViewController *musicLibraryVC; ///数据的请求 @property (nonatomic,strong) NSFetchRequest *request; + +@property(nonatomic, strong) UIVisualEffectView *blurEffectView; @end @implementation XPRoomBackMusicPlayerView @@ -61,7 +63,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; if (self) { [self initSubViews]; [self initSubViewConstraints]; - } + } return self; } #pragma mark - Public Method @@ -76,10 +78,25 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; } #pragma mark - Private Method +- (void)handleTapBackground { + [UIView animateWithDuration:0.25 + animations:^{ + self.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight); + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; +} + - (void)initSubViews { - self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.8]; - self.layer.masksToBounds = YES; - self.layer.cornerRadius = 40.f; + self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.0]; + UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom]; + b.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight - 250); + [b addTarget:self action:@selector(handleTapBackground) forControlEvents:UIControlEventTouchUpInside]; + [self addSubview:b]; + + [self setCornerRadius:16 + cornerMask:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner]; + [self addSubview:self.blurEffectView]; [self addSubview:self.titleLabel]; [self addSubview:self.voiceImageView]; [self addSubview:self.voiceSliderView]; @@ -90,15 +107,20 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; } - (void)initSubViewConstraints { + [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.leading.trailing.mas_equalTo(self); + make.height.mas_equalTo(kGetScaleWidth(200)); + }]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.mas_equalTo(self).inset(30); - make.top.mas_equalTo(self).offset(17); + make.bottom.mas_equalTo(self.blurEffectView.mas_centerY).offset(-24); }]; [self.voiceImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.size.mas_equalTo(CGSizeMake(12, 15)); make.leading.mas_equalTo(self.titleLabel); - make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(18); + make.centerY.mas_equalTo(self.blurEffectView); }]; [self.voiceSliderView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -413,5 +435,21 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; return _request; } +- (UIVisualEffectView *)blurEffectView { + if (!_blurEffectView) { + // 创建模糊效果 + UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; // 选择模糊样式(例如:Light, Dark, ExtraLight 等) + + // 创建包含模糊效果的视图 + _blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + + // 设置模糊视图的大小与目标视图一致 + _blurEffectView.frame = CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(200)); + _blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; // 使模糊视图适应目标视图的尺寸变化 + + [_blurEffectView setCornerRadius:16]; + } + return _blurEffectView; +} @end diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.h b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.h index 36fabcab..7b8de47f 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.h +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.h @@ -29,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)showPKPanelView; +- (void)showMusicPanel; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m index f31a16f6..4069cc8c 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -119,12 +119,6 @@ @property (nonatomic, strong) XPAnchorFansTeamEntranceView *fansTeamEntranceView; ///个播小时榜入口按钮 @property (nonatomic, strong) XPRoomAnchorRankEnterView *hourRankEntranceView; -/////话题的容器 -//@property (nonatomic,strong) UIStackView *topicStackView; -/////话题 -//@property (nonatomic,strong) UILabel *topicLabel; -/////编辑 -//@property (nonatomic,strong) UIButton *editButton; ///跨房pk的面板 @property (nonatomic,strong) XPAcrossRoomPKPanelView *acrossPKPanelView; ///跨房PK预约倒计时 @@ -437,6 +431,28 @@ } } +#pragma mark - DJ 抓个Beat +- (void)showMusicPanel { + [self addSubview:self.musicPlayView]; + [self bringSubviewToFront:self.musicPlayView]; + self.musicPlayView.frame = CGRectMake(0, KScreenHeight, KScreenWidth, 200); + +// POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; +// moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, self.musicPlayView.center.y)]; +// moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth/ 2, self.musicPlayView.center.y)]; +// moveAnimation.beginTime = CACurrentMediaTime(); +// moveAnimation.duration = 0.5; +// moveAnimation.repeatCount = 1; +// moveAnimation.removedOnCompletion = YES; +// [self.musicPlayView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; +// + [UIView animateWithDuration:0.25 animations:^{ +// self.musicEnterButton.hidden = YES; + self.musicPlayView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); + } completion:nil]; +// [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_music_click]; +} + #pragma mark - 房间PK // MARK: ----- 修改开始 - (void)showPKPanelView { @@ -669,10 +685,10 @@ - (void)onRoomMiniEntered { if ([XPRoomMiniManager shareManager].getCurrentMusic) { - if (!self.musicPlayView.superview) { - [self addSubview:self.musicPlayView]; - self.musicPlayView.frame = CGRectMake(-KScreenWidth, kNavigationHeight + 4, KScreenWidth - 85, 80); - } +// if (!self.musicPlayView.superview) { +// [self addSubview:self.musicPlayView]; +// self.musicPlayView.frame = CGRectMake(-KScreenWidth, kNavigationHeight + 4, KScreenWidth - 85, 80); +// } [self.musicPlayView configCurrentPlayingMusic:[XPRoomMiniManager shareManager].getCurrentMusic isPlaying:[XPRoomMiniManager shareManager].musicPlaying]; [[XPRoomMiniManager shareManager] configCurrentMusic:nil isPlaying:NO]; } @@ -1263,24 +1279,11 @@ } - (void)musicEnterButtonAction:(UIButton *)sender { - if (!self.musicPlayView.superview) { - [self addSubview:self.musicPlayView]; - self.musicPlayView.frame = CGRectMake(-KScreenWidth, kNavigationHeight + 4, KScreenWidth - 85, 80); - } - - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, self.musicPlayView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth/ 2, self.musicPlayView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime(); - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - [self.musicPlayView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - - [UIView animateWithDuration:0.2 animations:^{ - self.musicEnterButton.hidden = YES; - } completion:nil]; - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_music_click]; + [self showMusicPanel]; +// if (!self.musicPlayView.superview) { +// [self addSubview:self.musicPlayView]; +// self.musicPlayView.frame = CGRectMake(-KScreenWidth, kNavigationHeight + 4, KScreenWidth - 85, 80); +// } } #pragma mark - 房间话题 diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m index e7ecb0cf..d1eec70a 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m @@ -15,6 +15,7 @@ static const NSInteger kItemsPerRow = 5; @interface MSRoomMenuGameView() @property(nonatomic,strong) UIButton *backBtn; @property(nonatomic,strong) UIView *ms_bgView; +@property(nonatomic, strong) UIVisualEffectView *blurEffectView; @property(nonatomic,strong) UICollectionView *collectionView; @property (nonatomic, assign) CGFloat itemHeight; @@ -26,7 +27,6 @@ static const NSInteger kItemsPerRow = 5; -(instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if(self){ - self.itemHeight = kGetScaleWidth(80); self.emptyHeight = kGetScaleWidth(100); self.dataSource = @[].mutableCopy; @@ -41,6 +41,7 @@ static const NSInteger kItemsPerRow = 5; self.backgroundColor = [UIColor clearColor]; [self addSubview:self.backBtn]; [self addSubview:self.ms_bgView]; + [self addSubview:self.blurEffectView]; [self addSubview:self.collectionView]; } @@ -48,7 +49,7 @@ static const NSInteger kItemsPerRow = 5; [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self); }]; - [self.ms_bgView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.equalTo(self).inset(0); make.bottom.equalTo(self).offset(12); make.height.mas_equalTo(kGetScaleWidth(246)); @@ -180,4 +181,22 @@ static const NSInteger kItemsPerRow = 5; } return _collectionView; } + +- (UIVisualEffectView *)blurEffectView { + if (!_blurEffectView) { + // 创建模糊效果 + UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; + + // 创建包含模糊效果的视图 + _blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + + // 设置模糊视图的大小与目标视图一致 + _blurEffectView.frame = CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(246)); + _blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + + [_blurEffectView setCornerRadius:12]; + } + return _blurEffectView; +} + @end diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m index 3d8826e8..2d69170b 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m @@ -80,6 +80,8 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; @property (nonatomic, assign) BOOL isDisplayMicStatusControl; +@property(nonatomic, assign) BOOL isOnMic; + @end @@ -166,7 +168,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; case XPRoomMenuItemType_More: { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"XP didTapForNewFunction"]; [self.moreButton setImage:[UIImage imageNamed:@"room_menu_more"] forState:UIControlStateNormal]; - XPRoomMoreMenuViewController * moreMenuVC = [[XPRoomMoreMenuViewController alloc] initWithDelegate:self.delegate]; + XPRoomMoreMenuViewController * moreMenuVC = [[XPRoomMoreMenuViewController alloc] initWithDelegate:self.delegate isUserOnMic:self.isOnMic]; [self.delegate.getCurrentNav presentViewController:moreMenuVC animated:YES completion:nil]; } break; @@ -521,6 +523,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; - (void)onMicroQueueUpdate:(NSMutableDictionary *)queue { MicroQueueModel *model = [self findMySelfMicro:queue]; if (model) { + self.isOnMic = YES; self.micButton.hidden = NO; if ([RtcManager instance].isLocalMuted) { [self micButtonUpdate:2]; @@ -541,6 +544,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; self.faceButton.hidden = NO; } else { + self.isOnMic = NO; self.micButton.hidden = YES; self.faceButton.hidden = YES; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m index 3efc09fc..3f4ab7e1 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m @@ -28,95 +28,34 @@ - (void)setContent:(NSAttributedString *)content { _content = content; - CGSize size = [content boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) + CGFloat width = kRoomMessageMaxWidth; + if (self.isBoom) { + width = kRoomMessageMaxWidth - kGetScaleWidth(60); + } + + CGSize size = [content boundingRectWithSize:CGSizeMake(width, 0) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin context:nil].size; YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(size.width, CGFLOAT_MAX)]; container.maximumNumberOfRows = 0; container.truncationType = YYTextTruncationTypeEnd; + container.insets = UIEdgeInsetsMake(self.contentTopMargin, self.contentLeftMargin, self.contentBottomMargin, self.contentRightMargin); self.textLayout = [YYTextLayout layoutWithContainer:container text:content]; CGSize textSize = self.textLayout.textBoundingRect.size; -// CGFloat anotherHeight = [self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth].height; - if ([NSString isEmpty:self.bubbleImageUrl]) { - self.rowHeight = ceil(textSize.height) + self.cellBottomMargin + self.contentTopMargin + 20; + self.rowHeight = + ceil(textSize.height) + + self.cellBottomMargin + + (isMSRTL() ? self.contentTopMargin : (self.isBoom ? 20 : 8)); } else { - self.rowHeight = ceil(textSize.height) + self.contentTopMargin + self.contentBottomMargin + self.cellBottomMargin + 20; + self.rowHeight = + ceil(textSize.height) + + (isMSRTL() ? self.contentTopMargin : (self.isBoom ? 20 : 8)) + + self.contentBottomMargin + + self.cellBottomMargin; } - self.rowHeight += 10; - -// if ([self.cellKey isEqualToString:@"ChatMessage"]) { -// NSLog(@" ----- 11 ----- %@ : %@", [NSValue valueWithCGSize:textSize], [NSValue valueWithCGSize:[self heightForAttributedStringUsingTextKit:content maxWidth:kRoomMessageMaxWidth]]); -// } - -// self.rowHeight = [self heightForAttributedText:content -// maxWidth:kRoomMessageMaxWidth]; - -// CGFloat width = isMSRTL() ? 10 : 0; -////// width = self.vipIcon.length > 0 ? width + 15 : width; -// CGSize maxSize = CGSizeMake(kRoomMessageMaxWidth - self.contentLeftMargin - self.contentRightMargin - 12, MAXFLOAT); -// YYTextContainer *container = [YYTextContainer containerWithSize:maxSize]; -// container.maximumNumberOfRows = 0; -// YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:self.content]; -// CGFloat rowHeight = layout.textBoundingSize.height + self.contentTopMargin + self.contentBottomMargin + self.cellBottomMargin; -// self.rowHeight = rowHeight + width ; + self.rowHeight += 10 + (self.isBoom ? 20 : 0); } - -- (CGSize)heightForAttributedStringUsingTextKit:(NSAttributedString *)attributedString - maxWidth:(CGFloat)maxWidth { - NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:attributedString]; - NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:CGSizeMake(maxWidth, CGFLOAT_MAX)]; - NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init]; - - [layoutManager addTextContainer:textContainer]; - [textStorage addLayoutManager:layoutManager]; - - // 让布局管理器计算文本高度 - [layoutManager glyphRangeForTextContainer:textContainer]; - return [layoutManager usedRectForTextContainer:textContainer].size; -} - -- (CGFloat)heightForAttributedText:(NSAttributedString *)attributedText maxWidth:(CGFloat)maxWidth { - // 创建一个 YYTextContainer - YYTextContainer *container = [YYTextContainer new]; - container.size = CGSizeMake(maxWidth, CGFLOAT_MAX); // 设置宽度,支持无限高度 - container.maximumNumberOfRows = 0; // 允许多行 - - // 遍历富文本,设置未加载图片的占位尺寸 - // 确认是否 “@用户名” 会影响计算结果 - NSInteger index = 0; - NSMutableAttributedString *mutableAttributedText = [attributedText mutableCopy]; - [mutableAttributedText enumerateAttribute:YYTextAttachmentAttributeName - inRange:NSMakeRange(0, mutableAttributedText.length) - options:0 - usingBlock:^(id value, NSRange range, BOOL *stop) { - - if ([value isKindOfClass:[YYTextAttachment class]]) { - // TODO: 把图片变为字符串来占位, 观察结果是第二行字符长度少于前缀图片,则会高度减少 - YYTextAttachment *attachment = (YYTextAttachment *)value; - NSLog(@" ---00--- : %@", attachment.content); - if (attachment.content == nil) { - attachment.content = [[UIView alloc] init]; // 占位内容 - NSValue *v = [self.extraSizeArray xpSafeObjectAtIndex:index]; - if (value) { - UIView *placeholderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [v CGSizeValue].width, [v CGSizeValue].height)]; - attachment.content = placeholderView; // 使用占位尺寸 - } else { - *stop = YES; - } - } - } - }]; - - // 通过 YYTextLayout 创建布局 - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:mutableAttributedText]; - - self.textWidth = ceil(layout.textBoundingSize.width); - - // 返回布局的文本高度 - return ceil(layout.textBoundingSize.height) + self.contentTopMargin + self.contentBottomMargin + self.cellBottomMargin; // 向上取整,避免内容裁切 -} - @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 685e9433..4bff141a 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -67,8 +67,6 @@ Boom632Model *model = [Boom632Model modelWithJSON:attachment.data]; XPMessageInfoModel * messageInfo = [[XPMessageInfoModel alloc] init]; - - NSString *text = [NSString stringWithFormat:@"%@%@%@", YMLocalizedString(@"RoomMessageBoom_0"), model.nick, YMLocalizedString(@"RoomMessageBoom_1")]; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:text]; @@ -76,11 +74,11 @@ [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, text.length)]; [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xFF3B3B) range:NSMakeRange([YMLocalizedString(@"RoomMessageBoom_0") length], model.nick.length)]; - messageInfo.content = attributedString; messageInfo.isBoom = YES; messageInfo.boomImageUrl = model.pic; messageInfo.rowHeight = 80; messageInfo.first = attachment.first; + messageInfo.content = attributedString; return messageInfo; } } @@ -221,8 +219,6 @@ return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; }else if(first == CustomMessageType_Super_Gift){ return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; - }else if(first == CustomMessageType_Chat_Hall_Headlines && attachment.second == Custom_Message_Sub_Chat_Hall_Headlines){ - } return nil; @@ -363,30 +359,25 @@ [attribute appendAttributedString:[self createSapceAttribute:2]]; } - if (extModel.charmUrl.length > 0) {//等级 - [attribute appendAttributedString:[self createUrlImageAttribute:extModel.charmUrl]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; - } + if (extModel.charmUrl.length > 0) {//等级 + [attribute appendAttributedString:[self createUrlImageAttribute:extModel.charmUrl]]; + [attribute appendAttributedString:[self createSapceAttribute:2]]; + } - if (extModel.vipIcon.length > 0) {//VIPicon - messageInfo.vipIcon = extModel.vipIcon; - [attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; - } - - if(extModel.isCustomWord == YES){ - if (extModel.inRoomNameplatePic.length > 0) { - [attribute appendAttributedString:[self createUrlImageAttribute:extModel.inRoomNameplatePic]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; - } - }else{ - if (extModel.inRoomNameplatePic.length > 0 && extModel.inRoomNameplateWord.length > 0) { - [attribute appendAttributedString:[self createNameplateAttibute:extModel.inRoomNameplateWord image:extModel.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]]; - [attribute appendAttributedString:[self createSapceAttribute:2]]; - } + if (extModel.vipIcon.length > 0) {//VIPicon + messageInfo.vipIcon = extModel.vipIcon; + [attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon]]; + [attribute appendAttributedString:[self createSapceAttribute:2]]; + } + + if (extModel.inRoomNameplatePic.length > 0) { + [attribute appendAttributedString:[self createUrlImageAttribute:extModel.inRoomNameplatePic + size:CGSizeMake(60, kFontRegular(kRoomMessageDefalutFont).lineHeight)]]; + [attribute appendAttributedString:[self createSapceAttribute:2]]; } [attribute appendAttributedString:[self createNickAtrribute:nick uid:message.from.integerValue]]; + if (extModel.carName.length > 0) { [attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser1") color:[DJDKMIMOMColor messageTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createTextAttribute:extModel.carName color:[DJDKMIMOMColor messageNickColor] font:kRoomMessageDefalutFont]]; @@ -509,30 +500,42 @@ PIGeneralPublicScreenModel *screenModel = [PIGeneralPublicScreenModel modelWithDictionary:attachment.data]; NSDictionary *textDic = screenModel.template; - if(textDic.allKeys.count == 0)return messageInfo; + if(textDic.allKeys.count == 0) { + return messageInfo; + } NSString *key = [NSBundle uploadLanguageText]; NSString *title = textDic[key] == nil ? textDic[textDic.allKeys.firstObject] : textDic[key]; - if(title.length == 0)return messageInfo; - NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont],NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:screenModel.textColor]}]; + if(title.length == 0) { + return messageInfo; + } + NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title + attributes:@{ + NSFontAttributeName:kFontRegular(kRoomMessageDefalutFont), + NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:screenModel.textColor]}]; for (PIGeneralPublicScreenItemModel *model in screenModel.contents) { if([model.type isEqualToString:@"TEXT"]){ NSDictionary *subTextDic = model.text; if(subTextDic.allKeys.count > 0){ NSString *subText = subTextDic[key] == nil ? subTextDic[subTextDic.allKeys.firstObject] : subTextDic[key]; - NSAttributedString *attText = [[NSAttributedString alloc]initWithString:subText attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor]}]; + NSAttributedString *attText = [[NSAttributedString alloc] initWithString:subText + attributes:@{ + NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor]}]; if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){ [attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText]; } @kWeakify(self) - [attribute yy_setTextHighlightRange:[attribute.string rangeOfString:subText] color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { - @kStrongify(self); - if(model.skipType == 6){ - if(model.skipContent.length == 0)return; - [self showUserCard:model.skipContent.integerValue]; - } - }]; + [attribute yy_setTextHighlightRange:[attribute.string rangeOfString:subText] + color:nil + backgroundColor:nil + tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + @kStrongify(self); + if(model.skipType == 6){ + if(model.skipContent.length == 0)return; + [self showUserCard:model.skipContent.integerValue]; + } + }]; } }else if ([model.type isEqualToString:@"IMAGE"]){ @@ -803,7 +806,7 @@ imageView.image = face; imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.bounds = CGRectMake(0, 0, 30, 30); - NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter]; + NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; [attribute appendAttributedString:[self createSapceAttribute:1]]; [attribute appendAttributedString:attrString]; } @@ -1138,7 +1141,7 @@ //img if (giftInfo.giftUrl) { - [attribute appendAttributedString:[self createUrlImageAttribute:giftInfo.giftUrl]]; + [attribute appendAttributedString:[self createUrlImageAttribute:giftInfo.giftUrl size:CGSizeMake(40, 40)]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; } @@ -1248,7 +1251,7 @@ [attribute appendAttributedString: [self createNickAtrribute:info.targetNick uid:info.targetUid.integerValue]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; //img - [attribute appendAttributedString:[self createUrlImageAttribute:giftInfo.giftUrl]]; + [attribute appendAttributedString:[self createUrlImageAttribute:giftInfo.giftUrl size:CGSizeMake(40, 40)]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; //x N [attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@" X%ld",info.giftNum] color:[DJDKMIMOMColor messageTextColor] font:kRoomMessageDefalutFont]]; @@ -1363,9 +1366,9 @@ imageView.bounds = CGRectMake(0, 0, defaultSize.width, defaultSize.height); // 异步加载图片 - @kWeakify(self); +// @kWeakify(self); [imageView loadImageWithUrl:imageName completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { - @kStrongify(self); +// @kStrongify(self); if (image) { CGFloat scale = image.size.width / image.size.height; CGSize newSize = scale > 0 ? CGSizeMake(60 * scale, kFontRegular(kRoomMessageDefalutFont).lineHeight) : defaultSize; @@ -1439,9 +1442,9 @@ UIImage* image = imageView.image; if (image) { CGFloat scale = image.size.width / image.size.height; - imageView.bounds = CGRectMake(0, 0, 18 * scale, 18); + imageView.bounds = CGRectMake(0, 0, kFontRegular(kRoomMessageDefalutFont).lineHeight * scale, kFontRegular(kRoomMessageDefalutFont).lineHeight); } else { - imageView.bounds = CGRectMake(0, 0, 18, 18); + imageView.bounds = CGRectMake(0, 0, kFontRegular(kRoomMessageDefalutFont).lineHeight, kFontRegular(kRoomMessageDefalutFont).lineHeight); } imageView.layer.masksToBounds = YES; imageView.contentMode = UIViewContentModeScaleAspectFit; @@ -1472,7 +1475,7 @@ UIImageView *imaveView = [[UIImageView alloc]init]; imaveView.image = [UIImage imageNamed:imageName]; CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height; - imaveView.bounds = CGRectMake(0, 0, 16 * scale, 16); + imaveView.bounds = CGRectMake(0, 0, kFontRegular(kRoomMessageDefalutFont).lineHeight * scale, kFontRegular(kRoomMessageDefalutFont).lineHeight); NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attrString; @@ -1486,8 +1489,8 @@ UIImageView *imaveView = [[UIImageView alloc]init]; imaveView.image = [UIImage getLanguageImage:imageName]; CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height; - imaveView.bounds = CGRectMake(0, 0, 16 * scale, 16); - NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter]; + imaveView.bounds = CGRectMake(0, 0, kFontRegular(kRoomMessageDefalutFont).lineHeight * scale, kFontRegular(kRoomMessageDefalutFont).lineHeight); + NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attrString; } @@ -1497,8 +1500,8 @@ UIImageView *imaveView = [[UIImageView alloc]init]; imaveView.image = image; CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height; - imaveView.bounds = CGRectMake(0, 0, 20 * scale, 20); - NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter]; + imaveView.bounds = CGRectMake(0, 0, kFontRegular(kRoomMessageDefalutFont).lineHeight * scale, kFontRegular(kRoomMessageDefalutFont).lineHeight); + NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attrString; } @@ -1522,8 +1525,8 @@ NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init]; paraStyle.lineSpacing = 4.0f;//行间距 // 强制排版(从左到右) - paraStyle.alignment = NSTextAlignmentLeft; - paraStyle.baseWritingDirection = NSWritingDirectionLeftToRight; + paraStyle.alignment = NSTextAlignmentNatural; + paraStyle.baseWritingDirection = isMSRTL() ? NSWritingDirectionRightToLeft : NSWritingDirectionLeftToRight; return paraStyle; } @@ -1532,8 +1535,8 @@ - (NSMutableAttributedString *)createSapceAttribute:(CGFloat)width { UIView *spaceView = [[UIView alloc]init]; spaceView.backgroundColor = [UIColor clearColor]; - spaceView.bounds = CGRectMake(0, 0, width, 10); - NSMutableAttributedString * attribute = [NSMutableAttributedString yy_attachmentStringWithContent:spaceView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(spaceView.frame.size.width, spaceView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter]; + spaceView.bounds = CGRectMake(0, 0, width, kFontRegular(kRoomMessageDefalutFont).lineHeight); + NSMutableAttributedString * attribute = [NSMutableAttributedString yy_attachmentStringWithContent:spaceView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(spaceView.frame.size.width, spaceView.frame.size.height) alignToFont:kFontRegular(kRoomMessageDefalutFont) alignment:YYTextVerticalAlignmentCenter]; return attribute; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.h index 80300477..442c6455 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.h @@ -16,8 +16,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface XPNetImageYYLabel : YYLabel -@property (nonatomic, assign) CGFloat textWidth; -@property (nonatomic, assign) CGFloat maxWidth; @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m index 7a20ccf6..4a3289fb 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m @@ -13,10 +13,10 @@ @implementation XPNetImageYYLabel - (void)setAttributedText:(NSAttributedString *)attributedText { + if (!attributedText) return; + NSMutableAttributedString* attributedTextCopy = [attributedText mutableCopy]; - - CGSize maxSize = CGSizeMake(kRoomMessageMaxWidth, MAXFLOAT); - self.maxWidth = maxSize.width; + CGSize maxSize = CGSizeMake(kRoomMessageMaxWidth - 24, MAXFLOAT); CGSize size = [attributedText boundingRectWithSize:maxSize options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin @@ -25,55 +25,85 @@ YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(size.width, MAXFLOAT)]; container.truncationType = YYTextTruncationTypeEnd; -// YYTextLayout * layout = [YYTextLayout layoutWithContainerSize:maxSize text:attributedText]; - YYTextLayout * layout = [YYTextLayout layoutWithContainer:container text:attributedText]; + YYTextLayout *layout = [YYTextLayout layoutWithContainerSize:maxSize + text:attributedTextCopy]; - for (YYTextAttachment *attachment in layout.attachments) { - if (!attachment || ![attachment.content isKindOfClass:[NetImageView class]]) continue; - NSInteger index = [layout.attachments indexOfObject:attachment]; - NetImageView* imageView = attachment.content; - if (!imageView.imageUrl) continue; - - NSValue * value = [layout.attachmentRanges xpSafeObjectAtIndex:index]; - NSRange range = value.rangeValue; - - if (imageView.state == NetImageStateLoaded) { - attributedTextCopy = [self updateNetImageAttribute:imageView attributes:attributedTextCopy range:range]; + for (NSUInteger i = 0; i < layout.attachments.count; i++) { + YYTextAttachment *attachment = [layout.attachments xpSafeObjectAtIndex:i]; + if (![attachment.content isKindOfClass:[NetImageView class]]) { continue; - }else { + } + + NetImageView *imageView = (NetImageView *)attachment.content; + if (!imageView.imageUrl){ + continue; + } + + NSValue *value = [layout.attachmentRanges xpSafeObjectAtIndex:i]; + if (!value) { + continue; + } + + NSRange range = value.rangeValue; + if (imageView.state == NetImageStateLoaded) { + attributedTextCopy = [self updateNetImageAttribute:imageView + attributes:attributedTextCopy + range:range]; + } else { @kWeakify(self); [imageView loadImage:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { @kStrongify(self); - imageView.image = image; - [super setAttributedText:[self updateNetImageAttribute:imageView attributes:attributedTextCopy range:range]]; + @kWeakify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + @kStrongify(self); + [self updateImageAndRefresh:imageView + attributedText:attributedTextCopy + range:range]; + }); }]; } } - self.textWidth = layout.textBoundingRect.size.width + 12; - - [super setAttributedText:attributedTextCopy]; + [super setAttributedText:attributedTextCopy]; } -- (NSMutableAttributedString*)updateNetImageAttribute:(NetImageView*)imageView attributes:(NSMutableAttributedString*)attributes range:(NSRange)range{ - - UIImage* image = imageView.image; - CGSize size; - if (image != nil){ - CGFloat scale = image.size.width / image.size.height; - // 目前是根据原高度(imageView.bounds.size.height)等比例缩放图片。 - size = CGSizeMake(imageView.bounds.size.height * scale, imageView.bounds.size.height); - imageView.bounds = CGRectMake(0, 0, size.width, size.height); - }else{ - size = CGSizeMake(18, 18); - imageView.bounds = CGRectMake(0, 0, 18, 18); +- (void)updateImageAndRefresh:(NetImageView *)imageView + attributedText:(NSMutableAttributedString *)attributedText + range:(NSRange)range { + if (!imageView || !attributedText) return; + imageView.image = imageView.image ?: [UIImage new]; + NSMutableAttributedString *updatedAttributes = [self updateNetImageAttribute:imageView + attributes:attributedText + range:range]; + [super setAttributedText:updatedAttributes]; +} + +- (NSMutableAttributedString*)updateNetImageAttribute:(NetImageView*)imageView + attributes:(NSMutableAttributedString*)attributes + range:(NSRange)range{ + if (!imageView || !attributes) { + return attributes; } - NSMutableAttributedString * replaceAttr = [NSMutableAttributedString yy_attachmentStringWithContent:imageView - contentMode:UIViewContentModeScaleAspectFit - attachmentSize:size - alignToFont:kFontRegular(kRoomMessageDefalutFont) - alignment:YYTextVerticalAlignmentCenter]; - [attributes replaceCharactersInRange:range withAttributedString:replaceAttr]; + + CGSize size = imageView.bounds.size; + if (CGSizeEqualToSize(size, CGSizeZero)) { + size = CGSizeMake(kFontRegular(kRoomMessageDefalutFont).lineHeight, + kFontRegular(kRoomMessageDefalutFont).lineHeight); + } + UIImage *image = imageView.image; + if (image) { + CGFloat scale = image.size.width / image.size.height; + size = CGSizeMake(imageView.bounds.size.height * scale, imageView.bounds.size.height); + } + + imageView.bounds = CGRectMake(0, 0, size.width, size.height); + + NSMutableAttributedString *replaceAttr = [NSMutableAttributedString yy_attachmentStringWithContent:imageView + contentMode:UIViewContentModeScaleAspectFit + attachmentSize:size + alignToFont:kFontRegular(kRoomMessageDefalutFont) + alignment:YYTextVerticalAlignmentCenter]; + [attributes replaceCharactersInRange:range withAttributedString:replaceAttr]; return attributes; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m index 4a4d7fe9..a80c49d0 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageHeaderView.m @@ -53,20 +53,20 @@ make.width.mas_equalTo(kRoomMessageMaxWidth); make.height.mas_equalTo(height); }]; - if (isMSRTL()){ - [self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(10); - make.top.mas_equalTo(self); - make.width.mas_equalTo(kRoomMessageMaxWidth-10); - make.bottom.mas_equalTo(self).offset(-10); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self).inset(15); - make.centerY.mas_equalTo(self.bubbleView); - }]; - return; - } +// if (isMSRTL()){ +// [self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.mas_equalTo(10); +// make.top.mas_equalTo(self); +// make.width.mas_equalTo(kRoomMessageMaxWidth-10); +// make.bottom.mas_equalTo(self).offset(-10); +// }]; +// +// [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.trailing.mas_equalTo(self).inset(15); +// make.centerY.mas_equalTo(self.bubbleView); +// }]; +// return; +// } [self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.top.mas_equalTo(self); make.width.mas_equalTo(kRoomMessageMaxWidth-10); @@ -81,8 +81,13 @@ ///获取头部的高度 - (CGFloat)getHeaderViewHeight:(NSString *)title { - CGFloat width = isMSRTL() ? kRoomMessageMaxWidth - 30 : kRoomMessageMaxWidth - 20; - return [title boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]} context:nil].size.height; + CGFloat width = kRoomMessageMaxWidth - 20; //isMSRTL() ? kRoomMessageMaxWidth - 30 : + return [title boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) + options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin + attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]} + context:nil] + .size + .height; } #pragma mark - Getters And Setters diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index ea32b006..b6ea7106 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -35,8 +35,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self initSubViews]; - [self initSubViewConstraints]; + [self initSubViews]; } return self; } @@ -60,7 +59,6 @@ } - (void)initSubViewConstraints { - [self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(self.contentLabel).offset(-16); make.top.mas_equalTo(self.contentLabel).offset(0); @@ -82,27 +80,50 @@ - (void)setIsLeftBigImage:(BOOL)isLeftBigImage { _isLeftBigImage = isLeftBigImage; if (isLeftBigImage) { - - [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(0); - make.top.mas_equalTo(0); - make.bottom.mas_equalTo(-10); - make.trailing.mas_equalTo(self.contentLabel).offset(10); - }]; - [self.leftBigImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(0); - make.centerY.mas_equalTo(self.contentView); - make.size.mas_equalTo(CGSizeMake(50, 50)); + make.top.mas_equalTo(6); + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(60), kGetScaleWidth(60))); + }]; + + [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.leftBigImageView.mas_centerX); + make.top.mas_equalTo(0); +// make.bottom.mas_equalTo(-self.messageInfo.contentBottomMargin); + make.bottom.mas_equalTo(self.leftBigImageView).offset(6); + make.trailing.mas_equalTo(-8); + }]; + +// [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { +// make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); +// make.trailing.mas_equalTo(self.contentView).offset(-8); +//// make.centerY.mas_equalTo(self.contentView); +// make.centerY.mas_equalTo(self.leftBigImageView); +// }]; + + [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.mas_equalTo(self.bubbleImageView); + make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); + make.trailing.mas_equalTo(self.bubbleImageView).offset(-8); }]; - [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); - make.centerY.mas_equalTo(self.contentView); - if (isMSRTL()) { - make.width.mas_equalTo(20); - } + [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.bubbleImageView); }]; + self.blurEffectView.hidden = NO; + +// [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { +// make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); +// make.trailing.mas_equalTo(-self.messageInfo.contentRightMargin - 8); +// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin); +// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin); +//// if (isMSRTL()) { +//// make.width.mas_equalTo([self RTLLabelWidth] - 65); +//// } +// }]; + + } else { + [self initSubViewConstraints]; } } @@ -113,7 +134,8 @@ CGFloat left = (image.size.width - 1) / 2; CGFloat right = (image.size.width - 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]; } #pragma mark - UIGestureRecognizerDelegate - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { @@ -131,6 +153,7 @@ [self.delegate xPRoomMessageTableViewCellDidTapEmpty:self]; } } + -(void)clickBtnAction{ } @@ -141,123 +164,78 @@ } _messageInfo = messageInfo; if (messageInfo) { - -// [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { -// make.leading.mas_equalTo(self.bubbleImageView).offset(_messageInfo.contentLeftMargin); -// make.top.mas_equalTo(self.bubbleImageView).offset(_messageInfo.contentTopMargin); -// make.bottom.mas_equalTo(self.bubbleImageView).offset(-_messageInfo.contentBottomMargin); -// }]; - self.contentLabel.attributedText = messageInfo.content; -// self.contentLabel.textLayout = messageInfo.textLayout; - - if (![NSString isEmpty:messageInfo.bubbleImageUrl]) { - self.blurEffectView.hidden = YES; - @kWeakify(self); - [self.bubbleImageView loadImageWithUrl:messageInfo.bubbleImageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { - @kStrongify(self); - UIImage *image1 = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp]; - UIImage *cutImage = [image1 cropRightAndBottomPixels:2]; - self.bubbleImageView.image = [self resizableImage:cutImage]; - - [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(messageInfo.contentLeftMargin); - make.top.mas_equalTo(messageInfo.contentTopMargin); - make.bottom.mas_equalTo(- messageInfo.contentBottomMargin - messageInfo.cellBottomMargin); - -// make.centerY.mas_equalTo(self.contentView); - -// if (isMSRTL()) { - make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth] - messageInfo.contentLeftMargin); -// make.height.mas_greaterThanOrEqualTo([self RTLLabelHeight]); -// } - }]; - - [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(0); - make.leading.trailing.mas_equalTo(self.contentView).offset(0); -// make.trailing.mas_equalTo(self.contentLabel).offset(-messageInfo.contentRightMargin - 10); - }]; - }]; - + + if (self.isLeftBigImage) { + self.leftBigImageView.imageUrl = messageInfo.boomImageUrl; } else { - self.blurEffectView.hidden = NO; - self.bubbleImageView.image = [UIImage imageWithColor:[DJDKMIMOMColor messageBubbleColor]]; - [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(messageInfo.contentLeftMargin); - make.bottom.mas_equalTo(-messageInfo.cellBottomMargin); - make.top.mas_equalTo(messageInfo.contentTopMargin); - make.width.mas_equalTo([self RTLLabelWidth] - messageInfo.contentLeftMargin); - }]; -// [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { -//// make.top.equalTo(self.contentView).offset(10); // 距离顶部 10 点 -//// make.bottom.equalTo(self.contentView).offset(-10); // 距离底部 10 点 -//// make.trailing.equalTo(self.contentView).offset(-10); // 距离右侧 10 点 -//// make.centerY.mas_equalTo(self.contentView); -//// if (isMSRTL()) { -//// make.width.mas_greaterThanOrEqualTo([self RTLLabelWidth]); -// make.height.mas_greaterThanOrEqualTo([self RTLLabelHeight]); -//// } -// make.leading.equalTo(self.contentView).offset(10); // 左侧有足够空间,避免过宽 -// }]; - [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.contentLabel).offset(-8); - make.trailing.mas_equalTo(self.contentLabel).offset(8); - make.bottom.mas_equalTo(self.contentLabel).offset(0); - }]; + [self updateLayout]; + [self layoutIfNeeded]; } - -// if (self.isLeftBigImage) { -// self.leftBigImageView.imageUrl = messageInfo.boomImageUrl; -// [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { -// make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); -// make.trailing.mas_equalTo(-self.messageInfo.contentRightMargin - 8); -//// make.centerY.mas_equalTo(self.contentView); -// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin); -// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin); -//// if (isMSRTL()) { -//// make.width.mas_equalTo([self RTLLabelWidth] - 65); -//// } -// }]; -// } else { - -// } - -// _bubbleImageView.hidden = _messageInfo.isHiddenBubble; - [self layoutIfNeeded]; } } -- (CGFloat)RTLLabelWidth { - CGSize size = [self.contentLabel.attributedText boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) +- (void)updateLayout { + if ([NSString isEmpty:self.messageInfo.bubbleImageUrl]) { + [self updateLayoutWithoutBubble]; + }else { + [self updateLayoutWithBubble]; + } +} + +- (void)updateLayoutWithBubble { + self.blurEffectView.hidden = !self.messageInfo.isHiddenBubble; + @kWeakify(self); + [self.bubbleImageView loadImageWithUrl:self.messageInfo.bubbleImageUrl + completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + UIImage *image1 = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp]; + UIImage *cutImage = [image1 cropRightAndBottomPixels:2]; + self.bubbleImageView.image = [self resizableImage:cutImage]; + + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.messageInfo.contentLeftMargin); + make.top.mas_equalTo(0);//self.messageInfo.contentTopMargin); + make.bottom.mas_equalTo(- self.messageInfo.contentBottomMargin - self.messageInfo.cellBottomMargin); + make.width.mas_equalTo([self RTLLabelWidth] - self.messageInfo.contentLeftMargin); + }]; + + [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(0); + make.leading.trailing.mas_equalTo(self.contentView).offset(0); + }]; + }]; +} + +- (void)updateLayoutWithoutBubble { + self.blurEffectView.hidden = NO; + self.bubbleImageView.image = [UIImage imageWithColor:[DJDKMIMOMColor messageBubbleColor]]; + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.messageInfo.contentLeftMargin); + make.bottom.mas_equalTo(-self.messageInfo.cellBottomMargin); + make.top.mas_equalTo(0);//self.messageInfo.contentTopMargin); + make.width.mas_equalTo([self RTLLabelWidth] - self.messageInfo.contentLeftMargin - self.messageInfo.contentRightMargin); + }]; + + [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.contentLabel).offset(-8); + make.trailing.mas_equalTo(self.contentLabel).offset(8); + make.bottom.mas_equalTo(self.contentLabel).offset(0); + }]; +} + +- (CGSize)RTLLabelSize { + return [self.contentLabel.attributedText boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin context:nil].size; -// NSLog(@" ----- 11 ----- %@", [NSValue valueWithCGSize:size]); -// return MIN(ceil(size.width) + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, self.contentLabel.maxWidth); - return ceil(size.width);// + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8; +} +- (CGFloat)RTLLabelWidth { + return MIN(ceil([self RTLLabelSize].width) + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, + kRoomMessageMaxWidth - self.messageInfo.contentLeftMargin); } - (CGFloat)RTLLabelHeight { - CGSize size = [self.contentLabel.attributedText boundingRectWithSize:CGSizeMake(kRoomMessageMaxWidth, 0) - options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin - context:nil].size; - return ceil(size.height); -} - -- (UIImage *)scaleToSize:(UIImage *)img { - // 创建一个bitmap的context - // 并把它设置成为当前正在使用的context - CGFloat width = img.size.width * 0.5; - CGFloat height = img.size.height * 0.5; - UIGraphicsBeginImageContextWithOptions(CGSizeMake(width, height), NO, 1); - // 绘制改变大小的图片 - [img drawInRect:CGRectMake(0, 0, width, height)]; - // 从当前context中创建一个改变大小后的图片 - UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext(); - // 使当前的context出堆栈 - UIGraphicsEndImageContext(); - // 返回新的改变大小后的图片 - return scaledImage; + return ceil([self RTLLabelSize].height); } - (void)setRoomType:(RoomType)roomType { @@ -278,13 +256,6 @@ _bubbleImageView.clipsToBounds = NO; _bubbleImageView.userInteractionEnabled = YES; [_bubbleImageView setCornerRadius:8]; -// _bubbleImageView.layer.masksToBounds = YES; -// _bubbleImageView.layer.cornerRadius = 8; - -// [_contentLabel setCornerRadius:8 -// corners:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner | kCALayerMaxXMaxYCorner | kCALayerMinXMaxYCorner -// borderWidth:1 -// borderColor:[UIColor greenColor]]; } return _bubbleImageView; } @@ -304,12 +275,6 @@ _contentLabel.preferredMaxLayoutWidth = kRoomMessageMaxWidth ; _contentLabel.numberOfLines = 0; _contentLabel.userInteractionEnabled = YES; - -// [_contentLabel setCornerRadius:8 -// corners:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner | kCALayerMaxXMaxYCorner | kCALayerMinXMaxYCorner -// borderWidth:1 -// borderColor:[UIColor redColor]]; - } return _contentLabel; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h index 2e26ccfe..387c8155 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h @@ -62,6 +62,8 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) { RoomMoreMenuType_Room_Type_Setting = 25, RoomMoreMenuType_Room_Type_Background = 26, + + RoomMoreMenuType_Room_Music_Panel = 27, }; @interface XPRoomMoreItemModel : PIBaseModel diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h index 39c0f189..4be71216 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMoreMenuPresenter : BaseMvpPresenter ///获取更多菜单 -- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin; +- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic; /// 开启房间礼物值 /// @param roomUid 房间的uid diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index c5b2c193..2897b384 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -25,7 +25,7 @@ @implementation XPMoreMenuPresenter -- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin { +- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic { XPRoomMoreItemModel * roomPK = [[XPRoomMoreItemModel alloc] init]; roomPK.title = roomInfo.roomModeType == RoomModeType_Open_PK_Mode ?YMLocalizedString(@"XPMoreMenuPresenter26") : YMLocalizedString(@"XPMoreMenuPresenter1"); roomPK.imageName= @"room_pk_menu_icon"; @@ -135,6 +135,12 @@ roomTypeSetting.imageName = @"room_type_selection_icon"; roomTypeSetting.type = RoomMoreMenuType_Room_Type_Setting; roomTypeSetting.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + + XPRoomMoreItemModel * musicPanel = [[XPRoomMoreItemModel alloc] init]; + musicPanel.title = YMLocalizedString(@"XPRoomMusicVoiceSettingView1"); + musicPanel.imageName = @"menu_music"; + musicPanel.type = RoomMoreMenuType_Room_Music_Panel; + musicPanel.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; NSString * uid = [AccountInfoStorage instance].getUid; if (uid.length <= 0) { @@ -159,6 +165,11 @@ [array addObject:roomPK]; indexOfRoomAlbum += 1; } + + if (isOnMic) { + [array addObject:musicPanel]; + indexOfRoomAlbum += 1; + } if (isCreator && roomInfo.type != RoomType_MiniGame) { if(roomInfo.type != RoomType_Anchor){ @@ -166,12 +177,12 @@ indexOfRoomAlbum += 1; } } - + if (isCreator && roomInfo.type == RoomType_Anchor) { [array addObject:anchorRoomPK]; indexOfRoomAlbum += 1; } - + if ((isCreator || isManager || isSuperAdmin) && roomInfo.hasWishGiftPermit) { [array addObject:wishGift]; } @@ -189,7 +200,6 @@ } [array addObject:roomSetting]; [array addObject:clearScreen]; - } else { [array addObject:trumpet]; [array addObject:giftEffect]; diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.h b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.h index bb2e8f18..a344925b 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.h +++ b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPRoomMoreMenuViewController : MvpViewController -- (instancetype)initWithDelegate:(id)delegate; +- (instancetype)initWithDelegate:(id)delegate isUserOnMic:(BOOL)isOnMic; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m index 4d8dd7e5..771466b3 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m +++ b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m @@ -45,6 +45,7 @@ #import "XPMoreMenuProtocol.h" #import "CustomRoomBGContentViewController.h" + UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; @interface XPRoomMoreMenuViewController () @@ -62,13 +63,16 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; @property (nonatomic,strong) RoomInfoModel *roomInfo; @property (nonatomic,assign) id hostDelegate; + +@property(nonatomic, assign) BOOL isOnMic; @end @implementation XPRoomMoreMenuViewController -- (instancetype)initWithDelegate:(id)delegate{ +- (instancetype)initWithDelegate:(id)delegate isUserOnMic:(BOOL)isOnMic { if (self = [super init]) { self.modalPresentationStyle = UIModalPresentationOverFullScreen; + self.isOnMic = isOnMic; self.roomInfo = delegate.getRoomInfo; self.hostDelegate = delegate; } @@ -91,7 +95,7 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; break; } } - [self.presenter getMoreMenuDataSource:self.roomInfo isSuperAdmin:meIsSuperAdmin]; + [self.presenter getMoreMenuDataSource:self.roomInfo isSuperAdmin:meIsSuperAdmin isOnMic:self.isOnMic]; } #pragma mark - Private Method @@ -221,7 +225,7 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; } - (void)cancelMatchRandomPKSuccess { - self.hostDelegate.getRoomInfo.pkMatchStartTime = nil; + self.hostDelegate.getRoomInfo.pkMatchStartTime = 0; [[NSNotificationCenter defaultCenter] postNotificationName:@"cancelMatchRandomPK" object:nil]; [self dismissViewControllerAnimated:YES completion:nil]; NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid]; @@ -248,7 +252,7 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; [collectionView deselectItemAtIndexPath:indexPath animated:YES]; XPRoomMoreItemModel * item = [self.datasource xpSafeObjectAtIndex:indexPath.row]; NSString * roomUid = [NSString stringWithFormat:@"%ld",self.roomInfo.uid]; - NSString * roomId = [NSString stringWithFormat:@"%ld", self.roomInfo.roomId]; +// NSString * roomId = [NSString stringWithFormat:@"%ld", self.roomInfo.roomId]; switch (item.type) { case RoomMoreMenuType_Gift_Effect_Open: { @@ -511,6 +515,15 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; [self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil]; + } + break; + case RoomMoreMenuType_Room_Music_Panel: { + @kWeakify(self); + [self dismissViewControllerAnimated:YES + completion:^{ + @kStrongify(self); + [self.hostDelegate displayMusicPanel]; + }]; } break; default: diff --git a/YuMi/Modules/YMRoom/View/RoomHostDelegate.h b/YuMi/Modules/YMRoom/View/RoomHostDelegate.h index 9f0e3eb2..85bd29b7 100644 --- a/YuMi/Modules/YMRoom/View/RoomHostDelegate.h +++ b/YuMi/Modules/YMRoom/View/RoomHostDelegate.h @@ -51,6 +51,8 @@ NS_ASSUME_NONNULL_BEGIN -(NSInteger)getPublicScreenType; +- (void)displayMusicPanel; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m index b2dcc1f5..56a2a48d 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m @@ -460,15 +460,18 @@ if (!_sendGiftButton) { _sendGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_sendGiftButton setTitle:YMLocalizedString(@"XPGiftBarView2") forState:UIControlStateNormal]; - [_sendGiftButton setTitleColor:[DJDKMIMOMColor mainTextColor] forState:UIControlStateNormal]; + [_sendGiftButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_sendGiftButton setTitle:YMLocalizedString(@"XPGiftBarView3" ) forState:UIControlStateDisabled]; [_sendGiftButton setTitleColor:[DJDKMIMOMColor disableButtonTextColor] forState:UIControlStateDisabled]; [_sendGiftButton setTitle:YMLocalizedString(@"XPGiftBarView4") forState:UIControlStateSelected]; [_sendGiftButton setTitleColor:[DJDKMIMOMColor disableButtonTextColor] forState:UIControlStateSelected]; - [_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + [_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE29030), UIColorFromRGB(0xFCC074)] + gradientType:GradientTypeLeftToRight + imgSize:CGSizeMake(10, 10)] + forState:UIControlStateNormal]; [_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor disableButtonColor], [DJDKMIMOMColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled]; [_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor disableButtonColor], [DJDKMIMOMColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateSelected]; - _sendGiftButton.titleLabel.font = [UIFont systemFontOfSize:12]; + _sendGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; _sendGiftButton.layer.masksToBounds = YES; _sendGiftButton.layer.cornerRadius = 15; [_sendGiftButton addTarget:self action:@selector(sendButtonAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 7382a4d7..39ddad95 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -1208,10 +1208,10 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.anchorScrollView addSubview:self.quickMessageContainerView]; [self.anchorScrollView addSubview:self.activityContainerView]; [self.anchorScrollView addSubview:self.roomHeaderView]; - [self.anchorScrollView addSubview:self.functionView]; if (!self.menuContainerView.superview) { [self.view addSubview:self.menuContainerView]; } + [self.anchorScrollView addSubview:self.functionView]; [self.view bringSubviewToFront:self.animationView]; [self updateViewConstraintsOnAnchorRoom]; @@ -1604,9 +1604,8 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.anchorScrollView addSubview:self.quickMessageContainerView]; [self.anchorScrollView addSubview:self.activityContainerView]; [self.anchorScrollView addSubview:self.roomHeaderView]; - [self.anchorScrollView addSubview:self.functionView]; [self.anchorScrollView addSubview:self.menuContainerView]; - + [self.anchorScrollView addSubview:self.functionView]; [self.view bringSubviewToFront:self.animationView]; [self updateViewConstraintsOnAnchorRoom]; @@ -1834,8 +1833,8 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.view addSubview:self.menuContainerView]; [self.view addSubview:self.activityContainerView]; [self.view addSubview:self.roomHeaderView]; - [self.view addSubview:self.functionView]; [self.view bringSubviewToFront:self.menuContainerView]; + [self.view addSubview:self.functionView]; [self.view bringSubviewToFront:self.animationView]; [self initSubViewConstraints]; @@ -2525,10 +2524,11 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.anchorScrollView addSubview:self.quickMessageContainerView]; [self.anchorScrollView addSubview:self.activityContainerView]; [self.anchorScrollView addSubview:self.roomHeaderView]; - [self.anchorScrollView addSubview:self.functionView]; if (!self.menuContainerView.superview) { [self.view addSubview:self.menuContainerView]; } + [self.anchorScrollView addSubview:self.functionView]; + [self.view bringSubviewToFront:self.animationView]; [self updateViewConstraintsOnAnchorRoom]; @@ -2587,6 +2587,10 @@ XPCandyTreeInsufficientBalanceViewDelegate> return self.messageContainerView.type; } +- (void)displayMusicPanel { + [self.functionView showMusicPanel]; +} + #pragma mark - XPFirstRechargeViewDelegate -(void)rechargeHandle{} -(void)contactCustomerService{ From c49517dd947e66948f66c103df3a5c8d35c479fb Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Mon, 2 Dec 2024 19:33:20 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=E4=BF=AE=E6=AD=A3=E5=8F=91?= =?UTF-8?q?=E9=80=81=E7=A4=BC=E7=89=A9=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AnimationView/XPRoomAnimationView.m | 13 +++++++++++-- .../Model/XPMessageInfoModel.h | 4 ++-- .../YMRoom/View/SendGiftView/View/GiftComboView.m | 15 +++++++-------- .../View/SendGiftView/View/XPSendGiftView.m | 6 +++--- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 639dec8a..abd27c38 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -315,8 +315,17 @@ PIUniversalBannerViewDelegate> receiveInfo.nick = [attachment.data objectForKey:@"sendUserNick"]; receiveInfo.uid = [[attachment.data objectForKey:@"sendUserUid"] stringValue]; } else if (attachment.second == Custom_Message_Sub_Gift_Send) { - receiveInfo.targetUsers = @[]; - NSLog(@"******************* %@", receiveInfo.targetAvatar); + if (receiveInfo.targetUsers.count == 0) { + GiftReceiveUserInfoModel *model = [[GiftReceiveUserInfoModel alloc] init]; + model.nick = receiveInfo.targetNick; + model.avatar = receiveInfo.targetAvatar; + model.uid = receiveInfo.uid.integerValue; + receiveInfo.targetUsers = @[model]; + } + + if (receiveInfo.targetUids.count == 0) { + receiveInfo.targetUids = @[@(receiveInfo.uid.integerValue)]; + } } if (!_embeddedTargetDatas) { diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h index f16481e2..e583113d 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN ///cell的高度 @property (nonatomic,assign) CGFloat rowHeight; @property (nonatomic,assign) CGFloat textWidth; -@property(nonatomic, strong) YYTextLayout *textLayout; -@property(nonatomic, strong) NSMutableArray *extraSizeArray; +//@property(nonatomic, strong) YYTextLayout *textLayout; +//@property(nonatomic, strong) NSMutableArray *extraSizeArray; ///文本内容的 @property (nonatomic,assign) CGFloat contentLeftMargin; ///文本右边的间隙 diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m index 058d1826..8a959a7a 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m @@ -26,10 +26,9 @@ - (instancetype)init { if (self = [super init]) { - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapSpace)]; [self addGestureRecognizer:tap]; - + [self setupUI]; [self setupTimer]; [self updateCount]; @@ -104,10 +103,10 @@ } - (void)handleTap { - dispatch_async(dispatch_get_main_queue(), ^{ +// dispatch_async(dispatch_get_main_queue(), ^{ // 1521 连续震动 3 次 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); - }); +// }); [[GiftComboManager sharedManager] sendGift]; [self.playImageView startAnimation]; @@ -128,9 +127,6 @@ if (!_container) { _container = [[UIView alloc] init]; _container.backgroundColor = [UIColor clearColor]; - - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)]; - [_container addGestureRecognizer:tap]; } return _container; } @@ -141,6 +137,7 @@ font:kFontSemibold(30) textColor:UIColorFromRGB(0xFFE07B)]; _comboCountLabel.transform = isMSRTL() ? CGAffineTransformMakeRotation(M_PI_4) : CGAffineTransformMakeRotation(-M_PI_4); + _comboCountLabel.userInteractionEnabled = YES; } return _comboCountLabel; } @@ -158,7 +155,9 @@ - (CountdownRingView *)countdownRingView { if (!_countdownRingView) { _countdownRingView = [[CountdownRingView alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(90), kGetScaleWidth(90)) - duration:5]; + duration:555]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)]; + [_countdownRingView addGestureRecognizer:tap]; } return _countdownRingView; } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index f931c354..b9191367 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -353,11 +353,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; @kStrongify(self); AttachmentModel *attachment = [[AttachmentModel alloc] init]; attachment.first = CustomMessageType_Gift; - attachment.second = Custom_Message_Sub_Gift_Send; + attachment.second = Custom_Message_Sub_Gift_EmbeddedStyle; [data setObject:[[obj objectForKey:@"uid"] stringValue] forKey:@"targetUid"]; [data setObject:[obj objectForKey:@"nick"] forKey:@"targetNick"]; [data setObject:[obj objectForKey:@"avatar"] forKey:@"targetAvatar"]; - [data removeObjectForKey:@"targetUsers"]; +// [data removeObjectForKey:@"targetUsers"]; attachment.data = data; [self sendCustomMessage:attachment]; }); @@ -927,13 +927,13 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; dispatch_after(delayTime, dispatch_get_main_queue(), ^{ @kStrongify(self); if (self) { + [self sendCustomMessage:receiveInfo oringinDic:originDic]; [[GiftComboManager sharedManager] resetCombo]; @kWeakify(self); [[GiftComboManager sharedManager] setHandleComboSuccess:^(GiftReceiveInfoModel * _Nonnull receiveModel, NSMutableDictionary * _Nonnull originDic) { @kStrongify(self); [self sendCustomMessage:receiveInfo oringinDic:originDic.copy]; }]; - [self sendCustomMessage:receiveInfo oringinDic:originDic]; } }); From 2637ae065e5f7587dfa3860d7090837862066d4e Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Tue, 3 Dec 2024 17:40:29 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=B6=85?= =?UTF-8?q?=E7=BA=A7=E5=B0=81=E7=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 6 + .../block_selected.imageset}/Contents.json | 2 +- .../block_selected.imageset/组 7594@3x.png | Bin 0 -> 959 bytes .../block_unselected.imageset}/Contents.json | 2 +- .../矩形 3035@3x.png | Bin 0 -> 1071 bytes .../Contents.json | 21 -- .../common_icon_beautiful_ar.png | Bin 1373 -> 0 bytes .../common_new_user_ar.png | Bin 3650 -> 0 bytes .../Contents.json | 21 -- .../room_new_user_greet_new_ar.png | Bin 1229 -> 0 bytes .../Contents.json | 21 -- .../common_icon_beautiful_en.png | Bin 1427 -> 0 bytes .../common_new_user_en.png | Bin 3650 -> 0 bytes .../Contents.json | 21 -- .../room_new_user_greet_new_en.png | Bin 1214 -> 0 bytes .../Contents.json | 3 +- .../room_new_user_greet_new@2x.png | Bin 938 -> 0 bytes .../room_new_user_greet_new@3x.png | Bin 1709 -> 0 bytes .../room_new_user_greet_new.imageset/新人.png | Bin 0 -> 984 bytes .../gift_tag_effect.imageset/Contents.json | 3 +- .../gift_tag_effect@2x.png | Bin 1290 -> 0 bytes .../gift_tag_effect@3x.png | Bin 2330 -> 0 bytes .../middle/gift_tag_effect.imageset/特效.png | Bin 0 -> 970 bytes .../gift_tag_exclude.imageset/Contents.json | 3 +- .../gift_tag_exclude@2x.png | Bin 1198 -> 0 bytes .../gift_tag_exclude@3x.png | Bin 2232 -> 0 bytes .../gift_tag_exclude.imageset/独一无二.png | Bin 0 -> 853 bytes .../gift_tag_latest.imageset/Contents.json | 3 +- .../gift_tag_latest@2x.png | Bin 1229 -> 0 bytes .../gift_tag_latest@3x.png | Bin 2239 -> 0 bytes .../gift_tag_latest.imageset/新礼物.png | Bin 0 -> 1150 bytes .../Contents.json | 3 +- .../gift_tag_time_limit@2x.png | Bin 1245 -> 0 bytes .../gift_tag_time_limit@3x.png | Bin 2258 -> 0 bytes .../gift_tag_time_limit.imageset/限定礼物.png | Bin 0 -> 893 bytes .../gift_type_newIcon.imageset/Contents.json | 2 +- .../gift_type_newIcon@3x.png | Bin 846 -> 0 bytes .../gift_type_newIcon.imageset/新礼物.png | Bin 0 -> 1150 bytes .../Contents.json | 3 +- .../common_icon_beautiful@2x.png | Bin 1023 -> 0 bytes .../common_icon_beautiful@3x.png | Bin 2137 -> 0 bytes .../common_icon_beautiful.imageset/靓号.png | Bin 0 -> 1002 bytes .../common_new_user.imageset/Contents.json | 3 +- .../common_new_user@2x.png | Bin 1179 -> 0 bytes .../common_new_user@3x.png | Bin 2070 -> 0 bytes .../utils/common_new_user.imageset/新人.png | Bin 0 -> 984 bytes .../ShoppingMall/MyDressingViewController.m | 2 +- .../Session/Content/MessageContentTweetView.m | 10 - .../SessionList/SessionListViewController.m | 2 + YuMi/Modules/YMMine/Api/Api+Mine.h | 4 + YuMi/Modules/YMMine/Api/Api+Mine.m | 9 + .../Presenter/XPMineUserInfoPresenter.h | 9 + .../Presenter/XPMineUserInfoPresenter.m | 30 ++ .../MineInfo/XPMineUserInfoViewController.m | 32 +- .../View/SubViews/SuperBlockViewController.h | 18 + .../View/SubViews/SuperBlockViewController.m | 352 ++++++++++++++++++ .../View/Cell/XPMomentsTableViewCell.m | 2 +- .../Model/XPMessageInfoModel.m | 14 +- .../View/XPRoomMessageTableViewCell.m | 60 +-- .../XPRoomMessageContainerView.m | 4 +- .../RoomGame/Presenter/MSRoomGamePresenter.m | 7 +- .../YMRoom/View/XPRoomViewController.m | 14 + .../YMTabbar/View/TabbarViewController.m | 1 + YuMi/Network/HttpRequestHelper.m | 6 +- YuMi/Structure/MVP/Model/UserInfoModel.h | 3 + YuMi/ar.lproj/Localizable.strings | 7 + YuMi/en.lproj/Localizable.strings | 8 + YuMi/tr.lproj/Localizable.strings | 7 + YuMi/zh-Hant.lproj/Localizable.strings | 7 + 69 files changed, 563 insertions(+), 162 deletions(-) rename YuMi/Assets.xcassets/{Language/en/common_new_user_en.imageset => 1.0.30/block_selected.imageset}/Contents.json (85%) create mode 100644 YuMi/Assets.xcassets/1.0.30/block_selected.imageset/组 7594@3x.png rename YuMi/Assets.xcassets/{Language/ar/common_new_user_ar.imageset => 1.0.30/block_unselected.imageset}/Contents.json (85%) create mode 100644 YuMi/Assets.xcassets/1.0.30/block_unselected.imageset/矩形 3035@3x.png delete mode 100644 YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/Contents.json delete mode 100644 YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/common_icon_beautiful_ar.png delete mode 100644 YuMi/Assets.xcassets/Language/ar/common_new_user_ar.imageset/common_new_user_ar.png delete mode 100644 YuMi/Assets.xcassets/Language/ar/room_new_user_greet_new_ar.imageset/Contents.json delete mode 100644 YuMi/Assets.xcassets/Language/ar/room_new_user_greet_new_ar.imageset/room_new_user_greet_new_ar.png delete mode 100644 YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/Contents.json delete mode 100644 YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/common_icon_beautiful_en.png delete mode 100644 YuMi/Assets.xcassets/Language/en/common_new_user_en.imageset/common_new_user_en.png delete mode 100644 YuMi/Assets.xcassets/Language/en/room_new_user_greet_new_en.imageset/Contents.json delete mode 100644 YuMi/Assets.xcassets/Language/en/room_new_user_greet_new_en.imageset/room_new_user_greet_new_en.png delete mode 100644 YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/room_new_user_greet_new@2x.png delete mode 100644 YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/room_new_user_greet_new@3x.png create mode 100644 YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/新人.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/gift_tag_effect@2x.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/gift_tag_effect@3x.png create mode 100644 YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/特效.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/gift_tag_exclude@2x.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/gift_tag_exclude@3x.png create mode 100644 YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/独一无二.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/gift_tag_latest@2x.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/gift_tag_latest@3x.png create mode 100644 YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/新礼物.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/gift_tag_time_limit@2x.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/gift_tag_time_limit@3x.png create mode 100644 YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/限定礼物.png delete mode 100644 YuMi/Assets.xcassets/middle/gift_type_newIcon.imageset/gift_type_newIcon@3x.png create mode 100644 YuMi/Assets.xcassets/middle/gift_type_newIcon.imageset/新礼物.png delete mode 100644 YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/common_icon_beautiful@2x.png delete mode 100644 YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/common_icon_beautiful@3x.png create mode 100644 YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/靓号.png delete mode 100644 YuMi/Assets.xcassets/utils/common_new_user.imageset/common_new_user@2x.png delete mode 100644 YuMi/Assets.xcassets/utils/common_new_user.imageset/common_new_user@3x.png create mode 100644 YuMi/Assets.xcassets/utils/common_new_user.imageset/新人.png create mode 100644 YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.h create mode 100644 YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.m diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index df6077c7..02be5378 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -499,6 +499,7 @@ 4C6E1F752CEAEC3C0073D0A3 /* ShoppingMallTagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F742CEAEC3C0073D0A3 /* ShoppingMallTagView.m */; }; 4C6E1F792CEB12780073D0A3 /* UIView+GradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F782CEB12780073D0A3 /* UIView+GradientLayer.m */; }; 4C6E1F7C2CEB25B10073D0A3 /* ShoppingMallItemPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F7B2CEB25B10073D0A3 /* ShoppingMallItemPreview.m */; }; + 4C815A172CFEB758002A46A6 /* SuperBlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C815A162CFEB758002A46A6 /* SuperBlockViewController.m */; }; 4CC6195A2CEC7770008C1EE8 /* MyDressingDataPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */; }; 4CC6195D2CEC996E008C1EE8 /* MyDressingDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC6195C2CEC996E008C1EE8 /* MyDressingDataModel.m */; }; 540EC1D02C89925F00F3BF0D /* GiftComboView.m in Sources */ = {isa = PBXBuildFile; fileRef = 540EC1CF2C89925F00F3BF0D /* GiftComboView.m */; }; @@ -2584,6 +2585,8 @@ 4C6E1F782CEB12780073D0A3 /* UIView+GradientLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+GradientLayer.m"; sourceTree = ""; }; 4C6E1F7A2CEB25B10073D0A3 /* ShoppingMallItemPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShoppingMallItemPreview.h; sourceTree = ""; }; 4C6E1F7B2CEB25B10073D0A3 /* ShoppingMallItemPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShoppingMallItemPreview.m; sourceTree = ""; }; + 4C815A152CFEB758002A46A6 /* SuperBlockViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SuperBlockViewController.h; sourceTree = ""; }; + 4C815A162CFEB758002A46A6 /* SuperBlockViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SuperBlockViewController.m; sourceTree = ""; }; 4CC619582CEC7770008C1EE8 /* MyDressingDataPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyDressingDataPresent.h; sourceTree = ""; }; 4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyDressingDataPresent.m; sourceTree = ""; }; 4CC6195B2CEC996E008C1EE8 /* MyDressingDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyDressingDataModel.h; sourceTree = ""; }; @@ -11176,6 +11179,8 @@ 23E9EA992A84C39700B792F2 /* XPMineUserInfoRecordedSoundView.m */, 9BE01ACC28925F7D00B50299 /* XPMineNewUserRechargeView.h */, 9BE01ACD28925F7D00B50299 /* XPMineNewUserRechargeView.m */, + 4C815A152CFEB758002A46A6 /* SuperBlockViewController.h */, + 4C815A162CFEB758002A46A6 /* SuperBlockViewController.m */, ); path = SubViews; sourceTree = ""; @@ -12890,6 +12895,7 @@ 9BFB10222897D68400B3985E /* XPTabAnchorCardModel.m in Sources */, E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */, 9B1B7292280010E8003FACE9 /* Api+FansTeam.m in Sources */, + 4C815A172CFEB758002A46A6 /* SuperBlockViewController.m in Sources */, E8A3539728FE7C250014A784 /* XPWishGiftPresenter.m in Sources */, E85E7B142A4EB0D200B6D00A /* GuildAuthModel.m in Sources */, 9BE01ADE2892A66D00B50299 /* DressUpShopModel.m in Sources */, diff --git a/YuMi/Assets.xcassets/Language/en/common_new_user_en.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.30/block_selected.imageset/Contents.json similarity index 85% rename from YuMi/Assets.xcassets/Language/en/common_new_user_en.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.30/block_selected.imageset/Contents.json index 4844eaef..03d67398 100644 --- a/YuMi/Assets.xcassets/Language/en/common_new_user_en.imageset/Contents.json +++ b/YuMi/Assets.xcassets/1.0.30/block_selected.imageset/Contents.json @@ -1,7 +1,6 @@ { "images" : [ { - "filename" : "common_new_user_en.png", "idiom" : "universal", "scale" : "1x" }, @@ -10,6 +9,7 @@ "scale" : "2x" }, { + "filename" : "组 7594@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/1.0.30/block_selected.imageset/组 7594@3x.png b/YuMi/Assets.xcassets/1.0.30/block_selected.imageset/组 7594@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..ed432ce9e75d92d08374fd8ae5b1b3d090b894c4 GIT binary patch literal 959 zcmV;w13>(VP)Px&c}YY;RA@u(noUSlQ5462XPzU58nr4a!muI`6zr3NR&ByXv?#GCf)FG6ppQ)? zRA977i#~`%f-w5977-+ES_MU)LV*;NAW>l}Ba_5w=ER+8bew#S@6EjN&EPB__nvcp z=lt(|_suuUgD`UmSgTNWfRuyI1!mdJ@%Z@^CoML!9zcSuK zZ4RzPBK0U6f%(9=<2(kL$h-nQAooG;$eWH26v*7MwGHC41BV#BM6_7 zKoiBGc4;6KpEv>*h5A)ki-xZNrIWSnlW_xxwU?6NjyT*X*ty_tB9Zes2o=xm0D-_E zIUKrX9z?o6fEi6T?PGGTn zYrdNK1r4tkZMN!wn?Bsq-DXP>>O@4e+rLD zE(1?F?S}y~$CJGKO@rlHNvA6|T``|zz@JhK7DLIrSc-mqgV3PkbomdguoPAwgUb3C zOxGoN-QpO|e_$IfL&YvAD2jm%^~0^T(Erg<)%*iyDz*L$RP7lHkkeoWYTZewY#6PS z!TU1=T^Hf`=^T|}vi#yTdwUh09E0HjM=~^n-AOS6yH+$(JNcPPbzg_a`y2zsCpZT) zP%Dl=_5PTRcWvcIIo)hr!a3g+?Ht+3GI_k)*MmdA%z@d-GBF?n<)QpCx5kpQXeY}o z$t2cZzg4^wH#p+DpkH{c1C*;ZV(B- h#G+3Q^LxC__Ad^KzfZPx&=}AOERA@u(nqO!XR}{v-Z+2(nAdQlTU}##Dlpt93p)rA_tcJE|@j-lWQz=S| z6`_=tQs_gGHZ9VJLMbgGh%GHjsaYRHs8s8=`-ifyyYWF=F^HkkrYL#X#)ypBKXb~Y zZk!!A+0DZ+n{emx-ZS@}Z_alv1NTSF^JFp^qf`p4DOv0XWS@{d1l9mpJ>NSXk5373 zCqP~)3(jd}>vEy6@>VqZY_Z=C%+xD8S1Ao&-=g&SN19EiVEYC$zJGoOy9u zf8HHjlkoB5qk8Xp*>8y)7GSN9i8r;i0G0;)rIAN&jPc~5Lw%*{i*v$kQ9ZrZ5Qt*{ zo@i?2)(N@?!JFeZw2`W~Ibn%Z{y;_Ki+Z9+W+C#sfCUlD^g|D+83a28)&_u^0BLjO zaW6o=JGgbrH}?3fu!lVrbK8%=m_`iGm=DtJ?dzr{Cc2B!C@X#li^U|cYSq;hhEZxS zS(WDjej>nnXD$S82@th=j#S?lrPxBV!QF;#Vad=ZKb0E z>$Td8zeM&&kUOh`Hq%iu&D}e8M3%%=Z8|;LRkW;g0Bnk2_R+`@#uGW4#`(d?O9hBm z2DkQ)EcWa95&ugvyGNj%asVx2fv+-^%C0L3(*U~Xss=1s96}&BS;kJ<_?}q|eks5~ z*B4)M0E-Qc5&XO`X&i2d90Bs7t_6NGO?~?A-Axbtx^%ZM(Yw1RLetZKu5L3{L@dGZ zg2+*|O7lZvoB`x2p&yPz>Y4!wqZ z+Qi#}Af|JL|H(4$5m>tk_Ov283*a9DKM8Q6Av)_6H;emq++S-2wdaDwu8PR!R)C!; pG7j*Ru1QYUD|f=-aNR$o{{W)?=#4$>@=*W)002ovPDHLkV1g4<`$+%* literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/Contents.json b/YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/Contents.json deleted file mode 100644 index 701e90c6..00000000 --- a/YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "common_icon_beautiful_ar.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/common_icon_beautiful_ar.png b/YuMi/Assets.xcassets/Language/ar/common_icon_beautiful_ar.imageset/common_icon_beautiful_ar.png deleted file mode 100644 index 5d311b43c8895916bbe93280131a536bdc1d6217..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1373 zcmW-gc~nzJ6vjhc0Bu+g*lJLS3!(>6OR3vY!H5I|5fKEmpd$McG$3MaV+zF>rBFp6 zh#<0Ktl+6qb`oL&No0{FArZw!0;mKKf|1O;PW^a4&j%rT!zEp z@MJfV4|;D$kG;Vn6lJFcVjNCy)cdgSLG-B&Yr(2t!Bi1eDg!YbaEY%y*Me2bVMY&D zB}a=eT?{k20j(2+w}Qx4tU`{J450`jTH&2OvrH6K9!Rk=8H%V2)#&mH8CEWX`2+CYpcZMxao~L^L}duC za1iG8BQP`*0Rt)zZD}Lh!1;EpSc*gu7`!`x+OZO;PB*#@A;DrPh~>bXK9I}@i9DG7 z64iqXs8^z!iG*_dP=fHZ;VtN}kkzj{%U46t3P|C@k|A*MIhu@yAQA)yGkcIly0L%t zA`A?}z-0l_1y?$B!@pXg>$)n0MH28^C(P~F=|;674$tF>N{w_F0SUg3m{>i8*XW1DoE$e_lhj9R4>0JI5gRosL$f!umfzffCjX zBTM1GBOsoGy;oz3PuPobC>qB`XQ5mLTNQTXe2D(^X{wLcG2GPDQkvQ1q#|KvdU|R~ zAr(HUNTX1^zi3n+KYn=IC9bWZ#0CfW?%BO%Epd&NDPB9To*kC-iAAD@ic%JXo){H; z%){B)(ZLe0(Wpm;TbiG-*(?@|$w*3yiVXSTQgq3F9PS$)ndI#2#!u{?5B53w9eZ5`{jzf$%rztm!MkEf5X%KV%)ezz={su zTmL#QFxkk%!(;PdvB;ee-?#s6eN}n=3y$1sBBvL^-d>-TR`?^1_nj|zo(YSKtMkrc z9q%#N=6O7zGW?u6v&%+3D{2qqx#VP+4-*pY>w9jz@71L8ow6`>n6;IKAnZm*=tNcS z(x_cE2khHMmCB$*^Ofqyla-c@+L2wf`YfZ{l(6i;)i?C|zExDOms~6>UH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Ifhs*lu~ky=>D%7t1>`NR3dNG&|dErYtZmYNJ>m6coe1gv$n rmYUbeG$}NxG;utMH1T38nOXk=Un+_LpNz9600000NkvXXu0mjf4Cm!e diff --git a/YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/Contents.json b/YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/Contents.json deleted file mode 100644 index f9e32c16..00000000 --- a/YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "common_icon_beautiful_en.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/common_icon_beautiful_en.png b/YuMi/Assets.xcassets/Language/en/common_icon_beautiful_en.imageset/common_icon_beautiful_en.png deleted file mode 100644 index e42ff4e72a38f161870cdda0943df0b702b95dc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1427 zcmWkt2~<-@6io{#1<^x5Y^7?o0#Vc;)}@{*Wz`%MA&5u~I|dVWL6Akk$QD3AP{0rr zQ6TIZJym4O24PEB3}6TdqR1kaAf70iKfm+;ng3?q{5$vF_vU=2v(qs>osBv;98QmP z+>Q)qOZe{A)__sr+bO}}ei(5+aoQfHYHAx=GY*n_(Q*Y6#7BY!C`X~D@zClqB(WQ& z2%QhI2SBO>N$5gCh3Er0M1ssdB)S6$y zt7&|Qfm(1M?!Zrw4O+zvgb1JxP6UylHXf?tCD`huTw88pQJ>DhaNq$wDj)Xl%kIt z9*it07Z*P+)KqzUoZj>Mrf;gx(~4nPpR~89OH|HcMti%G9seL2>8*TKsouZtYHMwJ zR99EVVzDxrSL0|tWXFB<1Dki^a2k3fJL}WO#aH@c&b@Rt6fa#b@7JMQSCm@1jd2fZ z|JU;D$4Z9wA-~!|XA@7-=pgqQaX8Z0#yC_slT-Zt;l!3xn|ZnM6;oY^xyk<3y=_#Ko)Agw13Qj^C(jXtr<_+?Pn7wJZ`&tY_!UvF2ANtqCY(;T`?`{YQFq zgBR{y>f=tjwb5}GIE4KsZ2kPSBRH*1LzKLMC~}W((%k}Mqm(!CFEVp*^EHj409h^f zr&5Nw<;DXP%|ldAC6!8b>JMlO2uSsvA!-yCfpqEdg4~ksGBds6pY1cmkJ1-J?Yw#) zC4skfr&`w$btY{m>dvmapd$^s#$zx(jd8OwYP*;|7Mw1jHL>{eU)T2A?bdJC^pwTQ z>wFXb%-(3i*_~!fNb9&2+b~k&Fy~{yYPj!ES=OKOdaYSvMvYgPc8jKMo}oaWrsZxz z@-vA0rNg2mlH)D-Y{IRb+@6B>&8M;R%jj9Z1{#pc$a#c*qVG36^{^4YsBcE7y~(Bh zdgM`?d?7yb%q-j8-}w2P?QXXsT(<|?5Dz+!EA2R+A555KxKQL2 zm-8-Jlk*&cpX}6}QTI0ewS&obuV!)5BcgrVLVMB)VVQo@Mh===83b(s-c-}?#M!w9 zLuRS5Dqc&t+LJPLFW4rGwyg;7wPu6dpPpfQY<9{arXw3Kv~+rsc69HC<}IeSW;AY? zrO4M{&ts*ByQZ?DlRJ4MXChd0Hl+FAQ-U3FxJkOzot?W9PB!MR^RXg});CY2s=Sh{ zM?60;682Wjb2a{!_9!TVm4{8aGu#2uF#0sZeAlf@GdTbF!We$_3iaZSiM21-uCZ=a zj4y%Wa&--^>f~N;3oBP?;bVLH+xcCQhq99QeF*QR4n-^YqN~;W7B3dq5>E7sQe5o$Tsud>H=&>Wx0I diff --git a/YuMi/Assets.xcassets/Language/en/common_new_user_en.imageset/common_new_user_en.png b/YuMi/Assets.xcassets/Language/en/common_new_user_en.imageset/common_new_user_en.png deleted file mode 100644 index 6bd3b8a6b4b82bcdb093ee8a0b23ceeb7f2b3aec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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NP z%k15)?BB5J{rUa$;qvaY!Sv+#?$YkpnBw87+})qt-=5R!&++HR@!`4e=fdpn&*|p5 z;^D61@3g?ba`^Gs@7JH}>c;5iz2@Ji-sG*=-=o;;$L8n1=IO!X->l=}u-`ppi7x;E z06KJ1PE+ym@$vET@$m5S^6~KS@bdBSnGpc?_VV!Xm_|nF>DAQI(b3SDn3$MIMiCMA z_UP#7=-AlP(U?X<2@OUH0007&NkleabK4*C6E?8Qgbw2K?l&6}ef{k9Uuc4`>>3H>| zxvRwjjJ5vQ++1B<{q~h+X=!e5a&mHh-fp*Bt=6fj*?I=ybEl#h)2i8tiHZ8=F8K8B zUS+*iHk+-#89ugdmZ-T>HC0efXG1^q(6XW;W~Wgrr_1#kDmD39<#snh_5Jyb$;#~` z_WWu9`$(IL9bS-FhzMda+-Xt;zEz0rjV~v z#V}cgyyTQ+Wt5j(EmP;YgB=keT` z#@yjvCL5D7QO`D>aUotHl?XOL2MbH#zRh-k`>q_H_xTR-&mo?81c49j;1Q`{m>h+X zOF5l+6y2DSBuT*JF8lq$ou7F9Js1v0bWqRo$x%LvKIBC)nM@vYS?PlJ3P)LimPH~C za_q+4&m z??+&C=%qGHrM6DnM!I3_%kV&xCSRpKJneoCma);{fwwxH&R{SYjYhNCY%-ZZo+^2I c2Z>q!0q-@XR>YLwng9R*07*qoM6N<$f_YcS=>Px# diff --git a/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/Contents.json b/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/Contents.json index 27bd67a7..1dbbce05 100644 --- a/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/Contents.json +++ b/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "room_new_user_greet_new@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "room_new_user_greet_new@3x.png", + "filename" : "新人.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/room_new_user_greet_new@2x.png b/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/room_new_user_greet_new@2x.png deleted file mode 100644 index d92690afbe2ab0830f33e941232616caab6272bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 938 zcmV;b16BNqP)d+z;yS+dGpYVaWDbd+^GG>e`vt z?z6!D{QkXh`OAdq)R5lRlHA;z*501d;iJ#&vBL4Vy~cg-$A9hLpwZx=(DJ&w`}O_1 zZT$N3`S|bo>8!@@wZHVdx%lq<_2>D%a{1h=?#_ti(vITdqt5BA#`V6px@`T)ium%~ z_2jd=Yg;H~5C$>G9&{_WWN_Uiid<@)>c_``hm?9lY#x%146^2vqr z(v|J#zU0`O;qlJh)|1`p()`hz`Q^m;_UQKR)biG%@x^@a-mvcQ)a>cS>&}bn?8xZV zm*?xn<>j~Hg8cjR_r!kp-n91T$o1H#^yI+v$A9qo>hH*d z@5_nqt*xzl@x3qr00Fv5L_t(2&vnsPQ|eF@1>g;MEw>6pAy)+iqY_X9#zakwqEZFv z-QIiez5Q@cPDn<_alf30Z|2NiYlE)wPhGP*({0`DtsRj8M*k0V(D?ES&^h18;ixYv)T$xN!TtLF!g%!3jN;do+v23o`b+?v+i zoYmo?&*-ej&x+;Hi{##&)W381%7W|6gz3zM=*@@c>#)P|xV^)9^Vyf#?XtrB_x!$b z`OAaq&WPsfuf@A<{k(4cz;*Zd>h;8W^Tm7d){@=WmfFO7@yLJf$${+Op40NWy#4t4 z^yBx(e(%+h-|w}+@V3A6ySnx0{MVf6^}V_L`TqO%{rBtp^W^*V<@vyL_r`$q=BUf@ zx4!njxANip>CXG)#QMX1_`Y)Z?$-A3+4cGC^z`BM;(Y?t=)L3Fo8jN3-QlU(+nLznqtNuby7j)e z_`(KW0<@M{%^3j#@&X4ikuJ6*8?#+zu)tl_tpX=wp>f5F2)tBe# z!RFhdViE$nWaK>CK4g&4%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~DCreK1t~GN|ZFz>B^RV-wloVK9O+ z^)Kch0=Z~H6;?Yo9EMPKh&~u(X#otY?K^yI&~%UtrVr-#rl$p#K-uVV0Aok`z6?vl zkyX-aKWH_|W&s|_kg1c9(G{oFNNo7ukPRC?1FQW6$bF*_xC`yb00000NkvXXu0mjf DBK!tV diff --git a/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/新人.png b/YuMi/Assets.xcassets/low/Greet/room_new_user_greet_new.imageset/新人.png new file mode 100644 index 0000000000000000000000000000000000000000..967f8be5897682faad37560683d157b505e0690d GIT binary patch literal 984 zcmV;}11J26P)2p>7aa82y&2abEmlwd-NT z=yX;5Uc%{Kyy;`K>|?X+|NsARXZmHO?s8rHb6NdooA79s@o#MTbWs0pcK2~(`)+dh zZ*cf#q3>s(?`5g(WUlRGtL~UfIW3%jHxa(uK>ted0rX?V8!U{ z@%?XZ`D}jnZF~0Z@BV3$@@#?iYKQc;yZdR7^7i=tYK!y8(EMqQ^T*Wtw8#0{H& zbCUGZ)%~Nf`I@Qtc7ykPn)QRO^W^6KqPF;$vGISpX`P0006j zNkl< zf;L`iu|e0LYjKU9YC?}Sp(mQqBTeY0Ci=nyP3WN}WEkU*U~Cx11*$O%2o?hi^Fx%` zLM{gZjB`09Fq)AJP&q6)APz0kzn^LN|(9sQ4lDh$=nK*5Madmyd^OP{U{kAkwI{Y@;M;iSHc(E z$yWlFaDCrLBK;wHhW;6=R{xxN-}lLN(NP;pmctqZcffGVKsC9z-Y>Vz70G9AgSp|l zQvo6OBB95B8MrOgw9mB)mr=L}Aq?{n!cW+NkPp=#N>e&v2iG`aK5lUSNbQCp6$%gz z3RubmM3~^9!WG!WSsi@GI0ymRwi0Z+j&8h@Nyi4&DuxDrfwY4V4gwO9AnYmwY>6Kd zwO%@vDiv)8BU?ySPiz4}Kqv}vG7*FjZ3IB2h~;EbSEmR-rdcf(+omd@YAU{s>ZhX; z!fE`|G{2)n0R%nho+fl(6WaZt_t35;bVCz;;jSj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&#TTyl6Ye zqo+J=yyw(szLVW_+mOnb4>P-XxK$W9F5tdb@YC}P4loNx^0+~2e50OarcptP+$V`^B)2lq z6WcYWKMv$>|FYdqXxZ3x?|>|0Ui)=)oLb#YreOv%^KDY#j&t5|G~VI1Ytx}8SSkv_ zC*8lSrm>quOpZk1Myz}zm%n-4vh;+N&0EimrS!TTH`cTh8px$TiQg6GbZYPgk!{5X ee5Mm7X%ZV}lR;C>F;cT6DvfFH%;4?!z5YK`cK^Tt diff --git a/YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/gift_tag_effect@3x.png b/YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/gift_tag_effect@3x.png deleted file mode 100644 index 917df518812788415bc95598232320a4a1cd8f5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2330 zcmWku2{aUH6du|{v?|M>P->8(L{t)r%)H4GA(hB>L{gGMDN8+)m!|AJSu&F__Awfa zHDodwVJ7<)jb-AI`R~&`cRBZ-d+zzpcfNC@iGuEI?$a6d^&u&2h1zLjRdkh3?xIjA*@)33s82z zyDdP*{yFu@9$FnCPXRt(ga%6>OGAq-u&)B^GO(PX*#;VjKtGD|_duQ;2>PMc462R; zRTbs!Lhs~&69r6jU>F1A1my2T6eY-4L@VHzreSdk=D6_XGPK%5qct=UQ5_NLEudHf zQE^bDhRBLQkp;92%L}kD0!%#AuAEwNL!cc&rH7$R3kp==w*VFi>E+U6iv4U>;x&7JFcd1`~zQp9?)tq1gx3d7~P8^wA#Zra&_m zzQ+m4dx5IFoFxx4E%2ih_+-Q(A#mD*&8@3`eN3MIWuv z2TfQSg1IUfBSY^qXmdjhXJHv0Dzs)qGiO%RuNPoNu*R%L@+c@!W?_Dsml^Kk?q+GB zFI@a@UNAQ|%jZx1_%Yh`wS(2tSVYdwPEUDF3h;Axb+kRMQ%7w~z+l#p%uP<(=zX$H z2(-64CsY5dn-|QdFO+FK#uS8!elgj6;AVzuX8N_LL{Bf*a(~-4?N)AT8(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CBY=Oixu*DX`c0_epeTLe)vDk CPe087 diff --git a/YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/特效.png b/YuMi/Assets.xcassets/middle/gift_tag_effect.imageset/特效.png new file mode 100644 index 0000000000000000000000000000000000000000..79d59e55e4f1371391beed5b4df57c1a63a70d8f GIT binary patch literal 970 zcmV;*12z1KP)8_&Znu6b=Y24i1_T<*}y~pp$s`utEK0(oadZx+?rt7@a+2D$@1N~@57+z#hvJd~U=v7hJ7mFK9J6zf`Nw zQE_rowRZgKqVH=K6`PCY9qZ6rL&{a&M8P_=)=(&?QmyTj2a=BM3`#GP$(H=7a#8_t z=>Q!$7Ji_x(TY=UHHVH&F5YZ9U$CZDm!;!0x(=S9tF}zQlH+$xmQ~FqAKdXB7jl2s z8)WTOzZdwKM^%AVXB`bJv9o}#^a|6MCBU0X{CJGQ(+$KL&lD^uE>I|aV8{A`3QW(Z z^$XKnL0&RV8!=rn6_9Wh5$!~Rf5BUs&^}90FzMny&u+!nMGRB4|WKl!3wvu5nbU9LXuF0mLFR)8SVn284V*ELAAE-L0tpp4{v4jry8=6-T(jq07*qoM6N<$g0Nr*z5oCK literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/Contents.json b/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/Contents.json index 59215e0f..ab1fe0e8 100644 --- a/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/Contents.json +++ b/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "gift_tag_exclude@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "gift_tag_exclude@3x.png", + "filename" : "独一无二.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/gift_tag_exclude@2x.png b/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/gift_tag_exclude@2x.png deleted file mode 100644 index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)Xa!}QvG;@8lo5Vt;EZnevUUxJ@{QF*XRq3>yAU+U sYA#f&BRQ^Zf$g@u3Vl~`U2MXjgX2_#A)Pn6!N?rVmBDfrIR+*E2VTC`bN~PV diff --git a/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/gift_tag_exclude@3x.png b/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/gift_tag_exclude@3x.png deleted file mode 100644 index f6844369017450d6d1f5feb9cfd9b6e272d7df83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2232 zcmWkucQnw#bfzjF7mL znGqQ`A{kNc_j!5FXPnPDpFf^+p6BzqN6}X0S-*Wf8yg!BSxrfIr5{<%wVW&Ur;wx# z8yg3UqDfU=8CxHrEgO^d_%V$Bw_rA-D-%Du@ai@`*P^Ewv!m!vL6#d@GVrw=wZRxD zMO`dL-=QNCzkXnG5;0WF45Gyc59KjXfbK+;-9t|mo?C(W4nuFyoPrSsCfmUXK!`NP z-=aPSZ9xc;!FVTTdN5Fg%7^HVMZ6I{uh4jp(KpC;M$IF93PG4MI-ViX3@a$Rj7n=% zSRqUnp)!b+C*Inj+7?*`cuYdL973c}YmaC}lwLxl0;;Zn_=A#*D7>(;KrBq5;5_n7 zka8AuO+3}WBNCz%h;j=Qn;~5fv8tdc5hdn$PC+~wG!;ZE5OYlA7$Hdu;Ut7g?_5!S83kqtS43w%k*!C>s1VO|Sjif!@iu&G#b6EkE74Q7s?J9` z8l%wm0A+q?zJYotBp4&t2yq%nSRt&2Xk`>y5}77MygCskOH6;kWH%-|!2F25VtmR& zYb-uJ2ICGIJ(1~%6e}c|gQkNBGP(dS zG4cUln=rhhY&m-J@FfSmDd$Ml_a{BAQl>?A+)792vTSKrGu6a7`5M(h@tuJY+OYT_yz4&WkZg%$P z%=Gls_lb$IfzMs-jCTc@&r%ZOY0>_EPPW$P^kv0m3)k|pv2h(EE6Gz&H`zzHQ}xUR z>*OYBaGx@V#fB9@r)2A+qFT*&CjXFrG6G+S1n=wMCba53$3i+qG!x(kNeyT`IUn@=ZnVHq2Qa|Hz&9p1pODi`3{F#~c-4 zR>X)>HGheGKgl&E>)osSoJDm!^v!NfCY2HBG8w7D#ox%wSd;Zu7=D?}n zUTbFjeBGX9<+$jH8LW#7@Ud-@I;k@3kUiEVPHUR{$esMqkU}}GzgcR2)>ZF_J_nt` ze(0zx|8}>7k(~P5Joe=M6`~^Yq)9wBKWX&zZ_7W%iN-$a(y4g`=88Jgf5a0rPAOWn za$P8OVO^h_$k){xTz-%k7RCoY-_1KV<}NP#rcK@2R4<%$U+myb_0M`bM&q#>d`cIk zg)<$!7U`PfK6_L%E!~yfc`0e}v&uuad&0k19MvIx%55KCFxeEXaF)q@$i8p+AI>=^ zze^{&3Vd@m1o%sFQBHFuf@vGVzZAwU|5E@Yv_H zfW6Bq?(_U1RxMU~dk3TKNq;(Y($q$k=`rUYbBAX4x+;>_b8*^n393o?E?nM{v%l_& zsC_N>zAjRav)kaI#Qr9w6MZg+y`>EGTm?eUoXT(r)yTC?%-5K&JI5|`+I2|SgqOP{H{hjA&29HCvmhy_Q7?`K_17F@ z(Ph8(9nj|sNdNXOc-Dap~6&S zjctXes8B8U)k@CwOQR)?9O*pzseyfaC-$oIOiv9T7o=9UA4)k;b3np})AXDHDTGc= z>$U&Y=$PtMxkE_W&(FD1@snNL3)(iDrwyAZ?HLVwJv#ehspUZ(>s!4|c<+1gS&08w zQkAgZF7drxOhTe)x7;zuvW6{!84R^&8gp&eS>H~*q|?lfP165oQ~dAKl@H8DR@PR^ IQMl;$A9$??umAu6 diff --git a/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/独一无二.png b/YuMi/Assets.xcassets/middle/gift_tag_exclude.imageset/独一无二.png new file mode 100644 index 0000000000000000000000000000000000000000..2b11837122b27ac44c4b1864e8d08b7e573d29bf GIT binary patch literal 853 zcmV-b1FHOqP)naE0n z&s=)JHIKwSi_u|s%vOEWX>!|tXS*ks%~*WbaBj&?fx$a-lm!I2)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4K;42P@C^VoHjWLw%)HE_yiLS zQ&F^<(Y=&J^edH0>kz?)5AcSe4q5a;39L#r8jC;&#v%!;0pxUb*ws_g(EWBm7 z{yu@&m)^Fb)}%p$q=VvX$S^b@OP?MsKXho3bhHqB2@e^L|3M8VOs@UOr?AQ}I2A%n zTgXd7CLJmj3BdX*{yZyG_m956+rSEmOIe21C5`O00000NkvXXu0mjfrxV{2 diff --git a/YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/gift_tag_latest@3x.png b/YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/gift_tag_latest@3x.png deleted file mode 100644 index 0a2e6fda507a778937a1308ca5eecb1e396a3c25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2239 zcmW-hc|6qlAIC>1Dw_^RMDB7cIi{S2iO7*mSfQ0vY$CLDFie(6wxWJk}vm|5dUUf zks)3s5VimZTW8D7wTXiGqLgXm!!kP0!^b!9Aud+MK?|qQ-etW0 z2lkwezMMrpK0xXS_Tnp2x`ahf;4g6eZS1pAMic z^H}FHdUG0zWrOM!G?oR!Hs>5Tv5HS@pat{D?M^gq4mB)6Dwa{3_ejJPBAbgmoq?B| zVazlzFUQpixj2p=q=R$A;Otjm%L3M4fY@u`GzgSR!GR*M3~}>zu)h#!ya)1cf&NEe z(G7I#fp!g$D*;wLK(7Jl)B)8BAXUh->jR`-VB88cYk*|_X7EfuLzQNH4Z0?j(0z6mi83}HAI!CSd_H5dD|h<)Dl+awy&hWbq+iQ@=m z3~_Ek&eb5HOlbcF>NY}?8c1S5<#Kqi7A9YRN1vqT$@bv{eE`e8(S~2)eW8J&>$H#s zGX2g^9g}kjqVr$9mqnl!i9`y>=sm7cn?!=U#K0Zo!_=u~d0E zJ3ZgVm|ZPSA0Mand6ri7bJr8<>$6#-zk~8m!BK+F`ZtoFsAt^hW*=5GXmK4F8mvZD z>`K?dxTXBZ9%ixn+L%wYGa7F0jf+oultYvrT}czlFUvk5Kp-btybXV6yHn$4I(tSX z$Wd%VGRXn@W{h>bFcfo8H7EOYK0EE_vaE2(o-8z>BKoIqL42&DPw;Pz2TUoY3&j_9 zzD^;$Q72_OcTQS{{vByGa=S6z=%$*-eZYMq#yKWMZJZC-sd&*@P%$z<*doi7ujWj) zWBq6mfx1>p&{S8C%`Xs*^cFu)tg72WK24y@dTz~9ss5tU?fumth59^2gK1<>U6a55 z%<#?17iBYVccWcNb@>hES`rTTNnumvK6=dyP7FJ~Ba>>bTI*Eb5K2o7i5xaxW(20^@Nw z)tV()ULx11%anCUjyEt}QONXhxso$x%{%FTJS1GcU#2i$F2}x7UQw5c>1As1$)@+~umix;MR#)Z3uxA9+hE$tHEzoN0hwb;GZ-DGKkbCiY_3Z~?m)Qkk%ePyRD{}Y%Y z+qJK;+e_$@<0IFc?E`O#;>s5)LIh<~1)__D&ry9PS^Jd3yu>p@9PFd4W<3^ zyRH1glsbbsVYLi%?N=m657sQ7Px`ep7b$*6i~WL}434CrI@1nZz1pD~#nIl##H*rS zRa^_5F8ij5!XD~$uEo9@iLYLiu89sM<3Qurs#0sj#2WXC@%wqhcJ{Vv5n6HY!$Y?3 z{nQaGvTLn&$Kkso+8qC=p}z4;-}%Dw<>$oX6#Bf=5?JoOov}$ll=qcCD(jhBUwLn1 z5^^mCeh?F5T#oQBHdpM}Y1Z`6*`O%8r;^^%T9>Iipt4om?Nqaw*psd-`sdojAvuQy zkF~2?3S_v$@xil7{`GEd(iPtn{%oUD^W6>%Ok7#uXsiY0owwyTb2-%CXBV8a diff --git a/YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/新礼物.png b/YuMi/Assets.xcassets/middle/gift_tag_latest.imageset/新礼物.png new file mode 100644 index 0000000000000000000000000000000000000000..be4f94f7f30461364676e473447aaf6cb80e3e35 GIT binary patch literal 1150 zcmV-^1cCdBP)Gp37F8$y%Am)m@9)T8Z9RhfSc)<5q=8qR{A6gG8m$>`{R6PkyX%pS5h8x@wue zXqLlfl(BD}_Dy`KbD?dJzHyGce}}bpjJkt`vxtMSk$$X}e5#*#ruXdfje)P4dZ_I2 z_wVoZdWyLB`1{+<-qE_zk*v;oins6Z_VMra>*w&>UM=hETS(Baq4-{H#J&&S)?!q=g&(6Y17y06QKrOLyr z$El#h!l1yjo4$aOy~~@stdzOOlC`#uw4;HoseY-$eWuyi=kD6(!Oh~e$luS#+rPuw z-@ntmxznt+)4i?A;j+oCs>!*d!<(GJ)}Xzmmb{CNxTcD;(u}Xbim$VTt;cVhhVls< z0000TbW%=J0PINz2l?#m+S=OM#l^*`si~<;M@L64E-o&`#l6=~UjP6CJV``BR5;6x z&UaTDQ4j_20qniEWYT+&HSU5n0R#ons90h&HpH43HI_tUN$wtE zmMs>~t6Guos^X$L%My#N-|B(7xTw<7$6_*!7_N+u>XjX~s>9s7Ssz(mT$=n-e-QQD zl~0(JW#*l|VHSgXn|^J4+58AOr2^MBT0}`j%*X|(r2jEggdNLXn Qw*UYD07*qoM6N<$f-LoU?EnA( literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/Contents.json b/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/Contents.json index 9c60eabf..164e96d7 100644 --- a/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/Contents.json +++ b/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "gift_tag_time_limit@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "gift_tag_time_limit@3x.png", + "filename" : "限定礼物.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/gift_tag_time_limit@2x.png b/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/gift_tag_time_limit@2x.png deleted file mode 100644 index 4af08fbbc64a67938e08aa1255e325bfa1b015fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1245 zcmWlXdoOnv~h9*%Zfnox0)sT*%TZMWx+T|$e zfy+yz^Uyzq{!!Eqq2mKY@4z?+!0kYCJ96vbBLYBN`Q#uU`vr(7hD#;!;^7ttP6D{| zaj}e?FT<5m5?(@lpChys$9M=XM_36t!KF@C;7mE*=3-j72*itbTJ2hpqqS3#Bb zP@Hb^q#N}z!jh3ZDeg^lz{`|ezHiR~zyaabmk_SiNPG$RDjXLe zjR!v-BDv%mcTRWLUu787kmex>m1rBlvtGjKA;mIe$|#nEVoInq33X45h&C`qRJ4fP zuOm0>NLUSt7g7OL$l_BWd=meH`17bxE>bISp&UtNn+wx@bXb^Pa&pL@P^+UE3L3f40wXe4<0k!NJzrZDX@t z+tlH7zvc5sgL%Wl!)j*KZX2JL6^~1p_gK5<1)h@(NmdOGCs>}J4y)=lH@ZHPF>+{R zh4k1?Zf^EExmq**cGjrLN|vCv;;hx#MG5Qc=pJrfIb4s#2M?3HAccniq>|h*9 zyzLkLR7=muG&9LIp4S-GYhB$i<5YAm?LYzZn6!oId*bCTkJXWC1D4Hl`ir=}S8La< z)+BBI=)^z5G~dJywK{Uj#-SqsalxY7i6<%884{WxxDs{Hf3aH z&9*3$82TlHCE4Q8-sM7;XS1|fQgv4QVwcKD zOQX#}j4?g_#hhF8!->5#+Xc}oZQYMYwgx^5*lE$s`mUf%;~RA*b8dstC%Lb;o5{u# zN;74r{laTe-9KGV&Mk`PC;l3fP-Ja++w89Qh*pteeC&JPfap|3n%`i4-ul1>)pkqGhZHvLWFTw5@yOEP zK<8DOzxAx-@_lak^gkGR*QN}88o5@UUznQv%*qE;fq4vu(=WTTSpHWFAIN+sUrPq3 mr!R$juVL3e|5Ow3aORt!kalAgBiK_1B+bFj*|yN;c;x?M_XvRi diff --git a/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/gift_tag_time_limit@3x.png b/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/gift_tag_time_limit@3x.png deleted file mode 100644 index 2805d0b7677f228509024f3e5f6aa2b26a70ce76..0000000000000000000000000000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f}fA5n~s`Ck~0_&>eo{t0a$@aHRNn#soGPhGTo)kwIRJ`oDoI|iw z&GGo!>;2oUM_e(jt}}g^U+zD>SeivTwyP0qk^c7Yyz<_4>xkJopK!^0QbQI;^Obhn zBK2xE_D$$EJt5l;1txEt>Ky7)pNYd-d}$VrJU@Q^*|w9~vb>lxGevz?QljVgjjJe{HX1Ui|-~gU+ag>R|*Ap?I(%q+`>i2 zP1QwImU3MV*x!~@IQ*|08ytBTG)3H0Qbffur`ql|ndw5?v?ovAw%-Zy&K7D33yl?5lFty+Ob-N{7Nual z-)c;+Xo0kmAvd6d?R2Vdr1s6m++ev&HJC!jk1<$bF(U<|smVB%7oS|#ju<#po8`Q*XsYk;dYK|rryJ#G4D=Ny3i#QY)@wI!aSF8M2J});q zZ5Wf$O(^kExho|JxJxmk13^|7%p7RHetaKwU)R z?#PZSuRh!lel7l6jO?E#o^WpZh&JaYK4=oNUQI-!-@vl;!lS~`t-7(lassw_Xgm&Q zPegq09B1n3>Fq5pp7o81?F!_Pv(LJko_+p7=o|HEg7O^K3bi<$8fox~-|2TCv-#=Z z>G*$i+TN*b5N&)?;1kF;Q;X!>O~qOrjJx5lCbem%lpK+$Xh}|xQ}Dt%DikWK(3CB; z-%+*CikNE`(bwirs`~xjr!iub!7-m2cH*SV{zM6lAo4ZWqul)5 zy}TU-{eI&sjGF^e($b64i;IhgxOAd_{y};TCOPltLuyZvUF*-EWo4?qoSZD}clCFZ mX7$h85ocE{4&UOoc=GX~iqoGAj;;M>jGng9#e)A3!~O^RlO6~F diff --git a/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/限定礼物.png b/YuMi/Assets.xcassets/middle/gift_tag_time_limit.imageset/限定礼物.png new file mode 100644 index 0000000000000000000000000000000000000000..02480a02f89d5c9f2aec73977051c3711b15035d GIT binary patch literal 893 zcmV-@1A_dCP)&!GSR|18d=D~7`>g2gM2zbw?DE5xWPl)Wp9z$=NtE555N(V{D#xGc%0 zE2p(9t+Fe}rYn)Y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y%Am)m@9)T8Z9RhfSc)<5q=8qR{A6gG8m$>`{R6PkyX%pS5h8x@wue zXqLlfl(BD}_Dy`KbD?dJzHyGce}}bpjJkt`vxtMSk$$X}e5#*#ruXdfje)P4dZ_I2 z_wVoZdWyLB`1{+<-qE_zk*v;oins6Z_VMra>*w&>UM=hETS(Baq4-{H#J&&S)?!q=g&(6Y17y06QKrOLyr z$El#h!l1yjo4$aOy~~@stdzOOlC`#uw4;HoseY-$eWuyi=kD6(!Oh~e$luS#+rPuw z-@ntmxznt+)4i?A;j+oCs>!*d!<(GJ)}Xzmmb{CNxTcD;(u}Xbim$VTt;cVhhVls< z0000TbW%=J0PINz2l?#m+S=OM#l^*`si~<;M@L64E-o&`#l6=~UjP6CJV``BR5;6x z&UaTDQ4j_20qniEWYT+&HSU5n0R#ons90h&HpH43HI_tUN$wtE zmMs>~t6Guos^X$L%My#N-|B(7xTw<7$6_*!7_N+u>XjX~s>9s7Ssz(mT$=n-e-QQD zl~0(JW#*l|VHSgXn|^J4+58AOr2^MBT0}`j%*X|(r2jEggdNLXn Qw*UYD07*qoM6N<$f-LoU?EnA( literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/Contents.json b/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/Contents.json index ada538a3..fbba8da6 100644 --- a/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/Contents.json +++ b/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "common_icon_beautiful@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "common_icon_beautiful@3x.png", + "filename" : "靓号.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/common_icon_beautiful@2x.png b/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/common_icon_beautiful@2x.png deleted file mode 100644 index 9688f95f3204a85dd363e9bc6f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号.png b/YuMi/Assets.xcassets/utils/common_icon_beautiful.imageset/靓号.png new file mode 100644 index 0000000000000000000000000000000000000000..1ac12fc481ce109e03ac0dd6fc9585b7cd72ab04 GIT binary patch literal 1002 zcmVT50OYA*i33Gs&^@Pi}r zjvn)p9PfZ7^p+d)kRJD<7W0%G_MjL2@#FWulKQ+)`ND7h`0@9*bNkSX_o+4Zvvv5r zar(w>^O!vKqB#5E$o%BT_quZPnN9xl;{4~<{M)Gax`XwwcJ--T^qe~QuQT|oBmVN^ z{pZE{(yaT}tNO-%_p(#?wo>wxKK<#{`OmHU)tdLKMf9IJ@Q5+=m@N9)y8Pj{`OTg9 z#gF;GUirLF7}~yu0000QbW%=J07&eqsV*)D2kiOz`T5$~+Sr(_ao_w2-=?%PpdV6A~`3&FMwgziH z+We%&Cb>Uq;ijdRS}f6=o-jwxHPIK|X+m!`p=X-t3&A1(iurtT_Z0mu(+&ntxuE6L zW+?o%3`Iv4r6~r3MPtO#aoZM>Lf)`x^9UiC6u~B+R8X2JAhM3+S>Rb}E}hO9_qj>~ z3Nd*(b->Ma?pJ{egir{=pimeb!{~(s2ohX{Y{rBF-iV7R!Ow`$@!tW#?^gnnjyHTse*b~gGLk;-4I$3lo*7Vj!ct9vwc1tFc$#hFnYxqm1 zDP`X@_oZHN-oov=rT{_a%+GGckZO(#l}g=G-|s>RVTJ{p2G0<}VF&>G!+>J^Xx2xu z)rbv+CdY=2mA&CS1_9Kvmz8?`GJAt5%hV)PG@3k&pf{S(Yfb2>Ci=qc2Q6l4@x2y{ zL~gjo2AUH5%W_kK(E z`}+T{ng6bq|ErY$qly2Tga7B?{>HKVgov9D`vYr0G!n4VI$|Yk2?8R_p6_a&mIQFguL%y=pIRS;j(-mW+=+m{U9WGa zef4^Z0=OEfwd#@8ZADH<)W8NiqbraQHsMf^uzRLjt*)&dSw&HtB~fe>hRlZ{Oyc@kk8 zI~9-_@ZgyQ*c4m$m^cwKXJ*hDPzd}3Nb-Q) zWU|}s^Q35I8>7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RubmM3~^9!WG!WSsi@GI0ymRwi0Z+j&8h@Nyi4&DuxDrfwY4V4gwO9AnYmwY>6Kd zwO%@vDiv)8BU?ySPiz4}Kqv}vG7*FjZ3IB2h~;EbSEmR-rdcf(+omd@YAU{s>ZhX; z!fE`|G{2)n0R%nho+fl(6WaZt_t35;bVCz;;jSjM^h}E-TEC^mI;Hi5G-Xq_HArQN zG7Ith7cvC4=HJ9*ev2Y9sXMVqWoSw^y|y^3dvPtDCGZDdX<-Ep2*^bM0000 *> *MyDressUpOptions(void) { // 直接使用 NSInteger dressID = 0; if (model) { - if (type == 1) { + if (type == 1 || type == 2) { dressID = model.id; } else { dressID = model.dressId.integerValue; diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m index c5f2cb2e..789ee50a 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentTweetView.m @@ -79,18 +79,8 @@ NSArray *redPacketHistory = [[NSUserDefaults standardUserDefaults] objectForKey:kTuWenMessageHistory]; if ( [redPacketHistory containsObject: model1.message.messageId]) { self.isNewImageView.hidden = YES; - [self.isNewImageView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(self.backView); - make.centerY.equalTo(self.titleLabel); - make.size.mas_equalTo(CGSizeMake(0, 10)); - }]; } else { self.isNewImageView.hidden = NO; - [self.isNewImageView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(self.backView); - make.centerY.equalTo(self.titleLabel); - make.size.mas_equalTo(CGSizeMake(24, 10)); - }]; } } diff --git a/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m b/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m index 1ff23bd8..d2fc6fbc 100644 --- a/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m +++ b/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m @@ -19,6 +19,7 @@ ///View #import "XPSessionFindNewViewController.h" #import "TTPopUp.h" +#import "XPSkillCardPlayerManager.h" NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; @@ -90,6 +91,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; if (code == 200) { UserInfoModel * userInfo = [UserInfoModel modelWithDictionary:data.data]; self.userInfo = userInfo; + [[XPSkillCardPlayerManager shareInstance] setUserInfoModel:userInfo]; [self.sessionListView reloadData]; } } uid:uid]; diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.h b/YuMi/Modules/YMMine/Api/Api+Mine.h index 600af7df..489435cd 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.h +++ b/YuMi/Modules/YMMine/Api/Api+Mine.h @@ -359,6 +359,10 @@ NS_ASSUME_NONNULL_BEGIN /// - isShow: 是否开启 +(void)updateCPSetting:(HttpRequestHelperCompletion)completion type:(NSNumber *)type isShow:(NSNumber *)isShow; ++(void)requestBlockTime:(HttpRequestHelperCompletion)completion; + ++(void)blockUser:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid hours:(NSNumber *)hours blockReason:(NSString *)blockReason; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.m b/YuMi/Modules/YMMine/Api/Api+Mine.m index fe652df2..4e6420db 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.m +++ b/YuMi/Modules/YMMine/Api/Api+Mine.m @@ -463,4 +463,13 @@ +(void)updateCPSetting:(HttpRequestHelperCompletion)completion type:(NSNumber *)type isShow:(NSNumber *)isShow { [self makeRequest:@"user/setting/update" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, type, isShow, nil]; } + ++(void)requestBlockTime:(HttpRequestHelperCompletion)completion { + [self makeRequest:@"user/blockTime" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; +} + ++(void)blockUser:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid hours:(NSNumber *)hours blockReason:(NSString *)blockReason { + [self makeRequest:@"user/block" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, hours, blockReason, nil]; +} + @end diff --git a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h index b3cdcf9f..41e8fb68 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h +++ b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h @@ -41,6 +41,15 @@ NS_ASSUME_NONNULL_BEGIN -(void)getTagList; ////保存个人简介标签 -(void)saveTagListWithLabels:(NSString *)labels; + +- (void)requestBlockTimesSuccess:(void(^)(NSArray *array))finishHim + failure:(void(^)(NSError *error))failure; +- (void)superBlock:(NSInteger)uid + hours:(NSInteger)hours + resaon:(NSString *)reason + success:(void(^)(void))finishHim + failure:(void(^)(NSError *error))failure; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m index 6fd81bb9..56c7b332 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m +++ b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m @@ -123,4 +123,34 @@ [[self getView]saveTagListSuccess]; }showLoading:YES errorToast:YES] labels:labels]; } + +- (void)requestBlockTimesSuccess:(void(^)(NSArray *array))finishHim + failure:(void(^)(NSError *error))failure { + [Api requestBlockTime:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + if (finishHim) { + finishHim(data.data); + } + } fail:^(NSInteger code, NSString * _Nullable msg) { + if (failure) { + failure([NSError errorWithDomain:msg code:code userInfo:nil]); + } + } showLoading:YES errorToast:YES]]; +} + +- (void)superBlock:(NSInteger)uid + hours:(NSInteger)hours + resaon:(NSString *)reason + success:(void(^)(void))finishHim + failure:(void(^)(NSError *error))failure { + [Api blockUser:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + if (finishHim) { + finishHim(); + } + } fail:^(NSInteger code, NSString * _Nullable msg) { + if (failure) { + failure([NSError errorWithDomain:msg code:code userInfo:nil]); + } + } showLoading:YES errorToast:YES] uid:@(uid) hours:@(hours) blockReason:reason]; +} + @end diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index fcc9cc7f..070b08de 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -43,6 +43,7 @@ #import "XPMineUserDataViewController.h" #import "XPMomentsMineViewController.h" #import "XPGiftUserDataViewController.h" +#import "SuperBlockViewController.h" #import "XPRoomMiniManager.h" @@ -194,27 +195,38 @@ HWDMP4PlayDelegate> - (void)showRightNavHandle { NSMutableArray *array = [NSMutableArray array]; NSString *uid = [NSString stringWithFormat:@"%ld",self.uid]; + @kWeakify(self); TTActionSheetConfig *report = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoViewController0") clickAction:^{ + @kStrongify(self); XPWebViewController *vc = [[XPWebViewController alloc] initWithRoomUID:nil]; NSString *urlStr = [NSString stringWithFormat:@"%@?reportUid=%@&source=PERSONAL",URLWithType(kReportRoomURL),uid]; vc.url = urlStr; [self.navigationController pushViewController:vc animated:YES]; }]; - - TTActionSheetConfig *black = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoViewController1") clickAction:^{ - [self addOrRemoveBlack:NO uid:uid]; - }]; - - [array addObjectsFromArray:@[report, black]]; + [array addObject:report]; BOOL isInBlackList = [[NIMSDK sharedSDK].userManager isUserInBlackList:uid] || [self isSystemAccount]; - if (isInBlackList) { - [array removeObject:black]; + if (!isInBlackList) { + TTActionSheetConfig *black = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoViewController1") clickAction:^{ + @kStrongify(self); + [self addOrRemoveBlack:NO uid:uid]; + }]; + [array addObject:black]; } + + if (self.userInfo.hasSuperRole) { + TTActionSheetConfig *superBlock = [TTActionSheetConfig normalTitle:YMLocalizedString(@"1.0.30_text_26") clickAction:^{ + @kStrongify(self); + SuperBlockViewController *vc = [[SuperBlockViewController alloc] init]; + vc.targetUser = self.userInfo; + [self.navigationController pushViewController:vc animated:YES]; + }]; + [array addObject:superBlock]; + } + [TTPopup actionSheetWithItems:array]; } - //加入黑名单 - (void)addOrRemoveBlack:(BOOL)isRemove uid:(NSString *)uid { NSString *title; @@ -381,7 +393,7 @@ HWDMP4PlayDelegate> self.headerHeight = [XPMineUserInfoHeaderView headerHeight:userInfo]; [self.pagingView reloadData]; -// self.pagingView.hidden = NO; + if(isMSRTL()){ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ diff --git a/YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.h b/YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.h new file mode 100644 index 00000000..bd7b9411 --- /dev/null +++ b/YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.h @@ -0,0 +1,18 @@ +// +// SuperBlockViewController.h +// YuMi +// +// Created by P on 2024/12/3. +// + +#import "MvpViewController.h" +@class UserInfoModel; +NS_ASSUME_NONNULL_BEGIN + +@interface SuperBlockViewController : MvpViewController + +@property(nonatomic, strong) UserInfoModel *targetUser; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.m b/YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.m new file mode 100644 index 00000000..ee76009f --- /dev/null +++ b/YuMi/Modules/YMMine/View/SubViews/SuperBlockViewController.m @@ -0,0 +1,352 @@ +// +// SuperBlockViewController.m +// YuMi +// +// Created by P on 2024/12/3. +// + +#import "SuperBlockViewController.h" +#import "XPMineUserInfoPresenter.h" +#import "UserInfoModel.h" + +@interface BlockHourCell : UICollectionViewCell + +@property(nonatomic, assign) NSInteger hours; +@property(nonatomic, strong) UIImageView *selectedStatusImageView; +@property(nonatomic, strong) UILabel *titleLabel; + +@end + +@implementation BlockHourCell + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self.contentView addSubview:self.selectedStatusImageView]; + [self.selectedStatusImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.contentView); + make.leading.mas_equalTo(0); + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(18), kGetScaleWidth(18))); + }]; + + [self.contentView addSubview:self.titleLabel]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.contentView); + make.leading.mas_equalTo(self.selectedStatusImageView.mas_trailing).offset(6); + make.trailing.mas_equalTo(self.contentView); + }]; + } + return self; +} + +- (UIImageView *)selectedStatusImageView { + if (!_selectedStatusImageView) { + _selectedStatusImageView = [[UIImageView alloc] initWithImage:kImage(@"block_unselected")]; + } + return _selectedStatusImageView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel labelInitWithText:@"" font:kFontRegular(14) textColor:UIColorFromRGB(0x313131)]; + } + return _titleLabel; +} + +- (void)setHours:(NSInteger)hours { + _hours = hours; + self.titleLabel.text = [NSString stringWithFormat:YMLocalizedString(@"1.0.30_text_28"), @(hours)]; +} + +- (void)setSelected:(BOOL)selected { + [super setSelected:selected]; + if (selected) { + self.selectedStatusImageView.image = kImage(@"block_selected"); + } else { + self.selectedStatusImageView.image = kImage(@"block_unselected"); + } +} + +@end + +@interface SuperBlockViewController () + +@property(nonatomic, copy) NSArray *blockTimes; +@property(nonatomic, strong) NetImageView *avatarImageView; +@property(nonatomic, strong) UILabel *nameLabel; +@property(nonatomic, strong) UILabel *IDLabel; +@property(nonatomic, strong) UICollectionView *blockedTimeCollectionView; +@property(nonatomic, strong) UITextView *reasonTextView; +@property(nonatomic, strong) UILabel *placeholderLabel; +@property(nonatomic, strong) UIButton *blockButton; +@property(nonatomic, assign) NSInteger selectedHours; +@end + +@implementation SuperBlockViewController + +- (XPMineUserInfoPresenter *)createPresenter { + return [[XPMineUserInfoPresenter alloc] init]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.title = YMLocalizedString(@"1.0.30_text_26"); + self.view.backgroundColor = [UIColor whiteColor]; + + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapSpace:)]; + tap.cancelsTouchesInView = NO; // 允许触摸事件继续传递 + tap.delegate = self; + [self.view addGestureRecognizer:tap]; + + @kWeakify(self); + [self.presenter requestBlockTimesSuccess:^(NSArray * _Nonnull array) { + @kStrongify(self); + self.blockTimes = array; + [self setupUI]; + [self updateUI]; + } failure:^(NSError * _Nonnull error) { + @kStrongify(self); + [self dismissViewControllerAnimated:YES completion:nil]; + }]; +} + +- (void)setupUI { + [self.view addSubview:self.avatarImageView]; + [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(16); + make.top.mas_equalTo(20); + make.size.mas_equalTo(52); + }]; + + [self.view addSubview:self.nameLabel]; + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(8); + make.top.mas_equalTo(self.avatarImageView).offset(5); + make.height.mas_equalTo(22); + }]; + + [self.view addSubview:self.IDLabel]; + [self.IDLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(8); + make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(2); + make.height.mas_equalTo(18); + }]; + + [self.view addSubview:[self line]]; + + UILabel *timeTitleLabel = [self titleLabel:YMLocalizedString(@"1.0.30_text_27") withRedStar:NO]; + [self.view addSubview:timeTitleLabel]; + [timeTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.avatarImageView); + make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(41); + }]; + + [self.view addSubview:self.blockedTimeCollectionView]; + [self.blockedTimeCollectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(timeTitleLabel.mas_bottom).offset(12); + make.leading.mas_equalTo(self.view).offset(16); + make.trailing.mas_equalTo(self.view).offset(-70); + make.height.mas_equalTo(0); + }]; + + [self.view addSubview:[self line]]; + + UILabel *reasonTitleLabel = [self titleLabel:YMLocalizedString(@"1.0.30_text_29") withRedStar:YES]; + [self.view addSubview:reasonTitleLabel]; + [reasonTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.avatarImageView); + make.top.mas_equalTo(self.blockedTimeCollectionView.mas_bottom).offset(10); + }]; + + [self.view addSubview:self.reasonTextView]; + [self.reasonTextView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(reasonTitleLabel.mas_bottom).offset(10); + make.leading.trailing.mas_equalTo(self.view).inset(16); + make.height.mas_equalTo(140); + }]; + + [self.view addSubview:self.blockButton]; + [self.blockButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.view); + make.top.mas_equalTo(self.reasonTextView.mas_bottom).offset(20); + make.size.mas_equalTo(CGSizeMake(234, 44)); + }]; +} + +- (void)updateUI { + self.selectedHours = [[self.blockTimes xpSafeObjectAtIndex:0] integerValue]; + + self.avatarImageView.imageUrl = self.targetUser.avatar; + self.nameLabel.text = self.targetUser.nick; + self.IDLabel.text = [NSString stringWithFormat:@"ID: %@", @(self.targetUser.erbanNo)]; + [self.blockedTimeCollectionView reloadData]; + NSIndexPath *defaultIndexPath = [NSIndexPath indexPathForItem:0 inSection:0]; + [self.blockedTimeCollectionView selectItemAtIndexPath:defaultIndexPath + animated:NO + scrollPosition:UICollectionViewScrollPositionNone]; + + NSInteger lines = ceil(self.blockTimes.count/2.0); + [self.blockedTimeCollectionView mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(lines * 40); + }]; + + [self.view layoutIfNeeded]; +} + +- (void)didTapSpace:(UITapGestureRecognizer *)gesture { + [self.view endEditing:YES]; // 收起键盘 +} + +- (void)didTapBlock { + if ([NSString isEmpty:self.reasonTextView.text]) { + + } else { + @kWeakify(self); + [self.presenter superBlock:self.targetUser.uid + hours:self.selectedHours + resaon:self.reasonTextView.text + success:^{ + @kStrongify(self); + [self dismissViewControllerAnimated:YES completion:nil]; + } failure:^(NSError * _Nonnull error) { + + }]; + } +} + +#pragma mark - +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { + // 如果触摸点在 UITextView 或 UICollectionView 内,则不触发手势 + if ([touch.view isKindOfClass:[UICollectionView class]] || [touch.view isKindOfClass:[UITextView class]]) { + return NO; + } + return YES; // 触发手势 +} + +#pragma mark - UITextViewDelegate +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { + NSString *newText = [textView.text stringByReplacingCharactersInRange:range withString:text]; + self.placeholderLabel.hidden = ![NSString isEmpty:newText]; + self.blockButton.alpha = [NSString isEmpty:newText] ? 0.5 : 1; + return YES; +} + +#pragma mark - +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.blockTimes.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + BlockHourCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"BlockHourCell" forIndexPath:indexPath]; + NSNumber *hour = [self.blockTimes xpSafeObjectAtIndex:indexPath.row]; + cell.hours = hour.integerValue; + return cell; +} + +#pragma mark - +- (NetImageView *)avatarImageView { + if (!_avatarImageView) { + _avatarImageView = [[NetImageView alloc] init]; + [_avatarImageView setCornerRadius:52/2]; + } + return _avatarImageView; +} + +- (UILabel *)nameLabel { + if (!_nameLabel) { + _nameLabel = [UILabel labelInitWithText:@"" font:kFontMedium(16) textColor:UIColorFromRGB(0x313131)]; + } + return _nameLabel; +} + +- (UILabel *)IDLabel { + if (!_IDLabel) { + _IDLabel = [UILabel labelInitWithText:@"" font:kFontRegular(13) textColor:UIColorFromRGB(0x7b7b7d)]; + } + return _IDLabel; +} + +- (UIView *)line { + UIView *v = [[UIView alloc] initWithFrame:CGRectMake(16, 102, KScreenWidth-32, 1)]; + v.backgroundColor = UIColorFromRGB(0xe4e4e4); + return v; +} + +- (UILabel *)titleLabel:(NSString *)title withRedStar:(BOOL)isRed { + UILabel *label = [UILabel labelInitWithText:@"" font:kFontMedium(15) textColor:UIColorFromRGB(0x313131)]; + NSMutableAttributedString *s_title = [[NSMutableAttributedString alloc] initWithString:title + attributes:@{ + NSFontAttributeName: kFontMedium(15), + NSForegroundColorAttributeName: UIColorFromRGB(0x313131) + }]; + + if (isRed) { + NSAttributedString *star = [[NSAttributedString alloc] initWithString:@"*" attributes:@{ + NSFontAttributeName: kFontMedium(15), + NSForegroundColorAttributeName: UIColorFromRGB(0xff3332) + }]; + [s_title insertAttributedString:star atIndex:s_title.length]; + } + + label.attributedText = s_title; + + return label; +} + +- (UICollectionView *)blockedTimeCollectionView { + if (!_blockedTimeCollectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.itemSize = CGSizeMake((KScreenWidth - 32)/3, kGetScaleWidth(20)); + layout.minimumLineSpacing = 14; + layout.minimumInteritemSpacing = 20; + _blockedTimeCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _blockedTimeCollectionView.scrollEnabled = NO; + _blockedTimeCollectionView.allowsMultipleSelection = NO; + _blockedTimeCollectionView.delegate = self; + _blockedTimeCollectionView.dataSource = self; + [_blockedTimeCollectionView registerClass:[BlockHourCell class] forCellWithReuseIdentifier:@"BlockHourCell"]; + } + return _blockedTimeCollectionView; +} + +- (UITextView *)reasonTextView { + if (!_reasonTextView) { + _reasonTextView = [[UITextView alloc] init]; + _reasonTextView.delegate = self; + [_reasonTextView setCornerRadius:10]; + _reasonTextView.backgroundColor = UIColorFromRGB(0xf6f6f6); + + [_reasonTextView addSubview:self.placeholderLabel]; + [self.placeholderLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(10); + make.leading.mas_equalTo(12); + make.trailing.mas_equalTo(-12); + }]; + } + return _reasonTextView; +} + +- (UIButton *)blockButton { + if (!_blockButton) { + _blockButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_blockButton addGradientBackgroundWithColors:@[UIColorFromRGB(0xE29030), UIColorFromRGB(0xfcc074)] + startPoint:CGPointMake(0, 0.5) + endPoint:CGPointMake(1, 0.5) + cornerRadius:22]; + [_blockButton setTitle:YMLocalizedString(@"1.0.30_text_31") forState:UIControlStateNormal]; + [_blockButton addTarget:self action:@selector(didTapBlock) forControlEvents:UIControlEventTouchUpInside]; + _blockButton.alpha = 0.5; + } + return _blockButton; +} + +- (UILabel *)placeholderLabel { + if (!_placeholderLabel) { + _placeholderLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.30_text_30") + font:kFontRegular(14) + textColor:UIColorFromRGB(0x7b7b7d)]; + } + return _placeholderLabel; +} + +@end diff --git a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m index 7d1a018a..4fc28678 100644 --- a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m +++ b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m @@ -104,7 +104,7 @@ make.height.mas_equalTo(kMOMENTS_TEXT_TOPIC_HEIGHT); }]; [self.photoView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(KScreenWidth-30); + make.width.mas_equalTo(KScreenWidth-30); }]; [self.toolBarView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.mas_equalTo(self.backView); diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m index 3f4ab7e1..0469cee4 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m @@ -40,10 +40,11 @@ YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(size.width, CGFLOAT_MAX)]; container.maximumNumberOfRows = 0; container.truncationType = YYTextTruncationTypeEnd; - container.insets = UIEdgeInsetsMake(self.contentTopMargin, self.contentLeftMargin, self.contentBottomMargin, self.contentRightMargin); - self.textLayout = [YYTextLayout layoutWithContainer:container text:content]; + container.insets = UIEdgeInsetsMake(self.contentTopMargin, self.contentLeftMargin, self.contentBottomMargin, self.contentLeftMargin); + YYTextLayout *textLayout = [YYTextLayout layoutWithContainer:container text:content]; - CGSize textSize = self.textLayout.textBoundingRect.size; + CGSize textSize = textLayout.textBoundingRect.size; + self.textWidth = textSize.width; if ([NSString isEmpty:self.bubbleImageUrl]) { self.rowHeight = ceil(textSize.height) + @@ -53,9 +54,12 @@ self.rowHeight = ceil(textSize.height) + (isMSRTL() ? self.contentTopMargin : (self.isBoom ? 20 : 8)) + - self.contentBottomMargin + +// self.contentBottomMargin + self.cellBottomMargin; } - self.rowHeight += 10 + (self.isBoom ? 20 : 0); +// if ([self.cellKey isEqualToString:@"ChatMessage"]) { + self.rowHeight += 10; +// } + self.rowHeight += (self.isBoom ? 20 : 0); } @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index b6ea7106..5eeaeca7 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -36,6 +36,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self initSubViews]; + [self initSubViewConstraints]; } return self; } @@ -55,7 +56,7 @@ self.tapEmptyRecognizer = tap; [self.contentView addGestureRecognizer:self.tapEmptyRecognizer]; - [self.contentView addSubview:self.leftBigImageView]; + } - (void)initSubViewConstraints { @@ -70,6 +71,7 @@ make.leading.mas_equalTo(12); make.bottom.mas_equalTo(-20); make.top.mas_equalTo(10); + make.width.mas_equalTo(kRoomMessageMaxWidth); }]; [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -80,6 +82,7 @@ - (void)setIsLeftBigImage:(BOOL)isLeftBigImage { _isLeftBigImage = isLeftBigImage; if (isLeftBigImage) { + [self.contentView addSubview:self.leftBigImageView]; [self.leftBigImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(0); make.top.mas_equalTo(6); @@ -101,13 +104,13 @@ // make.centerY.mas_equalTo(self.leftBigImageView); // }]; - [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.bottom.mas_equalTo(self.bubbleImageView); make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); make.trailing.mas_equalTo(self.bubbleImageView).offset(-8); }]; - [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.blurEffectView mas_remakeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.bubbleImageView); }]; self.blurEffectView.hidden = NO; @@ -122,8 +125,6 @@ //// } // }]; - } else { - [self initSubViewConstraints]; } } @@ -181,6 +182,9 @@ }else { [self updateLayoutWithBubble]; } + + [self.contentView setNeedsLayout]; + [self.contentView layoutIfNeeded]; } - (void)updateLayoutWithBubble { @@ -192,18 +196,21 @@ UIImage *image1 = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp]; UIImage *cutImage = [image1 cropRightAndBottomPixels:2]; self.bubbleImageView.image = [self resizableImage:cutImage]; - - [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.messageInfo.contentLeftMargin); - make.top.mas_equalTo(0);//self.messageInfo.contentTopMargin); - make.bottom.mas_equalTo(- self.messageInfo.contentBottomMargin - self.messageInfo.cellBottomMargin); - make.width.mas_equalTo([self RTLLabelWidth] - self.messageInfo.contentLeftMargin); - }]; - - [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(0); - make.leading.trailing.mas_equalTo(self.contentView).offset(0); - }]; + }]; + + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.messageInfo.contentLeftMargin); + make.top.mas_equalTo(0);//self.messageInfo.contentTopMargin); + make.bottom.mas_equalTo(- self.messageInfo.cellBottomMargin); +// make.width.mas_equalTo([self RTLLabelWidth]); + // 设置宽度限制 + make.width.mas_lessThanOrEqualTo([self RTLLabelWidth]).priority(UILayoutPriorityDefaultHigh); // 优先使用宽度限制 + make.trailing.mas_lessThanOrEqualTo(self.contentView).offset(-self.messageInfo.contentLeftMargin).priority(UILayoutPriorityRequired); // 当宽度到达边缘时,使用右间距 + }]; + + [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.contentLabel); + make.size.mas_equalTo(self.contentLabel).multipliedBy(1.1); }]; } @@ -211,16 +218,19 @@ self.blurEffectView.hidden = NO; self.bubbleImageView.image = [UIImage imageWithColor:[DJDKMIMOMColor messageBubbleColor]]; [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.messageInfo.contentLeftMargin); + make.top.mas_equalTo(self.messageInfo.contentTopMargin); make.bottom.mas_equalTo(-self.messageInfo.cellBottomMargin); - make.top.mas_equalTo(0);//self.messageInfo.contentTopMargin); - make.width.mas_equalTo([self RTLLabelWidth] - self.messageInfo.contentLeftMargin - self.messageInfo.contentRightMargin); + make.leading.mas_equalTo(self.messageInfo.contentLeftMargin); +// make.width.mas_equalTo([self RTLLabelWidth]); + // 设置宽度限制 + make.width.mas_lessThanOrEqualTo([self RTLLabelWidth]).priority(UILayoutPriorityDefaultHigh); // 优先使用宽度限制 + // 设置右间距 + make.trailing.mas_lessThanOrEqualTo(self.contentView).offset(-self.messageInfo.contentLeftMargin).priority(UILayoutPriorityRequired); // 当宽度到达边缘时,使用右间距 }]; - [self.bubbleImageView mas_updateConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.contentLabel).offset(-8); - make.trailing.mas_equalTo(self.contentLabel).offset(8); - make.bottom.mas_equalTo(self.contentLabel).offset(0); + [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.contentLabel); + make.size.mas_equalTo(self.contentLabel).multipliedBy(1.1); }]; } @@ -230,7 +240,7 @@ context:nil].size; } - (CGFloat)RTLLabelWidth { - return MIN(ceil([self RTLLabelSize].width) + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, + return MIN(ceil([self RTLLabelSize].width),// + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, kRoomMessageMaxWidth - self.messageInfo.contentLeftMargin); } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index a538610e..4095c4ed 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -1198,7 +1198,9 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; XPRoomMessageTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellKey]; cell.delegate = self; - cell.isLeftBigImage = model.isBoom; + if (model.isBoom) { + cell.isLeftBigImage = model.isBoom; + } cell.messageInfo = model; cell.roomType = self.hostDelegate.getRoomInfo.type; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m b/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m index 4d9beeba..b0d3a2a1 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m @@ -16,6 +16,8 @@ #import "MSRoomGameModel.h" #import #import "XPMessageRemoteExtModel.h" +#import "XPSkillCardPlayerManager.h" + @implementation MSRoomGamePresenter -(void)getCoinNum{ @@ -43,16 +45,13 @@ [Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { UserInfoModel * infoModel = [UserInfoModel modelWithJSON:data.data]; - + [[XPSkillCardPlayerManager shareInstance] setUserInfoModel:infoModel]; [user sendNext:infoModel]; [user sendCompleted]; } fail:^(NSInteger code, NSString * _Nullable msg) { [user sendError:nil]; } showLoading:NO errorToast:NO] uid:uid]; - - - [Api getRoomGameHomeConfig:[self createHttpCompletion:^(BaseModel * _Nonnull data) { MSTabbarRoomGameModel *model = [MSTabbarRoomGameModel modelWithJSON:data.data]; [game sendNext:model]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 39ddad95..83296986 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -352,6 +352,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self setupForBoom]; + [self handleGiftComboCallBack]; #if DEBUG // UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight]; // b.frame = CGRectMake(100, 100, 100, 100); @@ -363,6 +364,15 @@ XPCandyTreeInsufficientBalanceViewDelegate> } +- (void)handleGiftComboCallBack { + @kWeakify(self); + [[GiftComboManager sharedManager] setHandleRoomUIChanged:^(BOOL comboViewDisplay) { + @kStrongify(self); + self.activityContainerView.hidden = comboViewDisplay; + self.menuContainerView.hidden = comboViewDisplay; + }]; +} + - (void)setupForBoom { @kWeakify(self); [[RoomBoomManager sharedManager] registerBoomExplosion:^(id _Nonnull sth) { @@ -2320,8 +2330,10 @@ XPCandyTreeInsufficientBalanceViewDelegate> config.cancelButtonConfig.title = YMLocalizedString(@"XPRoomSettingInputView4"); config.confirmButtonConfig.title = YMLocalizedString(@"TTAlertConfig0"); config.message = YMLocalizedString(@"XPRoomViewController14"); + @kWeakify(self); [TTPopup alertWithConfig:config confirmHandler:^{ // 知道了 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + @kStrongify(self); [self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]; [[RtcManager instance] exitRoom]; [self.littleGameView handleSelfInExitEvent]; @@ -2366,8 +2378,10 @@ XPCandyTreeInsufficientBalanceViewDelegate> config.cancelButtonConfig.title = YMLocalizedString(@"XPRoomViewController15"); config.confirmButtonConfig.title = YMLocalizedString(@"XPRoomViewController16"); config.message = YMLocalizedString(@"XPRoomViewController17"); + @kWeakify(self); [TTPopup alertWithConfig:config confirmHandler:^{ // 知道了 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + @kStrongify(self); [[XPRoomMiniManager shareManager] configRoomInfo:self.roomInfo]; [[XPRoomMiniManager shareManager] configUserInfo:self.userInfo]; [[XPRoomMiniManager shareManager] configCurrentMusic:self.functionView.getCurrentMusic isPlaying:self.functionView.isPlaying]; diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index 34f47003..7dff207e 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -314,6 +314,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; return; } self.userInfo = userInfo; + [[XPSkillCardPlayerManager shareInstance] setUserInfoModel:userInfo]; [[RoomBoomManager sharedManager] saveUserInfo:userInfo]; [self getRoomGameInfo]; [AccountInfoStorage instance].name = self.userInfo.nick; diff --git a/YuMi/Network/HttpRequestHelper.m b/YuMi/Network/HttpRequestHelper.m index 02ac014b..dada9761 100644 --- a/YuMi/Network/HttpRequestHelper.m +++ b/YuMi/Network/HttpRequestHelper.m @@ -42,11 +42,8 @@ return API_HOST_URL; } return API_HOST_TEST_URL; - #else - return API_HOST_URL; - #endif } + (void)GET:(NSString *)method @@ -74,7 +71,8 @@ if (timeout > 0) { manager.requestSerializer.timeoutInterval = timeout; } - } else { + } + else { manager.requestSerializer.timeoutInterval = 60; } diff --git a/YuMi/Structure/MVP/Model/UserInfoModel.h b/YuMi/Structure/MVP/Model/UserInfoModel.h index da4ab684..993515e8 100644 --- a/YuMi/Structure/MVP/Model/UserInfoModel.h +++ b/YuMi/Structure/MVP/Model/UserInfoModel.h @@ -192,6 +192,9 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, strong) InfoCardVO *infoCardVo; +/// 是否超管身份 +@property(nonatomic, assign) BOOL hasSuperRole; + - (BOOL)isUserValid; - (NSString *)userIDString; diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index 3b67f5cd..f1542592 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -4023,3 +4023,10 @@ ineHeadView12" = "الحمل"; "1.0.30_text_22" = "انتهت الصلاحية"; "1.0.30_text_23" = "%@أيام"; "1.0.30_text_24" = "أيام"; +"1.0.30_text_25" = "التطبيق يقصر التسجيل على المستخدمين الذين تقل أعمارهم عن 18 عاماً"; +"1.0.30_text_26" = "حظر المشرف الأعلى"; +"1.0.30_text_27" = "وقت الحظر"; +"1.0.30_text_28" = "%@ساعات"; +"1.0.30_text_29" = "سبب الحظر"; +"1.0.30_text_30" = "يرجى إدخال سبب الحظر، والذي سيكون مرئيًا في الخلفية"; +"1.0.30_text_31" = "حظر"; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index 774ea554..5ca7a746 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -3816,3 +3816,11 @@ "1.0.30_text_22" = "Expired"; "1.0.30_text_23" = "%@Days"; "1.0.30_text_24" = "Day"; +"1.0.30_text_25" = "APP restricts registration to users under 18 years old."; +"1.0.30_text_26" = "Super Admin Block"; +"1.0.30_text_27" = "Blocked time"; +"1.0.30_text_28" = "%@hours"; +"1.0.30_text_29" = "Blocked reason"; +"1.0.30_text_30" = "Please enter the block reason, which will be visible in the background"; +"1.0.30_text_31" = "Block"; + diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index e9c59aaf..702fa5d1 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -3602,3 +3602,10 @@ "1.0.30_text_22" = "Sona Erdi"; "1.0.30_text_23" = "%@Günler"; "1.0.30_text_24" = "Günler"; +"1.0.30_text_25" = "Bu uygulamada 18 yaş altında olan kişiler hesabı açmaz."; +"1.0.30_text_26" = "Süper Yönetici Engelleme"; +"1.0.30_text_27" = "Engellenen zaman"; +"1.0.30_text_28" = "%@saat"; +"1.0.30_text_29" = "Engellenme nedeni"; +"1.0.30_text_30" = "Lütfen arka planda görünecek olan engelleme nedenini girin"; +"1.0.30_text_31" = "Engelleme"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 8b8123f9..f38e4469 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -3474,3 +3474,10 @@ "1.0.30_text_22" = "已過期"; "1.0.30_text_23" = "%@天數"; "1.0.30_text_24" = "天數"; +"1.0.30_text_25" = "APP限制18歲以下用戶註冊。"; +"1.0.30_text_26" = "超级管理员封禁"; +"1.0.30_text_27" = "封禁时间"; +"1.0.30_text_28" = "%@小时"; +"1.0.30_text_29" = "封禁原因"; +"1.0.30_text_30" = "请输入封禁原因,该原因将在后台可见"; +"1.0.30_text_31" = "封禁"; From 2b4de25c80178ce3e574844c28311e3e95f15ec5 Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Wed, 4 Dec 2024 21:22:38 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShoppingMall/MyDressingDataModel.m | 57 ++- .../ShoppingMall/MyDressingDataPresent.m | 6 +- .../ShoppingMall/MyDressingViewController.m | 10 +- .../ShoppingMallCategoryListView.m | 79 +++- .../ShoppingMall/ShoppingMallItemPreview.m | 38 +- .../ShoppingMall/ShoppingMallTagView.m | 8 +- .../ShoppingMall/ShoppingMallViewController.m | 24 +- .../View/LoginFullInfoViewController.m | 31 +- .../XPMineMultipleContentTableViewCell.m | 8 +- .../View/DressUp/Model/DressUpShopModel.m | 59 ++- .../Cell/XPDressShopSearchTableViewCell.m | 9 + .../View/XPDressSearchViewController.m | 11 +- .../MineInfo/XPMineUserInfoViewController.m | 2 +- .../YMMonents/View/XPMomentsViewController.m | 2 +- .../Cell/XPNewHomePartyCollectionViewCell.m | 4 +- .../View/XPHomePartyViewController.m | 2 +- .../YMRoom/Model/CustomRoomBGItemModel.m | 2 +- .../AnimationView/LuckyGiftWinningFlagView.m | 3 +- .../View/AnimationView/XPRoomAnimationView.m | 10 +- .../View/XPRoomMessageTableViewCell.m | 36 +- .../XPRoomMessageContainerView.m | 404 +++++++++++++----- .../MoreView/Presenter/XPMoreMenuPresenter.m | 12 +- .../View/SendGiftView/GiftComboManager.h | 6 +- .../View/SendGiftView/GiftComboManager.m | 92 +--- .../SendGiftView/View/CountdownRingView.h | 1 + .../SendGiftView/View/CountdownRingView.m | 21 +- .../View/SendGiftView/View/GiftComboView.h | 5 +- .../View/SendGiftView/View/GiftComboView.m | 175 +++++++- .../View/SendGiftView/View/XPGiftBarView.m | 1 - .../View/SendGiftView/View/XPSendGiftView.m | 20 +- YuMi/Tools/NSString/NSString+Utils.h | 3 + YuMi/Tools/NSString/NSString+Utils.m | 55 +++ YuMi/ar.lproj/Localizable.strings | 4 +- YuMi/tr.lproj/Localizable.strings | 4 +- YuMi/zh-Hant.lproj/Localizable.strings | 2 +- 35 files changed, 857 insertions(+), 349 deletions(-) diff --git a/YuMi/Modules/ShoppingMall/MyDressingDataModel.m b/YuMi/Modules/ShoppingMall/MyDressingDataModel.m index 85cfc716..4066ef0d 100644 --- a/YuMi/Modules/ShoppingMall/MyDressingDataModel.m +++ b/YuMi/Modules/ShoppingMall/MyDressingDataModel.m @@ -9,6 +9,24 @@ @implementation MyDressingDataModel +// JSON 字段映射 ++ (NSDictionary *)mj_replacedKeyFromPropertyName { + return @{ + @"dressShopId" : @"id" + }; +} + +//// 自定义转换逻辑 +//- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property { +// if ([property.name isEqualToString:@"dressShopId"]) { +// if ([oldValue isKindOfClass:[NSNumber class]]) { +// // 将 NSNumber 转换为 NSString +// return [oldValue stringValue]; +// } +// } +// return oldValue; +//} + - (NSString *)expiredContent { if (self.hasExpired) { return YMLocalizedString(@"XPMineCarTableViewCell1"); @@ -74,16 +92,37 @@ // 辅助方法:格式化价格,支持 0-2 位小数 - (NSString *)formatPrice:(CGFloat)price { - if (fmod(price, 1.0) == 0.0) { - // 整数,移除小数部分 - return [NSString stringWithFormat:@"%.0f", price]; - } else if (fmod(price * 10, 1.0) == 0.0) { - // 保留 1 位小数 - return [NSString stringWithFormat:@"%.1f", price]; - } else { - // 保留 2 位小数 - return [NSString stringWithFormat:@"%.2f", price]; +// if (fmod(price, 1.0) == 0.0) { +// // 整数,移除小数部分 +// return [NSString stringWithFormat:@"%.0f", price]; +// } else if (fmod(price * 10, 1.0) == 0.0) { +// // 保留 1 位小数 +// return [NSString stringWithFormat:@"%.1f", price]; +// } else { +// // 保留 2 位小数 +// return [NSString stringWithFormat:@"%.2f", price]; +// } + + NSString *priceString = [NSString stringWithFormat:@"%.8f", price]; // 确保保留足够的位数 + NSArray *components = [priceString componentsSeparatedByString:@"."]; // 分割整数和小数部分 + NSString *integerPart = components[0]; + NSString *decimalPart = components.count > 1 ? components[1] : @""; + + if (decimalPart.length > 2) { + // 保留最多两位有效小数,直接截断 + decimalPart = [decimalPart substringToIndex:2]; } + + if ([decimalPart isEqualToString:@"00"]) { + // 如果小数部分为 00,只返回整数部分 + return integerPart; + } else if ([decimalPart hasSuffix:@"0"]) { + // 如果小数部分以 0 结尾,保留 1 位小数 + decimalPart = [decimalPart substringToIndex:1]; + } + + // 拼接整数和截断后的小数部分 + return [NSString stringWithFormat:@"%@.%@", integerPart, decimalPart]; } diff --git a/YuMi/Modules/ShoppingMall/MyDressingDataPresent.m b/YuMi/Modules/ShoppingMall/MyDressingDataPresent.m index 3b6f845e..707bcdc9 100644 --- a/YuMi/Modules/ShoppingMall/MyDressingDataPresent.m +++ b/YuMi/Modules/ShoppingMall/MyDressingDataPresent.m @@ -77,7 +77,7 @@ ticket:ticket uid:uid page:@(page).stringValue - pageSize:@"2"]; + pageSize:@"20"]; } - (void)loadBubble:(NSInteger)page @@ -91,7 +91,7 @@ } } fail:^(NSInteger code, NSString * _Nullable msg) { - } showLoading:page != 1 errorToast:YES] page:@(page).stringValue pageSize:@"2"]; + } showLoading:page != 1 errorToast:YES] page:@(page).stringValue pageSize:@"20"]; } - (void)loadMyDressingItems:(NSInteger)type @@ -107,7 +107,7 @@ } showLoading:page != 1 errorToast:YES] page:@(page).stringValue - pageSize:@"2" + pageSize:@"20" dressType:@(type).stringValue]; } diff --git a/YuMi/Modules/ShoppingMall/MyDressingViewController.m b/YuMi/Modules/ShoppingMall/MyDressingViewController.m index 403a55a0..c3ffc4e7 100644 --- a/YuMi/Modules/ShoppingMall/MyDressingViewController.m +++ b/YuMi/Modules/ShoppingMall/MyDressingViewController.m @@ -106,7 +106,7 @@ static NSArray *> *MyDressUpOptions(void) { [self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(100); make.centerX.mas_equalTo(self.view); - make.size.mas_equalTo(CGSizeMake(73, 73)); + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(73), kGetScaleWidth(73))); }]; [self.view addSubview:self.avatarHeadViewImageView]; @@ -130,7 +130,7 @@ static NSArray *> *MyDressUpOptions(void) { listView.bottomSpace = bottom; [self.view addSubview:listView]; [listView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.avatarView.mas_bottom).offset(14); + make.top.mas_equalTo(self.avatarView.mas_bottom).offset(16); make.leading.trailing.bottom.mas_equalTo(self.view); }]; @kWeakify(self); @@ -292,7 +292,7 @@ static NSArray *> *MyDressUpOptions(void) { // 弹窗购买 BOOL isVaild = model.obtainWay<=1; if (isVaild) { - isVaild = ![NSString isEmpty:model.dressId]; + isVaild = ![NSString isEmpty:model.dressShopId] && model.dressShopId.integerValue > 0; } ShoppingMallItemPreview *preview = [[ShoppingMallItemPreview alloc] initWithMyDress:model @@ -327,9 +327,7 @@ static NSArray *> *MyDressUpOptions(void) { dressID = model.dressId.integerValue; } } - if (dressID == 0) { - return; - } + @kWeakify(self); [self.presenter useDressBy:type dressID:dressID diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m b/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m index 596c11d7..074360a7 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m @@ -211,7 +211,7 @@ [self.contentView addSubview:self.roomCardView]; [self.roomCardView mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.centerX.mas_equalTo(self.itemBGView); - make.width.height.mas_equalTo(self.itemBGView.mas_width).multipliedBy(0.8f); + make.width.height.mas_equalTo(self.itemBGView.mas_width);//.multipliedBy(0.8f); }]; [self.contentView addSubview:self.playButton]; @@ -240,6 +240,21 @@ - (void)setModel:(MyDressingDataModel *)model { _model = model; if (model) { + switch (model.dressType) { + case 4:{ + [self.itemImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.itemBGView); + make.width.mas_equalTo(kGetScaleWidth(90)); + make.height.mas_equalTo(kGetScaleWidth(46)); + }]; + [self.contentView layoutIfNeeded]; + } + break; + + default: + break; + } + self.titleLabel.text = model.name; if (model.dressType == 3) { @@ -265,6 +280,10 @@ self.playButton.hidden = YES; self.itemImageView.image = kImage(@"mall_item_not_used"); self.titleLabel.text = YMLocalizedString(@"1.0.30_text_12"); + [self.itemImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.itemBGView); + make.width.height.mas_equalTo(self.itemBGView.mas_width).multipliedBy(0.4f); + }]; } } @@ -416,7 +435,7 @@ [self.contentView addSubview:self.roomCardView]; [self.roomCardView mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.centerX.mas_equalTo(self.itemBGView); - make.width.height.mas_equalTo(self.itemBGView.mas_width).multipliedBy(0.8f); + make.width.height.mas_equalTo(self.itemBGView.mas_width);//.multipliedBy(0.8f); }]; [self.contentView addSubview:self.playButton]; @@ -466,6 +485,21 @@ - (void)setCellModel:(DressUpShopModel *)cellModel { _cellModel = cellModel; + switch (cellModel.dressType) { + case 4:{ + [self.itemImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.itemBGView); + make.width.mas_equalTo(kGetScaleWidth(90)); + make.height.mas_equalTo(kGetScaleWidth(46)); + }]; + [self.contentView layoutIfNeeded]; + } + break; + + default: + break; + } + if (cellModel.dressType == 3) { self.itemImageView.hidden = YES; self.roomCardView.hidden = NO; @@ -838,7 +872,7 @@ for (int i = 0; i < items.count; i++) { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; layout.itemSize = CGSizeZero;// CGSizeMake((screenWidth-30) / 2 - 10, kGetScaleWidth(244)); - layout.minimumInteritemSpacing = 10; + layout.minimumInteritemSpacing = 0; layout.minimumLineSpacing = 10; layout.sectionInset = UIEdgeInsetsMake(0, 15, self.bottomSpace + 10, 15); @@ -848,7 +882,7 @@ collectionView.dataSource = self; collectionView.backgroundColor = [UIColor clearColor]; collectionView.tag = i; - collectionView.allowsSelection = YES; + collectionView.contentInset = UIEdgeInsetsMake(16, 0, 0, 0); [collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cell"]; [collectionView registerClass:[ShoppingMallItemCard class] forCellWithReuseIdentifier:@"ShoppingMallItemCard"]; [collectionView registerClass:[ShoppingMallEmptyCard class] forCellWithReuseIdentifier:@"ShoppingMallEmptyCard"]; @@ -860,7 +894,6 @@ if (self.isForMyDressingPage) { [self addRefreshControl:collectionView]; - [self addLoadMoreForCollectionView:collectionView]; } } @@ -924,6 +957,11 @@ } for (UICollectionView *itemView in self.itemCollectionViewArray) { [itemView reloadData]; + [itemView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UICollectionViewScrollPositionNone]; + if (self.returnSelectedModel) { + NSArray *data = self.dataCache[@(itemView.tag)]; + self.returnSelectedModel(data.firstObject); + } } } @@ -933,28 +971,47 @@ if (index < self.itemCollectionViewArray.count) { UICollectionView *itemView = self.itemCollectionViewArray[index]; [itemView reloadData]; + [itemView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UICollectionViewScrollPositionNone]; + if (self.returnSelectedModel) { + self.returnSelectedModel(data.firstObject); + } } } - (void)updateItemCollectionViewWithMyDressingData:(NSArray *)data pageNum:(NSInteger)pageNum atIndex:(NSInteger)index { + + NSMutableArray *sortedData = data.mutableCopy; + [sortedData sortUsingComparator:^NSComparisonResult(MyDressingDataModel * _Nonnull obj1, MyDressingDataModel * _Nonnull obj2) { + if (obj1.used) { + return NSOrderedAscending; + } + if (obj2.used) { + return NSOrderedDescending; + } + return NSOrderedSame; + }]; + if (pageNum == 1) { - self.myDressingDataCache[@(index)] = data; + self.myDressingDataCache[@(index)] = sortedData.copy; } else { NSMutableArray *array = self.myDressingDataCache[@(index)].mutableCopy; - [array addObjectsFromArray:data]; + [array addObjectsFromArray:sortedData]; self.myDressingDataCache[@(index)] = array.copy; } if (index < self.itemCollectionViewArray.count) { UICollectionView *itemView = self.itemCollectionViewArray[index]; + if (pageNum == 1 && !itemView.mj_footer) { + [self addLoadMoreForCollectionView:itemView]; + } [itemView.refreshControl endRefreshing]; [itemView.mj_header endRefreshing]; [itemView.mj_footer endRefreshing]; [itemView reloadData]; - if (data.count == 0 || data.count < 2) { + if (data.count == 0 || data.count < 20) { [itemView.mj_footer endRefreshingWithNoMoreData]; NSNumber *currentPageNum = [self.myDressingDataPagesNumbers xpSafeObjectAtIndex:itemView.tag]; @@ -1005,14 +1062,15 @@ - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + CGFloat width = (KScreenWidth-30) / 2 - 5; if (self.isForMyDressingPage) { - return CGSizeMake((KScreenWidth-30) / 2 - 10, kGetScaleWidth(190)); + return CGSizeMake(width, kGetScaleWidth(190)); } else { NSArray *data = self.dataCache[@(collectionView.tag)]; if (data.count == 0 ) { return CGSizeMake(KScreenWidth, 200); } else { - return CGSizeMake((KScreenWidth-30) / 2 - 10, kGetScaleWidth(244)); + return CGSizeMake(width, kGetScaleWidth(244)); } } } @@ -1140,7 +1198,6 @@ [self loadMyDressingItems:collectionView.tag pageNum:1]; [collectionView.mj_footer resetNoMoreData]; } - } @end diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallItemPreview.m b/YuMi/Modules/ShoppingMall/ShoppingMallItemPreview.m index 8ce7d205..325350da 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallItemPreview.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallItemPreview.m @@ -20,6 +20,7 @@ @property(nonatomic, strong) DressUpShopModel *model; @property(nonatomic, strong) MyDressingDataModel *myDressingModel; @property(nonatomic, strong) NetImageView *itemImageView; +@property(nonatomic, strong) UIView *itemImageBGView; @property(nonatomic, strong) VAPView *mp4View; @property(nonatomic, strong) XPRoomGiftAnimationParser *mp4Parser; @property(nonatomic, strong) SVGAImageView *svgaView; @@ -47,8 +48,8 @@ if (self = [super init]) { [self setupUI]; self.isForGive = isForGive; - self.model = model; self.userModel = [[XPSkillCardPlayerManager shareInstance] userInfoModel]; + self.model = model; } return self; } @@ -57,8 +58,8 @@ if (self = [super init]) { [self setupUI]; self.isVaild = isVaild; - self.myDressingModel = model; self.userModel = [[XPSkillCardPlayerManager shareInstance] userInfoModel]; + self.myDressingModel = model; } return self; } @@ -69,6 +70,14 @@ self.itemImageView.imageUrl = model.pic; self.nameLabel.text = model.name; + if (model.dressType == 4) { + [self.itemImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.itemImageBGView); + make.width.mas_equalTo(kGetScaleWidth(90)); + make.height.mas_equalTo(kGetScaleWidth(46)); + }]; + } + if (model.vipLimit > self.userModel.userVipInfoVO.vipLevel) { self.buyButton.hidden = YES; self.giveButton.hidden = YES; @@ -114,6 +123,15 @@ - (void)setMyDressingModel:(MyDressingDataModel *)myDressingModel { _myDressingModel = myDressingModel; + + if (myDressingModel.dressType == 4) { + [self.itemImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.itemImageBGView); + make.width.mas_equalTo(kGetScaleWidth(90)); + make.height.mas_equalTo(kGetScaleWidth(46)); + }]; + } + self.itemImageView.imageUrl = myDressingModel.pic; self.nameLabel.text = myDressingModel.name; if (self.isVaild) { @@ -142,6 +160,13 @@ make.edges.mas_equalTo(self); }]; + [self addSubview:self.itemImageBGView]; + [self.itemImageBGView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.top.mas_equalTo(32); + make.size.mas_equalTo(CGSizeMake(155, 155)); + }]; + [self addSubview:self.itemImageView]; [self.itemImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self); @@ -152,7 +177,7 @@ [self addSubview:self.nameLabel]; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self.itemImageView.mas_bottom).offset(4); + make.top.mas_equalTo(self.itemImageBGView.mas_bottom).offset(4); make.height.mas_equalTo(22); }]; @@ -226,6 +251,13 @@ return bgImageView; } +- (UIView *)itemImageBGView { + if (!_itemImageBGView) { + _itemImageBGView = [[UIView alloc] init]; + } + return _itemImageBGView; +} + - (NetImageView *)itemImageView { if (!_itemImageView) { _itemImageView = [[NetImageView alloc] init]; diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallTagView.m b/YuMi/Modules/ShoppingMall/ShoppingMallTagView.m index f8122092..9471952d 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallTagView.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallTagView.m @@ -31,8 +31,8 @@ self.clipsToBounds = YES; if (colors.count>1) { [self addGradientBackgroundWithColors:colors - startPoint:isMSRTL() ? CGPointMake(0.0, 1.0) : CGPointMake(0.0, 0.0) - endPoint:isMSRTL() ? CGPointMake(0.0, 0.0) : CGPointMake(0.0, 1.0) + startPoint:isMSRTL() ? CGPointMake(0.0, 0.0) : CGPointMake(1.0, 0.0) + endPoint:isMSRTL() ? CGPointMake(1.0, 0.0) : CGPointMake(0.0, 0.0) cornerRadius:0]; } else if (colors.count == 1){ self.backgroundColor = colors.firstObject; @@ -53,8 +53,8 @@ textColor:(UIColor *)textColor { if (colors.count>1) { [self addGradientBackgroundWithColors:colors //@[UIColorFromRGB(0xE29030), UIColorFromRGB(0xFCC074)] - startPoint:isMSRTL() ? CGPointMake(0.0, 1.0) : CGPointMake(0.0, 0.0) - endPoint:isMSRTL() ? CGPointMake(0.0, 0.0) : CGPointMake(0.0, 1.0) + startPoint:isMSRTL() ? CGPointMake(0.0, 0.0) : CGPointMake(1.0, 0.0) + endPoint:isMSRTL() ? CGPointMake(1.0, 0.0) : CGPointMake(0.0, 0.0) cornerRadius:0]; } else if (colors.count == 1){ self.backgroundColor = colors.firstObject; diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m b/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m index a29b6eaf..e94a8c75 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m @@ -69,7 +69,7 @@ static NSArray *> *DressUpOptions(void) { [self setupBottomControlBar]; [self setupContentList]; - [self hideBottomControlArea]; +// [self hideBottomControlArea]; } - (void)setupBackground { @@ -175,7 +175,7 @@ static NSArray *> *DressUpOptions(void) { if (self.selectedModel.obtainWay > 1) { self.bottomControlPriceLabel.text = @""; } else { - self.bottomControlPriceLabel.attributedText = [self.selectedModel mallItemPricePerDay:YES isFullDisplay:YES]; + self.bottomControlPriceLabel.attributedText = [self.selectedModel mallItemPricePerDay:NO isFullDisplay:YES]; } } else { self.bottomControlPriceLabel.text = @""; @@ -203,14 +203,10 @@ static NSArray *> *DressUpOptions(void) { } - (void)hideBottomControlArea { - [UIView animateWithDuration:0.25 animations:^{ - [self.bottomControlArea mas_updateConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(80 + kSafeAreaBottomHeight); - }]; - [self.bottomControlArea layoutIfNeeded]; - } completion:^(BOOL finished) { -// [self.view layoutIfNeeded]; + [self.bottomControlArea mas_updateConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(80 + kSafeAreaBottomHeight); }]; + [self.bottomControlArea layoutIfNeeded]; } - (void)didTapBuy:(id)sender { @@ -416,6 +412,7 @@ static NSArray *> *DressUpOptions(void) { - (UIButton *)bottomControlBuyButton { if (!_bottomControlBuyButton) { _bottomControlBuyButton = [UIButton buttonWithType:UIButtonTypeCustom]; + _bottomControlBuyButton.titleLabel.font = kFontMedium(14); [_bottomControlBuyButton setTitle:YMLocalizedString(@"1.0.30_text_5") forState:UIControlStateNormal]; [_bottomControlBuyButton setTitleColor:UIColorFromRGB(0x51281B) forState:UIControlStateNormal]; [_bottomControlBuyButton addGradientBackgroundWithColors:@[UIColorFromRGB(0xFFE3B2), UIColorFromRGB(0xE9A71D)] @@ -432,6 +429,7 @@ static NSArray *> *DressUpOptions(void) { - (UIButton *)bottomControlGiveButton { if (!_bottomControlGiveButton) { _bottomControlGiveButton = [UIButton buttonWithType:UIButtonTypeCustom]; + _bottomControlGiveButton.titleLabel.font = kFontMedium(14); [_bottomControlGiveButton setTitle:YMLocalizedString(@"1.0.30_text_6") forState:UIControlStateNormal]; [_bottomControlGiveButton setTitleColor:UIColorFromRGB(0x172055) forState:UIControlStateNormal]; [_bottomControlGiveButton addGradientBackgroundWithColors:@[UIColorFromRGB(0xB2FCFF), UIColorFromRGB(0x4DA2EA)] @@ -485,13 +483,9 @@ static NSArray *> *DressUpOptions(void) { atIndex:0]; [b setAttributedTitle:title forState:UIControlStateNormal]; -// [b setImage:kImage(@"mall_my_icon") forState:UIControlStateNormal]; - CGFloat spacing = 8.0; // 图像和标题之间的间距 -// b.imageEdgeInsets = UIEdgeInsetsMake(0, b.titleLabel.intrinsicContentSize.width + spacing, 0, -b.titleLabel.intrinsicContentSize.width - spacing); -// b.titleEdgeInsets = UIEdgeInsetsMake(0, -b.imageView.frame.size.width*2, 0, b.imageView.frame.size.width*2 + spacing); -// -// // 设置按钮的整体布局和样式 + CGFloat spacing = 8.0; + b.contentEdgeInsets = UIEdgeInsetsMake(0, spacing, 4, spacing); [b addTarget:self action:@selector(didTapMyDress) forControlEvents:UIControlEventTouchUpInside]; diff --git a/YuMi/Modules/YMLogin/View/LoginFullInfoViewController.m b/YuMi/Modules/YMLogin/View/LoginFullInfoViewController.m index a7fad652..f3ae9645 100644 --- a/YuMi/Modules/YMLogin/View/LoginFullInfoViewController.m +++ b/YuMi/Modules/YMLogin/View/LoginFullInfoViewController.m @@ -54,6 +54,8 @@ ///下一步 @property (nonatomic,strong) UIButton *nextButton; +@property(nonatomic, strong) UILabel *block18Tips; + ///邀请码的容器 @property (nonatomic,strong) UIView *codeContainView; ///邀请码输入框 @@ -102,28 +104,21 @@ [self.bgView addSubview:self.remindLabel]; [self.bgView addSubview:self.sexStackView]; - - [self.bgView addSubview:self.backView]; [self.view addSubview:self.codeContainView]; [self.view addSubview:self.nextButton]; - - - + [self.view addSubview:self.block18Tips]; [self.backView addSubview:self.textField]; [self.backView addSubview:self.refreshButton]; [self.backView addSubview:self.nameLabel]; - - [self.sexStackView addArrangedSubview:self.maleView]; [self.sexStackView addArrangedSubview:self.femaleView]; [self.codeContainView addSubview:self.codeTextField]; - if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].userName.length > 0) { self.textField.text = [self.presenter getThirdUserInfo].userName; } else { @@ -153,15 +148,13 @@ make.top.mas_equalTo(kGetScaleWidth(48)); }]; - - + [self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(kGetScaleWidth(38)); make.trailing.mas_equalTo(-kGetScaleWidth(38)); make.top.mas_equalTo(kGetScaleWidth(86)); }]; - [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(kGetScaleWidth(303)); make.height.mas_equalTo(kGetScaleWidth(52)); @@ -193,7 +186,6 @@ make.height.mas_equalTo(kGetScaleWidth(108)); }]; - [self.codeContainView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.height.mas_equalTo(self.backView); make.top.mas_equalTo(self.backView.mas_bottom).offset(kGetScaleWidth(20)); @@ -205,8 +197,6 @@ make.trailing.mas_equalTo(self.codeContainView).offset(-kGetScaleWidth(18)); }]; - - [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(kGetScaleWidth(303)); make.centerX.equalTo(self.bgView); @@ -214,7 +204,10 @@ make.top.mas_equalTo(self.codeContainView.mas_bottom).offset(kGetScaleWidth(48)); }]; - + [self.block18Tips mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.nextButton); + make.top.mas_equalTo(self.nextButton.mas_bottom).offset(8); + }]; } - (void)initEvents { @@ -482,6 +475,14 @@ return _nextButton; } +- (UILabel *)block18Tips { + if (!_block18Tips) { + _block18Tips = [UILabel labelInitWithText:YMLocalizedString(@"1.0.30_text_25") + font:kFontRegular(11) + textColor:UIColorFromRGB(0xAFB1B3)]; + } + return _block18Tips; +} - (UIView *)bgView{ if(!_bgView){ diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m index f3fa1c29..dfbb5791 100644 --- a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m @@ -149,7 +149,7 @@ self.countLabel.text = [NSString stringWithFormat:@"x%ld", (long)giftModel.reciveCount]; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.contentView); + make.leading.trailing.mas_equalTo(self.contentView).inset(2); make.bottom.mas_equalTo(-24); make.height.mas_equalTo(18); }]; @@ -162,7 +162,7 @@ self.countLabel.hidden = YES; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.contentView); + make.leading.trailing.mas_equalTo(self.contentView).inset(2); make.bottom.mas_equalTo(-8); make.height.mas_equalTo(18); }]; @@ -195,6 +195,10 @@ - (UILabel *)nameLabel { if (!_nameLabel) { _nameLabel = [UILabel labelInitWithText:@"" font:kFontMedium(12) textColor:[UIColor whiteColor]]; + _nameLabel.textAlignment = NSTextAlignmentCenter; + _nameLabel.numberOfLines = 2; + _nameLabel.minimumScaleFactor = 0.7f; + _nameLabel.adjustsFontSizeToFitWidth = YES; } return _nameLabel; } diff --git a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m index aac33155..4680e361 100644 --- a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m +++ b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m @@ -142,31 +142,44 @@ NSString *formattedPriceString = [self formatPrice: self.vipLevel>0 ? self.discountPrice : self.dressPrice]; if (isFull == NO) { - formattedPriceString = [NSString formatNumberToKOrM:formattedPriceString]; + formattedPriceString = [NSString formatNumberToKOrM_NoRounding:formattedPriceString]; } if (isMSRTL()) { - // 添加金币图片 - [attributedString appendAttributedString:[self iconAttributedString]]; - // 添加 day 文本 - NSString *formattedDayNumString = [NSString stringWithFormat:@"D%ld/", (long)self.dressDay]; - NSAttributedString *dayNumString = [[NSAttributedString alloc] initWithString:formattedDayNumString attributes:dayAttributes]; - [attributedString appendAttributedString:dayNumString]; - - // 添加 price 文本 - NSAttributedString *priceString = [[NSAttributedString alloc] initWithString:formattedPriceString attributes:priceAttributes]; - [attributedString appendAttributedString:priceString]; - +// MARK:DO NOT CHANGE ANYTHING!!!!!! // 添加空格 NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@" "]; [attributedString appendAttributedString:spaceString]; + // 添加金币图片 + [attributedString appendAttributedString:[self iconAttributedString]]; + + // 添加空格 + NSAttributedString *spaceString_1 = [[NSAttributedString alloc] initWithString:@" "]; + [attributedString appendAttributedString:spaceString_1]; + // 添加原始价格 if (includeOriginalPrice && self.vipLevel > 0) { NSString *originalPriceString = [NSString stringWithFormat:@"%@", [self formatPrice:self.dressPrice]]; + originalPriceString = [NSString formatNumberToKOrM_NoRounding:originalPriceString]; NSAttributedString *originalPriceAttributedString = [[NSAttributedString alloc] initWithString:originalPriceString attributes:originalPriceAttributes]; [attributedString appendAttributedString:originalPriceAttributedString]; } + + // 添加 day 文本 + NSString *formattedDayNumString_0 = @"D";//[NSString stringWithFormat:@"%@", YMLocalizedString(@"1.0.30_text_24")]; + NSAttributedString *dayNumString_0 = [[NSAttributedString alloc] initWithString:formattedDayNumString_0 attributes:dayAttributes]; + [attributedString appendAttributedString:dayNumString_0]; + NSString *formattedDayNumString = [NSString stringWithFormat:@"%ld", (long)self.dressDay]; + NSAttributedString *dayNumString = [[NSAttributedString alloc] initWithString:formattedDayNumString attributes:dayAttributes]; + [attributedString appendAttributedString:dayNumString]; + NSString *formattedDayNumString_1 = @"/"; + NSAttributedString *dayNumString_1 = [[NSAttributedString alloc] initWithString:formattedDayNumString_1 attributes:dayAttributes]; + [attributedString appendAttributedString:dayNumString_1]; + + // 添加 price 文本 + NSAttributedString *priceString = [[NSAttributedString alloc] initWithString:formattedPriceString attributes:priceAttributes]; + [attributedString appendAttributedString:priceString]; } else { // 1. 添加金币图片 [attributedString appendAttributedString:[self iconAttributedString]]; @@ -185,6 +198,7 @@ // 添加原始价格 if (includeOriginalPrice && self.vipLevel > 0) { NSString *originalPriceString = [NSString stringWithFormat:@"%@", [self formatPrice:self.dressPrice]]; + originalPriceString = [NSString formatNumberToKOrM_NoRounding:originalPriceString]; NSAttributedString *originalPriceAttributedString = [[NSAttributedString alloc] initWithString:originalPriceString attributes:originalPriceAttributes]; [attributedString appendAttributedString:originalPriceAttributedString]; } @@ -213,6 +227,27 @@ // 保留 2 位小数 return [NSString stringWithFormat:@"%.2f", price]; } + +// NSString *priceString = [NSString stringWithFormat:@"%.8f", price]; // 确保保留足够的位数 +// NSArray *components = [priceString componentsSeparatedByString:@"."]; // 分割整数和小数部分 +// NSString *integerPart = components[0]; +// NSString *decimalPart = components.count > 1 ? components[1] : @""; +// +// if (decimalPart.length > 2) { +// // 保留最多两位有效小数,直接截断 +// decimalPart = [decimalPart substringToIndex:2]; +// } +// +// if ([decimalPart isEqualToString:@"00"]) { +// // 如果小数部分为 00,只返回整数部分 +// return integerPart; +// } else if ([decimalPart hasSuffix:@"0"]) { +// // 如果小数部分以 0 结尾,保留 1 位小数 +// decimalPart = [decimalPart substringToIndex:1]; +// } +// +// // 拼接整数和截断后的小数部分 +// return [NSString stringWithFormat:@"%@.%@", integerPart, decimalPart]; } @end diff --git a/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPDressShopSearchTableViewCell.m b/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPDressShopSearchTableViewCell.m index 501e55b1..ae0ad044 100644 --- a/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPDressShopSearchTableViewCell.m +++ b/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPDressShopSearchTableViewCell.m @@ -82,7 +82,16 @@ make.centerY.mas_equalTo(self.contentView); }]; + [self.sendButton mas_remakeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(self.contentView).offset(-15); + make.centerY.mas_equalTo(self.contentView); + make.size.mas_equalTo(CGSizeMake(60, 26)); + }]; + self.nickLabel.textColor = [UIColor whiteColor]; + self.sexImageView.hidden = YES; + [self.avatarImageView setCornerRadius:25]; + self.idLabel.textColor = UIColorFromRGB(0xd9e7f7); } #pragma mark - Private Method diff --git a/YuMi/Modules/YMMine/View/DressUp/View/XPDressSearchViewController.m b/YuMi/Modules/YMMine/View/DressUp/View/XPDressSearchViewController.m index 3eddaa41..ee5226f0 100644 --- a/YuMi/Modules/YMMine/View/DressUp/View/XPDressSearchViewController.m +++ b/YuMi/Modules/YMMine/View/DressUp/View/XPDressSearchViewController.m @@ -80,6 +80,9 @@ UISearchBarDelegate> self.defaultFriendsList = tempArray.copy; self.datasource = tempArray.copy; [self.tableView reloadData]; + if (users.count == 0) { + [self showEmptyView]; + } } failure:^(NSError * _Nonnull error) { }]; @@ -93,7 +96,7 @@ UISearchBarDelegate> [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.view); - make.top.mas_equalTo(self.view).offset(44 + 11); + make.top.mas_equalTo(self.view).offset(kStatusBarHeight + kSafeAreaTopHeight); make.height.mas_equalTo(22); }]; @@ -120,17 +123,11 @@ UISearchBarDelegate> #pragma mark - Private Method - (void)initSubViews { -// [self.view addSubview:self.searchView]; [self.view addSubview:self.searchBar]; [self.view addSubview:self.tableView]; } - (void)initSubViewConstraints { -// [self.searchView mas_makeConstraints:^(MASConstraintMaker *make) { -// make.top.mas_equalTo(self.view).offset(kNavigationHeight); -// make.leading.trailing.mas_equalTo(self.view); -// make.height.mas_equalTo(kNavigationHeight); -// }]; [self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.view).offset(kNavigationHeight + 8); make.leading.trailing.mas_equalTo(self.view).inset(15); diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index 070b08de..378c12b9 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -214,7 +214,7 @@ HWDMP4PlayDelegate> [array addObject:black]; } - if (self.userInfo.hasSuperRole) { + if ([XPSkillCardPlayerManager shareInstance].userInfoModel.hasSuperRole) { TTActionSheetConfig *superBlock = [TTActionSheetConfig normalTitle:YMLocalizedString(@"1.0.30_text_26") clickAction:^{ @kStrongify(self); SuperBlockViewController *vc = [[SuperBlockViewController alloc] init]; diff --git a/YuMi/Modules/YMMonents/View/XPMomentsViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsViewController.m index 5f8933d8..455804af 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsViewController.m @@ -220,7 +220,7 @@ _titleView.cellSpacing = 26; _titleView.titles = self.titles; _titleView.listContainer = self.listContainerView; - _titleView.defaultSelectedIndex = 0; + _titleView.defaultSelectedIndex = 2; _titleView.contentEdgeInsetLeft = 15; } return _titleView; diff --git a/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m b/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m index 1515c445..6f9c3b62 100644 --- a/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m +++ b/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m @@ -250,11 +250,13 @@ self.flagImage.imageUrl = roomInfo.regionFlag; _heatView.text = [NSString isEmpty:roomInfo.hotValue.stringValue] ? @"0" : roomInfo.hotValue.stringValue; - _rankImageView.image = nil; + _pkImageView.hidden = !_roomInfo.crossPking; if (roomInfo.hourTop > 0) { NSString *name = [NSString stringWithFormat:@"room_top_%ld", (long)roomInfo.hourTop]; _rankImageView.image = [UIImage getLanguageImage:name]; + } else { + _rankImageView.image = nil; } for (int i = 0; i < self.membersCount; i++) { diff --git a/YuMi/Modules/YMNewHome/View/XPHomePartyViewController.m b/YuMi/Modules/YMNewHome/View/XPHomePartyViewController.m index 7da6db41..374da722 100644 --- a/YuMi/Modules/YMNewHome/View/XPHomePartyViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPHomePartyViewController.m @@ -368,7 +368,7 @@ [_collectionView registerClass:[XPNewHomePartyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomePartyCollectionViewCell class])]; [_collectionView registerClass:[XPGuildEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGuildEmptyCollectionViewCell class])]; [_collectionView registerClass:[HomePartyBannerCell class] forCellWithReuseIdentifier:NSStringFromClass([HomePartyBannerCell class])]; - _collectionView.contentInset = UIEdgeInsetsMake(0, 0, 10, 0); + _collectionView.contentInset = UIEdgeInsetsMake(10, 0, 10, 0); } return _collectionView; } diff --git a/YuMi/Modules/YMRoom/Model/CustomRoomBGItemModel.m b/YuMi/Modules/YMRoom/Model/CustomRoomBGItemModel.m index c1945ebc..ed35924d 100644 --- a/YuMi/Modules/YMRoom/Model/CustomRoomBGItemModel.m +++ b/YuMi/Modules/YMRoom/Model/CustomRoomBGItemModel.m @@ -17,7 +17,7 @@ if (hour<24) { return [NSString stringWithFormat:@"<1%@", YMLocalizedString(@"1.0.18_8")]; } else { - return [NSString stringWithFormat:@"%@%@", @(hour/24), YMLocalizedString(@"1.0.18_8")]; + return [NSString stringWithFormat:@"%@%@", @(hour/24), YMLocalizedString(@"1.0.18_14")]; } } } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningFlagView.m b/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningFlagView.m index 51f706e1..72e7f2f1 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningFlagView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningFlagView.m @@ -46,7 +46,6 @@ uID:(NSString *)UID { LuckyGiftWinningFlagViewModel *model = [LuckyGiftWinningFlagViewModel modelWithDictionary:attachment.data]; -// LuckyGiftWinningFlagViewModel *model = [LuckyGiftWinningFlagViewModel modelWithJSON:attachment.data]; if (model.roomId != roomID || model.uid != UID.integerValue) { return; } @@ -146,6 +145,8 @@ self.winPriceLabel.text = model.coins; self.winTimesLabel.text = model.times; self.backgroundImageView.image = model.level == 1 ? kImage(@"luck_gift_gold") : kImage(@"luck_gift_pruple"); + + [[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" object:model.coins]; } - (void)display { diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index abd27c38..cda989f4 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -367,6 +367,11 @@ PIUniversalBannerViewDelegate> receiveInfo.isLuckyBagGift = (attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend); receiveInfo.isComboBatch = attachment.second == Custom_Message_Sub_AllMicroSend; receiveInfo.isBatch = (attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend); + + if (receiveInfo.gift.notifyFull) { + return; + } + [self receiveGiftHandleSendGiftAnimation:attachment]; if (receiveInfo.isLuckyBagGift) { if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;} @@ -506,7 +511,6 @@ PIUniversalBannerViewDelegate> #pragma mark - 收到送礼者中奖飘屏 - (void)receiveLuckGiftWinning:(AttachmentModel *)attachment { RoomInfoModel *roomInfo = self.delegate.getRoomInfo; - [LuckyGiftWinningFlagView display:self with:attachment roomID:roomInfo.roomId @@ -1138,10 +1142,6 @@ PIUniversalBannerViewDelegate> NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:26], NSForegroundColorAttributeName:[UIColor whiteColor]}]; [attribute setYy_alignment:NSTextAlignmentLeft]; -#if DEBUG - effectPath = @""; -#endif - if (effectPath.length > 0) { @kWeakify(self); [self.parser parseWithURL:[NSURL URLWithString:effectPath] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index 5eeaeca7..c2b5dc25 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -92,18 +92,10 @@ [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(self.leftBigImageView.mas_centerX); make.top.mas_equalTo(0); -// make.bottom.mas_equalTo(-self.messageInfo.contentBottomMargin); make.bottom.mas_equalTo(self.leftBigImageView).offset(6); make.trailing.mas_equalTo(-8); }]; -// [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { -// make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); -// make.trailing.mas_equalTo(self.contentView).offset(-8); -//// make.centerY.mas_equalTo(self.contentView); -// make.centerY.mas_equalTo(self.leftBigImageView); -// }]; - [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.bottom.mas_equalTo(self.bubbleImageView); make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); @@ -114,17 +106,6 @@ make.edges.mas_equalTo(self.bubbleImageView); }]; self.blurEffectView.hidden = NO; - -// [self.contentLabel mas_updateConstraints:^(MASConstraintMaker *make) { -// make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); -// make.trailing.mas_equalTo(-self.messageInfo.contentRightMargin - 8); -// make.top.mas_equalTo(self.bubbleImageView).offset(self.messageInfo.contentTopMargin); -// make.bottom.mas_equalTo(self.bubbleImageView).offset(-self.messageInfo.contentBottomMargin); -//// if (isMSRTL()) { -//// make.width.mas_equalTo([self RTLLabelWidth] - 65); -//// } -// }]; - } } @@ -171,7 +152,6 @@ self.leftBigImageView.imageUrl = messageInfo.boomImageUrl; } else { [self updateLayout]; - [self layoutIfNeeded]; } } } @@ -229,8 +209,9 @@ }]; [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.center.mas_equalTo(self.contentLabel); - make.size.mas_equalTo(self.contentLabel).multipliedBy(1.1); + make.top.bottom.mas_equalTo(self.contentLabel); + make.leading.mas_equalTo(self.contentLabel).offset(-self.messageInfo.contentLeftMargin); + make.trailing.mas_equalTo(self.contentLabel).offset(self.messageInfo.contentLeftMargin); }]; } @@ -240,7 +221,7 @@ context:nil].size; } - (CGFloat)RTLLabelWidth { - return MIN(ceil([self RTLLabelSize].width),// + self.messageInfo.contentLeftMargin + self.messageInfo.contentRightMargin + 8, + return MIN(ceil([self RTLLabelSize].width) + self.messageInfo.contentLeftMargin, kRoomMessageMaxWidth - self.messageInfo.contentLeftMargin); } @@ -299,15 +280,12 @@ - (UIVisualEffectView *)blurEffectView { if (!_blurEffectView) { - // 创建模糊效果 - UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; // 选择模糊样式(例如:Light, Dark, ExtraLight 等) - - // 创建包含模糊效果的视图 + UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; _blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; // 设置模糊视图的大小与目标视图一致 - _blurEffectView.frame = CGRectMake(0, 0, KScreenWidth, 200); - _blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; // 使模糊视图适应目标视图的尺寸变化 + _blurEffectView.frame = CGRectMake(0, 0, KScreenWidth*2/3, 200); + _blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _blurEffectView.hidden = YES; [_blurEffectView setCornerRadius:8]; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 4095c4ed..b89e8295 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -104,8 +104,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } - (void)changeType:(NSInteger)type { + if (self.displayType == type) { + return; + } self.displayType = type; -// [self updateAllDataSource]; [self.messageTableView reloadData]; if (self.displayType == 1) { @@ -164,126 +166,295 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; ///追加数据源 - (void)appendAndScrollToAtUser { - if (self.incomingMessages.count < 1) { - NSInteger rows = self.datasource.count; - if (!self.locationArray.count) { - [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - self.messageTipsBtn.hidden = YES; - self.isPending = NO; - self.atCount = 0; - self.atTipBtn.hidden = YES; + // 1. 检查 incomingMessages 是否为空 + if (self.incomingMessages.count < 1) { + NSInteger rows = self.datasource.count; + + // 2. 安全检查 locationArray 是否为空 + if (self.locationArray.count == 0) { + [self scrollToBottomWithTipsHidden:YES]; + return; + } + + // 3. 获取首个 @ 消息的索引,并进行安全检查 + int index = [self safeGetIndexFromLocationArrayAt:0]; + if (index == NSNotFound) { + [self scrollToBottomWithTipsHidden:YES]; + return; + } + + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; + if (rows > indexPath.row) { + [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; + if (rows == indexPath.row + 1) { + self.messageTipsBtn.hidden = YES; + self.isPending = NO; + } + } else { + [self scrollToBottomWithTipsHidden:YES]; + } + + [self safelyRemoveLocationAtIndex:0]; + [self updateAtTipButton]; return; } - int index = [self.locationArray[0] intValue]; - NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; - if (rows > indexPath.row) { - [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - if (rows == indexPath.row + 1) { - self.messageTipsBtn.hidden = YES; - self.isPending = NO; - } - } else { - [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - //滚动到底部时隐藏@提示 - self.messageTipsBtn.hidden = YES; - } - if (self.locationArray.count) { - [self.locationArray removeObjectAtIndex:0]; - self.atCount -= 1; - [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView0"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; - if (self.locationArray.count == 0) { - self.atTipBtn.hidden = YES; - } - } else { - self.atTipBtn.hidden = YES; - } - } else { + + // 4. 超长消息处理逻辑 if (self.datasource.count > kRoomMessageMaxLength) { - NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; - NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; - [self.datasource removeObjectsInArray:needRemoveMsgArray]; - [self updateAllDataSource:nil]; - NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; - for (int i = 0; i indexPath.row) { - [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - if (rows == indexPath.row + 1) { - self.messageTipsBtn.hidden = YES; - self.isPending = NO; - } - } else { - [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - //滚动到底部时隐藏@提示 - self.messageTipsBtn.hidden = YES; - } - if (self.locationArray.count) { - [self.locationArray removeObjectAtIndex:0]; - self.atCount -= 1; - [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView1"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; - if (self.locationArray.count == 0) { - self.atTipBtn.hidden = YES; - } - } else { - self.atTipBtn.hidden = YES; + // 6. 滚动到指定位置或底部 + [self scrollToFirstLocationOrBottom]; + +// if (self.incomingMessages.count < 1) { +// NSInteger rows = self.datasource.count; +// if (!self.locationArray.count) { +// [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; +// self.messageTipsBtn.hidden = YES; +// self.isPending = NO; +// self.atCount = 0; +// self.atTipBtn.hidden = YES; +// return; +// } +// int index = [self.locationArray[0] intValue]; +// NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; +// if (rows > indexPath.row) { +// [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; +// if (rows == indexPath.row + 1) { +// self.messageTipsBtn.hidden = YES; +// self.isPending = NO; +// } +// } else { +// [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; +// //滚动到底部时隐藏@提示 +// self.messageTipsBtn.hidden = YES; +// } +// if (self.locationArray.count) { +// [self.locationArray removeObjectAtIndex:0]; +// self.atCount -= 1; +// [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView0"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; +// if (self.locationArray.count == 0) { +// self.atTipBtn.hidden = YES; +// } +// } else { +// self.atTipBtn.hidden = YES; +// } +// } else { +// if (self.datasource.count > kRoomMessageMaxLength) { +// NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; +// NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; +// [self.datasource removeObjectsInArray:needRemoveMsgArray]; +// [self updateAllDataSource:nil]; +// NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; +// for (int i = 0; i indexPath.row) { +// [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; +// if (rows == indexPath.row + 1) { +// self.messageTipsBtn.hidden = YES; +// self.isPending = NO; +// } +// } else { +// [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; +// //滚动到底部时隐藏@提示 +// self.messageTipsBtn.hidden = YES; +// } +// if (self.locationArray.count) { +// [self.locationArray removeObjectAtIndex:0]; +// self.atCount -= 1; +// [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView1"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; +// if (self.locationArray.count == 0) { +// self.atTipBtn.hidden = YES; +// } +// } else { +// self.atTipBtn.hidden = YES; +// } +// } +} + +- (void)scrollToBottomWithTipsHidden:(BOOL)hidden { + NSInteger rows = self.datasource.count; + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:(rows - 1) inSection:0]; + [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; + self.messageTipsBtn.hidden = hidden; + self.isPending = NO; + self.atCount = 0; + self.atTipBtn.hidden = hidden; +} + +- (void)updateLocationArrayForMessageRemoval:(NSInteger)removedCount { + NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; + for (int i = 0; i < self.locationArray.count; i++) { + NSNumber *number = self.locationArray[i]; + if (number.integerValue < removedCount) { + self.atCount--; + [indexSet addIndex:i]; } } + [self.locationArray removeObjectsAtIndexes:indexSet]; + for (int i = 0; i < self.locationArray.count; i++) { + NSNumber *number = self.locationArray[i]; + self.locationArray[i] = @(number.integerValue - removedCount); + } +} + +- (void)updateAtTipButton { + if (self.locationArray.count == 0) { + self.atTipBtn.hidden = YES; + } else { + [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView0"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; + self.atTipBtn.hidden = NO; + } +} + +- (int)safeGetIndexFromLocationArrayAt:(NSUInteger)index { + if (index < self.locationArray.count) { + NSNumber *number = self.locationArray[index]; + return [number intValue]; + } + return NSNotFound; // 返回一个无效值,避免崩溃 +} + +- (void)safelyRemoveLocationAtIndex:(NSUInteger)index { + if (index < self.locationArray.count) { + [self.locationArray removeObjectAtIndex:index]; + self.atCount = MAX(0, self.atCount - 1); + } +} + +- (void)safelyRemoveMessages:(NSInteger)count { + if (self.datasource.count >= count) { + NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, count)]; + [self.datasource removeObjectsAtIndexes:set]; + [self updateAllDataSource:nil]; + + // 更新 locationArray + NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; + for (NSUInteger i = 0; i < self.locationArray.count; i++) { + NSNumber *number = self.locationArray[i]; + if (number.integerValue < count) { + [indexSet addIndex:i]; + } else { + self.locationArray[i] = @(number.integerValue - count); + } + } + [self.locationArray removeObjectsAtIndexes:indexSet]; + } +} + +- (XPMessageInfoModel *)parseMessage:(id)item { + if ([item isKindOfClass:[NIMMessage class]]) { + return [self.messageParser parseMessageAttribute:item]; + } else if ([item isKindOfClass:[NIMBroadcastMessage class]]) { + return [self.messageParser parseBroadcastMessageAttribute:item]; + } + return nil; +} + +- (void)processAtMentionsForMessage:(id)item { + if ([item isKindOfClass:[NIMMessage class]]) { + NSArray *nickNameInfos = [(NIMMessage *)item remoteExt][@"atUids"]; + if ([nickNameInfos isKindOfClass:[NSArray class]]) { + for (NSString *nick in nickNameInfos) { + if ([nick isEqualToString:[AccountInfoStorage instance].getUid]) { + [self.locationArray addObject:@(self.datasource.count - 1)]; + } + } + } + } +} + +- (void)scrollToFirstLocationOrBottom { + NSInteger rows = self.datasource.count; + if (self.locationArray.count == 0) { + [self scrollToBottomWithTipsHidden:YES]; + return; + } + + int index = [self safeGetIndexFromLocationArrayAt:0]; + if (index == NSNotFound || index >= rows) { + [self scrollToBottomWithTipsHidden:YES]; + } else { + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; + [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; + [self safelyRemoveLocationAtIndex:0]; + } + [self updateAtTipButton]; } #pragma mark - @我 @@ -366,6 +537,20 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; if(self.isLoadHistoryMessage == YES)return; [self.incomingMessages addObject:messageData]; + NSInteger messageCount = 0; + switch (self.displayType) { + case 1: + messageCount = self.datasource.count; + break; + case 2: + messageCount = self.datasource_chat.count; + break; + case 3: + messageCount = self.datasource_gift.count; + break; + default: + break; + } if ([messageData isKindOfClass:[NIMBroadcastMessage class]]) { NIMBroadcastMessage *broadcastMessage = (NIMBroadcastMessage *)messageData; [[XPRoomMiniManager shareManager] saveRoomMessage:broadcastMessage]; @@ -388,6 +573,19 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } if (self.isPending) { +// switch (self.displayType) { +// case 1: +// self.messageTipsBtn.hidden = self.datasource.count == messageCount; +// break; +// case 2: +// self.messageTipsBtn.hidden = self.datasource_chat.count == messageCount; +// break; +// case 3: +// self.messageTipsBtn.hidden = self.datasource_gift.count == messageCount; +// break; +// default: +// break; +// } self.messageTipsBtn.hidden = NO; [self findAtMeNumber]; } else { diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index 2897b384..872f4158 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -166,11 +166,6 @@ indexOfRoomAlbum += 1; } - if (isOnMic) { - [array addObject:musicPanel]; - indexOfRoomAlbum += 1; - } - if (isCreator && roomInfo.type != RoomType_MiniGame) { if(roomInfo.type != RoomType_Anchor){ [array addObject:acrossRoomPK]; @@ -178,6 +173,11 @@ } } + if (isOnMic) { + [array addObject:musicPanel]; + indexOfRoomAlbum += 1; + } + if (isCreator && roomInfo.type == RoomType_Anchor) { [array addObject:anchorRoomPK]; indexOfRoomAlbum += 1; @@ -194,11 +194,11 @@ } [array addObject:trumpet]; [array addObject:giftEffect]; + [array addObject:roomSetting]; if (isCreator || isManager || isSuperAdmin) { [array addObject:bgValue]; indexOfRoomAlbum += 1; } - [array addObject:roomSetting]; [array addObject:clearScreen]; } else { [array addObject:trumpet]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.h b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.h index 38193470..17b0efab 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.h @@ -17,7 +17,8 @@ typedef enum : NSUInteger { ComboAction_RemovePanel, ComboAction_Error, ComboAction_Combo_Count_Update, - ComboAction_Update_After_Send_Success + ComboAction_Update_After_Send_Success, + ComboAction_SendGift_Gold_Update } ComboActionType; typedef enum : NSUInteger { @@ -31,8 +32,11 @@ NS_ASSUME_NONNULL_BEGIN @interface GiftComboManager : NSObject +@property (nonatomic, assign, readonly) BOOL enableCombo; +//@property(nonatomic, strong, nullable) GiftComboView *comboView; @property (nonatomic, strong) GiftReceiveInfoModel *sendGiftReceiveInfo; @property(nonatomic, copy) void(^handleComboSuccess)(GiftReceiveInfoModel *receiveModel, NSMutableDictionary *originDic); +@property(nonatomic, copy) void(^handleRoomUIChanged)(BOOL comboViewDisplay); // 单例方法 + (instancetype)sharedManager; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m index cf49fb1d..45cd020b 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m @@ -72,6 +72,8 @@ return sharedInstance; } + + //// 添加 GiftReceiveInfoModel 和 metadata 到队列 - (void)addGiftComboWithInfo:(GiftReceiveInfoModel *)info andMetadata:(NSDictionary *)metadata { if (info && metadata) { @@ -104,6 +106,10 @@ self.actionCallback(ComboAction_ShowPanel); self.isCombing = YES; } + + if (self.handleRoomUIChanged) { + self.handleRoomUIChanged(YES); + } } - (void)registerActions:(void (^)(ComboActionType))action { @@ -116,6 +122,9 @@ if (self.actionCallback) { self.actionCallback(ComboAction_RemovePanel); } + if (self.handleRoomUIChanged) { + self.handleRoomUIChanged(NO); + } self.isCombing = NO; } @@ -419,33 +428,6 @@ [self.requestQueue addObject:dic]; [self startProcessingQueue]; - -// @kWeakify(self); -// [Api requestSendGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { -// @kStrongify(self); -// if (!self) { -// return; -// } -// if (code == 200) { -// GiftReceiveInfoModel *receive = [GiftReceiveInfoModel modelWithJSON:data.data]; -// receive.sourceType = self.giftSourceType; -// receive.roomSendGiftType = self.roomSendGiftType; -// [self handleSendGiftSuccess:data]; -// } else { -// self.errorMessage = msg; -// self.actionCallback(ComboAction_RemovePanel); -// self.actionCallback(ComboAction_Error); -// } -// } -// targetUids:allUIDs -// giftNum:self.giftNumPerTimes -// sendType:[NSString stringWithFormat:@"%ld", GiftSendType_OnMic] -// giftId:[NSString stringWithFormat:@"%ld", self.giftInfo.giftId] -// giftSource:[NSString stringWithFormat:@"%ld", self.giftSourceType] -// giftType:[NSString stringWithFormat:@"%ld", self.roomSendGiftType] -// roomUid:self.roomUID -// msg:@"" -// uid:[AccountInfoStorage instance].getUid]; } - (void)handleSendGift:(NSDictionary *)dic { @@ -463,6 +445,10 @@ NSArray *array = [allUIDs componentsSeparatedByString:@","]; receive.receiveGiftNumberUser = array.count; [self handleSendGiftSuccess:receive sourceData:data]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" + object:@{@"CurrentGold": receive.userPurse.diamonds, + @"Price": @(receive.gift.goldPrice * receive.giftNum * array.count), + @"isFromWinning":@(NO)}]; } else { self.errorMessage = msg; self.actionCallback(ComboAction_RemovePanel); @@ -482,9 +468,6 @@ - (void)handleSendGiftSuccess:(GiftReceiveInfoModel *)receive sourceData:(BaseModel *)response { - -// self.combo += 1; - if (self.actionCallback) { self.actionCallback(ComboAction_Combo_Count_Update); } @@ -495,55 +478,6 @@ if (self.handleComboSuccess) { self.handleComboSuccess(receive, dic); } - - return; - - self.sendGiftReceiveInfo = receive; - if (self.actionCallback) { - self.actionCallback(ComboAction_Update_After_Send_Success); - } - - NSDictionary *tempDic = response.data; - NSMutableDictionary *data = [NSMutableDictionary dictionary]; - [data addEntriesFromDictionary:tempDic]; - - AttachmentModel *attachment = [[AttachmentModel alloc] init]; - switch (self.roomSendGiftType) { - case RoomSendGiftType_AllMic: { - attachment.first = CustomMessageType_AllMicroSend; - attachment.second = Custom_Message_Sub_AllMicroSend; - [data setObject:[tempDic valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; - attachment.data = data; - } - break; - case RoomSendGiftType_MutableOnMic: { - attachment.first = CustomMessageType_AllMicroSend; - attachment.second = Custom_Message_Sub_AllBatchSend; - attachment.data = data; - } - break; - case RoomSendGiftType_ToOne: { - attachment.first = CustomMessageType_Gift; - attachment.second = Custom_Message_Sub_Gift_Send; - NSDictionary *targetUsers = ((NSArray *)[data objectForKey:@"targetUsers"]).firstObject; - NSString *avatar = [targetUsers valueForKeyPath:@"avatar"]; - [data setObject:[targetUsers valueForKeyPath:@"uid"] forKey:@"targetUid"]; - [data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"]; - if (avatar.length > 0) { - [data setObject:avatar forKey:@"targetAvatar"]; - } - attachment.data = data; - } - break; - default: - attachment = nil; - break; - } - - if (attachment) { - [attachment.data setObject:@(self.combo) forKey:@"comboCount"]; - [self sendCustomMessage:attachment]; - } } - (void)sendCustomMessage:(AttachmentModel *)attachment { diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.h index 41e1a4f3..83f2b4bf 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.h @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithFrame:(CGRect)frame duration:(NSInteger)duration; - (void)startCountdown; - (void)resetCountdown; // 重置功能 +- (void)stopCountdown; - (void)setCompletionHandler:(void (^__nullable)(void))completionHandler; // 计时结束的回调 @end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m index eb067f67..e8a6c7d8 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m @@ -23,9 +23,7 @@ - (void)dealloc { - self.completionHandler = nil; - [self.timer invalidate]; - self.timer = nil; + [self stopCountdown]; } - (instancetype)initWithFrame:(CGRect)frame duration:(NSInteger)duration { @@ -51,14 +49,6 @@ endAngle:(M_PI * 2) - M_PI_2 clockwise:YES]; - // 背景圆环 -// self.backgroundLayer = [CAShapeLayer layer]; -// self.backgroundLayer.path = circularPath.CGPath; -// self.backgroundLayer.strokeColor = UIColorFromRGB(0x04D5C6).CGColor; -// self.backgroundLayer.lineWidth = 7; -// self.backgroundLayer.fillColor = [UIColor clearColor].CGColor; -// [self.layer addSublayer:self.backgroundLayer]; - // 前景倒计时圆环 self.foregroundLayer = [CAShapeLayer layer]; self.foregroundLayer.path = circularPath.CGPath; @@ -119,6 +109,9 @@ self.remainingTime -= 0.1; if (self.remainingTime <= 0) { + + // TODO: 这里的timer 只负责动画,manager 处增加处理逻辑的 timer + [self.timer invalidate]; self.timer = nil; @@ -128,6 +121,12 @@ } } +- (void)stopCountdown { + self.completionHandler = nil; + [self.timer invalidate]; + self.timer = nil; +} + // 环形倒计时动画 - (void)animateRing { CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h index 97c6b32f..fd5f963c 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h @@ -12,9 +12,10 @@ NS_ASSUME_NONNULL_BEGIN @interface GiftComboView : UIView - +- (void)setupCurrentGold:(double)gold; +- (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning; - (void)updateCount; - +- (void)stopTimer; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m index 8a959a7a..9aa85b1f 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m @@ -12,23 +12,39 @@ #import #import -@interface GiftComboView () +@interface GiftComboView () @property (nonatomic, strong) UIView *container; @property (nonatomic, strong) UILabel *comboCountLabel; +@property(nonatomic, strong) UILabel *comboGoldLabel; +@property(nonatomic, strong) UILabel *updateGoldLabel; @property (nonatomic, strong) SVGAImageView *playImageView; @property (nonatomic, strong) SVGAVideoEntity *svgaVideoEntity; @property (nonatomic, strong) CountdownRingView *countdownRingView; +@property(nonatomic, strong) NSMutableArray *updateGoldQueue; +@property(nonatomic, assign) BOOL isAnimatingUpdateGold; + @end @implementation GiftComboView +- (void)dealloc +{ + [self.countdownRingView stopCountdown]; + [self.countdownRingView removeFromSuperview]; + self.countdownRingView = nil; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + - (instancetype)init { if (self = [super init]) { - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapSpace)]; - [self addGestureRecognizer:tap]; + self.updateGoldQueue = @[].mutableCopy; + [self setupNotification]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapSpace)]; + tap.delegate = self; + [self addGestureRecognizer:tap]; [self setupUI]; [self setupTimer]; [self updateCount]; @@ -50,6 +66,30 @@ return self; } +- (void)setupNotification { + [[NSNotificationCenter defaultCenter] addObserverForName:@"receiveLuckGiftWinning" + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification * _Nonnull notification) { + if ([notification.object isKindOfClass:[NSString class]]) { + NSString *coin = (NSString *)notification.object; + if (![NSString isEmpty:coin]) { + [self updateCurrentGold:coin.doubleValue giftPrice:0 isFromWinning:YES]; + } + } else if ([notification.object isKindOfClass:[NSDictionary class]]) { + NSDictionary *dic = (NSDictionary *)notification.object; + double coin = [[dic objectForKey:@"CurrentGold"] doubleValue]; + double price = [[dic objectForKey:@"Price"] doubleValue]; + BOOL isFromWinning = [[dic objectForKey:@"isFromWinning"] boolValue]; + [self updateCurrentGold:coin giftPrice:price isFromWinning:isFromWinning]; +// [[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" +// object:@{@"CurrentGold": receive.userPurse.diamonds, +// @"Price": @(receive.gift.goldPrice), +// @"isFromWinning":@(NO)}]; + } + }]; +} + - (void)updateCount { NSString *countStr = [NSString stringWithFormat:@"x%ld", [[GiftComboManager sharedManager] loadComboCount]]; NSShadow *shadow = [[NSShadow alloc] init]; @@ -63,11 +103,15 @@ self.comboCountLabel.attributedText = string; } +- (void)stopTimer { + [self.countdownRingView stopCountdown]; +} + - (void)setupUI { [self addSubview:self.container]; [self.container mas_makeConstraints:^(MASConstraintMaker *make) { make.trailing.mas_equalTo(self).offset(-16); - make.bottom.mas_equalTo(self).offset(-20); + make.bottom.mas_equalTo(self).offset(-26); make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(170), kGetScaleWidth(310))); }]; @@ -90,6 +134,41 @@ make.bottom.mas_equalTo(self.playImageView.mas_bottom).offset(4); make.width.height.mas_equalTo(kGetScaleWidth(90)); }]; + + [self setupGoldArea]; +} + +- (void)setupGoldArea { + [self addSubview:self.comboGoldLabel]; + [self.comboGoldLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(44); + make.bottom.mas_equalTo(-74); + }]; + + UIImageView *coin = [[UIImageView alloc] initWithImage:kImage(@"moli_money_icon")]; + [self addSubview:coin]; + [coin mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.comboGoldLabel); + make.trailing.mas_equalTo(self.comboGoldLabel.mas_leading).offset(-4); + make.size.mas_equalTo(CGSizeMake(22, 22)); + }]; + + UIView *bg = [[UIView alloc] init]; + bg.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4]; + [bg setCornerRadius:18]; + [self insertSubview:bg belowSubview:self.comboGoldLabel]; + [bg mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(coin.mas_leading).offset(-8); + make.trailing.mas_equalTo(self.comboGoldLabel.mas_trailing).offset(8); + make.centerY.mas_equalTo(self.comboGoldLabel); + make.height.mas_equalTo(36); + }]; + + [self addSubview:self.updateGoldLabel]; + [self.updateGoldLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(bg); + make.bottom.mas_equalTo(self.comboGoldLabel.mas_bottom).offset(0); + }]; } - (void)setupTimer { @@ -103,10 +182,10 @@ } - (void)handleTap { -// dispatch_async(dispatch_get_main_queue(), ^{ + dispatch_async(dispatch_get_main_queue(), ^{ // 1521 连续震动 3 次 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); -// }); + }); [[GiftComboManager sharedManager] sendGift]; [self.playImageView startAnimation]; @@ -114,7 +193,7 @@ } - (void)handleTapSpace { - + [[GiftComboManager sharedManager] forceRemove]; } // SVGAPlayerDelegate: 当动画播放完毕时调用 @@ -122,6 +201,71 @@ [self.playImageView stepToPercentage:0 andPlay:NO]; } +#pragma mark - +- (void)setupCurrentGold:(double)gold { + self.comboGoldLabel.text = @(gold).stringValue; +} + +- (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning { + if (isFromWinning) { + [self.updateGoldQueue addObject:[NSString stringWithFormat:@"+ %@", @(gold)]]; + } else { + [self.updateGoldQueue addObject:@(-price).stringValue]; + self.comboGoldLabel.text = @(gold).stringValue; + } + + if (!self.isAnimatingUpdateGold) { + [self processNextUpdateGold]; + } +} + +- (void)processNextUpdateGold { + if (self.updateGoldQueue.count == 0) { + self.isAnimatingUpdateGold = NO; + return; + } + + NSNumber *goldNum = [self.updateGoldQueue xpSafeObjectAtIndex:0]; + [self.updateGoldQueue removeObjectAtIndex:0]; + + self.isAnimatingUpdateGold = YES; + + self.updateGoldLabel.text = goldNum.stringValue; + self.updateGoldLabel.alpha = 0; + [UIView animateWithDuration:0.25 animations:^{ + [self.updateGoldLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.comboGoldLabel.mas_bottom).offset(-40); + }]; + self.updateGoldLabel.alpha = 1; + [self layoutIfNeeded]; + } completion:^(BOOL finished) { + [UIView animateWithDuration:0.25 + delay:0.25 + options:UIViewAnimationOptionCurveLinear + animations:^{ + [self.updateGoldLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.comboGoldLabel.mas_bottom).offset(0); + }]; + self.updateGoldLabel.alpha = 0; + [self layoutIfNeeded]; + } completion:^(BOOL finished) { + self.isAnimatingUpdateGold = NO; + [self processNextUpdateGold]; + }]; + }]; +} + +#pragma mark - +#pragma mark - +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { + // 如果触摸点在 UITextView 或 UICollectionView 内,则不触发手势 + if (touch.view == self.container || touch.view == self.playImageView) { + return NO; + } + return YES; // 触发手势 +} + +#pragma mark - - (UIView *)container { if (!_container) { @@ -142,6 +286,20 @@ return _comboCountLabel; } +- (UILabel *)comboGoldLabel { + if (!_comboGoldLabel) { + _comboGoldLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(20) textColor:UIColorFromRGB(0xffd54c)]; + } + return _comboGoldLabel; +} + +- (UILabel *)updateGoldLabel { + if (!_updateGoldLabel) { + _updateGoldLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(24) textColor:UIColorFromRGB(0xffd54c)]; + } + return _updateGoldLabel; +} + - (SVGAImageView *)playImageView { if (_playImageView == nil) { _playImageView = [[SVGAImageView alloc]init]; @@ -155,7 +313,8 @@ - (CountdownRingView *)countdownRingView { if (!_countdownRingView) { _countdownRingView = [[CountdownRingView alloc] initWithFrame:CGRectMake(0, 0, kGetScaleWidth(90), kGetScaleWidth(90)) - duration:555]; + duration:5]; + _countdownRingView.userInteractionEnabled = YES; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)]; [_countdownRingView addGestureRecognizer:tap]; } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m index 56a2a48d..95b81400 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m @@ -345,7 +345,6 @@ diamondAtt.image = iconImage; NSAttributedString *diamondAttribute = [NSMutableAttributedString attributedStringWithAttachment:(NSTextAttachment *)diamondAtt]; - if (_walletInfoModel.canGoldSendGift == NO){ NSString * title = [NSString stringWithFormat:@" %@",diamonds]; NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:highlightColor}]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index b9191367..2555ad85 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -174,6 +174,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; if (self->_luckyBroadcastView) { self.luckyBroadcastView.hidden = NO; } + [self.comboView stopTimer]; [self.comboView removeFromSuperview]; self.comboView = nil; } @@ -194,6 +195,10 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; } else { self.giftBarView.walletInfoModel = receiveInfo.userPurse; } + } + break; + case ComboAction_SendGift_Gold_Update: { + } break; default: @@ -928,12 +933,15 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; @kStrongify(self); if (self) { [self sendCustomMessage:receiveInfo oringinDic:originDic]; - [[GiftComboManager sharedManager] resetCombo]; - @kWeakify(self); - [[GiftComboManager sharedManager] setHandleComboSuccess:^(GiftReceiveInfoModel * _Nonnull receiveModel, NSMutableDictionary * _Nonnull originDic) { - @kStrongify(self); - [self sendCustomMessage:receiveInfo oringinDic:originDic.copy]; - }]; + if ([GiftComboManager sharedManager].enableCombo) { + [[GiftComboManager sharedManager] resetCombo]; + [self.comboView setupCurrentGold:receiveInfo.userPurse.diamonds.doubleValue]; + @kWeakify(self); + [[GiftComboManager sharedManager] setHandleComboSuccess:^(GiftReceiveInfoModel * _Nonnull receiveModel, NSMutableDictionary * _Nonnull originDic) { + @kStrongify(self); + [self sendCustomMessage:receiveInfo oringinDic:originDic.copy]; + }]; + } } }); diff --git a/YuMi/Tools/NSString/NSString+Utils.h b/YuMi/Tools/NSString/NSString+Utils.h index 9d0274e2..68aebcdc 100644 --- a/YuMi/Tools/NSString/NSString+Utils.h +++ b/YuMi/Tools/NSString/NSString+Utils.h @@ -46,6 +46,9 @@ NS_ASSUME_NONNULL_BEGIN //- (BOOL)isEmpty; - (NSString *)pureURLString; + ++ (NSString *)formatNumberToKOrM_NoRounding:(NSString *)string; + @end diff --git a/YuMi/Tools/NSString/NSString+Utils.m b/YuMi/Tools/NSString/NSString+Utils.m index 40e1e55f..51113243 100644 --- a/YuMi/Tools/NSString/NSString+Utils.m +++ b/YuMi/Tools/NSString/NSString+Utils.m @@ -102,6 +102,61 @@ } } ++ (NSString *)formatNumberToKOrM_NoRounding:(NSString *)string { + // 定义数值单位 + NSDecimalNumber *thousand = [NSDecimalNumber decimalNumberWithString:@"1000"]; + NSDecimalNumber *nine = [NSDecimalNumber decimalNumberWithString:@"9999"]; + NSDecimalNumber *million = [NSDecimalNumber decimalNumberWithString:@"1000000"]; + NSDecimalNumber *billion = [NSDecimalNumber decimalNumberWithString:@"1000000000"]; + NSDecimalNumber *trillion = [NSDecimalNumber decimalNumberWithString:@"1000000000000"]; + // 创建 NSDecimalNumber 对象 + NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:string]; + + // 判断数值范围并处理 + if ([number compare:nine] == NSOrderedAscending) { + // 小于 10000,直接返回原始值 + return [NSString stringWithFormat:@"%@", string]; + } else if ([number compare:nine] != NSOrderedAscending && [number compare:million] == NSOrderedAscending) { + // 10000 到 9999999,用K表示 + NSDecimalNumber *result = [number decimalNumberByDividingBy:thousand]; + return [self truncateDecimal:result withUnit:@"K"]; + } else if ([number compare:million] != NSOrderedAscending && [number compare:billion] == NSOrderedAscending) { + // 超过 1000000,用M表示 + NSDecimalNumber *result = [number decimalNumberByDividingBy:million]; + return [self truncateDecimal:result withUnit:@"M"]; + } else if ([number compare:billion] != NSOrderedAscending && [number compare:trillion] == NSOrderedAscending) { + // 超过十亿,用 B 表示 + NSDecimalNumber *result = [number decimalNumberByDividingBy:billion]; + return [self truncateDecimal:result withUnit:@"B"]; + } else { + // 超过一万亿,可以继续增加更高单位 + NSDecimalNumber *result = [number decimalNumberByDividingBy:trillion]; + return [self truncateDecimal:result withUnit:@"T"]; // T 表示万亿 (Trillion) + } +} + +// 格式化并截断小数位 ++ (NSString *)truncateDecimal:(NSDecimalNumber *)decimal withUnit:(NSString *)unit { + // 获取字符串形式的结果,并截断到一位小数 + NSString *decimalString = decimal.stringValue; + NSArray *components = [decimalString componentsSeparatedByString:@"."]; + NSString *integerPart = components.firstObject; + NSString *decimalPart = components.count > 1 ? components[1] : @""; + + if (decimalPart.length > 1) { + decimalPart = [decimalPart substringToIndex:1]; // 截断到一位小数 + } + + if (decimalPart.length == 0 || [decimalPart isEqualToString:@"0"]) { + // 如果小数部分为空或为 0,只返回整数部分 + return [NSString stringWithFormat:@"%@%@", integerPart, unit]; + } else { + // 返回截断后的结果 + return [NSString stringWithFormat:@"%@.%@%@", integerPart, decimalPart, unit]; + } +} + + + (NSString *)formatResult:(NSDecimalNumber *)result withUnit:(NSString *)unit { // 将 NSDecimalNumber 转为浮点数 CGFloat floatValue = result.floatValue; diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index f1542592..b2232938 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -940,8 +940,8 @@ "XPMineDressUpListViewController11" = "عزيزي المستخدم، ليس لديك زينات رأس بعد!"; "XPMineDressUpListViewController12" = "عزيزي المستخدم، ليس لديك مركبات بعد!"; -"XPDressUpShopViewController0" = "تجهيزاتي"; -"XPDressUpShopViewController1" = "متجر الزينة"; +"XPDressUpShopViewController0" = "منجمي"; +"XPDressUpShopViewController1" = "مول"; "XPDressUpShopViewController6" = "فقاعات الدردشة"; "XPDressUpShopViewController7" = "كوينزاتي"; "XPDressUpShopViewController8" = "إعادة شحن"; diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index 702fa5d1..bfdb5508 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -282,8 +282,8 @@ "XPMineDressUpListViewController11" = "Sevgili kullanıcı, henüz bir başlık takımınız yok!"; "XPMineDressUpListViewController12" = "Sevgili kullanıcı, henüz bir araba süslemeniz yok!"; -"XPDressUpShopViewController0" = "Benim Giyimim"; -"XPDressUpShopViewController1" = "Giyim Mağazası"; +"XPDressUpShopViewController0" = "Benim"; +"XPDressUpShopViewController1" = "Mağaza"; "XPDressUpShopViewController6" = "Sohbet Balonları"; "XPDressUpShopViewController7" = "Benim Altınlarım"; "XPDressUpShopViewController8" = "Yükleme"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index f38e4469..1d4bc99e 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -3431,7 +3431,7 @@ "1.0.18_10" = "更新"; "1.0.18_11" = "購買提示"; "1.0.18_12" = "您確定要使用此圖像作為背景嗎?"; -"1.0.18_14" = "天"; +//"1.0.18_14" = "天"; "1.0.18_13" = "您確定要購買嗎?"; "1.0.18_14" = "1000/15Days"; "1.0.18_15" = "提交";