emailValidation.vue 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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-validation/>
  15. </template>
  16. </div>
  17. </template>
  18. <script>
  19. import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
  20. import EmailValidation from '~components/validation/EmailValidation.vue'
  21. import {ValidationEmailStepSelect, ValidationEmailStepMobile, ValidationEmailStepEmail, ValidationEmailStepSecurity, ValidationEmailStepNew, ValidationEmailStepSuccess, StepAppeal} from '~components/mobile/validation'
  22. export default {
  23. layout (content) {
  24. // console.log(content, 'content')
  25. return content.store.state.option.isMobile ? 'mobile' : 'default'
  26. },
  27. transition: {
  28. name: 'fade',
  29. mode: 'out-in'
  30. },
  31. data () {
  32. return {
  33. step: 'select',
  34. info: '',
  35. tokenId: '',
  36. stepLast: 'last'
  37. }
  38. },
  39. components: {
  40. AccountCenterHeader,
  41. EmailValidation,
  42. ValidationEmailStepSelect,
  43. ValidationEmailStepMobile,
  44. ValidationEmailStepEmail,
  45. ValidationEmailStepSecurity,
  46. ValidationEmailStepNew,
  47. ValidationEmailStepSuccess,
  48. StepAppeal
  49. },
  50. mounted () {
  51. if (!this.$route.query.token) {
  52. if (this.logged.isLogin) {
  53. this.step = 'select'
  54. } else {
  55. this.$router.push('/')
  56. }
  57. } else {
  58. if (this.$route.query.step === '2') {
  59. this.step = 'new'
  60. } else if (this.$route.query.step === '3') {
  61. this.step = 'last'
  62. this.stepLast = 'last'
  63. }
  64. }
  65. },
  66. computed: {
  67. logged () {
  68. // console.log(this.$store.state.option.isLogin.data.content.isLogin)
  69. return this.$store.state.option.isLogin.data.content
  70. },
  71. isMobile () {
  72. return this.$store.state.option.isMobile
  73. }
  74. },
  75. methods: {
  76. setStepLast (type) {
  77. console.log(type)
  78. this.stepLast = type
  79. },
  80. setStep (step) {
  81. console.log(step)
  82. this.step = step
  83. },
  84. setInfo (info) {
  85. this.info = info
  86. },
  87. loadToken (token) {
  88. this.tokenId = token
  89. }
  90. }
  91. }
  92. </script>