index.vue 2.9 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 } = useLogin()
  12. const { isLoginModalOpen, closeLoginModal } = useLoginModal()
  13. const route = useRoute()
  14. watch(() => loginedAccountList.value, (newVal: any) => {
  15. console.log('loginedAccountList', newVal)
  16. if (newVal.length > 0)
  17. commonStore.setLoginType('account')
  18. else
  19. commonStore.setLoginType('choice')
  20. }, { immediate: true })
  21. watch(() => route.path, () => {
  22. if (isLoginModalOpen.value)
  23. closeLoginModal({ status: false, error: '用户取消登录' })
  24. })
  25. onUnmounted(() => {
  26. console.log('onUnmounted------>>登陆弹窗销毁')
  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. width="880"
  36. >
  37. <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">
  38. <div class="flex">
  39. <div class="pt-110px pb-45px px-45px pos-relative bg-#D7C4FF w-375px">
  40. <img src="@/assets/images/login_icon01.png" alt="" class="w-110px h-110px pos-absolute top-0 left-0">
  41. <div class="custom-title-font text-24px fw-800 text-#333">
  42. Welcome to EJET Spark!
  43. </div>
  44. <img src="@/assets/images/login_img01.png" alt="" class="my-20px w-276px h-225px mx-auto">
  45. <div class="mb-10px custom-title-font text-18px fw-800 text-#333">
  46. EJET Spark Intro
  47. </div>
  48. <div class="text-14px text-#333 lh-22px">
  49. EJET Spark catalog description, spark the trend, ignate sales. EJET Spark catalog description, spark the trend, ignate sales.
  50. </div>
  51. </div>
  52. <div class="flex-1 b-rd-10px bg-#fff px-70px pt-100px">
  53. <AccountList v-if="emailStep === 0 && loginedAccountList.length && loginType === 'account'" />
  54. <Choice v-if="emailStep === 0 && loginType === 'choice'" />
  55. <Mail v-if="emailStep === 1 " />
  56. <Code v-if="emailStep === 2 && !isEmailGoogle " />
  57. <Google v-if="emailStep === 2 && isEmailGoogle " />
  58. </div>
  59. </div>
  60. </el-dialog>
  61. </template>
  62. <style lang="less">
  63. .el-dialog {
  64. border-radius: 10px;
  65. padding: 0;
  66. overflow: hidden;
  67. .el-dialog__header{
  68. display: none;
  69. &.show-close{
  70. .el-dialog__headerbtn{
  71. width: 60px;
  72. height: 60px;
  73. .el-dialog__close{
  74. font-size: 30px;
  75. color: #000;
  76. }
  77. }
  78. }
  79. }
  80. }
  81. </style>