Showing
3 changed files
with
48 additions
and
0 deletions
| @@ -16,6 +16,8 @@ import { Card19Component } from './cardview/Card19Component'; | @@ -16,6 +16,8 @@ import { Card19Component } from './cardview/Card19Component'; | ||
| 16 | import { Card20Component } from './cardview/Card20Component'; | 16 | import { Card20Component } from './cardview/Card20Component'; |
| 17 | import { Card21Component } from './cardview/Card21Component'; | 17 | import { Card21Component } from './cardview/Card21Component'; |
| 18 | import { SearchContentComponent } from './cardview/SearchContentComponent'; | 18 | import { SearchContentComponent } from './cardview/SearchContentComponent'; |
| 19 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 20 | +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| 21 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle | 23 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle |
| @@ -27,6 +29,20 @@ export struct CardParser { | @@ -27,6 +29,20 @@ export struct CardParser { | ||
| 27 | @State pageName: string = ''; | 29 | @State pageName: string = ''; |
| 28 | @State contentDTO: ContentDTO = new ContentDTO(); | 30 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 29 | @ObjectLink compDTO: CompDTO | 31 | @ObjectLink compDTO: CompDTO |
| 32 | + pageShowTime:number = 0; | ||
| 33 | + pageHideTime:number = 0; | ||
| 34 | + | ||
| 35 | + onPageShow() { | ||
| 36 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + //内容浏览Tracking | ||
| 40 | + onPageHide(): void { | ||
| 41 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 42 | + let duration = 0 | ||
| 43 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 44 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 45 | + } | ||
| 30 | 46 | ||
| 31 | build() { | 47 | build() { |
| 32 | this.contentBuilder(this.contentDTO); | 48 | this.contentBuilder(this.contentDTO); |
| @@ -33,6 +33,7 @@ import { HttpUtils } from 'wdNetwork/Index'; | @@ -33,6 +33,7 @@ import { HttpUtils } from 'wdNetwork/Index'; | ||
| 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 34 | import { common } from '@kit.AbilityKit'; | 34 | import { common } from '@kit.AbilityKit'; |
| 35 | import { componentUtils, window } from '@kit.ArkUI'; | 35 | import { componentUtils, window } from '@kit.ArkUI'; |
| 36 | +import { TrackConstants, TrackingButton, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 36 | 37 | ||
| 37 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 38 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 38 | 39 | ||
| @@ -62,6 +63,20 @@ export struct ImageAndTextPageComponent { | @@ -62,6 +63,20 @@ export struct ImageAndTextPageComponent { | ||
| 62 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 63 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 63 | @State isScrollTop: boolean = true | 64 | @State isScrollTop: boolean = true |
| 64 | @State offsetY: number = 0 | 65 | @State offsetY: number = 0 |
| 66 | + pageShowTime:number = 0; | ||
| 67 | + pageHideTime:number = 0; | ||
| 68 | + | ||
| 69 | + onPageShow() { | ||
| 70 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + //内容浏览Tracking | ||
| 74 | + onPageHide(): void { | ||
| 75 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 76 | + let duration = 0 | ||
| 77 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 78 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 79 | + } | ||
| 65 | 80 | ||
| 66 | build() { | 81 | build() { |
| 67 | Stack({ alignContent: Alignment.Top }) { | 82 | Stack({ alignContent: Alignment.Top }) { |
| @@ -359,6 +374,8 @@ export struct ImageAndTextPageComponent { | @@ -359,6 +374,8 @@ export struct ImageAndTextPageComponent { | ||
| 359 | PageRepository.postExecuteLike(params).then(res => { | 374 | PageRepository.postExecuteLike(params).then(res => { |
| 360 | console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) | 375 | console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) |
| 361 | if (this.newsStatusOfUser) { | 376 | if (this.newsStatusOfUser) { |
| 377 | + //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 378 | + TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 362 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 379 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 363 | this.queryContentInteractCount() | 380 | this.queryContentInteractCount() |
| 364 | } | 381 | } |
| @@ -6,6 +6,7 @@ import { Notes } from './notes'; | @@ -6,6 +6,7 @@ import { Notes } from './notes'; | ||
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 时间链卡--CompStyle: 09 | 12 | * 时间链卡--CompStyle: 09 |
| @@ -24,6 +25,20 @@ export struct Card9Component { | @@ -24,6 +25,20 @@ export struct Card9Component { | ||
| 24 | @State str01: string = ''; | 25 | @State str01: string = ''; |
| 25 | @State str02: string = ''; | 26 | @State str02: string = ''; |
| 26 | @State str03: string = ''; | 27 | @State str03: string = ''; |
| 28 | + pageShowTime:number = 0; | ||
| 29 | + pageHideTime:number = 0; | ||
| 30 | + | ||
| 31 | + onPageShow() { | ||
| 32 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + //内容浏览Tracking | ||
| 36 | + onPageHide(): void { | ||
| 37 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 38 | + let duration = 0 | ||
| 39 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 40 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 41 | + } | ||
| 27 | 42 | ||
| 28 | async aboutToAppear(): Promise<void> { | 43 | async aboutToAppear(): Promise<void> { |
| 29 | console.log('Card9Component', JSON.stringify(this.contentDTO)) | 44 | console.log('Card9Component', JSON.stringify(this.contentDTO)) |
-
Please register or login to post a comment