index.vue 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <script setup lang="ts">
  2. import Choice from './comp/choice.vue'
  3. import Mail from './comp/email/index.vue'
  4. import Code from './comp/email/code.vue'
  5. import Google from './comp/email/google.vue'
  6. import AccountList from './comp/account/list.vue'
  7. import useLogin from './useLogin'
  8. import { useCommonStore } from '@/stores/modules/common'
  9. const commonStore = useCommonStore()
  10. const { loginedAccountList, loginType } = storeToRefs(commonStore)
  11. const { emailStep, isEmailGoogle, loginForm } = useLogin()
  12. const { isLoginModalOpen, closeLoginModal } = useLoginModal()
  13. const route = useRoute()
  14. watch(() => loginedAccountList.value, (newVal: any) => {
  15. if (newVal.length > 0)
  16. commonStore.setLoginType('account')
  17. else
  18. commonStore.setLoginType('choice')
  19. }, { immediate: true })
  20. watch(() => route.path, () => {
  21. if (isLoginModalOpen.value)
  22. closeLoginModal({ status: false, error: '用户取消登录' })
  23. })
  24. onUnmounted(() => {
  25. console.log('onUnmounted------>>登陆弹窗销毁', loginForm.value)
  26. loginForm.value.captcha = ''
  27. })
  28. </script>
  29. <template>
  30. <el-dialog
  31. v-model="isLoginModalOpen"
  32. :append-to-body="true"
  33. :close-on-click-modal="false"
  34. :close-on-press-escape="false"
  35. :z-index="2000"
  36. width="880"
  37. >
  38. <img src="@/assets/images/login_close_icon.png" alt="" class="w-32px h-32px bg-#F4F4F4 cursor-pointer p-8px b-rd-50% pos-absolute top-24px right-24px" @click="isLoginModalOpen = false">
  39. <div class="flex">
  40. <div class="pt-110px pb-45px px-45px pos-relative bg-#D7C4FF w-375px">
  41. <img src="@/assets/images/login_icon01.png" alt="" class="w-110px h-110px pos-absolute top-0 left-0">
  42. <div class="custom-title-font text-24px fw-800 text-#333">
  43. Welcome to EJET Spark!
  44. </div>
  45. <img src="@/assets/images/login_img01.png" alt="" class="my-20px w-276px h-225px mx-auto">
  46. <div class="mb-10px custom-title-font text-18px fw-800 text-#333">
  47. EJET Spark Intro
  48. </div>
  49. <div class="text-14px text-#333 lh-22px">
  50. EJET Spark catalog description, spark the trend, ignate sales. EJET Spark catalog description, spark the trend, ignate sales.
  51. </div>
  52. </div>
  53. <div class="flex-1 b-rd-10px bg-#fff px-70px pt-100px">
  54. <AccountList v-if="emailStep === 0 && loginedAccountList.length && loginType === 'account'" />
  55. <Choice v-if="emailStep === 0 && loginType === 'choice'" />
  56. <Mail v-if="emailStep === 1 " />
  57. <Code v-if="emailStep === 2 && !isEmailGoogle " />
  58. <Google v-if="emailStep === 2 && isEmailGoogle " />
  59. </div>
  60. </div>
  61. </el-dialog>
  62. </template>
  63. <style lang="less">
  64. .el-dialog {
  65. border-radius: 10px;
  66. padding: 0;
  67. overflow: hidden;
  68. .el-dialog__header{
  69. display: none;
  70. &.show-close{
  71. .el-dialog__headerbtn{
  72. width: 60px;
  73. height: 60px;
  74. .el-dialog__close{
  75. font-size: 30px;
  76. color: #000;
  77. }
  78. }
  79. }
  80. }
  81. }
  82. </style>