AgreePrivacy.ets 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { IBestToast } from '../../../../Index';
  2. import { BasicType, ReqString } from '../models';
  3. import { YTRequest } from '../utils/YTRequest';
  4. import { YTToast } from '../utils/YTToast';
  5. import { YTButton } from './YTButton';
  6. @Builder
  7. export function AgreePrivacy(item: BasicType<undefined>) {
  8. Column() {
  9. Text('温馨提示')
  10. .fontSize(14)
  11. .fontColor('Color.Black')
  12. .margin({ top: 14, bottom: 8 })
  13. Text('已阅读并同意《用户协议》和《隐私政策》')
  14. .fontSize(13)
  15. .fontColor($r('sys.color.mask_secondary'))
  16. .margin({ bottom: 19 })
  17. Column() {
  18. YTButton({
  19. btContent: '同意并登入',
  20. btHeight: 37,
  21. click: () => {
  22. YTToast.getInstance().hide()
  23. const loginData: ReqString = AppStorage.get<ReqString>('captchaLogin')!
  24. if (item.text == '验证码登录') {
  25. if (!loginData.phonenumber || !loginData.captcha) {
  26. IBestToast.show({
  27. message: "请输入手机号或验证码"
  28. })
  29. return
  30. }
  31. YTRequest.phonenumberLogin(AppStorage.get<ReqString>('captchaLogin')!)
  32. }
  33. if (item.text == '华为登录') {
  34. YTRequest.huaweiLogin()
  35. }
  36. }
  37. })
  38. YTButton({
  39. btContent: '不同意',
  40. btHeight: 37,
  41. bgc: Color.White,
  42. btFontColor: '#80000000',
  43. click: () => {
  44. YTToast.getInstance().hide()
  45. }
  46. })
  47. }
  48. .padding({ left: 16, right: 16 })
  49. }
  50. .width(280)
  51. .height(160)
  52. .backgroundColor(Color.White)
  53. .borderRadius(8)
  54. .margin({ bottom: 28 })
  55. }