yangchenggong1_wd

fix:bug[17818] UI还原问题-【uat】点击退出,提示未居中,并且样式和android不一致

import { SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils, CustomToast } from 'wdKit';
import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
import MineSettingDatasModel from '../../model/MineSettingDatasModel';
import router from '@ohos.router';
... ... @@ -31,6 +31,17 @@ export struct AccountAndSecurityLayout {
pageShowAccountTime:number = 0;
pageHideAccountTime:number = 0;
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
//注销账户 浏览埋点
logoutLayoutHide(){
this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp()
... ... @@ -127,9 +138,6 @@ export struct AccountAndSecurityLayout {
// 收到eventId为1的事件后执行该回调
let callback = (eventData: emitter.EventData): void => {
// promptAction.showToast({
// message: JSON.stringify(eventData)
// });
if(eventData&&eventData.data){
this.listData[0].subTitle = eventData.data['content']
}
... ... @@ -477,11 +485,11 @@ export struct AccountAndSecurityLayout {
logout(){
let login = new LoginViewModel;
login.logOut().then(()=>{
promptAction.showToast({ message: '退出登录' })
this.showToastTip('退出登录')
EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION)
router.back();
}).catch((error:string)=>{
promptAction.showToast({ message: error })
this.showToastTip(error)
});
}
... ... @@ -500,6 +508,11 @@ export struct AccountAndSecurityLayout {
securityNum = phoneNum.replace(needSecurityString,'****')
return securityNum;
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
}
@Component
... ...