Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yangchenggong1_wd
2024-05-10 14:37:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a3e0eaccf672fef40df6d1cebb2efa94acdba65b
a3e0eacc
1 parent
23cdbb62
fix:bug[17187] 我的-退出登录鸿蒙版UI样式与安卓不一致
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
49 deletions
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/ConfirmLogoutDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
View file @
a3e0eac
...
...
@@ -49,9 +49,12 @@ export struct AccountAndSecurityLayout {
confirmDialogController: CustomDialogController = new CustomDialogController({
builder: ConfirmLogoutDialog({
cancel: () => {
},
tipShow:false,
title:"确认退出登录吗?",
leftText:"确认",
leftTextColor:$r('app.color.color_648DF2'),
rightText:"取消",
cancelIsLeft:false,
confirm: () => {
this.logout()
}
...
...
@@ -213,17 +216,6 @@ export struct AccountAndSecurityLayout {
Column() {
Button('退出登录',{ stateEffect: true ,type: ButtonType.Normal}).width('90%').height('80lpx').backgroundColor('#da3e22').fontColor('#fff').margin('20lpx').borderRadius('8lpx').onClick(()=>{
this.confirmDialogController.open()
// AlertDialog.show({
// title: '🥟id : ' + "button",
// message: '标题:' + '退出登录',
// confirm: {
// value: "OK",
// action: () => {
//
// },
// }
// })
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/ConfirmLogoutDialog.ets
View file @
a3e0eac
...
...
@@ -2,6 +2,17 @@
@CustomDialog
export struct ConfirmLogoutDialog {
@State title: string = "标题"
@State titleShow: boolean = true
@State tipValue: string ="提示文字"
@State tipShow: boolean = true
@State cancelIsLeft :boolean = true//取消是否在左边
@State leftText: string = "取消"
@State rightText: string = "确认"
@State leftTextColor: Resource = $r('app.color.color_333333')
@State rightTextColor: Resource = $r('app.color.color_648DF2')
controller: CustomDialogController
cancel: () => void = () => {
}
...
...
@@ -10,51 +21,78 @@ export struct ConfirmLogoutDialog {
build() {
Column() {
Text("确认退出登录吗?")
.fontColor("#222222")
.fontSize(18)
Column(){
if(this.titleShow){
Text(this.title)
.fontSize("32lpx")
.fontColor($r('app.color.color_333333'))
.lineHeight('50lpx')
.fontWeight(600)
}
if(this.tipShow){
Text(this.tipValue)
.margin({ top:this.titleShow?"10lpx":"0lpx" })
.fontSize("27lpx")
.fontWeight(400)
.lineHeight('38lpx')
.fontColor($r('app.color.color_999999'))
}
}.padding({top:"48lpx",bottom:"48lpx"})
.alignItems(HorizontalAlign.Center)
Divider()
.width("100%")
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.margin({ top: 20 })
Divider().color("#999999").width("100%").margin({ top: 20 }).height('1vp')
Row() {
Text('确认')
.fontSize(16)
.fontColor("#648DF2")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.strokeWidth('1lpx')
.height('1lpx')
.color($r('app.color.color_EEEEEE'))
Row(){
Text(this.leftText)
.fontSize('35lpx')
.fontWeight(400)
.fontColor(this.leftTextColor)
.onClick(() => {
if (this.controller != undefined){
if(this.cancelIsLeft){
this.controller.close()
this.cancel()
}else{
this.controller.close()
if (this.confirm) {
this.confirm()
}
})
.height('100%')
// Divider().color("#999999").height('100%').width('0.5vp')
Text('取消')
.fontSize(16)
.fontColor("#648DF2")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
}
}).layoutWeight(1)
.textAlign(TextAlign.Center)
.border({
width: { left: 1 },
color: "#999999",
style: { left: BorderStyle.Solid }
})
Divider()
.width("1lpx")
.strokeWidth('1lpx')
.vertical(true)
.height('92lpx')
.color($r('app.color.color_EEEEEE'))
Text(this.rightText)
.fontSize('35lpx')
.textAlign(TextAlign.Center)
.fontWeight(400)
.fontColor(this.rightTextColor)
.onClick(() => {
if (this.controller != undefined) {
if(this.cancelIsLeft){
this.controller.close()
this.confirm()
}else{
this.controller.close()
if (this.cancel) {
this.cancel()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}.height(110).backgroundColor(Color.White).borderRadius(6).width('74%')
}
}).layoutWeight(1)
}
.alignItems(VerticalAlign.Center)
.height('96lpx')
}.borderRadius(10)
.width("518lpx")
.backgroundColor("#FFF")
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment