This commit is contained in:
2025-09-22 19:50:34 +08:00
parent 556194f24a
commit 650b34d8df
2 changed files with 19 additions and 73 deletions
@@ -68,11 +68,11 @@ export class PastGirlListPanel extends li_BaseView {
item.reset();
}
}
protected onEnable(): void {
this.refresh();
}
// TODO: 实现获取已解锁女孩列表的逻辑
// 这个方法需要遍历所有分类,找出 isRelease === true 的女孩
private async getUnlockedGirls(): Promise<number[]> {
await this.reqCanChatGirlData();
@@ -82,7 +82,23 @@ export class PastGirlListPanel extends li_BaseView {
return allids;
}
cacheIds: number[];
async refresh() {
// 获取已解锁女孩列表
const ids = await this.getUnlockedGirls();
if (this.cacheIds && ids && this.cacheIds.length == ids.length) {
let isSame = true;
for (let i = 0; i < ids.length; i++) {
const element = ids[i];
if (this.cacheIds[i] != element) {
isSame = false;
break;
}
}
if (isSame) return;
}
// 回收当前显示的节点到缓存池
if (this.cache) {
for (let i = this.cache.length - 1; i >= 0; i--) {
@@ -92,9 +108,6 @@ export class PastGirlListPanel extends li_BaseView {
this.cache = [];
}
// 获取已解锁女孩列表
const ids = await this.getUnlockedGirls();
// 根据排序后的数据刷新界面
for (let id of ids) {
let item = this.getItemFromPool();