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('#FF000000')
  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.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.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. }