Showing
2 changed files
with
46 additions
and
17 deletions
| 1 | -import ArrayList from '@ohos.util.ArrayList' | ||
| 2 | import { MineSettingComponent } from '../setting/MineSettingComponent'; | 1 | import { MineSettingComponent } from '../setting/MineSettingComponent'; |
| 3 | import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | 2 | import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; |
| 4 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 5 | -import { Action, Params } from 'wdBean'; | 4 | +import { Params } from 'wdBean'; |
| 6 | import { DateTimeUtils } from 'wdKit/Index'; | 5 | import { DateTimeUtils } from 'wdKit/Index'; |
| 7 | -import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; | 6 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; |
| 8 | 7 | ||
| 9 | @Entry | 8 | @Entry |
| 10 | @Component | 9 | @Component |
| 11 | struct SettingPage { | 10 | struct SettingPage { |
| 12 | - @State message: string = 'Hello World 02' | ||
| 13 | @State pageType: string = 'mainSetting'; | 11 | @State pageType: string = 'mainSetting'; |
| 14 | @State params:Params = router.getParams() as Params; | 12 | @State params:Params = router.getParams() as Params; |
| 15 | @State enterActivityTime:number = 0; | 13 | @State enterActivityTime:number = 0; |
| 14 | + @Provide pageShow: number = -1 | ||
| 15 | + @Provide pageHide: number = -1 | ||
| 16 | 16 | ||
| 17 | pageShowSettingTime:number = 0; | 17 | pageShowSettingTime:number = 0; |
| 18 | pageHideSettingTime:number = 0; | 18 | pageHideSettingTime:number = 0; |
| 19 | - pageShowAccountTime:number = 0; | ||
| 20 | - pageHideAccountTime:number = 0; | 19 | + |
| 21 | 20 | ||
| 22 | onPageShow() { | 21 | onPageShow() { |
| 22 | + this.pageShow = Math.random() | ||
| 23 | + | ||
| 23 | this.pageType = this.params.pageID; | 24 | this.pageType = this.params.pageID; |
| 24 | this.enterActivityTime = DateTimeUtils.getTimeStamp() | 25 | this.enterActivityTime = DateTimeUtils.getTimeStamp() |
| 25 | if (this.pageType == 'mainSetting'){ | 26 | if (this.pageType == 'mainSetting'){ |
| 26 | this.pageShowSettingTime = DateTimeUtils.getTimeStamp() | 27 | this.pageShowSettingTime = DateTimeUtils.getTimeStamp() |
| 27 | - }else{ | ||
| 28 | - this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 29 | } | 28 | } |
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | onPageHide(): void { | 31 | onPageHide(): void { |
| 32 | + this.pageHide = Math.random() | ||
| 33 | if (this.pageType == 'mainSetting'){ | 33 | if (this.pageType == 'mainSetting'){ |
| 34 | this.pageHideSettingTime = DateTimeUtils.getTimeStamp() | 34 | this.pageHideSettingTime = DateTimeUtils.getTimeStamp() |
| 35 | - }else{ | ||
| 36 | - this.pageHideAccountTime = DateTimeUtils.getTimeStamp() | ||
| 37 | } | 35 | } |
| 38 | 36 | ||
| 39 | let duration = 0 | 37 | let duration = 0 |
| 40 | if(this.pageType == 'mainSetting'){ | 38 | if(this.pageType == 'mainSetting'){ |
| 41 | duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) | 39 | duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) |
| 42 | - }else{ | ||
| 43 | - duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000) | ||
| 44 | } | 40 | } |
| 45 | if(this.pageType == 'mainSetting'){ | 41 | if(this.pageType == 'mainSetting'){ |
| 46 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) | 42 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) |
| 47 | - }else{ | ||
| 48 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration) | ||
| 49 | } | 43 | } |
| 50 | } | 44 | } |
| 51 | 45 |
| 1 | import { SpConstants } from 'wdConstant'; | 1 | import { SpConstants } from 'wdConstant'; |
| 2 | -import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 2 | +import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit'; |
| 3 | import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem'; | 3 | import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem'; |
| 4 | import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | 4 | import MineSettingDatasModel from '../../model/MineSettingDatasModel'; |
| 5 | import router from '@ohos.router'; | 5 | import router from '@ohos.router'; |
| @@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; | @@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; | ||
| 11 | import { CustomLogoutDialog } from './CustomLogoutDialog'; | 11 | import { CustomLogoutDialog } from './CustomLogoutDialog'; |
| 12 | import { emitter } from '@kit.BasicServicesKit'; | 12 | import { emitter } from '@kit.BasicServicesKit'; |
| 13 | import { ConfirmLogoutDialog } from './ConfirmLogoutDialog'; | 13 | import { ConfirmLogoutDialog } from './ConfirmLogoutDialog'; |
| 14 | -import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 14 | +import { TrackingButton, TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 15 | export { SettingPasswordParams } from "wdLogin" | 15 | export { SettingPasswordParams } from "wdLogin" |
| 16 | 16 | ||
| 17 | @Component | 17 | @Component |
| @@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout { | @@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout { | ||
| 22 | @State protocolState: boolean = false //协议勾选状态 | 22 | @State protocolState: boolean = false //协议勾选状态 |
| 23 | @State isAccountPage: boolean = true | 23 | @State isAccountPage: boolean = true |
| 24 | @State ifSetPassword: boolean = false //是否设置过密码 | 24 | @State ifSetPassword: boolean = false //是否设置过密码 |
| 25 | + @Consume pageShow :number | ||
| 26 | + @Consume @Watch('pageHideForUpdateData') pageHide :number | ||
| 25 | 27 | ||
| 26 | @Watch("checkSetPassword") @Prop enterActivityTime:number = 0; | 28 | @Watch("checkSetPassword") @Prop enterActivityTime:number = 0; |
| 29 | + logoutLayoutShowTime:number = 0; | ||
| 30 | + logoutLayoutHideTime:number = 0; | ||
| 31 | + pageShowAccountTime:number = 0; | ||
| 32 | + pageHideAccountTime:number = 0; | ||
| 33 | + | ||
| 34 | + //注销账户 浏览埋点 | ||
| 35 | + logoutLayoutHide(){ | ||
| 36 | + this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp() | ||
| 37 | + let duration = 0 | ||
| 38 | + duration = Math.floor((this.logoutLayoutHideTime - this.logoutLayoutShowTime)/1000) | ||
| 39 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account,duration) | ||
| 40 | + } | ||
| 41 | + //账户管理 浏览埋点 | ||
| 42 | + logoutLayoutHide2(){ | ||
| 43 | + this.pageHideAccountTime = DateTimeUtils.getTimeStamp() | ||
| 44 | + let duration = 0 | ||
| 45 | + duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000) | ||
| 46 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration) | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + pageHideForUpdateData(){ | ||
| 50 | + if(!this.isAccountPage){ | ||
| 51 | + this.logoutLayoutHide() | ||
| 52 | + }else{ | ||
| 53 | + this.logoutLayoutHide2() | ||
| 54 | + } | ||
| 55 | + } | ||
| 27 | 56 | ||
| 28 | logoutViewModel = new LogoutViewModel() | 57 | logoutViewModel = new LogoutViewModel() |
| 29 | dialogController: CustomDialogController = new CustomDialogController({ | 58 | dialogController: CustomDialogController = new CustomDialogController({ |
| @@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout { | @@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout { | ||
| 57 | 86 | ||
| 58 | 87 | ||
| 59 | aboutToAppear() { | 88 | aboutToAppear() { |
| 89 | + this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 60 | // 获取设置页面数据 | 90 | // 获取设置页面数据 |
| 61 | this.getAccountAndSecurityData() | 91 | this.getAccountAndSecurityData() |
| 62 | this.addEmitEvent() | 92 | this.addEmitEvent() |
| @@ -189,7 +219,7 @@ export struct AccountAndSecurityLayout { | @@ -189,7 +219,7 @@ export struct AccountAndSecurityLayout { | ||
| 189 | }else if (index == 3) { | 219 | }else if (index == 3) { |
| 190 | trackButtonClick("accountManagementPageAccountCancellation") | 220 | trackButtonClick("accountManagementPageAccountCancellation") |
| 191 | this.isAccountPage=false | 221 | this.isAccountPage=false |
| 192 | - // WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) | 222 | + this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp() |
| 193 | } | 223 | } |
| 194 | }) | 224 | }) |
| 195 | 225 | ||
| @@ -253,6 +283,8 @@ export struct AccountAndSecurityLayout { | @@ -253,6 +283,8 @@ export struct AccountAndSecurityLayout { | ||
| 253 | }) | 283 | }) |
| 254 | .onClick(() => { | 284 | .onClick(() => { |
| 255 | this.isAccountPage=true | 285 | this.isAccountPage=true |
| 286 | + this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 287 | + this.logoutLayoutHide() | ||
| 256 | this.protocolState=false | 288 | this.protocolState=false |
| 257 | }) | 289 | }) |
| 258 | .id('backImage') | 290 | .id('backImage') |
| @@ -330,6 +362,7 @@ export struct AccountAndSecurityLayout { | @@ -330,6 +362,7 @@ export struct AccountAndSecurityLayout { | ||
| 330 | Text() { | 362 | Text() { |
| 331 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) | 363 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) |
| 332 | Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => { | 364 | Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 365 | + TrackingButton.click("cancelAccountPageUserLogoffAgreement",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | ||
| 333 | let bean = { contentID: "3", pageID: "" } as Params | 366 | let bean = { contentID: "3", pageID: "" } as Params |
| 334 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 367 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 335 | }) | 368 | }) |
| @@ -351,6 +384,7 @@ export struct AccountAndSecurityLayout { | @@ -351,6 +384,7 @@ export struct AccountAndSecurityLayout { | ||
| 351 | if (!this.protocolState) { | 384 | if (!this.protocolState) { |
| 352 | return | 385 | return |
| 353 | } | 386 | } |
| 387 | + TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | ||
| 354 | this.dialogController.open() | 388 | this.dialogController.open() |
| 355 | 389 | ||
| 356 | }) | 390 | }) |
| @@ -454,6 +488,7 @@ export struct AccountAndSecurityLayout { | @@ -454,6 +488,7 @@ export struct AccountAndSecurityLayout { | ||
| 454 | 488 | ||
| 455 | //注销账号 | 489 | //注销账号 |
| 456 | requestLogout() { | 490 | requestLogout() { |
| 491 | + TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | ||
| 457 | this.logoutViewModel.requestLogout().then(()=>{ | 492 | this.logoutViewModel.requestLogout().then(()=>{ |
| 458 | ToastUtils.shortToast("注销成功") | 493 | ToastUtils.shortToast("注销成功") |
| 459 | router.back() | 494 | router.back() |
-
Please register or login to post a comment