xugenyuan

ref |> 解决发布评论后,评论数量没加1的问题

... ... @@ -11,6 +11,7 @@ export struct CommentListDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
@Link publishCommentModel: publishCommentModel
onClose?: () => void
// @Consume pageId: TrackConstants.PageName
... ... @@ -19,6 +20,7 @@ export struct CommentListDialogView {
private dialogController: CustomDialogController = new CustomDialogController({
builder: CommentListDialog({
contentDetailData: this.contentDetailData,
publishCommentModel:this.publishCommentModel,
pageInfo: this.pageInfo,
onClose: this.onClose
}),
... ... @@ -47,7 +49,7 @@ export struct CommentListDialogView {
struct CommentListDialog {
/// 内部使用
@State private publishCommentModel: publishCommentModel = new publishCommentModel()
@Link publishCommentModel: publishCommentModel
@State private operationButtonList: string[] = []
controller?: CustomDialogController
@State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
... ...
... ... @@ -505,7 +505,7 @@ export struct OperRowListView {
// 评论组件需要数据
if (Number.parseInt(this.interactData.commentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + ''
}
}
// console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
... ...
... ... @@ -182,7 +182,7 @@ export struct DetailPlayShortVideoPage {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
// publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel
})
this.playerViewBuilder()
... ...
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView } from 'wdComponent/Index'
import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index'
@Component
export struct CommentDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@Link currentIndex: number
@Link publishCommentModel: publishCommentModel
@Consume contentDetailData: ContentDetailDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
... ... @@ -29,6 +30,7 @@ export struct CommentDialogView {
CommentListDialogView({
showCommentList: this.innerShowComment,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
... ...
... ... @@ -116,7 +116,7 @@ export struct MultiPictureDetailPageComponent {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
// publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel
})
}
... ...