Showing
1 changed file
with
19 additions
and
6 deletions
| 1 | import { SpConstants } from 'wdConstant'; | 1 | import { SpConstants } from 'wdConstant'; |
| 2 | -import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit'; | 2 | +import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils, CustomToast } 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'; |
| @@ -31,6 +31,17 @@ export struct AccountAndSecurityLayout { | @@ -31,6 +31,17 @@ export struct AccountAndSecurityLayout { | ||
| 31 | pageShowAccountTime:number = 0; | 31 | pageShowAccountTime:number = 0; |
| 32 | pageHideAccountTime:number = 0; | 32 | pageHideAccountTime:number = 0; |
| 33 | 33 | ||
| 34 | + @State toastText:string = "" | ||
| 35 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 36 | + builder: CustomToast({ | ||
| 37 | + msg: this.toastText, | ||
| 38 | + }), | ||
| 39 | + autoCancel: false, | ||
| 40 | + alignment: DialogAlignment.Center, | ||
| 41 | + customStyle: true, | ||
| 42 | + maskColor:"#00000000" | ||
| 43 | + }) | ||
| 44 | + | ||
| 34 | //注销账户 浏览埋点 | 45 | //注销账户 浏览埋点 |
| 35 | logoutLayoutHide(){ | 46 | logoutLayoutHide(){ |
| 36 | this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp() | 47 | this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp() |
| @@ -127,9 +138,6 @@ export struct AccountAndSecurityLayout { | @@ -127,9 +138,6 @@ export struct AccountAndSecurityLayout { | ||
| 127 | 138 | ||
| 128 | // 收到eventId为1的事件后执行该回调 | 139 | // 收到eventId为1的事件后执行该回调 |
| 129 | let callback = (eventData: emitter.EventData): void => { | 140 | let callback = (eventData: emitter.EventData): void => { |
| 130 | - // promptAction.showToast({ | ||
| 131 | - // message: JSON.stringify(eventData) | ||
| 132 | - // }); | ||
| 133 | if(eventData&&eventData.data){ | 141 | if(eventData&&eventData.data){ |
| 134 | this.listData[0].subTitle = eventData.data['content'] | 142 | this.listData[0].subTitle = eventData.data['content'] |
| 135 | } | 143 | } |
| @@ -477,11 +485,11 @@ export struct AccountAndSecurityLayout { | @@ -477,11 +485,11 @@ export struct AccountAndSecurityLayout { | ||
| 477 | logout(){ | 485 | logout(){ |
| 478 | let login = new LoginViewModel; | 486 | let login = new LoginViewModel; |
| 479 | login.logOut().then(()=>{ | 487 | login.logOut().then(()=>{ |
| 480 | - promptAction.showToast({ message: '退出登录' }) | 488 | + this.showToastTip('退出登录') |
| 481 | EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) | 489 | EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) |
| 482 | router.back(); | 490 | router.back(); |
| 483 | }).catch((error:string)=>{ | 491 | }).catch((error:string)=>{ |
| 484 | - promptAction.showToast({ message: error }) | 492 | + this.showToastTip(error) |
| 485 | }); | 493 | }); |
| 486 | } | 494 | } |
| 487 | 495 | ||
| @@ -500,6 +508,11 @@ export struct AccountAndSecurityLayout { | @@ -500,6 +508,11 @@ export struct AccountAndSecurityLayout { | ||
| 500 | securityNum = phoneNum.replace(needSecurityString,'****') | 508 | securityNum = phoneNum.replace(needSecurityString,'****') |
| 501 | return securityNum; | 509 | return securityNum; |
| 502 | } | 510 | } |
| 511 | + | ||
| 512 | + showToastTip(msg:string){ | ||
| 513 | + this.toastText = msg | ||
| 514 | + this.dialogToast.open() | ||
| 515 | + } | ||
| 503 | } | 516 | } |
| 504 | 517 | ||
| 505 | @Component | 518 | @Component |
-
Please register or login to post a comment