页面h5适配
This commit is contained in:
@@ -33,8 +33,6 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
@property(Label)
|
||||
tags: Label;
|
||||
|
||||
@property(Label)
|
||||
descName: Label;
|
||||
@property(Label)
|
||||
descAge: Label;
|
||||
@property(Label)
|
||||
@@ -60,9 +58,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
this.refresh(this.id);
|
||||
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = this.descName.string = LanguageUtils.getText(
|
||||
this.nameKey
|
||||
);
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
@@ -93,7 +89,9 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
if (parentTransform && videoTransform && videoTransform.height > 0) {
|
||||
const scale = parentTransform.height / videoTransform.height;
|
||||
this.avatarVideo.node.setScale(scale, scale, 1);
|
||||
console.log(`Video scaled to: ${scale}, parent height: ${parentTransform.height}, video height: ${videoTransform.height}`);
|
||||
console.log(
|
||||
`Video scaled to: ${scale}, parent height: ${parentTransform.height}, video height: ${videoTransform.height}`
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -121,9 +119,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
const data = ConfigManager.tables.TbGirls.get(this.id);
|
||||
this.category = data.category;
|
||||
this.nameKey = data.nameKey;
|
||||
this.girlName.string = this.descName.string = LanguageUtils.getText(
|
||||
data.nameKey
|
||||
);
|
||||
this.girlName.string = LanguageUtils.getText(data.nameKey);
|
||||
|
||||
if (dataDetail.pics[0].endsWith("video")) {
|
||||
ResManager.I.changeBundleVideo(
|
||||
@@ -131,12 +127,16 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
dataDetail.pics[0],
|
||||
"Chat18x"
|
||||
);
|
||||
|
||||
|
||||
// 添加视频加载完成回调
|
||||
this.avatarVideo.node.on(VideoPlayer.EventType.READY_TO_PLAY, () => {
|
||||
this.adjustVideoScale();
|
||||
}, this);
|
||||
|
||||
this.avatarVideo.node.on(
|
||||
VideoPlayer.EventType.READY_TO_PLAY,
|
||||
() => {
|
||||
this.adjustVideoScale();
|
||||
},
|
||||
this
|
||||
);
|
||||
|
||||
// 也立即尝试调整(以防已经加载完成)
|
||||
this.adjustVideoScale();
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
this.tagKey = data.tagKey;
|
||||
const tags = LanguageUtils.getText(data.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (i != 0) desc += "\n";
|
||||
if (i != 0) desc += "|";
|
||||
desc += tags[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
|
||||
Reference in New Issue
Block a user