This commit is contained in:
2025-10-11 16:19:57 +08:00
parent 45ec2bbb7d
commit fdea1383d0
27 changed files with 1662 additions and 977 deletions
+11 -13
View File
@@ -22,6 +22,8 @@ import { DataManager, DataId } from "../data/DataManager";
import { GirlData } from "../data/GirlData";
import { EnvData } from "../data/EnvData";
import { logger } from "db://assets/Scripts/Main/Common/Logger";
import { GButton } from "../../Main/Common/GButton";
import { GirlListPanel } from "../ui/panels/GirlListPanel";
const { ccclass, property } = _decorator;
@@ -36,6 +38,8 @@ export class GirlListItem extends Component {
@property(Node)
chatIcon: Node;
@property(Node)
detailBtn: Node;
@property(Node)
starParent: Node;
@@ -68,6 +72,8 @@ export class GirlListItem extends Component {
this,
this.onLanguageChangeCallback
);
GButton.BandClick(this.chatIcon, this.onClickChat, this);
GButton.BandClick(this.detailBtn, this.onClickDetail, this);
}
protected onDestroy(): void {
@@ -78,8 +84,8 @@ export class GirlListItem extends Component {
);
}
baseNode: Node;
refreshData(category: number, girlId: number, baseNode: Node) {
baseNode: GirlListPanel;
refreshData(category: number, girlId: number, baseNode: GirlListPanel) {
if (!this.stars) {
this.stars = this.starParent.getComponentsInChildren(Sprite);
}
@@ -92,17 +98,8 @@ export class GirlListItem extends Component {
this.nameKey = girlData.getGrilName(this.category.toString(), this.id);
this.girlName.string = LanguageUtils.getText(this.nameKey);
this.tagKey = girlData.getGrilTagKey(this.category.toString(), this.id);
// let desc = "";
// const tags = LanguageUtils.getText(this.tagKey).split("|");
// for (let i = 0; i < tags.length; i++) {
// if (i != 0) desc += "|";
// desc += tags[i];
// }
this.tags.string = LanguageUtils.getText(this.tagKey);
let priceType = girlData.getGrilPriceType(
this.category.toString(),
this.id
);
this.starParent.active = true;
this.chatIcon.active = true;
@@ -115,7 +112,7 @@ export class GirlListItem extends Component {
//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);
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize, this.avatar.node, 1);
this.loading.active = false;
});
@@ -197,6 +194,7 @@ export class GirlListItem extends Component {
} else {
logger.warn("[GirlListItem] 无法获取当前激活的主页面");
}
this.baseNode.close();
}
onClickChat() {