<template>
  <div>
    <template v-if="isMobile">
      <header-mobile/>
      <registerEnterprise-mobile/>
      <footer-mobile/>
    </template>
    <template v-else>
      <registerCenter-header/>
      <enterprise-registration/>
    </template>
  </div>
</template>
<script>
  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
  import EnterpriseRegistration from '~components/register/EnterpriseRegistration.vue'
  import { HeaderMobile, FooterMobile } from '~components/mobile'
  import registerEnterpriseMobile from '~components/mobile/registerEnterprise'
  export default {
    layout (context) {
      return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
    },
    fetch ({store, route}) {
      return Promise.all([
        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
      ])
    },
    components: {
      RegisterCenterHeader,
      EnterpriseRegistration,
      registerEnterpriseMobile,
      HeaderMobile,
      FooterMobile
    },
    computed: {
      isMobile () {
        return this.$store.state.option.isMobile
      }
    }
  }
</script>
