update
This commit is contained in:
@@ -46,11 +46,12 @@ export class DetailImageItem extends Component {
|
||||
resId: number;
|
||||
type: proto.cs.EnmResType;
|
||||
|
||||
test_resID: Node;
|
||||
onLoad() {
|
||||
GButton.BandClick(this.node, this.onClickThis, this);
|
||||
this.uitransform = this.node.getComponent(UITransform);
|
||||
}
|
||||
|
||||
isVisible: boolean;
|
||||
onClickThis() {
|
||||
let data = {
|
||||
url: this.url,
|
||||
@@ -63,15 +64,8 @@ export class DetailImageItem extends Component {
|
||||
// 数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
// 是否可见,不可见代表需要解锁
|
||||
let isVisible = false;
|
||||
if (this.type === proto.cs.EnmResType.ERT_Image) {
|
||||
// 图片
|
||||
isVisible = girlData.isGirlPhotoVisible(this.category.toString(), this.girlId, this.resId);
|
||||
} else if (this.type === proto.cs.EnmResType.ERT_Video) {
|
||||
// 视频
|
||||
isVisible = girlData.isGirlVideoVisible(this.category.toString(), this.girlId, this.resId);
|
||||
}
|
||||
if (isVisible) {
|
||||
|
||||
if (this.isVisible) {
|
||||
if (this.url) {
|
||||
ViewManager.I.openBundlesView("ShowPanel", data);
|
||||
this.base.setVideEnable(false);
|
||||
@@ -149,51 +143,70 @@ export class DetailImageItem extends Component {
|
||||
this.resId = resId;
|
||||
this.question.active = true; // 显示问号,表示加载中
|
||||
|
||||
this.test_resID = this.node.getChildByName("resID");
|
||||
|
||||
this.test_resID.getComponent(Label).string =
|
||||
this.girlId.toString() + this.resId;
|
||||
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
let imgPath = "";
|
||||
this.video.enabled = type === proto.cs.EnmResType.ERT_Video;
|
||||
this.priceFrame.active = type === proto.cs.EnmResType.ERT_Video;
|
||||
let price = 0;
|
||||
// 是否可见,不可见代表需要解锁
|
||||
let isVisible = false;
|
||||
if (this.type === proto.cs.EnmResType.ERT_Image) {
|
||||
// 图片
|
||||
this.isVisible = girlData.isGirlPhotoVisible(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
} else if (this.type === proto.cs.EnmResType.ERT_Video) {
|
||||
// 视频
|
||||
this.isVisible = girlData.isGirlVideoVisible(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
}
|
||||
if (type === proto.cs.EnmResType.ERT_Image) {
|
||||
// 图片
|
||||
price = girlData.getGrilPhotoOriginalPrice(this.category.toString(), this.girlId, this.resId);
|
||||
price = girlData.getGrilPhotoOriginalPrice(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
this.url = girlData.getGrilPhotoPic(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
imgPath = this.url;
|
||||
this.isImage = true;
|
||||
isVisible = girlData.isGirlPhotoVisible(this.category.toString(), this.girlId, this.resId);
|
||||
} else if (type === proto.cs.EnmResType.ERT_Video) {
|
||||
// 视频
|
||||
price = girlData.getGrilVideoOriginalPrice(this.category.toString(), this.girlId, this.resId);
|
||||
price = girlData.getGrilVideoOriginalPrice(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
this.isImage = false;
|
||||
this.url = girlData.getGrilVideoPath(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
this.url = girlData.getGrilVideoPath(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
|
||||
isVisible = girlData.isGirlVideoVisible(this.category.toString(), this.girlId, this.resId);
|
||||
if (isVisible) {
|
||||
imgPath = this.url + "_thumbnail_blur";
|
||||
} else {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
}
|
||||
this.priceFrame.active = price > 0;
|
||||
|
||||
this.videoPrice.string = price.toString();
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
if (this.isVisible) {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
} else {
|
||||
imgPath = this.url + "_thumbnail_blur";
|
||||
}
|
||||
this.priceFrame.active = price > 0;
|
||||
|
||||
this.videoPrice.string = price.toString();
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
|
||||
this.question.active = false; // 图片加载成功后隐藏问号
|
||||
this.scaleToFillItem();
|
||||
});
|
||||
@@ -202,7 +215,7 @@ export class DetailImageItem extends Component {
|
||||
refreshVideoBuy(success: boolean) {
|
||||
if (success) {
|
||||
const imgPath = this.url + "_thumbnail";
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
|
||||
this.question.active = false; // 图片加载成功后隐藏问号
|
||||
this.scaleToFillItem();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user