AgreePrivacy.ets 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { BasicType } from '../../models';
  2. import { yTRouter } from '../../utils/YTRouter';
  3. import { YTToast } from '../../utils/YTToast';
  4. import { YTButton } from './YTButton';
  5. @Extend(Span)
  6. function spanEx(click: () => void) {
  7. // .decoration({ type: TextDecorationType.Underline, color: $r('[basic].color.main_ac_color_dark') })
  8. .fontColor('rgba(0, 0, 0, 0.85)')
  9. .onClick(click)
  10. }
  11. @Builder
  12. export function agreePrivacy(item: BasicType<undefined>) {
  13. Column() {
  14. Text('温馨提示')
  15. .fontSize(14)
  16. .fontColor('Color.Black')
  17. .margin({ top: 14, bottom: 8 })
  18. Text() {
  19. Span('我已阅读并同意')
  20. // Span('《中国认证服务条款》')
  21. // .spanEx(() => {
  22. //
  23. // })
  24. //
  25. // Span('以及')
  26. Span('《樱桃小决定用户协议》')
  27. .spanEx(() => {
  28. yTRouter.router2userAgreement()
  29. })
  30. Span('和')
  31. Span('《隐私政策》')
  32. .spanEx(() => {
  33. yTRouter.router2Privacy()
  34. })
  35. Span('。')
  36. }
  37. .fontWeight(300)
  38. .fontColor('#FF686868')
  39. .fontSize(12)
  40. Column() {
  41. YTButton({
  42. btContent: '同意并登入',
  43. btHeight: 37,
  44. bgc:'rgba(253, 95, 229, 1)',
  45. btFontColor:Color.White,
  46. click: () => {
  47. YTToast.getInstance().hide()
  48. // if (item.text == '验证码登录') {
  49. // if (!loginData.phonenumber || !loginData.captcha) {
  50. // IBestToast.show({
  51. // message: "请输入手机号或验证码"
  52. // })
  53. // return
  54. // }
  55. //
  56. // // YTRequest.phonenumberLogin(AppStorage.get<ReqString>('captchaLogin')!)
  57. // }
  58. // if (item.text == '华为登录') {
  59. // // YTRequest.huaweiLogin()
  60. // }
  61. item.loginType!.isAgreePrivacy = true
  62. item.loginType?.executeLogin()
  63. }
  64. })
  65. YTButton({
  66. btContent: '不同意',
  67. btHeight: 37,
  68. bgc: Color.White,
  69. btFontColor: '#80000000',
  70. click: () => {
  71. YTToast.getInstance().hide()
  72. }
  73. })
  74. }
  75. .padding({ left: 16, right: 16 })
  76. }
  77. .width(280)
  78. .height(160)
  79. .backgroundColor(Color.White)
  80. .borderRadius(8)
  81. .margin({ bottom: 28 })
  82. }