From 020abb11dd226dc971827a7eb0b8358057d737a2 Mon Sep 17 00:00:00 2001 From: xlj <543978819@qq.com> Date: Wed, 17 Sep 2025 18:51:08 +0800 Subject: [PATCH] update --- assets/Scripts/Sub/UI/LoginUI.ts | 2 +- assets/Scripts/chat18x/data/ChatModel.ts | 7 +++-- .../chat18x/ui/panels/GirlDetailPanel.ts | 16 ++++++++-- .../Scripts/chat18x/uiitems/GirlListItem.ts | 30 +++++++------------ 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/assets/Scripts/Sub/UI/LoginUI.ts b/assets/Scripts/Sub/UI/LoginUI.ts index 163532a2..d99ffe54 100644 --- a/assets/Scripts/Sub/UI/LoginUI.ts +++ b/assets/Scripts/Sub/UI/LoginUI.ts @@ -96,7 +96,7 @@ export class LoginUI extends li_BaseView { const globalData = DataManager.I.getDataById(DataId.Global); globalData.globals = res.data; } - } + } private enterGame() { ResManager.I.goMainScene(); diff --git a/assets/Scripts/chat18x/data/ChatModel.ts b/assets/Scripts/chat18x/data/ChatModel.ts index c314f6fa..c5c2b3c4 100644 --- a/assets/Scripts/chat18x/data/ChatModel.ts +++ b/assets/Scripts/chat18x/data/ChatModel.ts @@ -525,9 +525,10 @@ export class ChatModel { //return false; const girlData = DataManager.I.getDataById(DataId.Girl); const roleData = this.rolesData.get(this.currentGirlId); - - return ( - girlData.getChatRemainCount(roleData.categoryId, roleData.girlId) > 0 + const leftTime = girlData.getChatRemainCount( + roleData.categoryId, + roleData.girlId ); + return leftTime === 0 ? false : true; } } diff --git a/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts b/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts index 1390c291..39c011e3 100644 --- a/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts +++ b/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts @@ -184,9 +184,21 @@ export class GirlDetailPanel extends li_BaseView { desc += tags[i]; } this.tags.string = desc; - for (let i = 0; i < 5; i++) { - this.starParent.children[i].active = i < 5; + const star = girlData.getStar(this.category.toString(), this.id); + const stars = this.starParent.getComponentsInChildren(Sprite); + console.log("好感度:" + star); + for (let i = 0; i < stars.length; i++) { + const element = stars[i]; + if (star > i) { + ResManager.I.changeResourceSpriteFrame(element, "ui/common/heart"); + } else { + ResManager.I.changeResourceSpriteFrame( + element, + "ui/common/heart_empty" + ); + } } + let age = girlData.getGrilAge(this.category.toString(), this.id); this.descAge.string = LanguageUtils.getText("girldetailpanel.age") + age.toString(); diff --git a/assets/Scripts/chat18x/uiitems/GirlListItem.ts b/assets/Scripts/chat18x/uiitems/GirlListItem.ts index 8b7e69ca..09634fa0 100644 --- a/assets/Scripts/chat18x/uiitems/GirlListItem.ts +++ b/assets/Scripts/chat18x/uiitems/GirlListItem.ts @@ -141,22 +141,14 @@ export class GirlListItem extends Component { const envData = DataManager.I.getDataById(DataId.Env); let newPath = envData.cdn + "/" + "Girls/" + avatarPath + ".png"; //listAvatarPath = listAvatarPath.replace("Avatar", "avatar"); //临时 - ResManager.I.changeRemoteSpriteFrame( - this.avatar, - newPath, - () => { - let sizeTran = this.avatar.node.parent.getComponent(UITransform); - Utils.adjustBgPixelRatioToSize( - sizeTran.contentSize, - this.avatar.node, - 2 - ); - this.loading.active = false; - } - ); + ResManager.I.changeRemoteSpriteFrame(this.avatar, newPath, () => { + let sizeTran = this.avatar.node.parent.getComponent(UITransform); + Utils.adjustBgPixelRatioToSize(sizeTran.contentSize, this.avatar.node, 2); + this.loading.active = false; + }); const star = girlData.getStar(this.category.toString(), this.id); - + console.log("好感度:" + star); for (let i = 0; i < this.stars.length; i++) { const element = this.stars[i]; if (star > i) { @@ -182,28 +174,28 @@ export class GirlListItem extends Component { this.nameKey = ""; this.tagKey = ""; this.baseNode = null; - + // 重置UI状态 this.node.active = false; this.loading.active = false; - + // 清理文本内容 if (this.girlName) this.girlName.string = ""; if (this.tags) this.tags.string = ""; if (this.price) this.price.string = ""; - + // 重置可见性状态 if (this.price?.node) this.price.node.active = false; if (this.freeNode) this.freeNode.active = false; if (this.starParent) this.starParent.active = false; if (this.chatIcon) this.chatIcon.active = false; if (this.unreleaseCover) this.unreleaseCover.active = false; - + // 清理头像 if (this.avatar) { this.avatar.spriteFrame = null; } - + // 清理星级显示 if (this.stars) { for (let star of this.stars) {