<template>
  <div>
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"/>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"/>
  </div>
</template>

<script>
import { WxConfig } from './utils/wxConfig'
import { platform } from './utils/platform'

export default {
  name: 'App',
  data () {
    return {
      activeTab: ''
    }
  },
  watch: {
    '$route.name': {
      handler: function (newVal) {
        this.activeTab = newVal
      },
      immediate: true
    }
  },
  async created () {
    platform.isWeixin && WxConfig()
    this.$store.dispatch('common/getUserInfo')
    this.$store.dispatch('common/getOrdertype')
  }
}
</script>

<style lang="scss">
@import "./assets/styles/reset";

body {
  background: #F7F6F9;
}

.clearfix {
  display: inline-block;

  &:after {
    display: block;
    content: ".";
    height: 0;
    line-height: 0;
    clear: both;
    visibility: hidden;
  }
}
</style>
