update
This commit is contained in:
@@ -47,10 +47,15 @@ export class GirlListPanel extends li_BaseView {
|
||||
this.refresh(this.category);
|
||||
}
|
||||
|
||||
cacheCategory: number = -1;
|
||||
|
||||
async refresh(category: number) {
|
||||
if (category == this.cacheCategory) return;
|
||||
this.cacheCategory = category;
|
||||
if (this.cache) {
|
||||
for (let i = this.cache.length - 1; i >= 0; i--) {
|
||||
this.cache[i].node.destroy();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +83,10 @@ export class GirlListPanel extends li_BaseView {
|
||||
}
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.node.active = false;
|
||||
}
|
||||
|
||||
private registerListener() {
|
||||
GButton.BandClick(this._nodeTab.ReturnBtn, this.Return, this);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,11 @@ import { _decorator, Component, Label, Node } from "cc";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {
|
||||
NavigationManager,
|
||||
PageTransitionType,
|
||||
PanelType,
|
||||
} from "../../manager/NavigationManager";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
import GameRootUI from "../../../Main/Common/GameRootUI";
|
||||
import { UITransitionHelper } from "../../utils/UITransitionHelper";
|
||||
import { ThemePanel } from "./ThemePanel";
|
||||
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user