Showing
1 changed file
with
12 additions
and
1 deletions
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | -import { NetworkUtil, StringUtils } from 'wdKit'; | 2 | +import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | import { editModelParams } from '../model/EditInfoModel'; | 4 | import { editModelParams } from '../model/EditInfoModel'; |
| 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; | 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; |
| @@ -7,6 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB | @@ -7,6 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB | ||
| 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; | 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; |
| 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; | 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; |
| 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; |
| 10 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 10 | 11 | ||
| 11 | const TAG = "MineHomePage" | 12 | const TAG = "MineHomePage" |
| 12 | 13 | ||
| @@ -37,8 +38,11 @@ struct MineHomePage { | @@ -37,8 +38,11 @@ struct MineHomePage { | ||
| 37 | @State isCommentEnter:string = ""; | 38 | @State isCommentEnter:string = ""; |
| 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 39 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 39 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 40 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 41 | + pageShowTime:number = 0; | ||
| 42 | + pageHideTime:number = 0; | ||
| 40 | 43 | ||
| 41 | onPageShow(): void { | 44 | onPageShow(): void { |
| 45 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 42 | this.getUserInfo() | 46 | this.getUserInfo() |
| 43 | 47 | ||
| 44 | let intervalID = setInterval(() => { | 48 | let intervalID = setInterval(() => { |
| @@ -50,6 +54,13 @@ struct MineHomePage { | @@ -50,6 +54,13 @@ struct MineHomePage { | ||
| 50 | }, 200); | 54 | }, 200); |
| 51 | } | 55 | } |
| 52 | 56 | ||
| 57 | + onPageHide(): void { | ||
| 58 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 59 | + let duration = 0 | ||
| 60 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 61 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,duration) | ||
| 62 | + } | ||
| 63 | + | ||
| 53 | build() { | 64 | build() { |
| 54 | if(this.isConnectNetwork){ | 65 | if(this.isConnectNetwork){ |
| 55 | Stack({ alignContent: Alignment.Top }){ | 66 | Stack({ alignContent: Alignment.Top }){ |
-
Please register or login to post a comment