update
This commit is contained in:
@@ -232,8 +232,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
}
|
||||
|
||||
let age = girlData.getGrilAge(this.category.toString(), this.id);
|
||||
this.descAge.string =
|
||||
LanguageUtils.getText("girldetailpanel.age") + age.toString();
|
||||
this.descAge.string = age.toString();
|
||||
|
||||
const firstPath = girlData.getFirstGrilVideoPath(
|
||||
this.category.toString(),
|
||||
@@ -326,17 +325,21 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
OnClickChatBtn() {
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
|
||||
|
||||
//if (isRelease || isFree) {
|
||||
// 直接在当前页面打开ChatPanel作为子页面
|
||||
const currentPanel = NavigationManager.Instance.getCurrentActivePanelNode();
|
||||
if (currentPanel) {
|
||||
const chatData = { girlId: this.id, base: currentPanel };
|
||||
NavigationManager.Instance.openSubPanel("ChatPanel", currentPanel, chatData, {
|
||||
openAnimation: PageTransitionType.SLIDE_LEFT,
|
||||
closeAnimation: PageTransitionType.SLIDE_RIGHT,
|
||||
hideBasePanel: true,
|
||||
});
|
||||
NavigationManager.Instance.openSubPanel(
|
||||
"ChatPanel",
|
||||
currentPanel,
|
||||
chatData,
|
||||
{
|
||||
openAnimation: PageTransitionType.SLIDE_LEFT,
|
||||
closeAnimation: PageTransitionType.SLIDE_RIGHT,
|
||||
hideBasePanel: true,
|
||||
}
|
||||
);
|
||||
} else {
|
||||
logger.warn("[GirlDetailPanel] 无法获取当前激活的主页面");
|
||||
}
|
||||
|
||||
@@ -56,6 +56,26 @@ export class ShowPanel extends li_BaseView {
|
||||
start() {
|
||||
//this.splash.node.on(Node.EventType.TOUCH_START,this.onclickback);
|
||||
GButton.BandClick(this.splash.node, this.onClose, this);
|
||||
|
||||
// 监听视频点击事件(Web平台上视频会覆盖UI,需要直接监听视频点击)
|
||||
if (this.videoPlayer) {
|
||||
this.videoPlayer.node.on(
|
||||
VideoPlayer.EventType.CLICKED,
|
||||
this.onClose,
|
||||
this
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
// 清理视频点击事件监听
|
||||
if (this.videoPlayer && this.videoPlayer.node) {
|
||||
this.videoPlayer.node.off(
|
||||
VideoPlayer.EventType.CLICKED,
|
||||
this.onClose,
|
||||
this
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected onClose() {
|
||||
@@ -63,7 +83,7 @@ export class ShowPanel extends li_BaseView {
|
||||
if (this.videoPlayer) {
|
||||
this.videoPlayer.stop();
|
||||
}
|
||||
|
||||
|
||||
if (this.func) {
|
||||
this.func();
|
||||
}
|
||||
@@ -105,10 +125,10 @@ export class ShowPanel extends li_BaseView {
|
||||
const pos = this.videoArea.node.getWorldPosition();
|
||||
this.videoPlayer.node.setWorldPosition(pos);
|
||||
}
|
||||
|
||||
|
||||
this.videoPlayer.loop = true;
|
||||
this.videoPlayer.play();
|
||||
|
||||
|
||||
// 延迟调整缩放以填充区域
|
||||
this.scheduleOnce(() => {
|
||||
this.adjustVideoScale();
|
||||
@@ -123,7 +143,7 @@ export class ShowPanel extends li_BaseView {
|
||||
const videoAreaPos = this.videoArea
|
||||
? this.videoArea.node.getWorldPosition()
|
||||
: undefined;
|
||||
|
||||
|
||||
if (SceneBgVideoLayer.handle) {
|
||||
SceneBgVideoLayer.handle.playVideo(path, {
|
||||
loop: true,
|
||||
@@ -140,13 +160,13 @@ export class ShowPanel extends li_BaseView {
|
||||
*/
|
||||
private adjustVideoScale() {
|
||||
if (!this.videoPlayer || !this.videoArea) return;
|
||||
|
||||
|
||||
const videoTransform = this.videoPlayer.node.getComponent(UITransform);
|
||||
if (videoTransform && videoTransform.height > 0) {
|
||||
const scaleX = this.videoArea.width / videoTransform.width;
|
||||
const scaleY = this.videoArea.height / videoTransform.height;
|
||||
const scale = Math.max(scaleX, scaleY); // 填满整个区域
|
||||
|
||||
|
||||
this.videoPlayer.node.setScale(new Vec3(scale, scale, 1));
|
||||
logger.log(`ShowPanel: 调整视频缩放到 ${scale}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user