From b96f270acf945ea3fd3addf96a41e27b05aaab76 Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Thu, 16 May 2024 14:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 4 +- YuMi/Global/YUMIMacroUitls.h | 2 +- .../Cell/MSSessionPublicChatHalImageCell.m | 9 +- .../Content/MessageContentHeadLinesText.m | 4 + .../View/AnimationView/XPRoomAnimationView.m | 17 +-- .../MenuContainerView/MSRoomMenuGameView.m | 7 + .../Model/XPMessageInfoModel.h | 1 + .../Model/XPMessageInfoModel.m | 16 +-- .../MsRoomMessagChatHallView.m | 28 ++-- .../Tool/XPRoomMessageParser.h | 2 + .../Tool/XPRoomMessageParser.m | 30 ++++- .../View/XPRoomMessageTableViewCell.m | 31 ++--- .../XPRoomMessageContainerView.m | 24 ++-- .../View/View/XPTreasureFairyStoreView.m | 4 +- .../View/XPTreasureFairyTrialsContentView.m | 3 +- .../YMRoom/View/XPRoomViewController.m | 127 ++++++++++-------- .../YMTabbar/View/TabbarViewController.m | 38 +++--- 17 files changed, 195 insertions(+), 152 deletions(-) diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 4b3be28a..5d9b40ea 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -12540,7 +12540,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.20.19; + MARKETING_VERSION = 20.20.20; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -12578,7 +12578,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.20.19; + MARKETING_VERSION = 20.20.20; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/YuMi/Global/YUMIMacroUitls.h b/YuMi/Global/YUMIMacroUitls.h index 5ed8284f..de5ec485 100644 --- a/YuMi/Global/YUMIMacroUitls.h +++ b/YuMi/Global/YUMIMacroUitls.h @@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns ///内置版本号 -#define PI_App_Version @"1.0.5" +#define PI_App_Version @"1.0.6" ///渠道 #define PI_App_Source @"appstore" #define PI_Test_Flight @"TestFlight" diff --git a/YuMi/Modules/YMMessage/View/Session/Cell/MSSessionPublicChatHalImageCell.m b/YuMi/Modules/YMMessage/View/Session/Cell/MSSessionPublicChatHalImageCell.m index a7b61222..6a054d1d 100644 --- a/YuMi/Modules/YMMessage/View/Session/Cell/MSSessionPublicChatHalImageCell.m +++ b/YuMi/Modules/YMMessage/View/Session/Cell/MSSessionPublicChatHalImageCell.m @@ -48,6 +48,7 @@ @property(nonatomic,strong) NetImageView *leftPicImageView; @property(nonatomic,strong) NetImageView *rightPicImageView; + @end @implementation MSSessionPublicChatHalImageCell @@ -75,8 +76,6 @@ [self addSubview:self.rightBubbleImageView]; [self.leftBgImage addSubview:self.leftPicImageView]; [self.rightBgImage addSubview:self.rightPicImageView]; - - } -(void)installConstraints{ [self.leftAvatar mas_makeConstraints:^(MASConstraintMaker *make) { @@ -85,7 +84,7 @@ make.top.mas_equalTo(kGetScaleWidth(10)); }]; [self.headWearImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.leftAvatar).with.insets(UIEdgeInsetsMake(kGetScaleWidth(10),kGetScaleWidth(10),kGetScaleWidth(10),kGetScaleWidth(10))); + make.edges.equalTo(self.leftAvatar).with.insets(UIEdgeInsetsMake(-kGetScaleWidth(10),-kGetScaleWidth(10),-kGetScaleWidth(10),-kGetScaleWidth(10))); }]; [self.leftNameView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(kGetScaleWidth(21)); @@ -211,6 +210,7 @@ self.rightBubbleImageView.image = [self resizableImage:image1]; }]; NSString *headwearUrl = extModel.headwearUrl; + self.rightHeadWearImageView.image = nil; if (headwearUrl.length > 0) { NSURL *url = [NSURL URLWithString:headwearUrl]; @kWeakify(self); @@ -232,7 +232,7 @@ }else { [self.leftPicImageView loadImageWithUrl:imageModel.imageUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { self.leftPicImageView.image = image; - }]; + }]; } [self.leftBgImage mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(kGetScaleWidth(45)); @@ -241,6 +241,7 @@ make.height.mas_equalTo(model.contentSize.height+kGetScaleWidth(10)); }]; NSString *headwearUrl = extModel.headwearUrl; + self.headWearImageView.image = nil; if (headwearUrl.length > 0) { NSURL *url = [NSURL URLWithString:headwearUrl]; @kWeakify(self); diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentHeadLinesText.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentHeadLinesText.m index 78506259..95c525b8 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentHeadLinesText.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentHeadLinesText.m @@ -176,6 +176,7 @@ self.rightBubbleImageView.image = [self resizableImage:image1]; }]; NSString *headwearUrl = extModel.headwearUrl; + self.rightHeadWearImageView.image = nil; if (headwearUrl.length > 0) { NSURL *url = [NSURL URLWithString:headwearUrl]; @kWeakify(self); @@ -195,6 +196,8 @@ make.top.mas_equalTo(kGetScaleWidth(45)); }]; NSString *headwearUrl = extModel.headwearUrl; + self.headWearImageView.image = nil; + if (headwearUrl.length > 0) { NSURL *url = [NSURL URLWithString:headwearUrl]; @kWeakify(self); @@ -216,6 +219,7 @@ }]; self.leftBgImage.image = [self resizableImage:kImage(@"ms_message_headlines_text_left")]; self.messageText.textColor = [UIColor whiteColor]; + self.leftBubbleImageView.image = nil; [self.leftBubbleImageView loadImageWithUrl:extModel.iosBubbleUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { self.leftBgImage.image = nil; self.messageText.textColor = UIColorFromRGB(0x333333); diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 2f49981a..955d2517 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -2053,11 +2053,12 @@ ///播放礼物特效 SVGA的 - (void)playGiftEffect:(NSString *)vggUrl { if ([self isInSudGame]) {return;} - NSString *fileName = [[vggUrl componentsSeparatedByString:@"/"] lastObject]; + NSString *encodingUrl = [vggUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){ - NSData *data=[NSData dataWithContentsOfFile:fullPath options:0 error:NULL]; + NSData *data = [NSData dataWithContentsOfFile:fullPath options:0 error:NULL]; [self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { if (videoItem != nil) { @@ -2160,8 +2161,8 @@ } ///播放礼物特效 vap的 - (void)playGiftEffectWithVapUrl:(NSString *)vapUrl { - - NSString *fileName = [[vapUrl componentsSeparatedByString:@"/"] lastObject]; + NSString *encodingUrl = [vapUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){ @@ -2204,8 +2205,8 @@ - (void)playLuckyGiftEffect:(NSURL *)vggUrl { if ([self isInSudGame]) {return;} - - NSString *fileName = [[vggUrl.absoluteString componentsSeparatedByString:@"/"] lastObject]; + NSString *encodingUrl = [vggUrl.absoluteString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){ @@ -2283,8 +2284,8 @@ ///播放礼物特效 vap的 - (void)playLuckyGiftEffectWithVapUrl:(NSString *)vapUrl { - - NSString *fileName = [[vapUrl componentsSeparatedByString:@"/"] lastObject]; + NSString *encodingUrl = [vapUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){ diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m index c94e2ef6..20e785b8 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m @@ -49,6 +49,13 @@ } -(void)setPlayList:(NSMutableArray *)playList{ _playList = playList; + if(_playList.count < 6){ + [self.ms_bgView mas_updateConstraints:^(MASConstraintMaker *make) { + + make.height.mas_equalTo(kGetScaleWidth(130)); + + }]; + } dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.collectionView reloadData]; }); diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h index 50ba1a8f..5a8b440c 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h @@ -10,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMessageInfoModel : PIBaseModel +@property(nonatomic,assign) BOOL isChatHall; @property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; @property(nonatomic,copy) NSString *vipIcon; @property(nonatomic,strong) NSString *charmUrl; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m index 7724f6df..ad0ccc4e 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.m @@ -27,14 +27,14 @@ - (void)setContent:(NSAttributedString *)content { _content = content; - 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; +// 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 ; } @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/MsRoomMessagChatHallView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/MsRoomMessagChatHallView.m index d7fc1dd7..6bc06ed1 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/MsRoomMessagChatHallView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/MsRoomMessagChatHallView.m @@ -217,7 +217,7 @@ } -(void)addRoomMessage:(NIMMessage *)msg{ if (self.hostDelegate.getRoomInfo.isCloseScreen) {return;} - [self.datasource addObject:[self.messageParser parseMessageAttribute:msg]]; + [self.datasource addObject:[self.messageParser parseMessageAttributeForChatHall:msg]]; [self.messageTableView reloadData]; [self scrollToBottom:YES]; } @@ -399,7 +399,7 @@ [self.datasource addObject:messageInfo]; return; } - [self.datasource addObject:[self.messageParser parseMessageAttribute:item]]; + [self.datasource addObject:[self.messageParser parseMessageAttributeForChatHall:item]]; } - (void)handleNIMTextMessage:(NIMMessage *)message { self.isMiniEnter = NO; @@ -475,17 +475,17 @@ return self.datasource.count; } -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - XPMessageInfoModel* messageInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; - - if(messageInfo.first == CustomMessageType_Room_Album){ - return 186; - }else if(messageInfo.first == CustomMessageType_Chat_Hall_Headlinesn){ - return 40; - } - - return messageInfo.rowHeight; -} +//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { +// XPMessageInfoModel* messageInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; +// +// if(messageInfo.first == CustomMessageType_Room_Album){ +// return 186; +// }else if(messageInfo.first == CustomMessageType_Chat_Hall_Headlinesn){ +// return 40; +// } +// +// return messageInfo.rowHeight; +//} - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { XPMessageInfoModel* attr = [self.datasource safeObjectAtIndex1:indexPath.row]; @@ -547,7 +547,7 @@ [browser show]; } - (void)pIRoomMessagePhotoAlbumCell:(PIRoomMessagePhotoAlbumCell *)cell lookUpUserCardModel:(PIRoomPhotoAlbumItemModel *)albumModel{ - [self.messageParser showUserCard:albumModel.uid.integerValue]; + } #pragma mark - PIRoomMessageUnlockPhotoAlbumViewDelegate - (void)unlockRoomAlbumImageWithAlbumModel:(PIRoomPhotoAlbumItemModel *)albumModel{ diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h index 5795b22d..9f941e30 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h @@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN @interface XPRoomMessageParser : NSObject +///公聊厅 +- (XPMessageInfoModel*)parseMessageAttributeForChatHall:(NIMMessage *)message; - (XPMessageInfoModel*)parseMessageAttribute:(NIMMessage *)message; - (NSString *)parseMessageBubble:(NIMMessage *)message; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 10efa1d6..7dc103b4 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -57,7 +57,28 @@ #import "QEmotionHelper.h" @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*)parseMessageAttribute:(NIMMessage *)message { NIMMessageType messageType = message.messageType; @@ -248,7 +269,7 @@ id nickNameNifo = message.remoteExt[@"atNames"]; NSMutableAttributedString *msgStr; if (message.text) { - if(model.nick != nick){ + 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]]; @@ -269,7 +290,10 @@ } [attribute appendAttributedString:msgStr]; } - [self attributeAddLongPressHihtLight:attribute uid:message.from nick:((NIMMessageChatroomExtension *)message.messageExt).roomNickname]; + if(messageInfo.isChatHall == NO){ + [self attributeAddLongPressHihtLight:attribute uid:message.from nick:((NIMMessageChatroomExtension *)message.messageExt).roomNickname]; + } + messageInfo.content = attribute; messageInfo.vipIcon = model.vipIcon; return messageInfo; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index 0204752c..2ffcc4d8 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -50,34 +50,21 @@ } - (void)initSubViewConstraints { - if (isMSZH()){ + [self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.top.mas_equalTo(self.contentView); - make.bottom.mas_equalTo(self.contentView).offset(-6); - make.right.mas_equalTo(self.contentLabel).offset(10); + make.leading.equalTo(self.contentLabel).offset(-12); + make.top.equalTo(self.contentLabel).offset(-10); + make.bottom.mas_equalTo(self.contentLabel).offset(10); + make.trailing.mas_equalTo(self.contentLabel).offset(10); }]; [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.bubbleImageView).offset(12); - make.bottom.mas_equalTo(self.bubbleImageView).offset(-10); - make.top.mas_equalTo(self.bubbleImageView).mas_offset(10); + make.leading.mas_equalTo(12); + make.bottom.mas_equalTo(-20); + make.top.mas_equalTo(10); }]; - return; - } - CGFloat width = kRoomMessageMaxWidth - 24 - 10; - [self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.top.mas_equalTo(self.contentView); - make.bottom.mas_equalTo(self.contentView).offset(-6); - make.trailing.mas_equalTo(self.contentLabel).offset(12); - }]; - - [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.bubbleImageView).offset(12); - make.bottom.mas_equalTo(self.bubbleImageView).offset(-10); - make.top.mas_equalTo(self.bubbleImageView).mas_offset(10); - make.width.mas_lessThanOrEqualTo(width); - }]; + } #pragma mark - tool diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 48e74c1c..aacb0969 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -967,15 +967,15 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; return self.datasource.count; } -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - XPMessageInfoModel* messageInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; - - if(messageInfo.first == CustomMessageType_Room_Album){ - return 186; - } - - return messageInfo.rowHeight; -} +//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { +// XPMessageInfoModel* messageInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; +// +// if(messageInfo.first == CustomMessageType_Room_Album){ +// return 186; +// } +// +// return messageInfo.rowHeight; +//} - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { XPMessageInfoModel* attr = [self.datasource safeObjectAtIndex1:indexPath.row]; @@ -994,7 +994,11 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } - +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + XPRoomMessageTableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath]; + NSLog(@"%@",cell.contentView.subviews); + NSLog(@"%@",cell.contentView.subviews); +} #pragma mark - XPRoomMessageTableViewCellDelegate - (void)xPRoomMessageTableViewCellDidTapEmpty:(XPRoomMessageTableViewCell *)view { diff --git a/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyStoreView.m b/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyStoreView.m index 2b73b2d5..50aa0c2f 100644 --- a/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyStoreView.m +++ b/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyStoreView.m @@ -479,8 +479,8 @@ [view mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.forestImageView); }]; - - NSString *fileName = [[animtionName componentsSeparatedByString:@"/"] lastObject]; + NSString *encodingUrl = [animtionName stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){ diff --git a/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyTrialsContentView.m b/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyTrialsContentView.m index 40371b88..d8aee920 100644 --- a/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyTrialsContentView.m +++ b/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyTrialsContentView.m @@ -284,7 +284,8 @@ make.edges.equalTo(self.trialsBgImageView); }]; } - NSString *fileName = [[animtionName componentsSeparatedByString:@"/"] lastObject]; + NSString *encodingUrl = [animtionName stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){ diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index ec7fefb1..ccdba55c 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -299,7 +299,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.presenter getRedPacketInft:self.redEnvelopeId]; } ///获取首充次数 -// [self.presenter getRoomFirstCharegWindow:self.roomUid]; + // [self.presenter getRoomFirstCharegWindow:self.roomUid]; if ([ClientConfig shareConfig].canOpen) { ///获取已解锁照片id列表 [self.presenter getUnlockRoomAlbumPhotoListWithRoomUid:self.roomUid]; @@ -384,7 +384,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 if([XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == YES && self.isShowFirstRecharge == NO){ [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = NO; ///获取首充次数 -// [self.presenter getRoomFirstCharegWindow:self.roomUid]; + // [self.presenter getRoomFirstCharegWindow:self.roomUid]; } } @@ -395,7 +395,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.view addSubview:self.littleGameView]; [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView]; - + [self.view addSubview:self.quickMessageContainerView]; [self.view addSubview:self.menuContainerView]; [self.view addSubview:self.activityContainerView]; @@ -779,30 +779,30 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 } -(void)showRoomFirstChargeWindowFormNot:(NSNotification *)not{ -// if(not != nil){ -// NSDictionary *parameter = not.object; -// if(parameter != nil){ -// self.firstRechargeView.type = parameter[@"type"]; -// self.firstRechargeView.diamonds = parameter[@"diamonds"]; -// } -// } -// [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showRoomFirstChargeWindow) object:nil]; -// [[UIApplication sharedApplication].keyWindow addSubview:self.firstRechargeView]; -// [self.presenter updateRoomFirstCharegWindow:self.roomUid]; + // if(not != nil){ + // NSDictionary *parameter = not.object; + // if(parameter != nil){ + // self.firstRechargeView.type = parameter[@"type"]; + // self.firstRechargeView.diamonds = parameter[@"diamonds"]; + // } + // } + // [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showRoomFirstChargeWindow) object:nil]; + // [[UIApplication sharedApplication].keyWindow addSubview:self.firstRechargeView]; + // [self.presenter updateRoomFirstCharegWindow:self.roomUid]; } -(void)showRoomFirstChargeWindow{ -// if([XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == YES){ -// self.isShowFirstRecharge = NO; -// return; -// } -// UIViewController *viewController = [XCCurrentVCStackManager shareManager].getCurrentVC; -// if(![viewController isKindOfClass:[XPRoomViewController class]]){ -// [viewController dismissViewControllerAnimated:YES completion:nil]; -// } -// self.isShowFirstRecharge = NO; -// [self.presenter updateRoomFirstCharegWindow:self.roomUid]; -// [[UIApplication sharedApplication].keyWindow addSubview:self.firstRechargeView]; + // if([XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == YES){ + // self.isShowFirstRecharge = NO; + // return; + // } + // UIViewController *viewController = [XCCurrentVCStackManager shareManager].getCurrentVC; + // if(![viewController isKindOfClass:[XPRoomViewController class]]){ + // [viewController dismissViewControllerAnimated:YES completion:nil]; + // } + // self.isShowFirstRecharge = NO; + // [self.presenter updateRoomFirstCharegWindow:self.roomUid]; + // [[UIApplication sharedApplication].keyWindow addSubview:self.firstRechargeView]; } @@ -1024,7 +1024,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 self.hasAnimationEffect = roomInfo.hasAnimationEffect; self.roomInfo = roomInfo; self.userInfo = userInfo; - + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ //获取一下红包信息 @@ -1341,26 +1341,26 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 if (list.count == 0) { return; } -// for (XPRedPacketModel *data in list) { -// if(data.kind == 0){ -// data.kind = 1; -// } -// if((data.validityType == 0 && data.type == RedPacketType_RoomDiamond && [self isShowRedPacketView:data] == YES) || data.type == RedPacketType_AllDiamond){ -// XPReceiveRedPacketView *view = [[XPReceiveRedPacketView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; -// view.receiveModel = data; -// view.delegate = self; -// self.isShowRedPacket = YES; -// for (UIView *subView in self.view.subviews) { -// if([subView isKindOfClass:[XPReceiveRedPacketView class]]) { -// view.alphaView.backgroundColor = [UIColor clearColor]; -// break; -// } -// } -// [self.view addSubview:view]; -// [self.view bringSubviewToFront:view]; -// } -// -// } + // for (XPRedPacketModel *data in list) { + // if(data.kind == 0){ + // data.kind = 1; + // } + // if((data.validityType == 0 && data.type == RedPacketType_RoomDiamond && [self isShowRedPacketView:data] == YES) || data.type == RedPacketType_AllDiamond){ + // XPReceiveRedPacketView *view = [[XPReceiveRedPacketView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; + // view.receiveModel = data; + // view.delegate = self; + // self.isShowRedPacket = YES; + // for (UIView *subView in self.view.subviews) { + // if([subView isKindOfClass:[XPReceiveRedPacketView class]]) { + // view.alphaView.backgroundColor = [UIColor clearColor]; + // break; + // } + // } + // [self.view addSubview:view]; + // [self.view bringSubviewToFront:view]; + // } + // + // } if(list.count > 0){ self.activityContainerView.redPacketList = [NSMutableArray arrayWithArray:list]; @@ -1437,14 +1437,23 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 continue; } NSString *publicChatRoomId = [NSString stringWithFormat:@"%@",[ClientConfig shareConfig].configInfo.publicChatRoomIdMap[self.userInfo.partitionId]]; - if(![message.session.sessionId isEqualToString:publicChatRoomId]){ + if([message.session.sessionId isEqualToString:publicChatRoomId]){ // 非本房间不处理 - if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]) { - continue; + if (message.messageType == NIMMessageTypeNotification) { + [self.messageContainerView handleNIMNotificationMessage:message]; + }else if(message.messageType == NIMMessageTypeText) { + [self.messageContainerView handleNIMTextMessage:message]; + }else if(message.messageType == NIMMessageTypeImage){ + [self.messageContainerView handleNIMImageMessage:message]; + }else if(message.messageType == NIMMessageTypeCustom){ + [self.messageContainerView handleNIMCustomMessage:message]; } + continue; } - + if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]) { + continue; + } if (message.messageType == NIMMessageTypeNotification) { NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject; NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content; @@ -1538,7 +1547,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 if (content.source.userId.integerValue != [AccountInfoStorage instance].getUid.integerValue && self.userInfo.platformRole != 1) { onLineNumber += 1; }else { - + ///如果是自己的话 如果有坐骑的话 [self userEnterRoomSuccess]; ///在活动页面 判断是否显示 相亲加入的按钮 所以需要等用户进房成功之后才能获取 房间角色 @@ -1675,7 +1684,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.view bringSubviewToFront:view]; } self.activityContainerView.redPacketList = redPacketList; - + } }else if(attachment.first == CustomMessageType_Free_Gift_Star_Reset_Time){ if(attachment.second == Custom_Message_Sub_Free_Gift_Star_Reset_Time){ @@ -1713,7 +1722,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 return; } BOOL isHave = NO; - if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){ + if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){ isHave = YES; }else if(attachment.first == CustomMessageType_Guardian_Planet && attachment.second == Custom_Message_Sub_Guardian_Planet_All_Room){ isHave = YES; @@ -1763,13 +1772,21 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 - (void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error { // 非本房间不处理 NSString *publicChatRoomId = [NSString stringWithFormat:@"%@",[ClientConfig shareConfig].configInfo.publicChatRoomIdMap[self.userInfo.partitionId]]; - if(![message.session.sessionId isEqualToString:publicChatRoomId]){ + if([message.session.sessionId isEqualToString:publicChatRoomId]){ // 非本房间不处理 - if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]) { - return; + if(message.messageType == NIMMessageTypeText) { + [self.messageContainerView handleNIMTextMessage:message]; + }else if(message.messageType == NIMMessageTypeImage){ + [self.messageContainerView handleNIMImageMessage:message]; } + return;; } + if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]) { + return; + } + + if (message.yidunAntiSpamRes) { NSDictionary * spamRes = message.yidunAntiSpamRes.toJSONObject; NSDictionary * spamResExt = ((NSString *)spamRes[@"ext"]).toJSONObject; diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index a822c297..91a6b694 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -336,6 +336,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; /// -(void)requestGiftList{ [self dealWithDefaultSvga]; + [self dealWithGiftList]; ///所有礼物接口,缓存礼物,保存时间,一天只请求一次 // NSString *time = [NSDate getNowTimeTimestamp]; // NSString *curTime = [NSDate timestampSwitchTime:[time integerValue] andFormatter:@"yyyy-MM-dd"]; @@ -353,22 +354,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; // [[NSUserDefaults standardUserDefaults]setValue:curDic forKey:@"kRequestGiftList"]; // [[NSUserDefaults standardUserDefaults]synchronize]; // } - [Api requestCacheGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if(code == 200){ - NSArray *giftList = [GiftInfoModel modelsWithArray:data.data]; - for (GiftInfoModel *giftModel in giftList) { - if(giftModel.vggUrl.length > 0){ - NSString *url = [giftModel.vggUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; - [self dealWithGiftListWithUrl:url isSvga:YES]; - }else if(giftModel.viewUrl.length > 0){ - NSString *url = [giftModel.viewUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; - [self dealWithGiftListWithUrl:url isSvga:NO]; - } - - } - } - }]; - [Api requestCacheGiftDynamicEffectList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ NSArray *list = data.data; @@ -389,7 +374,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; for (NSString *url in elfList) { NSString *encodingUrl = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; [self cacheGiftDynamicEffectList:encodingUrl]; - [self dealWithGiftListWithUrl:encodingUrl isSvga:NO]; } } ///缓存新的礼物动效数据 @@ -412,12 +396,22 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } }]; } --(void)dealWithGiftListWithUrl:(NSString *)url isSvga:(BOOL)isSvga { +-(void)dealWithGiftList{ ///删除旧数据缓存, - NSString *baseFileName = isSvga ? @"/GiftSvga":@"/GiftMp4"; - NSString *oldFilePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName]; - if ([[NSFileManager defaultManager] fileExistsAtPath:oldFilePath]) { - BOOL isSuccess = [[NSFileManager defaultManager]removeItemAtPath:oldFilePath error:nil]; + NSString *svgaFileName = @"/GiftSvga"; + NSString *svgaFilePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:svgaFileName]; + if ([[NSFileManager defaultManager] fileExistsAtPath:svgaFilePath]) { + BOOL isSuccess = [[NSFileManager defaultManager]removeItemAtPath:svgaFilePath error:nil]; + if(isSuccess == YES){ + NSLog(@"删除成功"); + } + + } + + NSString *mp4FileName = @"/GiftMp4"; + NSString *mp4FilePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:mp4FileName]; + if ([[NSFileManager defaultManager] fileExistsAtPath:mp4FilePath]) { + BOOL isSuccess = [[NSFileManager defaultManager]removeItemAtPath:mp4FilePath error:nil]; if(isSuccess == YES){ NSLog(@"删除成功"); }