Terms.ets 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import { yTRouter } from 'basic'
  2. @Extend(Span)
  3. function spanEx(click: () => void) {
  4. // .decoration({ type: TextDecorationType.Underline, color: $r('[basic].color.main_ac_color_dark') })
  5. .fontColor($r('[basic].color.main_ac_color_dark'))
  6. .onClick(click)
  7. }
  8. @Component
  9. export struct Terms {
  10. @Prop isAgree: boolean
  11. mg: number = 39
  12. @Require onAgreeChange: () => void
  13. build() {
  14. Column() {
  15. Row() {
  16. Checkbox()
  17. .width(12)
  18. .aspectRatio(1)
  19. .margin({ right: 5 })
  20. .onChange(() => {
  21. this.onAgreeChange()
  22. })
  23. .selectedColor($r('[basic].color.main_ac_color_dark'))
  24. Text() {
  25. Span('我已阅读并同意')
  26. // Span('《中国认证服务条款》')
  27. // .spanEx(() => {
  28. //
  29. // })
  30. //
  31. // Span('以及')
  32. Span('《小易决定用户协议》')
  33. .spanEx(() => {
  34. yTRouter.router2userAgreement()
  35. })
  36. Span('和')
  37. Span('《隐私政策》')
  38. .spanEx(() => {
  39. yTRouter.router2Privacy()
  40. })
  41. Span('。')
  42. }
  43. .fontWeight(300)
  44. .fontColor('#FF686868')
  45. .fontSize(12)
  46. }
  47. .width('100%')
  48. .alignItems(VerticalAlign.Center)
  49. .margin({ bottom: this.mg })
  50. // Row() {
  51. // Text()
  52. // .height('100%')
  53. // .aspectRatio(1)
  54. // .backgroundColor(Color.White)
  55. // .borderRadius(18)
  56. // }
  57. // .padding(1)
  58. // .alignSelf(ItemAlign.End)
  59. // .width(39)
  60. // .aspectRatio(2)
  61. // .borderRadius(18)
  62. // .justifyContent(this.isAgree ? FlexAlign.End : FlexAlign.Start)
  63. // .backgroundColor(this.isAgree ? $r('[basic].color.main_ac_color_dark') : '#D9D9D9')
  64. // .onClick(() => {
  65. // this.getUIContext().animateTo({ duration: 200 }, this.onAgreeChange)
  66. // })
  67. }
  68. }
  69. }