Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
chengen02
2024-05-25 16:40:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2cf4c547c9603df82eeff3bd4f379924b0cc22d0
2cf4c547
1 parent
73c0947a
-fix 埋点
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
2cf4c54
...
...
@@ -16,6 +16,8 @@ import { Card19Component } from './cardview/Card19Component';
import { Card20Component } from './cardview/Card20Component';
import { Card21Component } from './cardview/Card21Component';
import { SearchContentComponent } from './cardview/SearchContentComponent';
import { DateTimeUtils } from 'wdKit/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
/**
* card适配器,卡片样式汇总,依据ContentDTO#appStyle
...
...
@@ -27,6 +29,20 @@ export struct CardParser {
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
//内容浏览Tracking
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
}
build() {
this.contentBuilder(this.contentDTO);
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
2cf4c54
...
...
@@ -33,6 +33,7 @@ import { HttpUtils } from 'wdNetwork/Index';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { componentUtils, window } from '@kit.ArkUI';
import { TrackConstants, TrackingButton, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
...
...
@@ -62,6 +63,20 @@ export struct ImageAndTextPageComponent {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
//内容浏览Tracking
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
}
build() {
Stack({ alignContent: Alignment.Top }) {
...
...
@@ -359,6 +374,8 @@ export struct ImageAndTextPageComponent {
PageRepository.postExecuteLike(params).then(res => {
console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
this.queryContentInteractCount()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
View file @
2cf4c54
...
...
@@ -6,6 +6,7 @@ import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
/**
* 时间链卡--CompStyle: 09
...
...
@@ -24,6 +25,20 @@ export struct Card9Component {
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
//内容浏览Tracking
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
}
async aboutToAppear(): Promise<void> {
console.log('Card9Component', JSON.stringify(this.contentDTO))
...
...
Please
register
or
login
to post a comment