This commit is contained in:
2025-09-15 11:29:23 +08:00
parent 0e86ba3454
commit 413ac5ccf6
6 changed files with 84 additions and 563 deletions
+25 -19
View File
@@ -34,6 +34,7 @@ import { ShopData } from "../../data/ShopData";
import proto from "db://assets/Scripts/proto/proto.pb.js";
import GameRootUI from "../../../Main/Common/GameRootUI";
import { MainController } from "../../core/MainController";
import { GirlListPanel } from "./GirlListPanel";
const { ccclass, property } = _decorator;
@@ -53,7 +54,7 @@ export class ThemePanel extends li_BaseView {
cache: ThemeItem[] = [];
// 子页面管理
private currentChildPanel: any = null;
private listPanel: GirlListPanel = null;
// 加载状态保护
private isLoading: boolean = false;
@@ -316,7 +317,7 @@ export class ThemePanel extends li_BaseView {
) == 0;
if (isRelease || isFree) {
NavigationManager.Instance.setSelectedGirlId(this.recId);
NavigationManager.Instance.setSelectedThemeId(
NavigationManager.Instance.setSelectedCategoryId(
girlData.getGrilCategoryById(this.recId)
);
NavigationManager.Instance.switchToPanel(PanelType.GIRL_DETAIL);
@@ -384,29 +385,34 @@ export class ThemePanel extends li_BaseView {
}
}
public getChildPanel(): GirlListPanel {
if (this.listPanel) return this.listPanel;
return null;
}
public setChildPanel(panel: GirlListPanel) {
this.listPanel = panel;
}
/**
* 设置子页面
* @param panel 子页面实例
* 隐藏子页面
*/
public setChildPanel(panel: any): void {
console.log("[ThemePanel] Setting child panel:", panel);
// 先关闭旧的子页面
this.closeChildPanel();
this.currentChildPanel = panel;
public hideChildPanel(): void {
if (this.listPanel) {
console.log("[ThemePanel] Closing child panel");
if (this.listPanel.hide) {
this.listPanel.hide();
}
}
}
/**
* 关闭子页面
*/
public closeChildPanel(): void {
if (this.currentChildPanel) {
public clostChildPanel(): void {
if (this.listPanel) {
console.log("[ThemePanel] Closing child panel");
if (this.currentChildPanel.onClose) {
this.currentChildPanel.onClose();
} else if (this.currentChildPanel.destroy) {
this.currentChildPanel.destroy();
if (this.listPanel.close) {
this.listPanel.close();
}
this.currentChildPanel = null;
this.listPanel = null;
}
}
@@ -415,7 +421,7 @@ export class ThemePanel extends li_BaseView {
*/
public onHide(): void {
console.log("[ThemePanel] onHide called");
this.closeChildPanel();
this.hideChildPanel();
this.cancelCurrentOperation();
}
@@ -437,7 +443,7 @@ export class ThemePanel extends li_BaseView {
this.cancelCurrentOperation();
// 关闭子页面
this.closeChildPanel();
this.clostChildPanel();
// 清理缓存
this.clearCache();