yuzhilin
... ... @@ -5,3 +5,5 @@ export { DetailVideoListPage } from './src/main/ets/pages/DetailVideoListPage'
export { VideoChannelDetail } from './src/main/ets/pages/VideoChannelDetail'
export { LottieViewDemo } from './src/main/ets/pages/LottieViewDemo'
export { CommentDialogView } from './src/main/ets/view/CommentDialogView'
\ No newline at end of file
... ...
... ... @@ -15,8 +15,8 @@ import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, WindowModel } from 'wdKit/Index';
import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { CommentDialogView } from '../view/CommentDialogView';
import { DisplayDirection } from 'wdConstant/Index';
import { CommentDialogView } from '../view/CommentDialogView';
const TAG = 'DetailPlayShortVideoPage';
... ... @@ -28,6 +28,7 @@ const TAG = 'DetailPlayShortVideoPage';
export struct DetailPlayShortVideoPage {
@Prop index: number = 0
@Prop @Watch('currentIndexChange') currentIndex: number = 0
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
@State playerController: WDPlayerController = new WDPlayerController();
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide interactData: InteractDataDTO = {} as InteractDataDTO
... ... @@ -47,7 +48,6 @@ export struct DetailPlayShortVideoPage {
@Consume topSafeHeight: number
@Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
@State imageVisible: boolean = true
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State ratio: number = 16 / 9
/**
... ... @@ -164,15 +164,6 @@ export struct DetailPlayShortVideoPage {
}
this.queryNewsInfoOfUser()
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
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 || '')
this.publishCommentModel.commentContent = ''
}
... ... @@ -186,7 +177,11 @@ export struct DetailPlayShortVideoPage {
Stack({ alignContent: Alignment.Top }) {
Column() {
Stack() {
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
publishCommentModel: $publishCommentModel
})
this.playerViewBuilder()
PlayerBottomView({
... ... @@ -224,7 +219,6 @@ export struct DetailPlayShortVideoPage {
.height('100%')
.width('100%')
CommentDialogView({ publishCommentModel: this.publishCommentModel })
}
.height('100%')
.width('100%')
... ...
... ... @@ -9,19 +9,25 @@ import { OperRowListView } from '../../../../../wdComponent/src/main/ets/compone
@Component
export struct CommentDialogView {
@Prop publishCommentModel: publishCommentModel
@Link publishCommentModel: publishCommentModel
@Consume @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@Link currentIndex: number
@Consume windowWidth: number
@Consume windowHeight: number
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Consume contentDetailData: ContentDetailDTO
@Consume @Watch('showCommentListChange') showCommentList: boolean
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
@State modifier: DrawModifier = new DrawModifier();
private dialogController: CustomDialogController = new CustomDialogController({
// @State modifier: DrawModifier = new DrawModifier();
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
publishCommentModel: this.publishCommentModel,
dialogOffsetY: $dialogOffsetY
publishCommentModel: $publishCommentModel,
contentDetailData: $contentDetailData,
dialogOffsetY: $dialogOffsetY,
showCommentList: $showCommentList,
windowWidth: this.windowWidth,
windowHeight: this.windowHeight
}),
autoCancel: false,
customStyle: true,
... ... @@ -30,8 +36,8 @@ export struct CommentDialogView {
// this.showCommentList = false
// dismissDialogAction.dismiss()
// },
openAnimation: { duration: 0 },
closeAnimation: { duration: 0 },
// openAnimation: { duration: 0 },
// closeAnimation: { duration: 0 },
})
/**
... ... @@ -39,7 +45,7 @@ export struct CommentDialogView {
*/
showCommentListChange(val: boolean) {
if (this.showCommentList) {
if (this.showCommentList && this.index === this.currentIndex) {
this.dialogController.open()
console.log('open')
// animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => {
... ... @@ -59,15 +65,16 @@ export struct CommentDialogView {
@CustomDialog
export struct DetailDialog {
controller: CustomDialogController
@Prop publishCommentModel: publishCommentModel
@Link publishCommentModel: publishCommentModel
@Link dialogOffsetY: number
@Consume contentDetailData: ContentDetailDTO
@Consume showCommentList: boolean
@Consume windowWidth: number
@Consume windowHeight: number
@Link contentDetailData: ContentDetailDTO
@Link showCommentList: boolean
@Prop windowWidth: number
@Prop windowHeight: number
build() {
Column() {
Scroll() {
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
... ... @@ -75,9 +82,15 @@ export struct DetailDialog {
console.log('onCloseClick')
this.showCommentList = false
this.controller.close()
// setTimeout(() => {
//
// }, 1000)
}
}).height('100%')
}
})
.layoutWeight(1)
OperRowListView({
componentType: 1,
showBackIcon: false,
... ...
... ... @@ -69,7 +69,6 @@ export struct PlayerProgressView {
})
}
.margin({ top: 40 })
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,9 @@ import {
postExecuteLikeParams,
postInteractAccentionOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import {
publishCommentModel
} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { SPHelper, ToastUtils, NumberFormatterUtils } from 'wdKit';
import { WDPlayerController } from 'wdPlayer/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
... ... @@ -34,6 +37,7 @@ export struct PlayerRightView {
@Consume showComment?: boolean
@Consume showCommentList: boolean
@Consume displayDirection: DisplayDirection
@Consume publishCommentModel: publishCommentModel
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
aboutToAppear() {
... ... @@ -346,6 +350,16 @@ export struct PlayerRightView {
}
.margin({ bottom: 20 })
.onClick((event: ClickEvent) => {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
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 || '')
this.publishCommentModel.commentContent = ''
// ToastUtils.showToast('评论为公共方法,待开发', 1000);
this.showCommentList = true
})
... ...