emailValidation.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div>
  3. <template v-if="isMobile">
  4. <validationEmail-stepSelect v-if="step === 'select'" @stepEvent="setStep" @setDataEvent="setInfo"/>
  5. <validationEmail-stepMobile v-if="step === 'mobile'" @stepEvent="setStep" @tokenEvent="loadToken" :info="info"/>
  6. <validationEmail-stepEmail v-if="step === 'email'" @stepEvent="setStep" :info="info"/>
  7. <validationEmail-stepSecurity v-if="step === 'questions'" @stepEvent="setStep" @tokenEvent="loadToken"/>
  8. <validationEmail-stepNew v-if="step === 'new'" @stepEvent="setStep" :tokenId="tokenId"/>
  9. <validationEmail-stepSuccess v-if="step === 'last'" @stepEvent="setStep" :stepLast="stepLast"/>
  10. <step-appeal v-if="step === 'appeal'" @stepEvent="setStep" @lastEvent="setStepLast"/>
  11. </template>
  12. <template v-else>
  13. <accountCenter-header/>
  14. <email-stepSelect v-if="step === 'select'" @stepEvent="setStep" @setDataEvent="setInfo"/>
  15. <email-stepMobile v-if="step === 'mobile'" @stepEvent="setStep" @tokenEvent="loadToken" :info="info"/>
  16. <email-stepEmail v-if="step === 'email'" @stepEvent="setStep" :info="info"/>
  17. <email-stepSecurity v-if="step === 'questions'" @stepEvent="setStep" @tokenEvent="loadToken" :info="info"/>
  18. <email-stepNew v-if="step === 'new'" @stepEvent="setStep" :tokenId="tokenId"/>
  19. <email-stepSuccess v-if="step === 'last'" @stepEvent="setStep" :stepLast="stepLast"/>
  20. </template>
  21. </div>
  22. </template>
  23. <script>
  24. import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
  25. import { EmailStepSelect, EmailStepMobile, EmailStepEmail, EmailStepSecurity, EmailStepNew, EmailStepSuccess } from '~components/validation'
  26. import {ValidationEmailStepSelect, ValidationEmailStepMobile, ValidationEmailStepEmail, ValidationEmailStepSecurity, ValidationEmailStepNew, ValidationEmailStepSuccess, StepAppeal} from '~components/mobile/validation'
  27. export default {
  28. layout (content) {
  29. return content.store.state.option.isMobile ? 'mobile' : 'default'
  30. },
  31. transition: {
  32. name: 'fade',
  33. mode: 'out-in'
  34. },
  35. data () {
  36. return {
  37. step: 'select',
  38. info: '',
  39. tokenId: '',
  40. stepLast: 'last'
  41. }
  42. },
  43. components: {
  44. AccountCenterHeader,
  45. EmailStepSelect,
  46. EmailStepMobile,
  47. EmailStepEmail,
  48. EmailStepSecurity,
  49. EmailStepNew,
  50. EmailStepSuccess,
  51. ValidationEmailStepSelect,
  52. ValidationEmailStepMobile,
  53. ValidationEmailStepEmail,
  54. ValidationEmailStepSecurity,
  55. ValidationEmailStepNew,
  56. ValidationEmailStepSuccess,
  57. StepAppeal
  58. },
  59. mounted () {
  60. if (this.$route.query.token) {
  61. if (this.$route.query.step === '2') {
  62. this.step = 'new'
  63. }
  64. if (this.$route.query.step === '3') {
  65. this.step = 'last'
  66. this.stepLast = 'last'
  67. }
  68. } else {
  69. if (this.logged && this.logged.isLogin) {
  70. this.step = 'select'
  71. } else {
  72. this.$router.push('/')
  73. }
  74. }
  75. },
  76. computed: {
  77. logged () {
  78. return this.$store.state.option.isLogin.data.content
  79. },
  80. isMobile () {
  81. return this.$store.state.option.isMobile
  82. }
  83. },
  84. methods: {
  85. setStepLast (type) {
  86. this.stepLast = type
  87. },
  88. setStep (step) {
  89. this.step = step
  90. },
  91. setInfo (info) {
  92. this.info = info
  93. },
  94. loadToken (token) {
  95. this.tokenId = token
  96. }
  97. }
  98. }
  99. </script>