Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
# Conflicts: # assets/Scripts/Sub/UI/PreloadUI.ts # assets/Scripts/chat18x/ui/panels/GirlDetailPanel.ts # assets/Scripts/chat18x/uiitems/DetailImageItem.ts
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
import { _decorator, Component, math, Node, Sprite, UITransform } from "cc";
|
||||
import {
|
||||
_decorator,
|
||||
Component,
|
||||
Label,
|
||||
math,
|
||||
Node,
|
||||
Sprite,
|
||||
UITransform,
|
||||
} from "cc";
|
||||
import { Config18x } from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
@@ -21,13 +29,19 @@ export class DetailImageItem extends Component {
|
||||
@property(Sprite)
|
||||
video: Sprite;
|
||||
|
||||
@property(Node)
|
||||
priceFrame: Node;
|
||||
@property(Label)
|
||||
videoPrice: Label;
|
||||
|
||||
base: GirlDetailPanel;
|
||||
url: string;
|
||||
isImage: boolean;
|
||||
uitransform: UITransform;
|
||||
category: number;
|
||||
id: number;
|
||||
index: number;
|
||||
|
||||
girlId: number;
|
||||
resId: number;
|
||||
type: number;
|
||||
|
||||
onLoad() {
|
||||
@@ -59,7 +73,8 @@ export class DetailImageItem extends Component {
|
||||
|
||||
doScaleToFill() {
|
||||
if (!this.img || !this.img.spriteFrame) return;
|
||||
|
||||
if (!this.uitransform)
|
||||
this.uitransform = this.node.getComponent(UITransform);
|
||||
const itemSize = this.uitransform.contentSize;
|
||||
const imageSize = this.img.spriteFrame.originalSize;
|
||||
|
||||
@@ -93,24 +108,26 @@ export class DetailImageItem extends Component {
|
||||
type: number,
|
||||
category: number,
|
||||
id: number,
|
||||
index: number
|
||||
resId: number
|
||||
) {
|
||||
this.base = base;
|
||||
this.type = type;
|
||||
this.category = category;
|
||||
this.id = id;
|
||||
this.index = index;
|
||||
this.girlId = id;
|
||||
|
||||
this.resId = resId;
|
||||
this.question.active = true; // 显示问号,表示加载中
|
||||
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
let imgPath = "";
|
||||
this.video.enabled = type === 2;
|
||||
this.priceFrame.active = type === 2;
|
||||
if (type === 1) {
|
||||
// 图片
|
||||
this.url = girlData.getGrilPhotoPic(
|
||||
this.category.toString(),
|
||||
this.id,
|
||||
this.index
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
imgPath = this.url;
|
||||
this.isImage = true;
|
||||
@@ -119,19 +136,28 @@ export class DetailImageItem extends Component {
|
||||
this.isImage = false;
|
||||
this.url = girlData.getGrilVideoPath(
|
||||
this.category.toString(),
|
||||
this.id,
|
||||
this.index
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
let videoPrice = girlData.getGrilVideoPrice(
|
||||
this.category.toString(),
|
||||
this.id,
|
||||
this.index
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
this.url = girlData.getGrilVideoPath(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
);
|
||||
|
||||
if (videoPrice > 0) {
|
||||
imgPath = this.url + "_thumbnail_blur";
|
||||
} else {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
}
|
||||
this.priceFrame.active = videoPrice > 0;
|
||||
|
||||
this.videoPrice.string = videoPrice.toString();
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
|
||||
Reference in New Issue
Block a user