Merge branch 'main' of 47.107.44.202:xionglijia/18xchat

This commit is contained in:
chen wei bo
2025-09-23 10:29:18 +08:00
3 changed files with 28 additions and 7 deletions
+1 -4
View File
@@ -526,9 +526,6 @@ export class ChatModel {
//return false; //return false;
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl); const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
const roleData = this.rolesData.get(this.currentGirlId); const roleData = this.rolesData.get(this.currentGirlId);
return girlData.isCanChat( return girlData.isCanChat(roleData.categoryId, roleData.girlId);
roleData.categoryId,
roleData.girlId
);
} }
} }
@@ -96,7 +96,13 @@ export class PastGirlListPanel extends li_BaseView {
break; break;
} }
} }
if (isSame) return; if (isSame) {
//相同 那就只刷新聊天时间,不刷新item
for (let i = 0; i < this.cache.length; i++) {
this.cache[i].refreshSimple();
}
return;
}
} }
this.cacheIds = ids; 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) { if (!this.stars) {
this.stars = this.starParent.getComponentsInChildren(Sprite); this.stars = this.starParent.getComponentsInChildren(Sprite);
} }
@@ -148,7 +166,7 @@ export class PastGirlListItem extends Component {
}, 0); }, 0);
// 显示最近聊天时间 // 显示最近聊天时间
return this.updateLastChatTime(); this.updateLastChatTime();
} }
private getLastChatTime(id: number): number | null { private getLastChatTime(id: number): number | null {