From ffbced749c395879912148e76af8512033ef528e Mon Sep 17 00:00:00 2001 From: xlj <543978819@qq.com> Date: Tue, 9 Sep 2025 19:59:11 +0800 Subject: [PATCH] fix --- assets/Scripts/chat18x/data/GirlData.ts | 23 ---------- .../chat18x/ui/panels/GirlDetailPanel.ts | 6 +-- .../chat18x/uiitems/DetailImageItem.ts | 46 ++++++++++--------- .../Scripts/chat18x/uiitems/GirlListItem.ts | 2 +- assets/bundles/Chat18x/ThemePanel.prefab | 4 +- 5 files changed, 32 insertions(+), 49 deletions(-) diff --git a/assets/Scripts/chat18x/data/GirlData.ts b/assets/Scripts/chat18x/data/GirlData.ts index 864d8c6b..35059608 100644 --- a/assets/Scripts/chat18x/data/GirlData.ts +++ b/assets/Scripts/chat18x/data/GirlData.ts @@ -463,29 +463,6 @@ export class GirlData extends BaseData { return displayIds; } - /** 获取所有用来展示在列表的技师视频的id */ - public getGirlVideosData(categoryId: string, girlId: number): any[] { - let oneData = this.getGrilDetail(categoryId, girlId); - if (!oneData) return []; - // 所有id - let allId = oneData.getAllGrilVideoId(); - // 用来展示的id - let displayIds = []; - for (let id of allId) { - let price = oneData.getGrilVideoPrice(id); - let isUnlock = true; - if (price <= 0) { - // 价格为0,代表免费 - //displayIds.push(id); - } else { - // 价格大于0,代表付费 - isUnlock = this.isVideoUnlock(categoryId, girlId, id); - } - displayIds.push({ id: id, isUnlock: isUnlock, price: price }); - } - return displayIds; - } - /** 获取第一个技师视频的资源路径 */ public getFirstGrilVideoPath(categoryId: string, girlId: number): string { let oneData = this.getGrilDetail(categoryId, girlId); diff --git a/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts b/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts index 75b942cb..57aa1ea1 100644 --- a/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts +++ b/assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts @@ -188,15 +188,15 @@ export class GirlDetailPanel extends li_BaseView { bindVideoToggle() { const girlData = DataManager.I.getDataById(DataId.Girl); - let videoDatas = girlData.getGirlVideosData(this.category.toString(), this.id); - this.refreshImgs(2, this.category, this.id, videoDatas); + let ids = girlData.getAllGrilVideoId(this.category.toString(), this.id); + this.refreshImgs(2, this.category, this.id, ids); } refreshImgs( type: number, category: number, id: number, - datas: any[] + datas: number[] ) { for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) { this.imgsLayout.children[i].destroy(); diff --git a/assets/Scripts/chat18x/uiitems/DetailImageItem.ts b/assets/Scripts/chat18x/uiitems/DetailImageItem.ts index e717aaa7..a359d4fd 100644 --- a/assets/Scripts/chat18x/uiitems/DetailImageItem.ts +++ b/assets/Scripts/chat18x/uiitems/DetailImageItem.ts @@ -60,28 +60,27 @@ export class DetailImageItem extends Component { this.base.setVideEnable(true); }, }; - - if (!this.isImage) { - //判断是否已经解锁此资源 - const isRelease = randomRange(0, 1) > 0.5; - if (isRelease) { - if (this.url) { - ViewManager.I.openBundlesView("ShowPanel", data); - this.base.setVideEnable(false); - } - } else { - ViewManager.I.openBundlesView("PopupGirlDetailPanel", { - resId: this.resId, - girlId: this.girlId, - base: this, - }); - } - } else { + const isRelease = randomRange(0, 1) > 0.5; + if (isRelease) { if (this.url) { ViewManager.I.openBundlesView("ShowPanel", data); this.base.setVideEnable(false); } + } else { + ViewManager.I.openBundlesView("PopupGirlDetailPanel", { + resId: this.resId, + girlId: this.girlId, + base: this, + }); } + // if (!this.isImage) { + // //判断是否已经解锁此资源 + // } else { + // if (this.url) { + // ViewManager.I.openBundlesView("ShowPanel", data); + // this.base.setVideEnable(false); + // } + // } } scaleToFillItem() { @@ -123,20 +122,20 @@ export class DetailImageItem extends Component { ); } } - + refresh( base: GirlDetailPanel, type: number, category: number, id: number, - data: any + resId: number ) { this.base = base; this.type = type; this.category = category; this.girlId = id; - this.resId = data.id; + this.resId = resId; this.question.active = true; // 显示问号,表示加载中 const girlData = DataManager.I.getDataById(DataId.Girl); @@ -166,7 +165,12 @@ export class DetailImageItem extends Component { this.resId ); - if (!data.isUnlock) { + const isUnlock = girlData.isVideoUnlock( + this.category.toString(), + this.girlId, + this.resId + ); + if (isUnlock) { imgPath = this.url + "_thumbnail_blur"; } else { imgPath = this.url + "_thumbnail"; diff --git a/assets/Scripts/chat18x/uiitems/GirlListItem.ts b/assets/Scripts/chat18x/uiitems/GirlListItem.ts index 30d630a4..f45d41c8 100644 --- a/assets/Scripts/chat18x/uiitems/GirlListItem.ts +++ b/assets/Scripts/chat18x/uiitems/GirlListItem.ts @@ -114,7 +114,7 @@ export class GirlListItem extends Component { ResManager.I.changeBundleSpriteFrame( this.avatar, listAvatarPath, - "Chat18x", + "Girls", () => { let sizeTran = this.avatar.node.parent.getComponent(UITransform); Utils.adjustBgPixelRatioToSize( diff --git a/assets/bundles/Chat18x/ThemePanel.prefab b/assets/bundles/Chat18x/ThemePanel.prefab index dce3fc8d..e980aa7c 100644 --- a/assets/bundles/Chat18x/ThemePanel.prefab +++ b/assets/bundles/Chat18x/ThemePanel.prefab @@ -2412,7 +2412,7 @@ }, { "__type__": "cc.Node", - "_name": "coinNum", + "_name": "uid", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -7997,6 +7997,8 @@ "__id__": 0 }, "fileId": "51KcV2HfdKO6K1YfqFDU4y", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, {