yangchenggong1_wd

desc:个人中心 评论跳转

1 -import { Params } from 'wdBean'; 1 +import { ContentDTO, Params } from 'wdBean';
2 import { DateTimeUtils, LazyDataSource, SPHelper,UserDataLocal } from 'wdKit'; 2 import { DateTimeUtils, LazyDataSource, SPHelper,UserDataLocal } from 'wdKit';
3 -import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
4 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 4 import MinePageDatasModel from '../../../model/MinePageDatasModel';
5 import { CommentListItem } from '../../../viewmodel/CommentListItem'; 5 import { CommentListItem } from '../../../viewmodel/CommentListItem';
6 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; 6 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
@@ -265,7 +265,7 @@ export struct HomePageBottomComponent{ @@ -265,7 +265,7 @@ export struct HomePageBottomComponent{
265 }else{ 265 }else{
266 value.list.forEach((value)=>{ 266 value.list.forEach((value)=>{
267 let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) 267 let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
268 - this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) 268 + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType,value.targetRelId,value.targetRelObjectId,value.targetRelType,value.targetStatus))
269 }) 269 })
270 this.data_comment.notifyDataReload() 270 this.data_comment.notifyDataReload()
271 this.count = this.data_comment.totalCount() 271 this.count = this.data_comment.totalCount()
@@ -365,6 +365,14 @@ struct ChildCommentComponent { @@ -365,6 +365,14 @@ struct ChildCommentComponent {
365 .width('662lpx') 365 .width('662lpx')
366 .backgroundColor($r('app.color.color_F5F5F5')) 366 .backgroundColor($r('app.color.color_F5F5F5'))
367 .margin({top:'19lpx',bottom:'31lpx'}) 367 .margin({top:'19lpx',bottom:'31lpx'})
  368 + .onClick(()=>{
  369 + ProcessUtils.processPage(
  370 + {objectId: this.data.targetId,
  371 + relType:this.data.targetRelType+"",
  372 + relId:this.data.targetRelId,
  373 + objectType:this.data.targetType+"",
  374 + } as ContentDTO )
  375 + })
368 376
369 if(!this.isLastItem){ 377 if(!this.isLastItem){
370 Divider().width('100%') 378 Divider().width('100%')
@@ -6,6 +6,8 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; @@ -6,6 +6,8 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
6 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; 6 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
7 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 7 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
8 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'; 8 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem';
  9 +import { ProcessUtils } from 'wdRouter/Index';
  10 +import { ContentDTO } from 'wdBean/Index';
9 11
10 const TAG = "HomePageBottomComponent" 12 const TAG = "HomePageBottomComponent"
11 @Component 13 @Component
@@ -107,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -107,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent{
107 let data : CommentListItem[] = [] 109 let data : CommentListItem[] = []
108 value.list.forEach((item)=>{ 110 value.list.forEach((item)=>{
109 status.commentIdList.push(item.id) 111 status.commentIdList.push(item.id)
110 - data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,0,item.id,item.targetId,item.targetType)) 112 + data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus))
111 }) 113 })
112 114
113 MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ 115 MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{
@@ -120,7 +122,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -120,7 +122,7 @@ export struct OtherHomePageBottomCommentComponent{
120 }) 122 })
121 123
122 data.forEach((item)=>{ 124 data.forEach((item)=>{
123 - this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType)) 125 + this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus))
124 }) 126 })
125 127
126 this.data_comment.notifyDataReload() 128 this.data_comment.notifyDataReload()
@@ -237,6 +239,14 @@ struct ChildCommentComponent { @@ -237,6 +239,14 @@ struct ChildCommentComponent {
237 .width('662lpx') 239 .width('662lpx')
238 .backgroundColor($r('app.color.color_F5F5F5')) 240 .backgroundColor($r('app.color.color_F5F5F5'))
239 .margin({top:'19lpx',bottom:'31lpx'}) 241 .margin({top:'19lpx',bottom:'31lpx'})
  242 + .onClick(()=>{
  243 + ProcessUtils.processPage(
  244 + {objectId: this.data.targetId,
  245 + relType:this.data.targetRelType+"",
  246 + relId:this.data.targetRelId,
  247 + objectType:this.data.targetType+"",
  248 + } as ContentDTO )
  249 + })
240 250
241 if(!this.isLastItem){ 251 if(!this.isLastItem){
242 Divider().width('100%') 252 Divider().width('100%')
@@ -2,19 +2,46 @@ @@ -2,19 +2,46 @@
2 2
3 @Observed 3 @Observed
4 export class CommentListItem{ 4 export class CommentListItem{
5 - fromUserHeader:string = ""  
6 - fromUserName:string = ""  
7 - commentContent:string = ""  
8 - targetTitle:string = ""  
9 - createTime:string = ""  
10 - likeNum:number = 0  
11 like_status:number = 0 5 like_status:number = 0
12 - id:number = 0  
13 - targetId:string = ""  
14 - targetType:number = 0  
15 6
  7 + avatarFrame: string = ""
  8 + checkStatus: number = -1
  9 + commentContent: string = ""
  10 + commentContentSensitive: string = ""
  11 + commentLevel: number = -1
  12 + commentPics: string = ""
  13 + commentSensitive: string = ""
  14 + commentType: string = ""
  15 + createTime: string = ""
  16 + fromCreatorId: string = ""
  17 + fromDeviceId: string = ""
  18 + fromUserHeader: string = ""
  19 + fromUserId: string = ""
  20 + fromUserName: string = ""
  21 + fromUserType: number = -1
  22 + h5Url: string = ""
  23 + id: number = 0
  24 + keyArticle: number = -1
  25 + likeNum: number = 0
  26 + // pageId: null
  27 + // parentCommentVo: null
  28 + parentId: number = -1
  29 + rootCommentId: number = -1
  30 + sensitiveExist: number = -1
  31 + sensitiveShow: number = -1
  32 + // shareInfo: ShareInfo$1Type
  33 + targetId: string = ""
  34 + targetType: number = 0
  35 + targetRelId: string = ""
  36 + targetRelObjectId: string = ""
  37 + targetRelType: number = -1
  38 + targetStatus: number = -1
  39 + targetTitle: string = ""
  40 + // topicType: null
  41 + uuid: string = ""
16 42
17 - constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string,likeNum:number,like_status:number,id:number,targetId:string,targetType:number) { 43 +
  44 + constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string,likeNum:number,like_status:number,id:number,targetId:string,targetType:number,targetRelId: string,targetRelObjectId: string,targetRelType: number,targetStatus: number,) {
18 this.fromUserHeader = fromUserHeader 45 this.fromUserHeader = fromUserHeader
19 this.fromUserName = fromUserName 46 this.fromUserName = fromUserName
20 this.commentContent = commentContent 47 this.commentContent = commentContent
@@ -25,5 +52,9 @@ export class CommentListItem{ @@ -25,5 +52,9 @@ export class CommentListItem{
25 this.id = id 52 this.id = id
26 this.targetId = targetId 53 this.targetId = targetId
27 this.targetType = targetType 54 this.targetType = targetType
  55 + this.targetRelId = targetRelId
  56 + this.targetRelObjectId = targetRelObjectId
  57 + this.targetRelType = targetRelType
  58 + this.targetStatus = targetStatus
28 } 59 }
29 } 60 }