xugenyuan

ref |> 解决视频详情页评论数和评论弹框同步问题

... ... @@ -38,7 +38,11 @@ export struct CommentListDialogView {
}
closeAction() {
this.showCommentList = false
if (this.onClose) {
this.onClose()
} else {
this.showCommentList = false
}
}
build() {
... ...
... ... @@ -182,7 +182,8 @@ export struct DetailPlayShortVideoPage {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel,
interactData: $interactData,
})
this.playerViewBuilder()
... ...
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index'
... ... @@ -9,6 +9,7 @@ export struct CommentDialogView {
@Link currentIndex: number
@Link publishCommentModel: publishCommentModel
@Consume contentDetailData: ContentDetailDTO
@Link interactData: InteractDataDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
... ... @@ -34,6 +35,9 @@ export struct CommentDialogView {
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
}
}
})
}
... ...
... ... @@ -387,7 +387,7 @@ export struct PlayerRightView {
.width(32)
.aspectRatio(1)
Text(this.transNum2String('commentNum') || '抢首评')
Text(this.interactData.commentNum > 0 ? this.transNum2String('commentNum') : '抢首评')
.width('100%')
.fontWeight(500)
.textAlign(TextAlign.Center)
... ...
... ... @@ -6,7 +6,8 @@ import {
postInteractBrowsOperateParams,
postBatchAttentionStatusParams,
postInteractAccentionOperateParams,
Params
Params,
InteractDataDTO
} from 'wdBean';
import display from '@ohos.display';
import { DateTimeUtils } from 'wdKit/Index';
... ... @@ -59,6 +60,7 @@ export struct MultiPictureDetailPageComponent {
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State currentOffset: number = 0
@State duration: number = 0
@Provide interactData: InteractDataDTO = {} as InteractDataDTO
pageParam: ParamType = {}
followUserId: string = ''
followUserName: string = ''
... ... @@ -116,7 +118,8 @@ export struct MultiPictureDetailPageComponent {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel,
interactData:$interactData
})
}
... ...