OtherLoginMethods.ets 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { BasicType } from 'basic'
  2. @Component
  3. export struct OtherLoginMethods {
  4. loginMethodArr: BasicType<undefined>[] = []
  5. build() {
  6. Column() {
  7. Text('其他登入方式')
  8. .fontSize($r('[basic].float.page_text_font_size_10'))
  9. .margin({ bottom: 24 })
  10. Column({ space: 16 }) {
  11. ForEach(this.loginMethodArr, (item: BasicType<undefined>) => {
  12. LoginMethod(item)
  13. })
  14. }
  15. }
  16. .alignItems(HorizontalAlign.Start)
  17. }
  18. }
  19. @Builder
  20. function LoginMethod(item: BasicType<undefined>) {
  21. Stack({ alignContent: Alignment.Start }) {
  22. Button(item.text)
  23. .border({ width: 1, color: $r('[basic].color.main_ac_color_dark') })
  24. .backgroundColor(Color.Transparent)
  25. .width('100%')
  26. .height(37)
  27. .fontSize($r('[basic].float.page_text_font_size_12'))
  28. .type(ButtonType.Normal)
  29. .fontColor($r('[basic].color.main_ac_color_dark'))
  30. .borderRadius(32)
  31. Image(item.src)
  32. .width(24)
  33. .height(24)
  34. .offset({ left: 12 })
  35. }
  36. .onClick(item.click)
  37. }