yangchenggong1_wd

desc:埋点[登录页 - 获取验证码点击]

@@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String
2 import router from '@ohos.router' 2 import router from '@ohos.router'
3 import { LoginViewModel } from './LoginViewModel' 3 import { LoginViewModel } from './LoginViewModel'
4 import { LoginInputComponent } from './LoginInputComponent' 4 import { LoginInputComponent } from './LoginInputComponent'
5 -import { ErrorToastUtils, SPHelper } from 'wdKit'  
6 import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; 5 import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage';
7 import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; 6 import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
8 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' 7 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'
9 import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' 8 import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
10 -import HuaweiAuth from '../../utils/HuaweiAuth'  
11 -import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent'  
12 -import { BusinessError } from '@ohos.base'  
13 -import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index' 9 +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'
14 10
15 @Extend(Row) 11 @Extend(Row)
16 function otherStyle() { 12 function otherStyle() {
@@ -43,7 +39,6 @@ struct LoginPage { @@ -43,7 +39,6 @@ struct LoginPage {
43 @State isSubmit: boolean = false 39 @State isSubmit: boolean = false
44 @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 40 @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录
45 @State passwordSwitch: boolean = true //密码显示 41 @State passwordSwitch: boolean = true //密码显示
46 - // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录  
47 lastTime: number = 0 42 lastTime: number = 0
48 @State codeStateSuccess:boolean=false 43 @State codeStateSuccess:boolean=false
49 @State toastText:string = "" 44 @State toastText:string = ""
@@ -64,6 +59,7 @@ struct LoginPage { @@ -64,6 +59,7 @@ struct LoginPage {
64 onCodeSend() { 59 onCodeSend() {
65 Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "") 60 Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
66 if (this.isCodeSend) { 61 if (this.isCodeSend) {
  62 + TrackingButton.click("loginPageGetVerificationCode",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
67 this.sendVerifyCode() 63 this.sendVerifyCode()
68 } 64 }
69 } 65 }
@@ -81,8 +77,13 @@ struct LoginPage { @@ -81,8 +77,13 @@ struct LoginPage {
81 this.pageHideTime = DateTimeUtils.getTimeStamp() 77 this.pageHideTime = DateTimeUtils.getTimeStamp()
82 let duration = 0 78 let duration = 0
83 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) 79 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
  80 +
  81 + if(this.checkCodePage){
  82 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page,duration)
  83 + }else{
84 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) 84 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
85 } 85 }
  86 + }
86 87
87 build() { 88 build() {
88 Stack() { 89 Stack() {
@@ -289,24 +290,6 @@ struct LoginPage { @@ -289,24 +290,6 @@ struct LoginPage {
289 }.width('100%') 290 }.width('100%')
290 291
291 Row() { 292 Row() {
292 - /*Row() {  
293 - Image($r('app.media.login_wx'))  
294 - .width(20).height(20).onClick(()=>{  
295 - ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK)  
296 - })  
297 - }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat)  
298 - .otherStyle()  
299 -  
300 - Row() {  
301 - Image($r('app.media.login_qq')).size({ width: 20, height: 20 })  
302 - }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)  
303 - .otherStyle()  
304 -  
305 - Row() {  
306 - Image($r('app.media.login_wb')).size({ width: 20, height: 20 })  
307 - }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)  
308 - .otherStyle()*/  
309 -  
310 Row() { 293 Row() {
311 Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) 294 Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
312 .size({ width: "35lpx", height: "35lpx" }) 295 .size({ width: "35lpx", height: "35lpx" })
@@ -320,10 +303,12 @@ struct LoginPage { @@ -320,10 +303,12 @@ struct LoginPage {
320 .lineHeight("38lpx") 303 .lineHeight("38lpx")
321 } 304 }
322 .onClick(() => { 305 .onClick(() => {
  306 + this.onPageHide()
323 this.updateAccount() 307 this.updateAccount()
324 - this.checkCodePage = !this.checkCodePage; 308 + this.checkCodePage = !this.checkCodePage
325 this.passwordSwitch = true 309 this.passwordSwitch = true
326 this.isSubmit = false 310 this.isSubmit = false
  311 + this.pageShowTime = DateTimeUtils.getTimeStamp()
327 }).width('100%') 312 }).width('100%')
328 .alignItems(VerticalAlign.Center) 313 .alignItems(VerticalAlign.Center)
329 .justifyContent(FlexAlign.Center) 314 .justifyContent(FlexAlign.Center)