<!--
  @description: 新产品电商/首页
  @Modifier：杨胜国
  @routerPath:/shop
  @date：  2021/05/17
-->
<template>
  <div>
    <div class="shopmallLayout">
      <!-- navbar -->
      <div class="top">
        <navbar :is-show="isShow" />
      </div>
      <!-- body -->
      <div class="bottom">
        <div class="banner_wrap">
          <banner />
        </div>
        <div class="content">
          <div class="left">
            <!-- v-if="sidebarData.length" -->
            <sidebar :sidebar-data="sidebarData" />
          </div>
          <div class="right">
            <appMain />
          </div>
        </div>
      </div>
      <!-- footerbar -->
      <div class="footer">
        <footerbar />
      </div>
    </div>
  </div>
</template>
<script>
import { navbar, appMain, banner, sidebar, footerbar } from './components/shopmallComponents'
// import { getUserMenu } from '@/api/common/loginCenter'
export default {
  components: {
    navbar,
    appMain,
    banner,
    sidebar,
    footerbar
  },
  data() {
    return {
      fixed: false,
      isShow: true
      // sidebarData: []
    }
  },
  watch: {
    '$route'() {
      this.$route.path === '/shopmallHome' ? this.isShow = true : this.isShow = false
    }
  },
  created() {
    this.$route.path === '/shopmallHome' ? this.isShow = true : this.isShow = false
    // getUserMenu().then(res => {
    //   if (res.header.ret === '0') {
    //     this.sidebarData = res.data
    //   }
    // })
  },
  methods: {

  }
}
</script>

<style scoped lang="less">
@import "~@/assets/style/common/maincommon.less";
.shopmallLayout {
  height: 100vh;
  overflow: auto;
  .top,
  .content {
    max-width: 1366px;
    margin: 0 auto;
  }
  .bottom {
    background-color: #f4f4f4;
    min-height: 100vh;
    padding-bottom: 35px;
    .banner_wrap {
      background-color: @orange;
      height: 84px;
    }
    .content {
      margin-top: 26px;
      display: flex;
      justify-content: space-between;
      .left {
        width: 10%;
        background: #ffffff;
        height: 600px;
        margin-right: 1%;
      }
      .right {
        width: 90%;
        background: #ffffff;
      }
    }
  }
  .footer {
    width: 100%;
  }
}
</style>
