调整布局、新增导航栏,调整页面跳转逻辑
This commit is contained in:
@@ -10,6 +10,7 @@ import { GirlData } from "../../data/GirlData";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import GameRootUI from "../../../Main/Common/GameRootUI";
|
||||
import { UITransitionHelper } from "../../utils/UITransitionHelper";
|
||||
import { NavigationManager, PanelType } from "../../manager/NavigationManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -23,14 +24,19 @@ export class GirlListPanel extends li_BaseView {
|
||||
cache: GirlListItem[] = [];
|
||||
|
||||
category: number;
|
||||
openUIDataCT(data) {
|
||||
// 支持新的数据格式:既可以是单纯的数字,也可以是包含过渡动画信息的对象
|
||||
this.category =
|
||||
typeof data === "object" && data.category !== undefined
|
||||
? data.category
|
||||
: data;
|
||||
private parentPanelName: string = null;
|
||||
|
||||
const withAnimation = typeof data === "object" && data.withTransition;
|
||||
openUIDataCT(data) {
|
||||
console.log("[GirlListPanel] openUIDataCT called with data:", data);
|
||||
|
||||
// 支持新的数据格式:既可以是单纯的数字,也可以是包含主题ID和父页面信息的对象
|
||||
if (typeof data === "object") {
|
||||
this.category = data.themeId;
|
||||
this.parentPanelName = data.parentPanel;
|
||||
console.log("[GirlListPanel] Set parent panel:", this.parentPanelName);
|
||||
} else {
|
||||
this.category = data;
|
||||
}
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
@@ -76,37 +82,7 @@ export class GirlListPanel extends li_BaseView {
|
||||
GButton.BandClick(this._nodeTab.ReturnBtn, this.Return, this);
|
||||
}
|
||||
Return() {
|
||||
console.log("GirlListPanel: Return button clicked");
|
||||
|
||||
// 执行同步的过渡动画:GirlListPanel向右滑出,ThemePanel从左滑入
|
||||
const duration = 0.1;
|
||||
let animationsCompleted = 0;
|
||||
const totalAnimations = 2;
|
||||
|
||||
const onAnimationComplete = (source: string) => {
|
||||
console.log(`GirlListPanel: Animation completed from ${source}`);
|
||||
animationsCompleted++;
|
||||
console.log(
|
||||
`GirlListPanel: ${animationsCompleted}/${totalAnimations} animations completed`
|
||||
);
|
||||
|
||||
if (animationsCompleted >= totalAnimations) {
|
||||
console.log("GirlListPanel: All animations completed, closing panel");
|
||||
// 所有动画完成后关闭当前面板
|
||||
this.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
// 1. GirlListPanel向右滑出
|
||||
console.log("GirlListPanel: Starting slideOutToRight animation");
|
||||
UITransitionHelper.slideOutToRight(this.node, duration, () =>
|
||||
onAnimationComplete("slideOutToRight")
|
||||
);
|
||||
|
||||
// 2. ThemePanel从左侧滑入
|
||||
console.log("GirlListPanel: Starting ThemePanel slide_left animation");
|
||||
GameRootUI.I.showDefaultViewWithTransition("slide_left", duration, () =>
|
||||
onAnimationComplete("ThemePanel_slide_left")
|
||||
);
|
||||
// 直接关闭,不需要动画
|
||||
this.node.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user