xugenyuan

ref |> 视频详情页评论弹框改为半模态弹框,视频上推效果

... ... @@ -8,7 +8,7 @@ import {
postInteractBrowsOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, WindowModel } from 'wdKit/Index';
import { DateTimeUtils, Logger, WindowModel } from 'wdKit/Index';
import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { DisplayDirection } from 'wdConstant/Index';
... ... @@ -229,7 +229,7 @@ export struct DetailPlayShortVideoPage {
showCommentListChanged() {
if (this.showCommentList) {
this.playerWidth = px2vp(this.windowWidth)
this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
// this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
} else {
this.calculatePlayerRect()
}
... ... @@ -245,6 +245,11 @@ export struct DetailPlayShortVideoPage {
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
onHeightDidChange: (height: number) => {
this.playerWidth = px2vp(this.windowWidth)
this.playerHeight = px2vp(this.windowHeight - height)
Logger.debug(TAG, "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " + px2vp(this.windowHeight))
}
})
this.playerViewBuilder()
... ... @@ -338,7 +343,7 @@ export struct DetailPlayShortVideoPage {
// 横屏-全屏观看
// 点击查看详情 不展示
if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL) {
if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL && !this.showCommentList) {
this.playerFullscreenBuilder()
}
... ...
... ... @@ -12,6 +12,7 @@ export struct CommentDialogView {
@Link interactData: InteractDataDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
onHeightDidChange?: Callback<number>
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
... ... @@ -38,7 +39,8 @@ export struct CommentDialogView {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
}
}
},
onHeightDidChange: this.onHeightDidChange
})
}
}
\ No newline at end of file
... ...
... ... @@ -141,7 +141,27 @@ export struct WDPlayerRenderView {
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.height * ratio,
surfaceHeight: info.size.height
surfaceHeight: info.size.height,
offsetY: 0
});
return
}
} else {
// 横屏
let ratio = this.videoWidth / this.videoHeight
const height = info.size.width / ratio
// 横屏,缩放高度小 视频区域高度
if (height < info.size.height) {
Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
Logger.debug(TAG, "宽度固定,求高度: " + height)
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: height,
offsetY: (info.size.height - height) / 2
});
return
}
... ... @@ -149,7 +169,8 @@ export struct WDPlayerRenderView {
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: info.size.height
surfaceHeight: info.size.height,
offsetY: 0
});
}
... ...