yangchenggong1_wd

desc:埋点[个人主页(主态),个人主页(客态) - 内容曝光,内容点击]

... ... @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'
@Component
export struct ChildCommentComponent {
... ... @@ -16,6 +17,7 @@ export struct ChildCommentComponent {
@State isOverLines: boolean = false
@State isOverLinesParent: boolean = false
testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
@Link fromPage:number
build() {
Column() {
... ... @@ -195,11 +197,12 @@ export struct ChildCommentComponent {
}.height('69lpx')
.justifyContent(FlexAlign.Center)
.onClick(() => {
let content = new ContentDTO()
content.objectId = this.data.targetId;
content.relType = this.data.targetRelType + "";
content.relId = this.data.targetRelId;
content.objectType = this.data.targetType + "";
let content = getParams(this.data)
if(this.fromPage === 0 ){
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
}else{
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
}
ProcessUtils.processPage(content)
})
}
... ... @@ -284,3 +287,20 @@ function textStyle() {
.lineHeight('46lpx')
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent';
import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
const TAG = "HomePageBottomCommentComponent"
... ... @@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: UserDataLocal.getUserLevelHeaderUrl(),
isLastItem: index === this.data_comment.totalCount() - 1
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:0
})
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
}
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
... ... @@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent {
this.isGetRequest = true
})
}
}
\ No newline at end of file
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU
import { ChildCommentComponent } from './ChildCommentComponent';
import { EmptyComponent } from '../../view/EmptyComponent';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
const TAG = "HomePageBottomComponent"
/**
... ... @@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:1
})
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
}
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
... ... @@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent {
this.isGetRequest = true
})
}
}
\ No newline at end of file
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...