<template>
  <header>
    <!-- <div class="header-top">
      <div class="container">
        <div class="row">
          <div class="col-md-6 col-xs-12 col-sm-6 ">
            <p><i class="fa fa-phone"> </i> 4008-352358</p>
          </div>
          <div class="col-md-6 col-xs-12 col-sm-6 text-right">
            <form class="navbar-form text-right" role="search">
              <div class="form-group" style="margin-right: 5px;">
                <input type="text" class="form-control" placeholder="北斗平安玉">
                <i class="fa fa-search"></i>
              </div>
              <button type="submit" href="products.html" class="btn btn-default">搜索</button>
            </form>
          </div>
        </div>
      </div>
    </div> -->
    <nav class="navbar" role="navigation">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <!-- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
            data-target="#bs-example-navbar-collapse-1">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button> -->
          <a>
            <img class="logo" src="@/assets/images/logo11.png" alt="">

          </a>
          <i class="el-icon-menu header_icon" @click="showNav = !showNav"></i>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <el-collapse-transition>
          <div v-show="showNav">
            <el-menu class="nav navbar-right" :default-active="navActive" mode="horizontal" text-color="#303133" active-text-color="#3884c0" router>
              <el-menu-item index="/home">首页</el-menu-item>
              <el-menu-item index="/profuiles">关于天云</el-menu-item>
              <el-menu-item index="/products">产品中心</el-menu-item>
              <el-menu-item index="/business">核心业务</el-menu-item>
              <el-menu-item index="/applications">应用方案</el-menu-item>
              <el-menu-item index="/news">新闻动态</el-menu-item>
              <!-- <el-menu-item index="/join">品牌招商</el-menu-item> -->
              <el-menu-item index="/about">联系我们</el-menu-item>
            </el-menu>
          </div>
      </el-collapse-transition>
        
        <!-- /.navbar-collapse -->
      </div>
      <!-- /.container-fluid -->
    </nav>
  </header>
</template>

<script>
import { mapGetters, mapActions } from 'vuex'

export default {
  data() {
    return {
      navBarFixed: false,
      isFadeUp: false,
      preScrollTop: 0,
      showNav: true
      // navPath: '/'
    }
  },

  computed: {
    ...mapGetters([
      'navActive'
    ])
  },

  mounted() {
    const navPath = localStorage.getItem('menuPath')
    if (navPath) {
      this.setNavPath(navPath)
    }
  },

  methods: {
    ...mapActions({
      setNavPath: 'app/setNavPath'
    }),
    handleToogleMenu() {
      console.log('//////')
      console.log(localStorage.getItem('lastChecked'))
      // localStorage.setItem('lastChecked', '')
    }
  },

}
</script>

<style scoped>
.nav {
  border: none;
}

.navbar-header {
  position: relative;
}

.navbar-header .header_icon {
  font-size: 32px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
@media screen and (max-width: 720px) {
  .navbar-header .header_icon {
    display: block;
  }
}
/* .nav {
  height: 74px;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid #e6e6e6;
  background-color: #fff;
  position: absolute;
  top: 0;
}

.nav-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 66px;
}

.fix-nav {
  position: fixed;
  top: 0;
  z-index: 999;
}

.el-col {
  height: 100%;
}

.el-menu-item {
  font-size: 0.9em;
} */
</style>
