encryptedSetting.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div>
  3. <template v-if="isMobile">
  4. <step-select v-if="step === 'select'" @stepEvent="setStep" @setDataEvent="setInfo"/>
  5. <step-mobile v-if="step === 'mobile'" @stepEvent="setStep" @tokenEvent="loadToken" :info="info"/>
  6. <step-email v-if="step === 'email'" @stepEvent="setStep" :info="info"/>
  7. <step-new v-if="step === 'new'" @stepEvent="setStep" :tokenId="tokenId"/>
  8. <step-success v-if="step === 'success'"/>
  9. </template>
  10. <template v-else>
  11. <accountCenter-header/>
  12. <encrypted-setting/>
  13. </template>
  14. </div>
  15. </template>
  16. <script>
  17. import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
  18. import EncryptedSetting from '~components/encrypted-setting/EncryptedSetting.vue'
  19. import {StepSelect, StepMobile, StepEmail, StepNew, StepSuccess} from '~components/mobile/encryptedSetting'
  20. export default {
  21. layout (content) {
  22. return content.store.state.option.isMobile ? 'mobile' : 'default'
  23. },
  24. transition: {
  25. name: 'fade',
  26. mode: 'out-in'
  27. },
  28. middleware: 'authenticated',
  29. data () {
  30. return {
  31. step: 'select',
  32. info: '',
  33. tokenId: ''
  34. }
  35. },
  36. components: {
  37. AccountCenterHeader,
  38. EncryptedSetting,
  39. StepSelect,
  40. StepMobile,
  41. StepEmail,
  42. StepNew,
  43. StepSuccess
  44. },
  45. mounted () {
  46. this.$route.query.token ? this.step = 'new' : this.step = 'select'
  47. },
  48. computed: {
  49. isMobile () {
  50. return this.$store.state.option.isMobile
  51. }
  52. },
  53. methods: {
  54. setStep (step) {
  55. this.step = step
  56. },
  57. setInfo (info) {
  58. this.info = info
  59. },
  60. loadToken (token) {
  61. this.tokenId = token
  62. }
  63. }
  64. }
  65. </script>