chengen02

-fix 评论展示bug修复

import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView, publishCommentModel } from '../../../../Index'
@Component
export struct CommentDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@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)
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
showCommentListChange(val: boolean) {
if (this.showCommentList && this.index === this.currentIndex) {
this.innerShowComment = true
} else {
this.innerShowComment = false
}
}
innerShowCommentChange() {
this.showCommentList = this.innerShowComment
}
build() {
CommentListDialogView({
showCommentList: this.innerShowComment,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
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)
}
}
})
}
}
\ No newline at end of file
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO } from 'wdBean';
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
... ... @@ -13,6 +13,7 @@ import { NetworkUtil, WindowModel } from 'wdKit';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -23,7 +24,11 @@ export struct SpacialTopicPageComponent {
action: Action = {} as Action
@State webUrl: string = '';
@State subjectData: string = '';
@State index: number = 0
@State currentIndex: number = 0
@State isPageEnd: boolean = false
@State showCommentList: boolean = false
@State interactData: InteractDataDTO = {} as InteractDataDTO
@Prop reload: number = 0;
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
... ... @@ -185,6 +190,16 @@ export struct SpacialTopicPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
onCommentIconClick:()=>{
this.showCommentList = true
}
})
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
})
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
... ...
... ... @@ -48,6 +48,7 @@ export struct OperRowListView {
private onCommentFocus: () => void = () => {
}
private onCommentIconClick: () => void = () => {
}
@Provide inDialog: boolean = false
... ... @@ -252,6 +253,9 @@ export struct OperRowListView {
@Builder
builderComment() {
Column() {
// Text((this.contentDetailData.openComment == 1).toString())
// Text((this.contentDetailData.commentDisplay == 1).toString())
// Text(this.publishCommentModel?.targetId.toString())
if (this.contentDetailData.openComment == 1
&& this.contentDetailData.commentDisplay == 1
&& this.publishCommentModel?.targetId) {
... ... @@ -284,9 +288,10 @@ export struct OperRowListView {
contentDetail: this.contentDetailData
})
.onClick(() => {
console.log('akdbakdbakdbaksjd')
this.onCommentIconClick()
console.log(JSON.stringify(this.dialogController?.open))
// console.log('his.dialogController?.open',JSON.stringify(this.dialogController))
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
... ...