zhangfengjin

Merge remote-tracking branch 'origin/main'

... ... @@ -50,6 +50,8 @@ export struct OperRowListView {
}
private onCommentFocus: () => void = () => {
}
private onCommentIconClick: () => void = () => {
}
@Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
/**
* 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断
... ... @@ -205,6 +207,9 @@ export struct OperRowListView {
Column() {
if (this.publishCommentModel?.targetId) {
CommentIconComponent({ publishCommentModel: this.publishCommentModel, styleType: this.styleType })
.onClick(() => {
this.onCommentIconClick()
})
}
}
.width(46)
... ... @@ -393,9 +398,9 @@ export struct OperRowListView {
contentType: this.contentDetailData?.newsType,
}]
}
console.log(TAG, '点赞点击', JSON.stringify(params))
console.log(TAG, '查询点赞、收藏数量', JSON.stringify(params))
PageRepository.getContentInteract(params).then(res => {
console.log(TAG, '点赞点击 res', JSON.stringify(res))
console.log(TAG, '查询点赞、收藏数量 res', JSON.stringify(res))
if (res.data) {
this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum)
this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
... ...
... ... @@ -49,6 +49,7 @@ export struct DetailPlayShortVideoPage {
@Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
@State imageVisible: boolean = true
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State ratio: number = 16 / 9
/**
* 页面显示重查用户关注、点赞等信息
... ... @@ -149,8 +150,11 @@ export struct DetailPlayShortVideoPage {
}
aboutToAppear() {
this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape
this.ratio = this.contentDetailData.videoInfo[0].resolutionWidth /
this.contentDetailData.videoInfo[0].resolutionHeight
this.playerController.onCanplay = () => {
this.ratio = this.playerController.videoWidth / this.playerController.videoHeight
if ((this.index == 0 || this.currentIndex === this.index) && this.switchVideoStatus) {
this.playerController.play()
this.imageVisible = false
... ... @@ -179,57 +183,58 @@ export struct DetailPlayShortVideoPage {
}
build() {
Column() {
Stack() {
// this.playerCoverBuilder()
this.playerViewBuilder()
Stack({ alignContent: Alignment.Top }) {
Column() {
Stack() {
// this.playerCoverBuilder()
this.playerViewBuilder()
PlayerBottomView({
playerController: this.playerController
})
.position({ x: 0, y: '100%' })
.markAnchor({ y: '100%' })
.visibility(this.displayDirection === DisplayDirection.VERTICAL ?
Visibility.Visible : Visibility.None)
PlayerBottomView({
playerController: this.playerController
})
PlayerRightView({
playerController: this.playerController
})
PlayerRightView({
playerController: this.playerController
})
}
.layoutWeight(1)
.onClick(() => {
this.playerController?.switchPlayOrPause();
})
CommentComponentPage({}).visibility(this.showCommentList ? Visibility.Visible : Visibility.None)
.position({ y: '100%' })
.markAnchor({ y: '100%' })
// 显示评论且非全屏模式(视频频道无评论showComment=false)
if (this.showComment && this.displayDirection === DisplayDirection.VERTICAL) {
OperRowListView({
pageComponentType: 1,
styleType: 3,
componentType: 4,
operationButtonList: ['comment',],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: false,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
}
}
.width(this.displayDirection === DisplayDirection.VERTICAL ? '100%' : 'auto')
.height(this.displayDirection === DisplayDirection.VERTICAL ? 'auto' : '100%')
.layoutWeight(1)
.onClick(() => {
this.playerController?.switchPlayOrPause();
.height('100%')
.width('100%')
.padding({
top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px'
})
// 显示评论且非全屏模式(视频频道无评论showComment=false)
if (this.showComment && this.displayDirection === DisplayDirection.VERTICAL && this.index === this.currentIndex) {
OperRowListView({
pageComponentType: 1,
styleType: 3,
componentType: 4,
operationButtonList: ['comment',],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: false,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
if (this.showCommentList) {
CommentComponentPage({})
.position({ y: '100%' })
.markAnchor({ y: '100%' })
}
}
.height('100%')
.width('100%')
.padding({
top: this.topSafeHeight + 'px'
})
}
/**
... ... @@ -261,16 +266,26 @@ export struct DetailPlayShortVideoPage {
}
}
})
.height(this.videoLandScape === 1 ? 210 : 'auto')// .height(this.videoLandScape === 1 ? 210 : '100%')
.width('100%')
.height(this.windowWidth / this.ratio + 'px')
// .height(this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? '100%' :
// this.videoLandScape === 1 ? 210 : 'auto')// .height(this.videoLandScape === 1 ? 210 : '100%')
// .width(this.videoLandScape === 1 ?
// this.playerController.videoWidth / this.playerController.videoHeight * this.windowHeight + 'px' : '100%')
// .height(this.videoLandScape === 1 ? 210 :
// this.playerController.videoHeight / this.playerController.videoWidth * this.windowWidth + 'px')
// 横屏-全屏观看
if (this.videoLandScape === 1) {
this.playerFullscreenBuilder()
}
}
.width(this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 'auto' : '100%')
.height(this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? '100%' : 'auto')
.width('100%')
.height('100%')
// .width(this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ?
// this.playerController.videoWidth / this.playerController.videoHeight * this.windowHeight + 'px' : '100%')
// .height(this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? '100%' : 'auto')
.align(this.videoLandScape === 1 ? Alignment.Center : Alignment.Top)
}
... ... @@ -295,14 +310,14 @@ export struct DetailPlayShortVideoPage {
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.align(Alignment.Bottom)
.margin({ top: 230 })
.margin({ top: 280 })
.onClick(() => {
this.displayDirection =
this.displayDirection === DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
// this.displayDirection =
// this.displayDirection === DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
// DisplayDirection.VERTICAL
// WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE_INVERTED)
// this.playerController.xComponentController?.setXComponentSurfaceRect({
// surfaceWidth: px2vp(this.windowHeight),
... ...
... ... @@ -174,7 +174,7 @@ export struct DetailVideoListPage {
})
}, (item: ContentDetailDTO) => item.newsId + '')
}
.disableSwipe(this.displayDirection === DisplayDirection.VERTICAL ? false : true)
.disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true)
.indicator(false)
.vertical(true)
.loop(false)
... ...
... ... @@ -269,7 +269,7 @@ export struct VideoChannelDetail {
}, (item: ContentDetailDTO) => item.newsId + '')
}
.displayCount(1, true)
.disableSwipe(this.displayDirection === DisplayDirection.VERTICAL ? false : true)
.disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true)
.visibility(this.isMouted ? Visibility.Visible : Visibility.None)
.indicator(false)
.vertical(true)
... ...
import { ContentDetailDTO } from 'wdBean/Index'
import { WindowModel } from 'wdKit/Index'
import {
publishCommentModel
} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent'
import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView'
@Component
export struct CommentComponentPage {
scroller: Scroller = new Scroller()
... ... @@ -20,28 +23,45 @@ export struct CommentComponentPage {
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment)
}
build() {
Scroll(this.scroller) {
Stack() {
CommentComponent({
publishCommentModel: this.publishCommentModel
})
Image($r("app.media.ic_close_black"))
.width(20)
.height(20)
.onClick(() => {
this.showCommentList = false
Column() {
Scroll(this.scroller) {
Stack() {
CommentComponent({
publishCommentModel: this.publishCommentModel
})
.margin({ top: 10, right: 20 })
.position({ x: '100%' })
.markAnchor({ x: '100%' })
Image($r("app.media.ic_close_black"))
.width(20)
.height(20)
.onClick(() => {
this.showCommentList = false
})
.margin({ top: 10, right: 30 })
.position({ x: '100%' })
.markAnchor({ x: '100%' })
}
}
.layoutWeight(1)
OperRowListView({
componentType: 1,
operationButtonList: ['comment', 'like', 'collect', 'share'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
}
.zIndex(1000)
.backgroundColor(Color.White)
.height('60%')
}
}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ import { WDPlayerController } from 'wdPlayer/Index';
import { PlayerTitleView } from './PlayerTitleView'
import { PlayerProgressView } from './PlayerProgressView'
import { ContentDetailDTO } from 'wdBean/Index';
import { DisplayDirection } from 'wdConstant/Index';
@Component
export struct PlayerBottomView {
... ... @@ -11,6 +12,7 @@ export struct PlayerBottomView {
@Consume isOpenDetail?: boolean
@Consume isDragging?: boolean
@Consume contentDetailData: ContentDetailDTO
@Consume displayDirection: DisplayDirection
aboutToAppear(): void {
... ... @@ -21,7 +23,11 @@ export struct PlayerBottomView {
PlayerTitleView()
PlayerProgressView({ playerController: this.playerController })
}
.width('100%')
.alignItems(HorizontalAlign.Start)
.position({ x: 0, y: '100%' })
.markAnchor({ y: '100%' })
.visibility(this.displayDirection === DisplayDirection.VERTICAL ?
Visibility.Visible : Visibility.None)
}
}
\ No newline at end of file
... ...
... ... @@ -45,6 +45,7 @@ export struct WDPlayerRenderView {
onLoad?: ((event?: object) => void);
@State videoWidth: number = 16
@State videoHeight: number = 9
@State videoRatio: number = 16 / 9
@State selfSize: Size = new Size('100%', '100%');
aboutToAppear() {
... ... @@ -60,6 +61,7 @@ export struct WDPlayerRenderView {
Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`)
this.videoWidth = width;
this.videoHeight = height;
this.videoRatio = width / height
this.updateLayout()
}
}
... ...