Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
This commit is contained in:
@@ -19,10 +19,10 @@ export class SimpleToggleGroup extends Component {
|
||||
}
|
||||
|
||||
toggleSelected(selectedNode: Node) {
|
||||
const pos = this.slider.getWorldPosition();
|
||||
const targetPos = new Vec3(selectedNode.worldPosition.x, pos.y, pos.z);
|
||||
const pos = this.slider.getPosition();
|
||||
const targetPos = new Vec3(selectedNode.getPosition().x, pos.y, pos.z);
|
||||
tween(this.slider)
|
||||
.to(0.3, { worldPosition: targetPos }, { easing: "sineInOut" })
|
||||
.to(0.3, { position: targetPos }, { easing: "sineInOut" })
|
||||
.start();
|
||||
|
||||
for (let i = 0; i < this.toggles.length; i++) {
|
||||
|
||||
@@ -166,34 +166,33 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
// 也立即尝试调整(以防已经加载完成)
|
||||
this.adjustVideoScale();
|
||||
this.vids = dataDetail.commercialVideos.slice(0);
|
||||
const paths = dataDetail.commercialImages.map((a) => a.path);
|
||||
this.refreshImgs(paths, true);
|
||||
this.refreshImgs(dataDetail.commercialImages);
|
||||
}
|
||||
|
||||
vids: purchase.CommercialVideo[];
|
||||
bindImgToggle() {
|
||||
const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
const paths = dataDetail.commercialImages.map((a) => a.path);
|
||||
const images = dataDetail.commercialImages;
|
||||
|
||||
this.refreshImgs(paths, true);
|
||||
this.refreshImgs(images);
|
||||
}
|
||||
|
||||
bindVideoToggle() {
|
||||
const paths = this.vids.map((a) => a.path);
|
||||
|
||||
this.refreshImgs(paths, false);
|
||||
this.refreshImgs(this.vids);
|
||||
}
|
||||
|
||||
refreshImgs(paths: string[], isImg: boolean) {
|
||||
refreshImgs(
|
||||
resouces: purchase.CommercialImage[] | purchase.CommercialVideo[]
|
||||
) {
|
||||
for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
|
||||
this.imgsLayout.children[i].destroy();
|
||||
}
|
||||
|
||||
for (let i = 1; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
for (let i = 1; i < resouces.length; i++) {
|
||||
const resource = resouces[i];
|
||||
let newNode = instantiate(this.imgItemInst.node);
|
||||
let item = newNode.getComponent(DetailImageItem);
|
||||
item.refresh(path, this, isImg);
|
||||
item.refresh(resource, this);
|
||||
newNode.active = true;
|
||||
this.imgsLayout.addChild(newNode);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
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";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -80,17 +81,28 @@ export class DetailImageItem extends Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
refresh(path: string, base: GirlDetailPanel, isImage: boolean = true) {
|
||||
refresh(
|
||||
resource: purchase.CommercialImage | purchase.CommercialVideo,
|
||||
base: GirlDetailPanel
|
||||
) {
|
||||
this.base = base;
|
||||
this.lock.active = false;
|
||||
this.question.active = true; // 显示问号,表示加载中
|
||||
this.url = path;
|
||||
this.url = resource.path;
|
||||
|
||||
let imgPath = this.url;
|
||||
this.isImage = isImage;
|
||||
if (!isImage) {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
|
||||
if (resource instanceof purchase.CommercialImage) {
|
||||
this.isImage = true;
|
||||
} else {
|
||||
this.isImage = false;
|
||||
if (resource.videoPrice > 0) {
|
||||
imgPath = this.url + "_thumbnail_blur";
|
||||
} else {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
}
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
this.question.active = false; // 图片加载成功后隐藏问号
|
||||
this.scaleToFillItem();
|
||||
|
||||
@@ -33,10 +33,10 @@ export class GirlListItem extends Component {
|
||||
|
||||
nameKey: string;
|
||||
tagKey: string;
|
||||
|
||||
|
||||
private onLanguageChangeCallback = () => {
|
||||
if (!this.girlName || !this.tags) return;
|
||||
|
||||
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
@@ -48,11 +48,19 @@ export class GirlListItem extends Component {
|
||||
};
|
||||
|
||||
protected onLoad(): void {
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, this.onLanguageChangeCallback);
|
||||
Utils.addInnerEL(
|
||||
InnerMsgCode.LanguageChange,
|
||||
this,
|
||||
this.onLanguageChangeCallback
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
protected onDestroy(): void {
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, this.onLanguageChangeCallback);
|
||||
Utils.removeInnerEL(
|
||||
InnerMsgCode.LanguageChange,
|
||||
this,
|
||||
this.onLanguageChangeCallback
|
||||
);
|
||||
}
|
||||
|
||||
baseNode: Node;
|
||||
@@ -75,7 +83,7 @@ export class GirlListItem extends Component {
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.avatar,
|
||||
data.avatarPath,
|
||||
data.listAvatarPath,
|
||||
"Chat18x",
|
||||
() => {
|
||||
let sizeTran = this.avatar.node.parent.getComponent(UITransform);
|
||||
@@ -87,9 +95,9 @@ export class GirlListItem extends Component {
|
||||
}
|
||||
);
|
||||
|
||||
for (let i = 0; i < 5; i++) {
|
||||
this.starParent.children[i].active = i < data.starCount;
|
||||
}
|
||||
// for (let i = 0; i < 5; i++) {
|
||||
// this.starParent.children[i].active = i < data.;
|
||||
// }
|
||||
}
|
||||
|
||||
onClickDetail() {
|
||||
|
||||
@@ -17,9 +17,9 @@ export enum Category {
|
||||
*/
|
||||
shunv = 0,
|
||||
/**
|
||||
* 18岁
|
||||
* 20s
|
||||
*/
|
||||
eighteen = 1,
|
||||
twenty = 1,
|
||||
/**
|
||||
* 辣妈
|
||||
*/
|
||||
@@ -117,6 +117,7 @@ export class Girl {
|
||||
this.tagKey = _buf_.readString()
|
||||
this.priceType = _buf_.readInt()
|
||||
this.avatarPath = _buf_.readString()
|
||||
this.listAvatarPath = _buf_.readString()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,6 +148,10 @@ export class Girl {
|
||||
* 头像路径
|
||||
*/
|
||||
readonly avatarPath: string
|
||||
/**
|
||||
* 头像路径
|
||||
*/
|
||||
readonly listAvatarPath: string
|
||||
|
||||
resolve(tables:Tables) {
|
||||
|
||||
@@ -156,6 +161,7 @@ export class Girl {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user