phoneValidation.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div>
  3. <template v-if="isMobile">
  4. <validationPhone-stepSelect v-if="step === 'select'" @stepEvent="setStep" @setDataEvent="setInfo"/>
  5. <validationPhone-stepMobile v-if="step === 'mobile'" @stepEvent="setStep" @tokenEvent="loadToken" :info="info"/>
  6. <validationPhone-stepEmail v-if="step === 'email'" @stepEvent="setStep" :info="info"/>
  7. <validationPhone-stepSecurity v-if="step === 'questions'" @stepEvent="setStep" @tokenEvent="loadToken"/>
  8. <validationPhone-stepNew v-if="step === 'new'" @stepEvent="setStep" @lastEvent="setStepLast" :stepLast="stepLast" :tokenId="tokenId"/>
  9. <validationPhone-stepSuccess v-if="step === 'last'" @stepEvent="setStep" :stepLast="stepLast"/>
  10. </template>
  11. <template v-else>
  12. <accountCenter-header/>
  13. <phone-validation/>
  14. </template>
  15. </div>
  16. </template>
  17. <script>
  18. import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
  19. import PhoneValidation from '~components/validation/PhoneValidation.vue'
  20. import {ValidationPhoneStepSelect, ValidationPhoneStepMobile, ValidationPhoneStepEmail, ValidationPhoneStepSecurity, ValidationPhoneStepNew, ValidationPhoneStepSuccess} from '~components/mobile/validation'
  21. export default {
  22. layout (context) {
  23. return context.store.state.option.isMobile ? 'mobile' : 'default'
  24. },
  25. middleware: 'authenticated',
  26. transition: {
  27. name: 'fade',
  28. mode: 'out-in'
  29. },
  30. data () {
  31. return {
  32. step: 'select',
  33. info: '',
  34. tokenId: '',
  35. stepLast: 'new'
  36. }
  37. },
  38. components: {
  39. AccountCenterHeader,
  40. PhoneValidation,
  41. ValidationPhoneStepSelect,
  42. ValidationPhoneStepMobile,
  43. ValidationPhoneStepEmail,
  44. ValidationPhoneStepSecurity,
  45. ValidationPhoneStepNew,
  46. ValidationPhoneStepSuccess
  47. },
  48. computed: {
  49. isMobile () {
  50. return this.$store.state.option.isMobile
  51. }
  52. },
  53. mounted () {
  54. this.$route.query.token ? this.step = 'new' : this.step = 'select'
  55. },
  56. methods: {
  57. setStep (type) {
  58. this.step = type
  59. },
  60. setInfo (style) {
  61. this.info = style
  62. },
  63. loadToken (token) {
  64. this.tokenId = token
  65. },
  66. setStepLast (type) {
  67. this.stepLast = type
  68. }
  69. }
  70. }
  71. </script>