CustomProtocolDialog.ets 1.9 KB
@CustomDialog
export struct CustomProtocolDialog {
  cancel: () => void=()=>{}
  confirm: () => void=()=>{}
  controller: CustomDialogController

  build() {
    Column() {
      Text("温馨提示")
        .fontColor("#222222")
        .fontSize(23)
        .width("100%")
        .fontWeight(FontWeight.Bold)
        .textAlign(TextAlign.Center)
        .margin({ top: 26 })
      Text() {
        Span("为保障您的合法权益,请阅读并同意").fontSize(18).fontColor("#666666")
        Span("《用户协议》").fontSize(18).fontColor("#ED2800")
        Span("及").fontSize(18).fontColor("#666666")
        Span("《隐私政策》").fontSize(18).fontColor("#ED2800")
        Span("后进行登录").fontSize(18).fontColor("#666666")
      }.margin({ top: 15, left: 20, right: 20 })

      Divider().color("#999999").width("100%").margin({ top: 18 }).height('0.5vp')
      Row() {
        Text('放弃登录')
          .fontSize(20)
          .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(20)
          .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(206).backgroundColor(Color.White).borderRadius(8)
  }
}