处理了评论新增评论,在聊天里的评论数也一同改变

This commit is contained in:
2026-02-04 19:31:30 +08:00
parent bacaf537f3
commit dd59094a16
4 changed files with 32 additions and 1 deletions

View File

@@ -22,7 +22,7 @@
///
static NSString * const KBChatSessionDidResetNotification = @"KBChatSessionDidResetNotification";
@interface KBPersonaChatCell () <KBChatTableViewDelegate, KBChatMessageActionPopViewDelegate>
@interface KBPersonaChatCell () <KBChatTableViewDelegate, KBChatMessageActionPopViewDelegate, KBAICommentViewDelegate>
///
@property (nonatomic, strong) UIImageView *backgroundImageView;
@@ -1250,6 +1250,7 @@ static NSString * const KBChatSessionDidResetNotification = @"KBChatSessionDidRe
CGFloat customViewHeight = KB_SCREEN_HEIGHT * 0.75;
KBAICommentView *customView = [[KBAICommentView alloc]
initWithFrame:CGRectMake(0, 0, KB_SCREEN_WIDTH, customViewHeight)];
customView.delegate = self;
NSString *commentCount = self.persona.commentCount;
NSInteger totalCommentCount = [commentCount integerValue];;
@@ -1281,6 +1282,18 @@ static NSString * const KBChatSessionDidResetNotification = @"KBChatSessionDidRe
[popView pop];
}
#pragma mark - KBAICommentViewDelegate
- (void)commentView:(KBAICommentView *)view didUpdateTotalCommentCount:(NSInteger)totalCommentCount {
// cell
if (view.companionId <= 0 || view.companionId != self.persona.personaId) {
return;
}
self.persona.commentCount = [NSString stringWithFormat:@"%ld", (long)totalCommentCount];
[self.commentButton setTitle:self.persona.commentCount forState:UIControlStateNormal];
}
- (AiVM *)aiVM{