From 0ac9030f80cebd83c12f49f42b34198ecdb91fdb Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Mon, 2 Feb 2026 15:28:00 +0800 Subject: [PATCH] 1 --- keyBoard/Class/AiTalk/V/Chat/KBPersonaChatCell.m | 4 ++++ keyBoard/Class/AiTalk/VC/AIPersonInfoVC.m | 4 ++-- keyBoard/Class/AiTalk/VC/KBAIHomeVC.m | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/keyBoard/Class/AiTalk/V/Chat/KBPersonaChatCell.m b/keyBoard/Class/AiTalk/V/Chat/KBPersonaChatCell.m index d523931..0e49631 100644 --- a/keyBoard/Class/AiTalk/V/Chat/KBPersonaChatCell.m +++ b/keyBoard/Class/AiTalk/V/Chat/KBPersonaChatCell.m @@ -546,6 +546,10 @@ static NSString * const KBChatSessionDidResetNotification = @"KBChatSessionDidRe if (self.persona && self.persona.personaId == companionId) { NSLog(@"[KBPersonaChatCell] 收到聊天重置通知:companionId=%ld, 清空聊天记录", (long)companionId); + self.shouldAutoPlayPrologueAudio = NO; + self.hasPlayedPrologueAudio = NO; + [self.chatView stopPlayingAudio]; + // 清空消息数组 self.messages = [NSMutableArray array]; self.hasLoadedData = NO; diff --git a/keyBoard/Class/AiTalk/VC/AIPersonInfoVC.m b/keyBoard/Class/AiTalk/VC/AIPersonInfoVC.m index 27eb6db..30b0d77 100644 --- a/keyBoard/Class/AiTalk/VC/AIPersonInfoVC.m +++ b/keyBoard/Class/AiTalk/VC/AIPersonInfoVC.m @@ -46,7 +46,7 @@ [super viewDidLoad]; self.kb_navView.hidden = YES; - self.view.backgroundColor = [UIColor blackColor]; +// self.view.backgroundColor = [UIColor blackColor]; self.aiVM = [[AiVM alloc] init]; /// 1:控件初始化 @@ -261,7 +261,7 @@ - (UIButton *)closeButton { if (!_closeButton) { _closeButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_closeButton setImage:[UIImage imageNamed:@"comment_close_icon"] forState:UIControlStateNormal]; + [_closeButton setImage:[UIImage imageNamed:@"ai_close_icon"] forState:UIControlStateNormal]; [_closeButton addTarget:self action:@selector(closeButtonTapped) forControlEvents:UIControlEventTouchUpInside]; } return _closeButton; diff --git a/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m b/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m index 8f0f7b7..b1f56b7 100644 --- a/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m +++ b/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m @@ -159,6 +159,16 @@ } } +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + for (NSIndexPath *indexPath in self.collectionView.indexPathsForVisibleItems) { + KBPersonaChatCell *cell = (KBPersonaChatCell *)[self.collectionView cellForItemAtIndexPath:indexPath]; + if (cell) { + [cell onResignedCurrentPersonaCell]; + } + } +} + - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if (self.bottomMaskLayer) {