phoneValidation.vue 2.4 KB

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