From ac727831ff5abf0b5f14e12f4441f9d5aef45441 Mon Sep 17 00:00:00 2001 From: xlj <543978819@qq.com> Date: Mon, 22 Sep 2025 19:59:38 +0800 Subject: [PATCH] fix --- assets/Scripts/chat18x/data/ChatModel.ts | 5 +---- .../chat18x/ui/panels/PastGirlListPanel.ts | 8 ++++++- .../chat18x/uiitems/PastGirlListItem.ts | 22 +++++++++++++++++-- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/assets/Scripts/chat18x/data/ChatModel.ts b/assets/Scripts/chat18x/data/ChatModel.ts index af5587f4..3f4931b3 100644 --- a/assets/Scripts/chat18x/data/ChatModel.ts +++ b/assets/Scripts/chat18x/data/ChatModel.ts @@ -526,9 +526,6 @@ export class ChatModel { //return false; const girlData = DataManager.I.getDataById(DataId.Girl); const roleData = this.rolesData.get(this.currentGirlId); - return girlData.isCanChat( - roleData.categoryId, - roleData.girlId - ); + return girlData.isCanChat(roleData.categoryId, roleData.girlId); } } diff --git a/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts b/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts index 049ea009..6476721f 100644 --- a/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts +++ b/assets/Scripts/chat18x/ui/panels/PastGirlListPanel.ts @@ -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; diff --git a/assets/Scripts/chat18x/uiitems/PastGirlListItem.ts b/assets/Scripts/chat18x/uiitems/PastGirlListItem.ts index 8e82d9e5..6dc95524 100644 --- a/assets/Scripts/chat18x/uiitems/PastGirlListItem.ts +++ b/assets/Scripts/chat18x/uiitems/PastGirlListItem.ts @@ -78,7 +78,25 @@ export class PastGirlListItem extends Component { ); } - refreshData(girlId: number, baseNode: Node): number { + refreshSimple() { + // 显示星级(好感度) + const girlData = DataManager.I.getDataById(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 {