yuzhilin

feat H5详情接入评论列表

@@ -20,6 +20,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -20,6 +20,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
21 import { PageRepository } from '../repository/PageRepository'; 21 import { PageRepository } from '../repository/PageRepository';
22 import { detailedSkeleton } from './skeleton/detailSkeleton'; 22 import { detailedSkeleton } from './skeleton/detailSkeleton';
  23 +import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
  24 +
23 import { CommentComponent } from '../components/comment/view/CommentComponent' 25 import { CommentComponent } from '../components/comment/view/CommentComponent'
24 26
25 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 27 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
@@ -36,6 +38,7 @@ export struct ImageAndTextPageComponent { @@ -36,6 +38,7 @@ export struct ImageAndTextPageComponent {
36 @State interactData: InteractDataDTO = {} as InteractDataDTO 38 @State interactData: InteractDataDTO = {} as InteractDataDTO
37 @State isPageEnd: boolean = false 39 @State isPageEnd: boolean = false
38 @State publishTime: string = '' 40 @State publishTime: string = ''
  41 + @State publishCommentModel: publishCommentModel = {} as publishCommentModel
39 42
40 build() { 43 build() {
41 Column() { 44 Column() {
@@ -90,7 +93,7 @@ export struct ImageAndTextPageComponent { @@ -90,7 +93,7 @@ export struct ImageAndTextPageComponent {
90 .height(24) 93 .height(24)
91 .margin({ right: 5 }) 94 .margin({ right: 5 })
92 } 95 }
93 - if(this.interactData?.likeNum !== '0'){ 96 + if (this.interactData?.likeNum !== '0') {
94 Text(`${this.interactData?.likeNum}`) 97 Text(`${this.interactData?.likeNum}`)
95 .fontSize(16) 98 .fontSize(16)
96 .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') 99 .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
@@ -112,17 +115,17 @@ export struct ImageAndTextPageComponent { @@ -112,17 +115,17 @@ export struct ImageAndTextPageComponent {
112 115
113 }.width(CommonConstants.FULL_WIDTH).height(80) 116 }.width(CommonConstants.FULL_WIDTH).height(80)
114 .justifyContent(FlexAlign.Center) 117 .justifyContent(FlexAlign.Center)
115 -  
116 - Divider().strokeWidth(6).color('#f5f5f5')  
117 } 118 }
118 if (this.recommendList.length > 0) { 119 if (this.recommendList.length > 0) {
  120 + Divider().strokeWidth(6).color('#f5f5f5')
119 RecommendList({ recommendList: this.recommendList }) 121 RecommendList({ recommendList: this.recommendList })
120 } 122 }
121 // 评论 123 // 评论
122 - if(this.contentDetailData[0]?.openComment){  
123 - // CommentComponent({  
124 - //  
125 - // }) 124 + if (this.contentDetailData[0]?.openComment) {
  125 + Divider().strokeWidth(6).color('#f5f5f5')
  126 + CommentComponent({
  127 + publishCommentModel: this.publishCommentModel
  128 + })
126 } 129 }
127 } 130 }
128 } 131 }
@@ -139,7 +142,7 @@ export struct ImageAndTextPageComponent { @@ -139,7 +142,7 @@ export struct ImageAndTextPageComponent {
139 142
140 //底部交互区 143 //底部交互区
141 if (this.contentDetailData?.length) { 144 if (this.contentDetailData?.length) {
142 - OperRowListView({contentDetailData: this.contentDetailData[0]}) 145 + OperRowListView({ contentDetailData: this.contentDetailData[0] })
143 } 146 }
144 } 147 }
145 148
@@ -177,6 +180,17 @@ export struct ImageAndTextPageComponent { @@ -177,6 +180,17 @@ export struct ImageAndTextPageComponent {
177 this.getInteractDataStatus() 180 this.getInteractDataStatus()
178 this.queryContentInteractCount() 181 this.queryContentInteractCount()
179 } 182 }
  183 + if (this.contentDetailData[0]?.openComment) {
  184 + this.publishCommentModel = {
  185 + targetId: String(this.contentDetailData[0]?.newsId || ''),
  186 + targetRelId: this.contentDetailData[0]?.reLInfo?.relId,
  187 + targetTitle: this.contentDetailData[0]?.newsTitle,
  188 + targetRelType: this.contentDetailData[0]?.reLInfo?.relType,
  189 + targetRelObjectId: String(this.contentDetailData[0]?.reLInfo?.relObjectId),
  190 + keyArticle: String(this.contentDetailData[0]?.keyArticle),
  191 + targetType: String(this.contentDetailData[0]?.newsType),
  192 + } as publishCommentModel
  193 + }
180 } 194 }
181 } 195 }
182 } 196 }