daijian_wd

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

@@ -184,15 +184,13 @@ export struct ImageAndTextPageComponent { @@ -184,15 +184,13 @@ export struct ImageAndTextPageComponent {
184 this.queryContentInteractCount() 184 this.queryContentInteractCount()
185 } 185 }
186 if (this.contentDetailData[0]?.openComment) { 186 if (this.contentDetailData[0]?.openComment) {
187 - this.publishCommentModel = {  
188 - targetId: String(this.contentDetailData[0]?.newsId || ''),  
189 - targetRelId: this.contentDetailData[0]?.reLInfo?.relId,  
190 - targetTitle: this.contentDetailData[0]?.newsTitle,  
191 - targetRelType: this.contentDetailData[0]?.reLInfo?.relType,  
192 - targetRelObjectId: String(this.contentDetailData[0]?.reLInfo?.relObjectId),  
193 - keyArticle: String(this.contentDetailData[0]?.keyArticle),  
194 - targetType: String(this.contentDetailData[0]?.newsType),  
195 - } as publishCommentModel 187 + this.publishCommentModel.targetId = String(this.contentDetailData[0]?.newsId || '')
  188 + this.publishCommentModel.targetRelId = String(this.contentDetailData[0]?.reLInfo?.relId)
  189 + this.publishCommentModel.targetTitle = this.contentDetailData[0]?.newsTitle
  190 + this.publishCommentModel.targetRelType = String(this.contentDetailData[0]?.reLInfo?.relType)
  191 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData[0]?.reLInfo?.relObjectId)
  192 + this.publishCommentModel.keyArticle = String(this.contentDetailData[0]?.keyArticle)
  193 + this.publishCommentModel.targetType = String(this.contentDetailData[0]?.newsType)
196 } 194 }
197 } 195 }
198 } 196 }
@@ -40,7 +40,7 @@ const TAG = 'OperRowListView'; @@ -40,7 +40,7 @@ const TAG = 'OperRowListView';
40 export struct OperRowListView { 40 export struct OperRowListView {
41 @Prop contentDetailData: ContentDetailDTO // 稿件详情 41 @Prop contentDetailData: ContentDetailDTO // 稿件详情
42 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] // 组件展示条件 42 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] // 组件展示条件
43 - @Prop publishCommentModel: publishCommentModel 43 + @ObjectLink publishCommentModel: publishCommentModel
44 // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 44 // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
45 @State interactData: InteractDataDTO = {} as InteractDataDTO 45 @State interactData: InteractDataDTO = {} as InteractDataDTO
46 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 46 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@@ -258,12 +258,11 @@ export struct OperRowListView { @@ -258,12 +258,11 @@ export struct OperRowListView {
258 this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) 258 this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
259 this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) 259 this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
260 // 评论组件需要数据 260 // 评论组件需要数据
261 - if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) {  
262 - this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'  
263 - } 261 + this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'
264 } 262 }
265 // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) 263 // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
266 - console.log(TAG, 'this.interactData', JSON.stringify(this.interactData)) 264 + console.log(TAG, 'this.interactData44', JSON.stringify(this.interactData))
  265 + console.log(TAG, 'this.publishCommentModel', JSON.stringify(this.publishCommentModel))
267 }) 266 })
268 } 267 }
269 } 268 }