This commit is contained in:
2025-10-14 18:54:02 +08:00
parent b40b02e2a2
commit af2031f486
11 changed files with 352 additions and 111 deletions
+15 -2
View File
@@ -148,6 +148,12 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
this.onEmotionInitialized
);
// 停止视频播放,释放资源
if (this.videoLayer) {
this.videoLayer.stop();
logger.log("ChatPanel: 销毁时停止视频播放");
}
// 解绑ChatController(不销毁,因为它是单例)
if (this.chatController) {
this.chatController.unbindView();
@@ -401,13 +407,20 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
this.isActive = true; // 设置为活跃状态
ChatAIService.Instance.setShouldShowErrorTips(true); // 启用错误提示
this.base.active = false;
// 注意:basePanel 的显隐现在由 NavigationManager 统一管理,无需手动设置
this.refresh();
}
protected onDisable(): void {
this.isActive = false; // 设置为非活跃状态,停止响应异步操作
ChatAIService.Instance.setShouldShowErrorTips(false); // 禁用错误提示,避免在其他页面显示
this.base.active = true;
// 停止视频播放,释放资源
if (this.videoLayer) {
this.videoLayer.stop();
logger.log("ChatPanel: 面板禁用时停止视频播放");
}
// 注意:basePanel 的显隐现在由 NavigationManager 统一管理,无需手动设置
}
isWaiting: boolean = false;