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
shishuangxi
2024-04-24 10:12:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c96cb1187121eeb8ed18fc7ed9486568d08d69b9
c96cb118
1 parent
c1c86c9f
修改协议弹窗样式
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
9 deletions
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginPage.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginPage.ets
View file @
c96cb11
...
...
@@ -55,6 +55,7 @@ struct LoginPage {
alignment:DialogAlignment.Center
})
loginViewModel = new LoginViewModel()
@State isProtocol:boolean=false
onCodeSend() {
Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
...
...
@@ -72,6 +73,7 @@ struct LoginPage {
}
build() {
Stack() {
RelativeContainer() {
//注册内容
...
...
@@ -105,13 +107,13 @@ struct LoginPage {
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
let bean={contentID:"1",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontColor("#999999").fontSize(12)
Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => {
let bean={contentID:"2",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
}
}.margin({ top: 48 }).alignItems(VerticalAlign.Center)
...
...
@@ -119,16 +121,16 @@ struct LoginPage {
Row() {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ?"#FFFFFFFF":
"#66FFFFFF")
.fontColor(this.isSubmit ? "#FFFFFFFF" :
"#66FFFFFF")
.fontSize(18)
.fontWeight(FontWeight.Medium)
.margin({ top: 20 })
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
.backgroundColor(this.isSubmit?"#FFED2800":
"#99ED2800")
.backgroundColor(this.isSubmit ? "#FFED2800" :
"#99ED2800")
.onClick(() => {
if(!this.isSubmit)
{
if (!this.isSubmit)
{
return
}
this.loginSubmit()
...
...
@@ -141,7 +143,7 @@ struct LoginPage {
Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 })
.onClick(() => {
// router.pushUrl({ url: 'pages/login/ForgetPasswordPage' })
let pageType = {'pageType': 0
} as Record<string, number>;
let pageType = { 'pageType': 0
} as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
})
}
...
...
@@ -174,6 +176,16 @@ struct LoginPage {
.id('id_close')
}.width('100%').height('100%')
ProtocolComponent({
cancelMethod: (): void => this.cancelProtocol(),
agreeMethod: (): void => this.agreeProtocol()
})
.visibility(this.isProtocol ? Visibility.Visible : Visibility.None)
}.width('100%')
.height('100%')
}
@Builder
...
...
@@ -366,8 +378,92 @@ struct LoginPage {
if (this.protocolState) {
this.requestLogin()
} else {
this.dialogController.open()
// this.dialogController.open()
this.isProtocol=true
}
}
agreeProtocol(): void {
this.isProtocol = false
this.protocolState = true
this.requestLogin()
}
cancelProtocol(): void {
this.isProtocol = false
}
}
@Component
struct ProtocolComponent {
cancelMethod?: () => void
agreeMethod?: () => void
build() {
Stack() {
Column() {
Text("温馨提示")
.fontColor("#222222")
.fontSize(18)
.width("100%")
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.margin({ top: 20 })
Text() {
Span("为保障您的合法权益,请阅读并同意").fontSize(14).fontColor("#666666")
Span("《用户协议》").fontSize(14).fontColor("#ED2800").onClick(() => {
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontSize(14).fontColor("#666666")
Span("《隐私政策》").fontSize(14).fontColor("#ED2800").onClick(() => {
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("后进行登录").fontSize(14).fontColor("#666666")
}.margin({ top: 12, left: 16, right: 16 })
Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')
Row() {
Text('放弃登录')
.fontSize(16)
.fontColor("#999999")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.onClick(() => {
if (this.cancelMethod) {
this.cancelMethod()
}
})
.height('100%')
// Divider().color("#999999").height('100%').width('0.5vp')
Text('同意并登录')
.fontSize(16)
.fontColor("#ED2800")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.border({
width: { left: 1 },
color: "#999999",
style: { left: BorderStyle.Solid }
})
.onClick(() => {
if (this.agreeMethod) {
this.agreeMethod()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}.height(161).backgroundColor(Color.White).borderRadius(6).width('74%')
}.width('100%')
.height('100%')
.backgroundColor('#66000000')
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment