This commit is contained in:
2025-09-17 18:51:08 +08:00
parent 7687a4f026
commit 020abb11dd
4 changed files with 30 additions and 25 deletions
+11 -19
View File
@@ -141,22 +141,14 @@ export class GirlListItem extends Component {
const envData = DataManager.I.getDataById<EnvData>(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) {