yuzhilin

fix:专题页互动组件必传值

... ... @@ -7,6 +7,7 @@ import { detailedSkeleton } from './skeleton/detailSkeleton'
import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -21,6 +22,7 @@ export struct SpacialTopicPageComponent {
private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
private webPrepared = false;
private dataPrepared = false;
@State publishCommentModel: publishCommentModel = new publishCommentModel()
private trySendData2H5() {
if (!this.webPrepared || !this.dataPrepared) {
... ... @@ -61,6 +63,15 @@ export struct SpacialTopicPageComponent {
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans;
if (this.contentDetailData[0]?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData[0]?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData[0]?.reLInfo?.relId)
this.publishCommentModel.targetTitle = this.contentDetailData[0]?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData[0]?.reLInfo?.relType)
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData[0]?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData[0]?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData[0]?.newsType)
}
this.trySendData2H5()
}
}
... ... @@ -86,7 +97,9 @@ export struct SpacialTopicPageComponent {
detailedSkeleton()
}
//底部交互区
OperRowListView({ contentDetailData: this.contentDetailData[0] })
OperRowListView({ contentDetailData: this.contentDetailData[0],
publishCommentModel: this.publishCommentModel
})
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
... ...