daijian_wd

稿件底部评论点赞组件封装完善3

... ... @@ -184,15 +184,13 @@ export struct ImageAndTextPageComponent {
this.queryContentInteractCount()
}
if (this.contentDetailData[0]?.openComment) {
this.publishCommentModel = {
targetId: String(this.contentDetailData[0]?.newsId || ''),
targetRelId: this.contentDetailData[0]?.reLInfo?.relId,
targetTitle: this.contentDetailData[0]?.newsTitle,
targetRelType: this.contentDetailData[0]?.reLInfo?.relType,
targetRelObjectId: String(this.contentDetailData[0]?.reLInfo?.relObjectId),
keyArticle: String(this.contentDetailData[0]?.keyArticle),
targetType: String(this.contentDetailData[0]?.newsType),
} as publishCommentModel
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)
}
}
}
... ...
... ... @@ -40,7 +40,7 @@ const TAG = 'OperRowListView';
export struct OperRowListView {
@Prop contentDetailData: ContentDetailDTO // 稿件详情
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] // 组件展示条件
@Prop publishCommentModel: publishCommentModel
@ObjectLink publishCommentModel: publishCommentModel
// @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
... ... @@ -258,12 +258,11 @@ export struct OperRowListView {
this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
// 评论组件需要数据
if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'
}
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'
}
// console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
console.log(TAG, 'this.interactData', JSON.stringify(this.interactData))
console.log(TAG, 'this.interactData44', JSON.stringify(this.interactData))
console.log(TAG, 'this.publishCommentModel', JSON.stringify(this.publishCommentModel))
})
}
}
\ No newline at end of file
... ...