张善主

fix(详情页):动态详情页埋点

@@ -43,7 +43,7 @@ import { EmptyComponent } from './view/EmptyComponent'; @@ -43,7 +43,7 @@ import { EmptyComponent } from './view/EmptyComponent';
43 import { detailedSkeleton } from './skeleton/detailSkeleton'; 43 import { detailedSkeleton } from './skeleton/detailSkeleton';
44 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' 44 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
45 import { common } from '@kit.AbilityKit'; 45 import { common } from '@kit.AbilityKit';
46 - 46 +import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
47 const TAG = 'DynamicDetailComponent' 47 const TAG = 'DynamicDetailComponent'
48 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 48 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
49 49
@@ -78,7 +78,7 @@ export struct DynamicDetailComponent { @@ -78,7 +78,7 @@ export struct DynamicDetailComponent {
78 @State publishCommentModel: publishCommentModel = new publishCommentModel() 78 @State publishCommentModel: publishCommentModel = new publishCommentModel()
79 @State reachEndIncreament: number = 0 79 @State reachEndIncreament: number = 0
80 @State operationButtonList: string[] = [] 80 @State operationButtonList: string[] = []
81 - 81 + pageParam: ParamType = {}
82 async aboutToAppear() { 82 async aboutToAppear() {
83 await this.getContentDetailData() 83 await this.getContentDetailData()
84 } 84 }
@@ -535,7 +535,6 @@ export struct DynamicDetailComponent { @@ -535,7 +535,6 @@ export struct DynamicDetailComponent {
535 //点赞操作 535 //点赞操作
536 this.toggleLikeStatus() 536 this.toggleLikeStatus()
537 //内容点赞/取消点赞埋点 537 //内容点赞/取消点赞埋点
538 -  
539 }) 538 })
540 539
541 // 评论 540 // 评论
@@ -608,6 +607,12 @@ export struct DynamicDetailComponent { @@ -608,6 +607,12 @@ export struct DynamicDetailComponent {
608 this.makeJumpInfo() 607 this.makeJumpInfo()
609 this.interactDataV2() 608 this.interactDataV2()
610 this.viewBlogInsightIntentShare() 609 this.viewBlogInsightIntentShare()
  610 +
  611 + this.pageParam = {
  612 + 'contentType': `${this.contentDetailData.newsType}`,
  613 + 'contentId': `${this.contentDetailData.newsId}`,
  614 + 'contentName': `${this.contentDetailData.newsTitle || ''}`,
  615 + }
611 } 616 }
612 617
613 private async interactDataV2() { 618 private async interactDataV2() {
@@ -737,8 +742,10 @@ export struct DynamicDetailComponent { @@ -737,8 +742,10 @@ export struct DynamicDetailComponent {
737 console.log('关注号主==', JSON.stringify(res.data)) 742 console.log('关注号主==', JSON.stringify(res.data))
738 if (this.followStatus == '1') { 743 if (this.followStatus == '1') {
739 this.followStatus = '0' 744 this.followStatus = '0'
  745 + TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam)
740 } else { 746 } else {
741 this.followStatus = '1' 747 this.followStatus = '1'
  748 + TrackingContent.follow(false,this.followUserId,this.followUserName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam)
742 } 749 }
743 }) 750 })
744 } 751 }
@@ -766,6 +773,14 @@ export struct DynamicDetailComponent { @@ -766,6 +773,14 @@ export struct DynamicDetailComponent {
766 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 773 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
767 } 774 }
768 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) 775 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
  776 +
  777 + //内容点赞、取消点赞Tracking 1点赞 0取消点赞
  778 + TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
  779 + {
  780 + 'contentType': `${this.contentDetailData.newsType}`,
  781 + 'contentId': `${this.contentDetailData.newsId}`,
  782 + 'contentName': `${this.contentDetailData.newsTitle || ''}`,
  783 + })
769 }) 784 })
770 } 785 }
771 786
@@ -212,8 +212,6 @@ export namespace TrackConstants { @@ -212,8 +212,6 @@ export namespace TrackConstants {
212 Interest = "preferenceSelectionPage", 212 Interest = "preferenceSelectionPage",
213 //意见反馈 213 //意见反馈
214 FeedbackPage = 'feedbackPage', 214 FeedbackPage = 'feedbackPage',
215 - //动态详情  
216 - DynamicDetailPage = 'dynamicDetailPage',  
217 //早晚报 215 //早晚报
218 NewsPaperPage = 'newsPaperPage', 216 NewsPaperPage = 'newsPaperPage',
219 } 217 }
@@ -37,7 +37,7 @@ struct DynamicDetailPage { @@ -37,7 +37,7 @@ struct DynamicDetailPage {
37 } 37 }
38 onPageHide() { 38 onPageHide() {
39 //页面浏览 39 //页面浏览
40 - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.DynamicDetailPage,TrackConstants.PageName.DynamicDetailPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) 40 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
41 41
42 } 42 }
43 } 43 }