<template>
  <div>
    <template v-if="isMobile">
      <step-one v-if="step === 'first'"
                @stepEvent="setStep"/>
      <step-last v-if="step === 'await'" :step="step"/>
    </template>
    <template v-else>
      <accountCenter-header/>
      <enterprise-certification/>
    </template>
  </div>
</template>
<script>
  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
  import EnterpriseCertification from '~components/certification/EnterpriseCertification.vue'
  import {stepOne, stepLast} from '~components/mobile/enterpriseCertification'
  export default {
    layout (content) {
      return content.store.state.option.isMobile ? 'mobile' : 'default'
    },
    components: {
      AccountCenterHeader,
      EnterpriseCertification,
      stepOne,
      stepLast
    },
    transition: {
      name: 'fade',
      mode: 'out-in'
    },
    data () {
      return {
        step: 'first'
      }
    },
    computed: {
      isMobile () {
        return this.$store.state.option.isMobile
      }
    },
    methods: {
      setStep (step) {
        this.step = step
      }
    }
  }
</script>
