CustomProtocolDialog.ets
2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'
import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'
@CustomDialog
export struct CustomProtocolDialog {
controller: CustomDialogController
cancel: () => void = () => {
}
confirm: () => void = () => {
}
build() {
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)
this.controller.close()
})
Span("及").fontSize(14).fontColor("#666666")
Span("《隐私政策》").fontSize(14).fontColor("#ED2800").onClick(()=>{
let bean={contentId:"2",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
this.controller.close()
})
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(() => {
this.controller.close()
if (this.cancel) {
this.cancel()
}
})
.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(() => {
this.controller.close()
if (this.confirm) {
this.confirm()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}.height(161).backgroundColor(Color.White).borderRadius(6).width('74%')
}
}