张善主

Merge remote-tracking branch 'origin/main'

@@ -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
@@ -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 ?? "")
@@ -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 }