优化加载显示

This commit is contained in:
2025-09-11 15:01:03 +08:00
parent 7ed18b410d
commit d6a9898c8d
13 changed files with 4532 additions and 2238 deletions
@@ -36,7 +36,8 @@ export class DetailImageItem extends Component {
priceFrame: Node;
@property(Label)
videoPrice: Label;
@property(Node)
loading: Node;
base: GirlDetailPanel;
url: string;
isImage: boolean;
@@ -142,8 +143,9 @@ export class DetailImageItem extends Component {
this.category = category;
this.girlId = id;
this.resId = resId;
this.question.active = true; // 显示问号,表示加载中
//this.question.active = true; // 显示问号,表示加载中
this.loading.active = true;
this.test_resID = this.node.getChildByName("resID");
this.test_resID.getComponent(Label).string =
@@ -209,8 +211,9 @@ export class DetailImageItem extends Component {
}
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
this.question.active = false; // 图片加载成功后隐藏问号
if (!this.isVisible) this.question.active = false; // 图片加载成功后隐藏问号
this.scaleToFillItem();
this.loading.active = false;
});
}
@@ -41,7 +41,8 @@ export class GirlListItem extends Component {
@property(Node)
starParent: Node;
@property(Node)
loading: Node;
stars: Sprite[];
id: number = -1;
@@ -133,15 +134,16 @@ export class GirlListItem extends Component {
// this.price.node.active = priceType == PriceType.pay;
// this.freeNode.active = priceType == PriceType.free;
//this.tryNode.active = priceType == PriceType.first_time_free;
let listAvatarPath = girlData.getGrilAvatar(
let avatarPath = girlData.getGrilAvatar(
this.category.toString(),
this.id
);
this.loading.active = true;
//listAvatarPath = listAvatarPath.replace("Avatar", "avatar"); //临时
ResManager.I.changeBundleSpriteFrame(
this.avatar,
listAvatarPath,
avatarPath,
"Girls",
() => {
let sizeTran = this.avatar.node.parent.getComponent(UITransform);
@@ -150,6 +152,7 @@ export class GirlListItem extends Component {
this.avatar.node,
2
);
this.loading.active = false;
}
);
+8 -1
View File
@@ -19,6 +19,9 @@ export class ThemeItem extends Component {
@property(Label)
titleName: Label;
@property(Node)
loading: Node;
@property(Sprite)
img: Sprite;
@@ -39,13 +42,16 @@ export class ThemeItem extends Component {
}
refresh(themeId: number) {
this.loading.active = true;
// 主题数据
const themeData = DataManager.I.getDataById<ThemeData>(DataId.Theme);
this.lockImg.node.active = this.lockCover.node.active =
!themeData.getIsReleaseById(themeId);
this.isLocked = !themeData.getIsReleaseById(themeId);
this.key = themeData.getLanKeyById(themeId);
this.titleName.string = LanguageUtils.getText(themeData.getLanKeyById(themeId));
this.titleName.string = LanguageUtils.getText(
themeData.getLanKeyById(themeId)
);
this.category = themeData.getCategoryById(themeId);
ResManager.I.changeBundleSpriteFrame(
this.img,
@@ -54,6 +60,7 @@ export class ThemeItem extends Component {
() => {
let sizeTran = this.img.node.parent.getComponent(UITransform);
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize, this.img.node, 3);
this.loading.active = false;
}
);
GButton.RemoveAndBandClick(this.node, this.OnClickThis, this);