index.vue 3.1 KB

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