张善主

feat(动态):评论model重新创建

@@ -53,7 +53,7 @@ export struct DynamicDetailComponent { @@ -53,7 +53,7 @@ export struct DynamicDetailComponent {
53 //跳转 53 //跳转
54 private mJumpInfo: ContentDTO = {} as ContentDTO; 54 private mJumpInfo: ContentDTO = {} as ContentDTO;
55 55
56 - @State publishCommentModel: publishCommentModel = new publishCommentModel() 56 +
57 57
58 async aboutToAppear() { 58 async aboutToAppear() {
59 await this.getContentDetailData() 59 await this.getContentDetailData()
@@ -364,7 +364,15 @@ export struct DynamicDetailComponent { @@ -364,7 +364,15 @@ export struct DynamicDetailComponent {
364 if (this.contentDetailData?.openComment) { 364 if (this.contentDetailData?.openComment) {
365 Divider().strokeWidth(6).color('#f5f5f5') 365 Divider().strokeWidth(6).color('#f5f5f5')
366 CommentComponent({ 366 CommentComponent({
367 - publishCommentModel: this.publishCommentModel 367 + publishCommentModel: {
  368 + targetId: String(this.contentDetailData?.newsId || ''),
  369 + targetRelId: this.contentDetailData?.reLInfo?.relId,
  370 + targetTitle: this.contentDetailData?.newsTitle,
  371 + targetRelType: this.contentDetailData?.reLInfo?.relType,
  372 + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
  373 + keyArticle: String(this.contentDetailData?.keyArticle),
  374 + targetType: String(this.contentDetailData?.newsType),
  375 + } as publishCommentModel
368 }) 376 })
369 } 377 }
370 Blank().layoutWeight(1) 378 Blank().layoutWeight(1)
@@ -379,7 +387,15 @@ export struct DynamicDetailComponent { @@ -379,7 +387,15 @@ export struct DynamicDetailComponent {
379 OperRowListView({ contentDetailData: this.contentDetailData 387 OperRowListView({ contentDetailData: this.contentDetailData
380 ,interactData:this.interactDataDTO 388 ,interactData:this.interactDataDTO
381 ,newsStatusOfUser:this.newsStatusOfUser 389 ,newsStatusOfUser:this.newsStatusOfUser
382 - ,publishCommentModel: this.publishCommentModel 390 + ,publishCommentModel: {
  391 + targetId: String(this.contentDetailData?.newsId || ''),
  392 + targetRelId: this.contentDetailData?.reLInfo?.relId,
  393 + targetTitle: this.contentDetailData?.newsTitle,
  394 + targetRelType: this.contentDetailData?.reLInfo?.relType,
  395 + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
  396 + keyArticle: String(this.contentDetailData?.keyArticle),
  397 + targetType: String(this.contentDetailData?.newsType),
  398 + } as publishCommentModel
383 ,needLike:false}) 399 ,needLike:false})
384 } 400 }
385 } 401 }
@@ -399,17 +415,6 @@ export struct DynamicDetailComponent { @@ -399,17 +415,6 @@ export struct DynamicDetailComponent {
399 } catch (exception) { 415 } catch (exception) {
400 console.log('请求失败',JSON.stringify(exception)) 416 console.log('请求失败',JSON.stringify(exception))
401 } 417 }
402 - if (this.contentDetailData.openComment) {  
403 - this.publishCommentModel = {  
404 - targetId: String(this.contentDetailData?.newsId || ''),  
405 - targetRelId: this.contentDetailData?.reLInfo?.relId,  
406 - targetTitle: this.contentDetailData?.newsTitle,  
407 - targetRelType: this.contentDetailData?.reLInfo?.relType,  
408 - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),  
409 - keyArticle: String(this.contentDetailData?.keyArticle),  
410 - targetType: String(this.contentDetailData?.newsType),  
411 - } as publishCommentModel  
412 - }  
413 this.getBatchAttentionStatus() 418 this.getBatchAttentionStatus()
414 this.getInteractDataStatus() 419 this.getInteractDataStatus()
415 this.makeJumpInfo() 420 this.makeJumpInfo()