chengen02

Merge remote-tracking branch 'origin/main'

@@ -601,6 +601,8 @@ export struct DynamicDetailComponent { @@ -601,6 +601,8 @@ export struct DynamicDetailComponent {
601 this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') 601 this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
602 this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') 602 this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
603 this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') 603 this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
  604 + this.publishCommentModel.pageId = TrackConstants.PageName.DynamicDetail
  605 + this.publishCommentModel.pageName = TrackConstants.PageName.DynamicDetail
604 } 606 }
605 607
606 this.operationButtonList = ['comment', 'collect', 'share'] 608 this.operationButtonList = ['comment', 'collect', 'share']
@@ -680,7 +682,7 @@ export struct DynamicDetailComponent { @@ -680,7 +682,7 @@ export struct DynamicDetailComponent {
680 682
681 //创建跳转信息 683 //创建跳转信息
682 makeJumpInfo() { 684 makeJumpInfo() {
683 - this.mJumpInfo.pageId = 'dynamicDetailPage' 685 + this.mJumpInfo.pageId = TrackConstants.PageName.DynamicDetail
684 this.mJumpInfo.objectId = this.contentDetailData.newsId + "" 686 this.mJumpInfo.objectId = this.contentDetailData.newsId + ""
685 this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType + "" 687 this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType + ""
686 this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId + "" 688 this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId + ""
@@ -86,7 +86,7 @@ export struct ENewspaperItemComponent { @@ -86,7 +86,7 @@ export struct ENewspaperItemComponent {
86 } as ContentDTO 86 } as ContentDTO
87 ProcessUtils.processPage(content) 87 ProcessUtils.processPage(content)
88 //内容点击 88 //内容点击
89 - TrackingContent.commentClickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage 89 + TrackingContent.clickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
90 ,{ 90 ,{
91 'contentName':this.itemBeanClicked.title, 91 'contentName':this.itemBeanClicked.title,
92 'contentType':this.itemBeanClicked.newsType, 92 'contentType':this.itemBeanClicked.newsType,
@@ -36,7 +36,7 @@ export struct ENewspaperPageComponent { @@ -36,7 +36,7 @@ export struct ENewspaperPageComponent {
36 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex 36 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
37 37
38 //电子报--版面序号选择点击 38 //电子报--版面序号选择点击
39 - TrackingContent.commentClickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage 39 + TrackingContent.clickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
40 ,{ 40 ,{
41 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, 41 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
42 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, 42 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
@@ -61,7 +61,7 @@ export struct ENewspaperPageComponent { @@ -61,7 +61,7 @@ export struct ENewspaperPageComponent {
61 new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) 61 new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
62 } 62 }
63 //日历选择点击 63 //日历选择点击
64 - TrackingContent.commentClickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage 64 + TrackingContent.clickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
65 ,{ 65 ,{
66 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, 66 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
67 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, 67 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
@@ -340,7 +340,7 @@ export struct ENewspaperPageComponent { @@ -340,7 +340,7 @@ export struct ENewspaperPageComponent {
340 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 340 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
341 this.isOpenListDialog = true 341 this.isOpenListDialog = true
342 //电子报--读报纸点击 342 //电子报--读报纸点击
343 - TrackingContent.commentClickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage 343 + TrackingContent.clickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
344 ,{ 344 ,{
345 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, 345 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
346 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, 346 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
@@ -295,7 +295,7 @@ export struct MorningEveningPaperComponent { @@ -295,7 +295,7 @@ export struct MorningEveningPaperComponent {
295 topPaperTitle(){ 295 topPaperTitle(){
296 Column(){ 296 Column(){
297 PaperTitleComponent().margin({top:this.topSafeHeight}) 297 PaperTitleComponent().margin({top:this.topSafeHeight})
298 - }.height(44+this.topSafeHeight).backgroundColor(this.scrollOffset > 100?this.mixedBgColor:'') 298 + }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
299 } 299 }
300 300
301 @Builder 301 @Builder
@@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean'; @@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean';
3 import { BreakpointConstants } from 'wdConstant'; 3 import { BreakpointConstants } from 'wdConstant';
4 import { Logger } from 'wdKit'; 4 import { Logger } from 'wdKit';
5 import { PaperSingleColumn999CardView } from '../page/CardView'; 5 import { PaperSingleColumn999CardView } from '../page/CardView';
6 -import { EmptyComponent } from '../view/EmptyComponent'; 6 +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent';
7 7
8 const TAG = 'SingleColumn999Component'; 8 const TAG = 'SingleColumn999Component';
9 9
@@ -153,9 +153,8 @@ export struct SingleColumn999Component { @@ -153,9 +153,8 @@ export struct SingleColumn999Component {
153 }) 153 })
154 } else { 154 } else {
155 if (this.compListItem && this.compListItem?.operDataList) { 155 if (this.compListItem && this.compListItem?.operDataList) {
156 - EmptyComponent({ emptyHeight: 200 }) 156 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent})
157 } 157 }
158 -  
159 } 158 }
160 } 159 }
161 160
@@ -75,7 +75,7 @@ export struct topicInfoView { @@ -75,7 +75,7 @@ export struct topicInfoView {
75 left: { anchor: "__container__", align: HorizontalAlign.Start }, 75 left: { anchor: "__container__", align: HorizontalAlign.Start },
76 bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom } 76 bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom }
77 }) 77 })
78 - .margin({ left: 16, right: 16 }) 78 + .margin({ left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0?0:16})
79 .id('txt_summary') 79 .id('txt_summary')
80 80
81 Text(this.frontLinkObject?.title ?? "") 81 Text(this.frontLinkObject?.title ?? "")
@@ -41,7 +41,8 @@ export class publishCommentModel { @@ -41,7 +41,8 @@ export class publishCommentModel {
41 41
42 //最新发布的评论 42 //最新发布的评论
43 lastCommentModel: commentItemModel = new commentItemModel() 43 lastCommentModel: commentItemModel = new commentItemModel()
44 - 44 + pageId: string = ''
  45 + pageName: string = ''
45 46
46 } 47 }
47 48
@@ -16,7 +16,7 @@ const TAG = 'CommentComponent'; @@ -16,7 +16,7 @@ const TAG = 'CommentComponent';
16 16
17 17
18 const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸' 18 const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸'
19 - 19 +//评论组件
20 // @Entry 20 // @Entry
21 @Preview 21 @Preview
22 @Component 22 @Component
@@ -6,6 +6,7 @@ import { @@ -6,6 +6,7 @@ import {
6 import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; 6 import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index';
7 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 7 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
8 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 8 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  9 +import { TrackConstants, TrackingContent } from 'wdTracking/Index';
9 import { 10 import {
10 commentItemModel, 11 commentItemModel,
11 commentListModel, 12 commentListModel,
@@ -16,7 +17,7 @@ import { @@ -16,7 +17,7 @@ import {
16 import { publishCommentModel } from '../model/PublishCommentModel'; 17 import { publishCommentModel } from '../model/PublishCommentModel';
17 18
18 const TAG = "CommentViewModel" 19 const TAG = "CommentViewModel"
19 - 20 +//评论model
20 class CommentViewModel { 21 class CommentViewModel {
21 private static instance: CommentViewModel 22 private static instance: CommentViewModel
22 23
@@ -166,9 +167,9 @@ class CommentViewModel { @@ -166,9 +167,9 @@ class CommentViewModel {
166 return new Promise<commentItemModel>((success, fail) => { 167 return new Promise<commentItemModel>((success, fail) => {
167 const visitorMode = model.visitorComment == "1" && HttpUtils.isLogin() == false 168 const visitorMode = model.visitorComment == "1" && HttpUtils.isLogin() == false
168 let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl() 169 let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl()
169 - 170 + let pageId = model.pageId;
  171 + let pageName = model.pageName;
170 let bean: Record<string, string> = {}; 172 let bean: Record<string, string> = {};
171 -  
172 bean['targetId'] = model.targetId; 173 bean['targetId'] = model.targetId;
173 bean['targetRelId'] = model.targetRelId; 174 bean['targetRelId'] = model.targetRelId;
174 bean['commentType'] = model.commentType; 175 bean['commentType'] = model.commentType;
@@ -188,6 +189,11 @@ class CommentViewModel { @@ -188,6 +189,11 @@ class CommentViewModel {
188 } 189 }
189 190
190 HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { 191 HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
  192 + // fixme 埋点 评论发布点击
  193 + TrackingContent.commentClick(pageId,pageName
  194 + ,{
  195 + 'duration':0,
  196 + })
191 if (data.code != 0) { 197 if (data.code != 0) {
192 ToastUtils.showToast(data.message, 1000); 198 ToastUtils.showToast(data.message, 1000);
193 fail() 199 fail()
@@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI { @@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI {
16 Grid(){ 16 Grid(){
17 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ 17 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{
18 GridItem(){ 18 GridItem(){
19 - PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true}) 19 + PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true})
20 }.onClick(()=>{ 20 }.onClick(()=>{
21 console.log(index+"") 21 console.log(index+"")
22 switch (item.msg){ 22 switch (item.msg){
@@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI { @@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI {
77 break; 77 break;
78 } 78 }
79 } 79 }
80 - }).width('169lpx') 80 + }).width('142lpx')
81 .height('117lpx') 81 .height('117lpx')
82 }) 82 })
83 } 83 }
84 - .rowsTemplate('1fr 1fr')  
85 - .columnsTemplate('1fr 1fr 1fr 1fr')  
86 - .height('234lpx')  
87 - .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) 84 + .rowsTemplate('1fr')
  85 + .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
  86 + .height('117lpx')
  87 + .margin({top:'31lpx'})
88 } 88 }
89 89
90 messageClick(){ 90 messageClick(){
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 "wdConstant": "file:../../commons/wdConstant", 16 "wdConstant": "file:../../commons/wdConstant",
17 "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", 17 "wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
18 "wdComponent": "file:../../features/wdComponent", 18 "wdComponent": "file:../../features/wdComponent",
19 - "wdShare": "file:../../features/wdShare" 19 + "wdShare": "file:../../features/wdShare",
  20 + "wdTracking": "file:../../features/wdTracking"
20 } 21 }
21 } 22 }
@@ -8,6 +8,8 @@ import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentD @@ -8,6 +8,8 @@ import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentD
8 import { DisplayDirection } from 'wdConstant/Index'; 8 import { DisplayDirection } from 'wdConstant/Index';
9 import { window } from '@kit.ArkUI'; 9 import { window } from '@kit.ArkUI';
10 import { EmptyComponent } from 'wdComponent/Index'; 10 import { EmptyComponent } from 'wdComponent/Index';
  11 +import { DateTimeUtils } from 'wdKit/Index';
  12 +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
11 13
12 const storage = LocalStorage.getShared(); 14 const storage = LocalStorage.getShared();
13 const TAG = 'DetailVideoListPage' 15 const TAG = 'DetailVideoListPage'
@@ -33,6 +35,8 @@ export struct DetailVideoListPage { @@ -33,6 +35,8 @@ export struct DetailVideoListPage {
33 @State currentIndex: number = 0 35 @State currentIndex: number = 0
34 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 36 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
35 @State interactDataList: InteractDataDTO[] = [] 37 @State interactDataList: InteractDataDTO[] = []
  38 + pageShowTime:number = 0;
  39 + pageHideTime:number = 0;
36 40
37 async aboutToAppear(): Promise<void> { 41 async aboutToAppear(): Promise<void> {
38 // 注册监听网络连接 42 // 注册监听网络连接
@@ -70,12 +74,18 @@ export struct DetailVideoListPage { @@ -70,12 +74,18 @@ export struct DetailVideoListPage {
70 this.switchVideoStatus = true 74 this.switchVideoStatus = true
71 this.openFullScreen() 75 this.openFullScreen()
72 76
  77 + this.pageShowTime = DateTimeUtils.getTimeStamp()
73 } 78 }
74 79
75 onPageHide(): void { 80 onPageHide(): void {
76 console.log(TAG, 'onPageHide') 81 console.log(TAG, 'onPageHide')
77 this.switchVideoStatus = false 82 this.switchVideoStatus = false
78 this.closeFullScreen() 83 this.closeFullScreen()
  84 +
  85 + this.pageHideTime = DateTimeUtils.getTimeStamp()
  86 + let duration = 0
  87 + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
  88 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
79 } 89 }
80 90
81 /** 91 /**
@@ -14,6 +14,8 @@ import { PictureLoading } from './PictureLoading'; @@ -14,6 +14,8 @@ import { PictureLoading } from './PictureLoading';
14 import { DisplayDirection } from 'wdConstant/Index'; 14 import { DisplayDirection } from 'wdConstant/Index';
15 import { window } from '@kit.ArkUI'; 15 import { window } from '@kit.ArkUI';
16 import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; 16 import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
  17 +import { DateTimeUtils } from 'wdKit/Index';
  18 +import {TrackConstants,TrackingPageBrowse } from 'wdTracking/Index';
17 19
18 interface loadMoreData { 20 interface loadMoreData {
19 pageNum: number; 21 pageNum: number;
@@ -59,6 +61,8 @@ export struct VideoChannelDetail { @@ -59,6 +61,8 @@ export struct VideoChannelDetail {
59 @State totalCount: number = 0 61 @State totalCount: number = 0
60 @State isMouted: boolean = false 62 @State isMouted: boolean = false
61 @State isRequestError: boolean = false 63 @State isRequestError: boolean = false
  64 + pageShowTime:number = 0;
  65 + pageHideTime:number = 0;
62 66
63 autoRefreshChange() { 67 autoRefreshChange() {
64 if (this.topNavIndex === 0) { 68 if (this.topNavIndex === 0) {
@@ -78,12 +82,21 @@ export struct VideoChannelDetail { @@ -78,12 +82,21 @@ export struct VideoChannelDetail {
78 this.switchVideoStatus = true 82 this.switchVideoStatus = true
79 this.openFullScreen() 83 this.openFullScreen()
80 } 84 }
  85 +
  86 + this.pageShowTime = DateTimeUtils.getTimeStamp()
  87 + console.log(TAG, '一级视频显示')
81 } 88 }
82 89
83 pageHideChange() { 90 pageHideChange() {
84 this.barBackgroundColor = Color.Transparent 91 this.barBackgroundColor = Color.Transparent
85 this.switchVideoStatus = false 92 this.switchVideoStatus = false
86 this.closeFullScreen() 93 this.closeFullScreen()
  94 +
  95 + console.log(TAG, '一级视频隐藏')
  96 + this.pageHideTime = DateTimeUtils.getTimeStamp()
  97 + let duration = 0
  98 + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
  99 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
87 } 100 }
88 101
89 /** 102 /**
@@ -255,7 +268,6 @@ export struct VideoChannelDetail { @@ -255,7 +268,6 @@ export struct VideoChannelDetail {
255 }) 268 })
256 } 269 }
257 } 270 }
258 -  
259 build() { 271 build() {
260 Column() { 272 Column() {
261 if (this.isRequestError) { 273 if (this.isRequestError) {
@@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
14 import { DisplayDirection, SpConstants } from 'wdConstant/Index' 14 import { DisplayDirection, SpConstants } from 'wdConstant/Index'
15 import { WDShare } from "wdShare" 15 import { WDShare } from "wdShare"
16 import { publishCommentModel } from 'wdComponent/Index'; 16 import { publishCommentModel } from 'wdComponent/Index';
  17 +import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
17 18
18 interface ILikeStyleResp { 19 interface ILikeStyleResp {
19 url: Resource; 20 url: Resource;
@@ -37,16 +38,44 @@ export struct PlayerRightView { @@ -37,16 +38,44 @@ export struct PlayerRightView {
37 @Consume showCommentList: boolean 38 @Consume showCommentList: boolean
38 @Consume displayDirection: DisplayDirection 39 @Consume displayDirection: DisplayDirection
39 @Consume publishCommentModel: publishCommentModel 40 @Consume publishCommentModel: publishCommentModel
40 - @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 41 + // @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
41 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 42 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
  43 + @State likesStyle: number | string = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
  44 + pageParam: ParamType = {}
  45 + PageName: string = ''
  46 + followUserId: string = ''
  47 + followUserName: string = ''
  48 +
42 aboutToAppear() { 49 aboutToAppear() {
43 // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 50 // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
44 this.likesStyle = this.contentDetailData.likesStyle 51 this.likesStyle = this.contentDetailData.likesStyle
45 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false 52 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
46 // console.log(TAG, 'this.likesStyle', this.likesStyle) 53 // console.log(TAG, 'this.likesStyle', this.likesStyle)
47 // console.log(TAG, 'this.openLikes', this.openLikes) 54 // console.log(TAG, 'this.openLikes', this.openLikes)
  55 + this.contentTrackingDict()
  56 + }
  57 + contentTrackingDict(){
  58 + this.pageParam = {
  59 + 'contentType': `${this.contentDetailData.newsType}`,
  60 + 'contentId': `${this.contentDetailData.newsId}`,
  61 + 'contentName': `${this.contentDetailData.newsTitle || ''}`,
  62 + }
  63 + if(this.contentDetailData.newsType == 1) {
  64 + this.PageName = TrackConstants.PageName.VideoDetail // 点播
  65 + } else if(this.contentDetailData.newsType == 2) {
  66 + this.PageName = TrackConstants.PageName.Live_Detail // 直播
  67 + } else if(this.contentDetailData.newsType == 5) {
  68 + this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
  69 + } else if(this.contentDetailData.newsType == 8) {
  70 + this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
  71 + } else if(this.contentDetailData.newsType == 9) {
  72 + this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
  73 + } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
  74 + this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
  75 + }
  76 + this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || ''
  77 + this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || ''
48 } 78 }
49 -  
50 /** 79 /**
51 * 点赞、取消点赞 80 * 点赞、取消点赞
52 */ 81 */
@@ -76,8 +105,12 @@ export struct PlayerRightView { @@ -76,8 +105,12 @@ export struct PlayerRightView {
76 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 105 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
77 if (this.newsStatusOfUser.likeStatus == '1') { 106 if (this.newsStatusOfUser.likeStatus == '1') {
78 this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 107 this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
  108 + TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
  109 + console.log(TAG, '点赞')
79 } else { 110 } else {
80 this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) 111 this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1)
  112 + TrackingContent.like(false,this.PageName,this.PageName,this.pageParam)
  113 + console.log(TAG, '取消点赞')
81 } 114 }
82 console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) 115 console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
83 // this.queryContentInteractCount() 116 // this.queryContentInteractCount()
@@ -112,8 +145,12 @@ export struct PlayerRightView { @@ -112,8 +145,12 @@ export struct PlayerRightView {
112 // this.queryContentInteractCount() 145 // this.queryContentInteractCount()
113 if (this.newsStatusOfUser.collectStatus === 1) { 146 if (this.newsStatusOfUser.collectStatus === 1) {
114 this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 147 this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1
  148 + TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam)
  149 + console.log(TAG, '收藏')
115 } else { 150 } else {
116 this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) 151 this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1)
  152 + TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam)
  153 + console.log(TAG, '取消收藏')
117 } 154 }
118 console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) 155 console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum)
119 } 156 }
@@ -175,6 +212,8 @@ export struct PlayerRightView { @@ -175,6 +212,8 @@ export struct PlayerRightView {
175 ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); 212 ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000);
176 } 213 }
177 }) 214 })
  215 + console.log(TAG, '关注号主')
  216 + TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
178 } 217 }
179 }) 218 })
180 } 219 }
@@ -3,6 +3,7 @@ import { TrackConstants } from "../common/TrackConstants" @@ -3,6 +3,7 @@ import { TrackConstants } from "../common/TrackConstants"
3 import { TrackingUtils } from '../common/TrackingUtils' 3 import { TrackingUtils } from '../common/TrackingUtils'
4 import { Tracking } from './Tracking' 4 import { Tracking } from './Tracking'
5 import { PointerMatrix } from '@kit.TestKit' 5 import { PointerMatrix } from '@kit.TestKit'
  6 +import { StringUtils } from 'wdKit/Index'
