调整布局、新增导航栏,调整页面跳转逻辑
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { DetailImageItem } from "../../uiitems/DetailImageItem";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { NavigationManager, PanelType } from "../../manager/NavigationManager";
|
||||
import { ConfigManager } from "../../manager/ConfigManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import Utils from "../../../Main/Common/Utils";
|
||||
@@ -71,36 +71,16 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
@property(Node)
|
||||
imgsLayout: Node;
|
||||
|
||||
openUIDataCT(data) {
|
||||
this.id = data;
|
||||
}
|
||||
videoAreaPos;
|
||||
|
||||
protected onEnable(): void {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
super.onLoadCT();
|
||||
this.imgItemInst.node.active = false;
|
||||
this.videoAreaPos = new Vec3(540, 1384);
|
||||
|
||||
const pos = new Vec3(
|
||||
this.descContent.position.x,
|
||||
this.descContent.position.y,
|
||||
this.descContent.position.z
|
||||
);
|
||||
this.descContent.position = new Vec3(pos.x, pos.y - 1000, pos.z);
|
||||
//this.node.scale = Vec3.ZERO;
|
||||
tween(this.descContent)
|
||||
.to(0.3, { position: pos }, { easing: "quadOut" })
|
||||
.start();
|
||||
|
||||
// 检查 SceneBgVideoLayer 是否可用
|
||||
if (!this.videoLayer) {
|
||||
console.error("GirlDetailPanel: SceneBgVideoLayer.handle 未初始化");
|
||||
} else {
|
||||
console.log("GirlDetailPanel: 成功获取 SceneBgVideoLayer 实例");
|
||||
// 初始化视频显示位置
|
||||
//this.initVideoPosition();
|
||||
}
|
||||
|
||||
this.refresh(this.id);
|
||||
//this.refresh();
|
||||
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
@@ -153,7 +133,32 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
tagKey: string;
|
||||
descKey: string;
|
||||
category: number;
|
||||
async refresh(index: number) {
|
||||
async refresh() {
|
||||
this.id = NavigationManager.Instance.getSelectedGirlId();
|
||||
|
||||
this.imgItemInst.node.active = false;
|
||||
this.videoAreaPos = new Vec3(540, 1384);
|
||||
|
||||
const pos = new Vec3(
|
||||
this.descContent.position.x,
|
||||
this.descContent.position.y,
|
||||
this.descContent.position.z
|
||||
);
|
||||
this.descContent.position = new Vec3(pos.x, pos.y - 1000, pos.z);
|
||||
//this.node.scale = Vec3.ZERO;
|
||||
tween(this.descContent)
|
||||
.to(0.3, { position: pos }, { easing: "quadOut" })
|
||||
.start();
|
||||
|
||||
// 检查 SceneBgVideoLayer 是否可用
|
||||
if (!this.videoLayer) {
|
||||
console.error("GirlDetailPanel: SceneBgVideoLayer.handle 未初始化");
|
||||
} else {
|
||||
console.log("GirlDetailPanel: 成功获取 SceneBgVideoLayer 实例");
|
||||
// 初始化视频显示位置
|
||||
//this.initVideoPosition();
|
||||
}
|
||||
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
this.category = girlData.getGrilCategoryById(this.id);
|
||||
// 请求详细数据
|
||||
@@ -305,18 +310,11 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
OnClickChatBtn() {
|
||||
// 使用带过渡动画的导航方法
|
||||
NavigationManager.Instance.navigateToChatWithTransition(
|
||||
this.category.toString(),
|
||||
this.id,
|
||||
this
|
||||
);
|
||||
// 注意:不在这里直接调用onClose,而是在动画完成后由NavigationManager调用
|
||||
NavigationManager.Instance.switchToPanel(PanelType.CHAT);
|
||||
}
|
||||
|
||||
returnBtn() {
|
||||
this.onClose();
|
||||
NavigationManager.Instance.navigateToGirlList(this.category);
|
||||
//ViewManager.I.openBundlesView("GirlListPanel");
|
||||
NavigationManager.Instance.switchToPanel(PanelType.THEME);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user