index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <script lang='ts' setup>
  2. import type { FormInstance, FormRules } from 'element-plus'
  3. import useLogin from '../../useLoginAndDownload'
  4. const { loginForm, sendEmail, backStep, errorTxt } = useLogin()
  5. const ruleFormRef = ref<FormInstance>()
  6. const rules = ref<FormRules>({
  7. email: [
  8. { required: true, message: 'Please enter a valid email.', trigger: 'blur' },
  9. {
  10. pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
  11. message: 'Please enter a valid email.',
  12. },
  13. {
  14. validator: (rule: any, value: any, callback: any) => {
  15. if (errorTxt.value)
  16. callback(new Error(errorTxt.value))
  17. else
  18. callback()
  19. },
  20. },
  21. ],
  22. })
  23. </script>
  24. <template>
  25. <div>
  26. <div class="custom-title-font text-24px fw-800 text-#333 mb-10px flex items-center">
  27. <img src="@/assets/images/login_back_arrow.png" alt="" class="w-16px h-16px mr-4px cursor-pointer" @click="backStep">
  28. Continue with Email
  29. </div>
  30. <div class="text-14px text-#1A1A1A lh-22px mb-20px">
  31. We’ll check if you have an account, and help create one if you don’t.
  32. </div>
  33. <el-form ref="ruleFormRef" :rules="rules" :model="loginForm" @submit.prevent>
  34. <el-form-item label="" prop="email" class="!mb-24px">
  35. <el-input v-model.trim="loginForm.email" class="!h-46px login-input !text-14px" placeholder="Enter email" />
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button class="!w-full !h-50px !text-16px !fw-500 !b-rd-10px !bg-#9B6CFF !text-#fff" @click="sendEmail(ruleFormRef)">
  39. Continue
  40. </el-button>
  41. </el-form-item>
  42. </el-form>
  43. </div>
  44. </template>
  45. <style lang='less' scoped>
  46. ::v-deep(.login-input) {
  47. .el-input__wrapper{
  48. border-radius: 10px;
  49. }
  50. }
  51. </style>