6 7
7 export class TrackingContent { 8 export class TrackingContent {
8 9
@@ -86,10 +87,10 @@ export class TrackingContent { @@ -86,10 +87,10 @@ export class TrackingContent {
86 } 87 }
87 88
88 static commentClick(pageId: string, pageName: string, extParams?: ParamType) { 89 static commentClick(pageId: string, pageName: string, extParams?: ParamType) {
89 - TrackingContent.commentClickWithEvent("content_comment_click",pageId,pageName,extParams); 90 + TrackingContent.clickWithEventAction("content_comment_click",pageId,pageName,TrackConstants.ActionType.Comment,extParams);
90 } 91 }
91 92
92 - static commentClickWithEvent(event: string,pageId: string, pageName: string, extParams?: ParamType) { 93 + static clickWithEventAction(event: string,pageId: string, pageName: string,action: string, extParams?: ParamType) {
93 let params = TrackingUtils.generateParams(extParams) 94 let params = TrackingUtils.generateParams(extParams)
94 if (pageId.length) { 95 if (pageId.length) {
95 params["pageId"] = pageId 96 params["pageId"] = pageId
@@ -97,11 +98,17 @@ export class TrackingContent { @@ -97,11 +98,17 @@ export class TrackingContent {
97 if (pageName.length) { 98 if (pageName.length) {
98 params["pageName"] = pageName 99 params["pageName"] = pageName
99 } 100 }
100 - params["action"] =TrackConstants.ActionType.Comment 101 + if(!StringUtils.isEmpty(action)){
  102 + params["action"] =action
  103 + }
101 TrackingUtils.fillPositionWith(params) 104 TrackingUtils.fillPositionWith(params)
102 Tracking.event(event, params) 105 Tracking.event(event, params)
103 } 106 }
104 107
  108 + static clickWithEvent(event: string,pageId: string, pageName: string,extParams?: ParamType) {
  109 + TrackingContent.clickWithEventAction(event,pageId,pageName,'',extParams);
  110 + }
  111 +
105 static commentShare(pageId: string, pageName: string, extParams?: ParamType) { 112 static commentShare(pageId: string, pageName: string, extParams?: ParamType) {
106 113
107 } 114 }