emailValidation.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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" @lastEvent="setStepLast" :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. middleware: 'authenticated',
  28. transition: {
  29. name: 'fade',
  30. mode: 'out-in'
  31. },
  32. data () {
  33. return {
  34. step: 'select',
  35. info: '',
  36. tokenId: '',
  37. stepLast: 'new'
  38. }
  39. },
  40. components: {
  41. AccountCenterHeader,
  42. EmailValidation,
  43. ValidationEmailStepSelect,
  44. ValidationEmailStepMobile,
  45. ValidationEmailStepEmail,
  46. ValidationEmailStepSecurity,
  47. ValidationEmailStepNew,
  48. ValidationEmailStepSuccess,
  49. StepAppeal
  50. },
  51. mounted () {
  52. console.log('111')
  53. if (this.logged.isLogin) {
  54. if (this.$route.query.token) {
  55. this.step = 'last'
  56. } else {
  57. this.step = 'select'
  58. }
  59. } else {
  60. if (this.$route.query.token) {
  61. this.step = 'last'
  62. } else {
  63. this.$router.push('/')
  64. }
  65. }
  66. },
  67. computed: {
  68. logged () {
  69. // console.log(this.$store.state.option.isLogin.data.content.isLogin)
  70. return this.$store.state.option.isLogin.data.content
  71. },
  72. isMobile () {
  73. return this.$store.state.option.isMobile
  74. }
  75. },
  76. methods: {
  77. setStep (step) {
  78. this.step = step
  79. },
  80. setInfo (info) {
  81. this.info = info
  82. },
  83. loadToken (token) {
  84. this.tokenId = token
  85. }
  86. }
  87. }
  88. </script>