xugenyuan

ref |> 调整精选评论点击评论内容可进行回复

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -339,6 +339,9 @@ struct QualityCommentItem {
.fontColor('#222222')
.fontWeight(FontWeight.Medium)
}.margin({ top: 10 })
.onClick(() => {
this.replyComment()
})
/*分割线*/
Row() {
... ... @@ -381,19 +384,9 @@ struct QualityCommentItem {
Row({ space: 16 }) {
Row() {
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
}.onClick(()=>{
this.publishCommentModel.targetId = this.item.targetId
this.publishCommentModel.targetRelId = this.item.targetRelId
this.publishCommentModel.targetTitle = this.item.targetTitle
this.publishCommentModel.targetRelType = this.item.targetRelType
this.publishCommentModel.targetRelObjectId = this.item.targetRelObjectId
this.publishCommentModel.targetType = this.item.targetType
// this.publishCommentModel.keyArticle = this.item.keyArticle
this.publishCommentModel.rootCommentId = this.item.rootCommentId
this.publishCommentModel.parentId = this.item.id
this.dialogController?.open()
}.height('100%')
.onClick(()=>{
this.replyComment()
})
Row() {
... ... @@ -407,17 +400,7 @@ struct QualityCommentItem {
.margin({ left: 3 })
}
}.onClick(() => {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
commentLikeChange(this.item)
commentViewModel.commentLike(this.item).then(() => {
}).catch(() => {
commentLikeChange(this.item)
})
this.clickLikeComment()
})
}
}.height(38).width('100%').justifyContent(FlexAlign.SpaceBetween)
... ... @@ -473,6 +456,37 @@ struct QualityCommentItem {
ProcessUtils.processPage(program)
}
replyComment() {
this.publishCommentModel.targetId = this.item.targetId
this.publishCommentModel.targetRelId = this.item.targetRelId
this.publishCommentModel.targetTitle = this.item.targetTitle
this.publishCommentModel.targetRelType = this.item.targetRelType
this.publishCommentModel.targetRelObjectId = this.item.targetRelObjectId
this.publishCommentModel.targetType = this.item.targetType
// this.publishCommentModel.keyArticle = this.item.keyArticle
this.publishCommentModel.rootCommentId = this.item.rootCommentId
this.publishCommentModel.parentId = this.item.id
this.publishCommentModel.placeHolderText = '回复 ' + this.item.fromUserName + ':'
this.dialogController?.open()
}
clickLikeComment() {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
commentLikeChange(this.item)
commentViewModel.commentLike(this.item).then(() => {
}).catch(() => {
commentLikeChange(this.item)
})
}
}
function commentLikeChange(item: commentItemModel) {
... ...