This commit is contained in:
2025-09-09 16:09:10 +08:00
parent 5e3e639638
commit f9f2077665
12 changed files with 123 additions and 26 deletions
@@ -0,0 +1,40 @@
import { _decorator, Button, Component, Node } from "cc";
import li_BaseView from "../../../Main/Common/li_BaseView";
import Utils from "../../../Main/Common/Utils";
import { GButton } from "../../../Main/Common/GButton";
import { PopupGirlDetailPanel } from "./PopupGirlDetailPanel";
import { GirlListItem } from "../../uiitems/GirlListItem";
const { ccclass, property } = _decorator;
@ccclass("GirlListPopupPanel")
export class GirlListPopupPanel extends li_BaseView {
private _nodeTab: any = {};
private girlId: number;
base: GirlListItem;
openUIDataCT(data) {
this.girlId = data.id;
this.base = data.base;
}
onLoadCT() {
Utils.parseNode(this.node, this._nodeTab);
this.registerListener();
}
registerListener() {
GButton.BandClick(this._nodeTab.BuyBtn, this.buyCharacter, this);
GButton.BandClick(this._nodeTab.CloseBtn, this.Close, this);
}
Close() {
this.close();
}
buyCharacter() {
// 购买id为girlId的女生
console.log(this.girlId);
if (true) {
this.base.refreshBuy(true);
this.close();
}
}
}
@@ -2,7 +2,7 @@
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "5d94228f-b43d-4fd7-8cb6-0336edbff11b",
"uuid": "8c377088-00d5-423d-bf8b-331e05789f60",
"files": [],
"subMetas": {},
"userData": {}
@@ -1,17 +1,19 @@
import { _decorator, Button, Component, Node } from "cc";
import { _decorator, Component, Node } from "cc";
import li_BaseView from "../../../Main/Common/li_BaseView";
import Utils from "../../../Main/Common/Utils";
import { GButton } from "../../../Main/Common/GButton";
import Utils from "../../../Main/Common/Utils";
const { ccclass, property } = _decorator;
@ccclass("PopupGirlListPanel")
export class PopupGirlListPanel extends li_BaseView {
@ccclass("PopupGirlDetailPanel")
export class PopupGirlDetailPanel extends li_BaseView {
private _nodeTab: any = {};
private girlId: number;
private resId: number;
openUIDataCT(data) {
this.girlId = data;
this.resId = data.resId;
this.girlId = data.girlId;
}
onLoadCT() {
Utils.parseNode(this.node, this._nodeTab);
@@ -26,6 +28,6 @@ export class PopupGirlListPanel extends li_BaseView {
}
buyCharacter() {
// 购买id为girlId的女生
console.log(this.girlId);
console.log(this.girlId + "---" + this.resId);
}
}
@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "5d78d19c-53d5-4b1e-b0a9-634b420be34c",
"files": [],
"subMetas": {},
"userData": {}
}
@@ -6,6 +6,7 @@ import {
Node,
Sprite,
UITransform,
View,
} from "cc";
import { Config18x } from "db://assets/Scripts/Main/Config/Config18x";
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
@@ -58,9 +59,19 @@ export class DetailImageItem extends Component {
this.base.setVideEnable(true);
},
};
if (this.url) {
ViewManager.I.openBundlesView("ShowPanel", data);
this.base.setVideEnable(false);
//判断是否已经解锁此资源
const isRelease = false;
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,
});
}
}
+10 -1
View File
@@ -141,13 +141,22 @@ export class GirlListItem extends Component {
}
}
refreshBuy(success: boolean) {
if (success) {
this.refreshData(this.category, this.id, this.baseNode);
}
}
onClickDetail() {
if (false) {
NavigationManager.Instance.navigateToGirlDetail(this.id);
ViewManager.I.closeView(this.baseNode);
} else {
//未解锁
ViewManager.I.openBundlesView("PopupGirlListPanel", this.id);
ViewManager.I.openBundlesView("GirlListPopupPanel", {
base: this,
id: this.id,
});
}
}
}