update
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
Label,
|
||||
math,
|
||||
Node,
|
||||
randomRange,
|
||||
Sprite,
|
||||
UITransform,
|
||||
View,
|
||||
@@ -60,18 +61,26 @@ export class DetailImageItem extends Component {
|
||||
},
|
||||
};
|
||||
|
||||
//判断是否已经解锁此资源
|
||||
const isRelease = false;
|
||||
if (isRelease) {
|
||||
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 {
|
||||
if (this.url) {
|
||||
ViewManager.I.openBundlesView("ShowPanel", data);
|
||||
this.base.setVideEnable(false);
|
||||
}
|
||||
} else {
|
||||
ViewManager.I.openBundlesView("PopupGirlDetailPanel", {
|
||||
resId: this.resId,
|
||||
girlId: this.girlId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,19 +123,20 @@ export class DetailImageItem extends Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
refresh(
|
||||
base: GirlDetailPanel,
|
||||
type: number,
|
||||
category: number,
|
||||
id: number,
|
||||
resId: number
|
||||
data: any
|
||||
) {
|
||||
this.base = base;
|
||||
this.type = type;
|
||||
this.category = category;
|
||||
this.girlId = id;
|
||||
|
||||
this.resId = resId;
|
||||
this.resId = data.id;
|
||||
this.question.active = true; // 显示问号,表示加载中
|
||||
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
@@ -150,25 +160,20 @@ export class DetailImageItem extends Component {
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
let videoPrice = girlData.getGrilVideoPrice(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
this.url = girlData.getGrilVideoPath(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
|
||||
if (videoPrice > 0) {
|
||||
if (!data.isUnlock) {
|
||||
imgPath = this.url + "_thumbnail_blur";
|
||||
} else {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
}
|
||||
this.priceFrame.active = videoPrice > 0;
|
||||
this.priceFrame.active = data.price > 0;
|
||||
|
||||
this.videoPrice.string = videoPrice.toString();
|
||||
this.videoPrice.string = data.price.toString();
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
@@ -176,4 +181,14 @@ export class DetailImageItem extends Component {
|
||||
this.scaleToFillItem();
|
||||
});
|
||||
}
|
||||
|
||||
refreshVideoBuy(success: boolean) {
|
||||
if (success) {
|
||||
const imgPath = this.url + "_thumbnail";
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
this.question.active = false; // 图片加载成功后隐藏问号
|
||||
this.scaleToFillItem();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ export class GirlListItem extends Component {
|
||||
}
|
||||
|
||||
onClickDetail() {
|
||||
if (false) {
|
||||
if (true) {
|
||||
NavigationManager.Instance.navigateToGirlDetail(this.id);
|
||||
ViewManager.I.closeView(this.baseNode);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user