diff --git a/assets/Scripts/chat18x/ui/panels/NavigationPanel.ts b/assets/Scripts/chat18x/ui/panels/NavigationPanel.ts index f56a8bba..15a17012 100644 --- a/assets/Scripts/chat18x/ui/panels/NavigationPanel.ts +++ b/assets/Scripts/chat18x/ui/panels/NavigationPanel.ts @@ -5,6 +5,7 @@ import { GButton } from "db://assets/Scripts/Main/Common/GButton"; import { NavigationManager, PanelType } from "../../manager/NavigationManager"; import { NavigationBtn } from "../items/NavigationBtn"; import { ChatHistoryManager } from "../../manager/ChatHistoryManager"; +import { PastGirlListPanel } from "./PastGirlListPanel"; const { ccclass, property } = _decorator; @@ -58,7 +59,15 @@ export class NavigationPanel extends li_BaseView { ); GButton.BandClick( this.pastGirlListBtn.node, - () => NavigationManager.Instance.switchToPanel(PanelType.PAST_GIRL_LIST), + () => { + NavigationManager.Instance.switchToPanel( + PanelType.PAST_GIRL_LIST, + false, + (panel) => { + panel.getComponent(PastGirlListPanel).refresh(); + } + ); + }, this ); GButton.BandClick( diff --git a/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts b/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts index a62268be..c8e291aa 100644 --- a/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts +++ b/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts @@ -28,7 +28,7 @@ export class PastGirlListPanel extends li_BaseView { this.itemInst = this._nodeTab.BubbleItem.getComponent(PastGirlListItem); this.itemInst.node.active = false; this.content = this._nodeTab.content; - this.refresh(); + //this.refresh(); } // 从缓存池获取节点 @@ -71,6 +71,7 @@ export class PastGirlListPanel extends li_BaseView { private getUnlockedGirls(): number[] { const GirlData = DataManager.I.getDataById(DataId.Girl); const allids = GirlData.getAllReleaseGirlIds(); + console.log(allids); return allids; } @@ -88,12 +89,12 @@ export class PastGirlListPanel extends li_BaseView { const ids = this.getUnlockedGirls(); // 创建带时间戳的数组用于排序 - const girlsWithTime: {id: number, lastTime: number}[] = []; + const girlsWithTime: { id: number; lastTime: number }[] = []; // 收集每个女孩的最后聊天时间 for (let id of ids) { const lastTime = ChatHistoryManager.Instance.getLastChatTime(id) || 0; - girlsWithTime.push({id, lastTime}); + girlsWithTime.push({ id, lastTime }); } // 按最后聊天时间降序排序(最近的在前)