This commit is contained in:
2025-09-09 19:59:11 +08:00
parent 7b6a119049
commit ffbced749c
5 changed files with 32 additions and 49 deletions
-23
View File
@@ -463,29 +463,6 @@ export class GirlData extends BaseData {
return displayIds; 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 { public getFirstGrilVideoPath(categoryId: string, girlId: number): string {
let oneData = this.getGrilDetail(categoryId, girlId); let oneData = this.getGrilDetail(categoryId, girlId);
@@ -188,15 +188,15 @@ export class GirlDetailPanel extends li_BaseView {
bindVideoToggle() { bindVideoToggle() {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl); const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
let videoDatas = girlData.getGirlVideosData(this.category.toString(), this.id); let ids = girlData.getAllGrilVideoId(this.category.toString(), this.id);
this.refreshImgs(2, this.category, this.id, videoDatas); this.refreshImgs(2, this.category, this.id, ids);
} }
refreshImgs( refreshImgs(
type: number, type: number,
category: number, category: number,
id: number, id: number,
datas: any[] datas: number[]
) { ) {
for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) { for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
this.imgsLayout.children[i].destroy(); this.imgsLayout.children[i].destroy();
@@ -60,28 +60,27 @@ export class DetailImageItem extends Component {
this.base.setVideEnable(true); this.base.setVideEnable(true);
}, },
}; };
const isRelease = randomRange(0, 1) > 0.5;
if (!this.isImage) { if (isRelease) {
//判断是否已经解锁此资源
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 {
if (this.url) { if (this.url) {
ViewManager.I.openBundlesView("ShowPanel", data); ViewManager.I.openBundlesView("ShowPanel", data);
this.base.setVideEnable(false); 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() { scaleToFillItem() {
@@ -129,14 +128,14 @@ export class DetailImageItem extends Component {
type: number, type: number,
category: number, category: number,
id: number, id: number,
data: any resId: number
) { ) {
this.base = base; this.base = base;
this.type = type; this.type = type;
this.category = category; this.category = category;
this.girlId = id; this.girlId = id;
this.resId = data.id; this.resId = resId;
this.question.active = true; // 显示问号,表示加载中 this.question.active = true; // 显示问号,表示加载中
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl); const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
@@ -166,7 +165,12 @@ export class DetailImageItem extends Component {
this.resId this.resId
); );
if (!data.isUnlock) { const isUnlock = girlData.isVideoUnlock(
this.category.toString(),
this.girlId,
this.resId
);
if (isUnlock) {
imgPath = this.url + "_thumbnail_blur"; imgPath = this.url + "_thumbnail_blur";
} else { } else {
imgPath = this.url + "_thumbnail"; imgPath = this.url + "_thumbnail";
@@ -114,7 +114,7 @@ export class GirlListItem extends Component {
ResManager.I.changeBundleSpriteFrame( ResManager.I.changeBundleSpriteFrame(
this.avatar, this.avatar,
listAvatarPath, listAvatarPath,
"Chat18x", "Girls",
() => { () => {
let sizeTran = this.avatar.node.parent.getComponent(UITransform); let sizeTran = this.avatar.node.parent.getComponent(UITransform);
Utils.adjustBgPixelRatioToSize( Utils.adjustBgPixelRatioToSize(
+3 -1
View File
@@ -2412,7 +2412,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "coinNum", "_name": "uid",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
@@ -7997,6 +7997,8 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "51KcV2HfdKO6K1YfqFDU4y", "fileId": "51KcV2HfdKO6K1YfqFDU4y",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{ {