yuzhilin

feat H5详情接入评论列表

... ... @@ -20,6 +20,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { PageRepository } from '../repository/PageRepository';
import { detailedSkeleton } from './skeleton/detailSkeleton';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
import { CommentComponent } from '../components/comment/view/CommentComponent'
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
... ... @@ -36,6 +38,7 @@ export struct ImageAndTextPageComponent {
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State isPageEnd: boolean = false
@State publishTime: string = ''
@State publishCommentModel: publishCommentModel = {} as publishCommentModel
build() {
Column() {
... ... @@ -90,7 +93,7 @@ export struct ImageAndTextPageComponent {
.height(24)
.margin({ right: 5 })
}
if(this.interactData?.likeNum !== '0'){
if (this.interactData?.likeNum !== '0') {
Text(`${this.interactData?.likeNum}`)
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
... ... @@ -112,17 +115,17 @@ export struct ImageAndTextPageComponent {
}.width(CommonConstants.FULL_WIDTH).height(80)
.justifyContent(FlexAlign.Center)
Divider().strokeWidth(6).color('#f5f5f5')
}
if (this.recommendList.length > 0) {
Divider().strokeWidth(6).color('#f5f5f5')
RecommendList({ recommendList: this.recommendList })
}
// 评论
if(this.contentDetailData[0]?.openComment){
// CommentComponent({
//
// })
if (this.contentDetailData[0]?.openComment) {
Divider().strokeWidth(6).color('#f5f5f5')
CommentComponent({
publishCommentModel: this.publishCommentModel
})
}
}
}
... ... @@ -139,7 +142,7 @@ export struct ImageAndTextPageComponent {
//底部交互区
if (this.contentDetailData?.length) {
OperRowListView({contentDetailData: this.contentDetailData[0]})
OperRowListView({ contentDetailData: this.contentDetailData[0] })
}
}
... ... @@ -177,6 +180,17 @@ export struct ImageAndTextPageComponent {
this.getInteractDataStatus()
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
}
}
}
}
... ...