<template>
  <div id="app">
    <HeaderBanner></HeaderBanner>
    <Navigation :navTitle1='navTitle1' :navTitle2='navTitle2'></Navigation>
    <div class="app_content">
      <div class="router">
        <LoginInfo></LoginInfo>
        <Routerbanner
          @change_nav="changeNav"
          :isManufacturer="isManufacturer"
        />
      </div>
      <div class="router_view">
        <router-view :isManufacturer="isManufacturer"></router-view>
      </div>
    </div>
  </div>
</template>

<script>
import HeaderBanner from "./components/HeaderBanner";
import Navigation from "./components/Navigation";
import LoginInfo from "./components/LoginInfo";
import Routerbanner from "./components/RouterBanner"
import qs from 'qs'
export default {
  components: {
    HeaderBanner,
    Navigation,
    LoginInfo,
    Routerbanner
  },
  data() {
    return {
      navTitle1: ' > 数据管理',
      navTitle2: '',
      isManufacturer: 'manufacturer', // distributor经销商 manufacturer厂商
    }
  },
  methods: {
    changeNav: function(navTitle1, navTitle2){
      this.navTitle1 = ' > ' + navTitle1;
      if (navTitle2) {
        this.navTitle2 = ' > ' + navTitle2;
      } else {
        this.navTitle2 = '';
      }
    }
  },
  mounted() {
    this.$axios({
      method: 'post',
      url: '/api/auth/checkSign',
      data: qs.stringify({
        token: 'dXNlcklkPXh4eHh4JmFjY291bnQ9eHh4eHgmZnJvbT1zaXdlaSZ0aW1lc3RhbXA9MTYxNjY1NDMxOSZzaWduPTllMDQxMDgzMTNlZmI5M2Y2OGQ3YWI4ZTUzZTQwYTIx'
      })
    }).then(function (response) {
      console.log(response);
    }).catch(function (error) {
      console.log(error);
    });
  }
};
</script>

<style lang="less">
* {
  padding: 0;
  margin: 0;
  list-style: none;
}
#app {
  background-color: #eeeeee;
  .app_content {
    width: 1190px;
    margin: 0 auto;
    font-size: 12px;
    color: #333;
    font-family: "微软雅黑";
    display: flex;
    justify-content: space-around;
    .router{
      width: 150px;
    }
    .router_view{
      width: 1030px;
    }
  }
}
</style>
