模拟数据:技师的详细数据

This commit is contained in:
chen wei bo
2025-09-03 17:35:41 +08:00
parent 7ad2261867
commit cd05c4d3a8
5 changed files with 271 additions and 142 deletions
@@ -5,6 +5,9 @@ import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
import { GirlDetailPanel } from "../ui/panels/GirlDetailPanel";
import { purchase } from "../../schema/schema";
import proto from 'db://assets/Scripts/proto/proto.pb.js';
import { DataManager, DataId } from "../data/DataManager";
import { GirlData } from "../data/GirlData";
const { ccclass, property } = _decorator;
@@ -22,6 +25,10 @@ export class DetailImageItem extends Component {
url: string;
isImage: boolean;
uitransform: UITransform;
category: number;
id: number;
index: number;
type : number;
onLoad() {
GButton.BandClick(this.node, this.onClickThis, this);
@@ -82,21 +89,33 @@ export class DetailImageItem extends Component {
}
}
refresh(
resource: purchase.CommercialImage | purchase.CommercialVideo,
base: GirlDetailPanel
base: GirlDetailPanel,
type: number,
category: number,
id: number,
index: number
) {
this.base = base;
this.type = type;
this.category = category;
this.id = id;
this.index = index;
this.lock.active = false;
this.question.active = true; // 显示问号,表示加载中
this.url = resource.path;
let imgPath = this.url;
if (resource instanceof purchase.CommercialImage) {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
let imgPath = "";
if (type === 1) {
// 图片
this.url = girlData.getGrilPhotoPic(this.category.toString(), this.id, this.index);
imgPath = this.url;
this.isImage = true;
} else {
} else if (type === 2) {
// 视频
this.isImage = false;
if (resource.videoPrice > 0) {
this.url = girlData.getGrilVideoPath(this.category.toString(), this.id, this.index);
let videoPrice = girlData.getGrilVideoPrice(this.category.toString(), this.id, this.index);
if (videoPrice > 0) {
imgPath = this.url + "_thumbnail_blur";
} else {
imgPath = this.url + "_thumbnail";
@@ -87,8 +87,7 @@ export class GirlListItem extends Component {
this.price.node.active = priceType == PriceType.pay;
this.freeNode.active = priceType == PriceType.free;
this.tryNode.active = priceType == PriceType.first_time_free;
// TODO,先用 AvatarPath 代替着 listAvatarPath
let listAvatarPath = girlData.getGrilAvatar(this.category.toString(), this.id);
let listAvatarPath = girlData.getGrilListAvatar(this.category.toString(), this.id);
ResManager.I.changeBundleSpriteFrame(
this.avatar,
listAvatarPath,