This commit is contained in:
2025-09-22 19:59:38 +08:00
parent 738e64acb5
commit ac727831ff
3 changed files with 28 additions and 7 deletions
+1 -4
View File
@@ -526,9 +526,6 @@ export class ChatModel {
//return false;
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
const roleData = this.rolesData.get(this.currentGirlId);
return girlData.isCanChat(
roleData.categoryId,
roleData.girlId
);
return girlData.isCanChat(roleData.categoryId, roleData.girlId);
}
}
@@ -96,7 +96,13 @@ export class PastGirlListPanel extends li_BaseView {
break;
}
}
if (isSame) return;
if (isSame) {
//相同 那就只刷新聊天时间,不刷新item
for (let i = 0; i < this.cache.length; i++) {
this.cache[i].refreshSimple();
}
return;
}
}
this.cacheIds = ids;
@@ -78,7 +78,25 @@ export class PastGirlListItem extends Component {
);
}
refreshData(girlId: number, baseNode: Node): number {
refreshSimple() {
// 显示星级(好感度)
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
const star = girlData.getStar(this.category.toString(), this.id);
for (let i = 0; i < this.stars.length; i++) {
const element = this.stars[i];
if (star > i) {
ResManager.I.changeResourceSpriteFrame(element, "ui/common/heart");
} else {
ResManager.I.changeResourceSpriteFrame(
element,
"ui/common/heart_empty"
);
}
}
this.updateLastChatTime();
}
refreshData(girlId: number, baseNode: Node) {
if (!this.stars) {
this.stars = this.starParent.getComponentsInChildren(Sprite);
}
@@ -148,7 +166,7 @@ export class PastGirlListItem extends Component {
}, 0);
// 显示最近聊天时间
return this.updateLastChatTime();
this.updateLastChatTime();
}
private getLastChatTime(id: number): number | null {