update
This commit is contained in:
@@ -188,26 +188,26 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
bindVideoToggle() {
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
let resIds = girlData.getAllDisplayGrilVideoId(this.category.toString(), this.id);
|
||||
this.refreshImgs(2, this.category, this.id, resIds);
|
||||
let videoDatas = girlData.getGirlVideosData(this.category.toString(), this.id);
|
||||
this.refreshImgs(2, this.category, this.id, videoDatas);
|
||||
}
|
||||
|
||||
refreshImgs(
|
||||
type: number,
|
||||
category: number,
|
||||
id: number,
|
||||
resIds: number[]
|
||||
datas: any[]
|
||||
) {
|
||||
for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
|
||||
this.imgsLayout.children[i].destroy();
|
||||
}
|
||||
|
||||
let count = resIds.length;
|
||||
let count = datas.length;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let newNode = instantiate(this.imgItemInst.node);
|
||||
let item = newNode.getComponent(DetailImageItem);
|
||||
let resId = resIds[i];
|
||||
item.refresh(this, type, category, id, resId);
|
||||
let data = datas[i];
|
||||
item.refresh(this, type, category, id, data);
|
||||
newNode.active = true;
|
||||
this.imgsLayout.addChild(newNode);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { _decorator, Component, Node } from "cc";
|
||||
import li_BaseView from "../../../Main/Common/li_BaseView";
|
||||
import { GButton } from "../../../Main/Common/GButton";
|
||||
import Utils from "../../../Main/Common/Utils";
|
||||
import { DetailImageItem } from "../../uiitems/DetailImageItem";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PopupGirlDetailPanel")
|
||||
@@ -10,10 +11,11 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
|
||||
private girlId: number;
|
||||
private resId: number;
|
||||
|
||||
private base: DetailImageItem;
|
||||
openUIDataCT(data) {
|
||||
this.resId = data.resId;
|
||||
this.girlId = data.girlId;
|
||||
this.base = data.base;
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
@@ -29,5 +31,11 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
buyCharacter() {
|
||||
// 购买id为girlId的女生
|
||||
console.log(this.girlId + "---" + this.resId);
|
||||
|
||||
const success = true;
|
||||
if (success) {
|
||||
this.close();
|
||||
this.base.refreshVideoBuy(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user