update
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user