<template>
  <div class="loginpage">
     <div class="login_top_class">
      <div class="bgcenter" @click="gopage">
        <img class="storeIcon_img" src="../assets/img/logo.png" alt="">
      </div>
      <div class="loginNav">
          <router-link class="alink" to="/pt">平台介绍</router-link>
          <router-link class="alink" to="/brand">品牌共享</router-link>
          <router-link class="alink" to="/ashop">E淘A店</router-link>
          <router-link class="alink" to="/joinin">招商加盟</router-link>
          <a class="alink" href="http://wiki.edsmall.cn/" target="_black" >E百科</a>
          <router-link v-if="!curlogin" class="loginbtn" to="/login">登录</router-link>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HeaderTop',
  props:['curlogin'],
  data () {
    return {

    }
  },
  mounted() {
    // 时间钩子
  },
  methods:{
    // 执行方法
    gopage(){
      //判断是否移动端
      var pathLogin = '/login';
      let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
      if(flag){
          pathLogin = '/m_login';
      }
      this.$router.push({
        path:pathLogin
      })
    }
  },
  components:{
    // 传入组件

  }
}
</script>

<style lang="scss" scoped>
.loginpage{
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 999;
}
.login_top_class {
        height: 70px;
        background-color: #fff;
        display: flex;
        width: 1100px;
        margin: 0 auto;
        align-items: center;
        // justify-content: space-between;
        .bgcenter {
            height: 38px;
            width: 158px;
        }
        .loginNav{
          margin-left: 100px;

          .alink{
            color: #333;
            font-size: 16px;
            padding-left: 70px;
          }
          a.alink.router-link-exact-active.router-link-active{
              color:#f60
          }
          .loginbtn{
            display: inline-block;
            border:1px solid #f60;
            text-align: center;
            border-radius: 4px;
            color: #f60;
            font-size: 14px;
            padding: 4px 16px;
            margin-left: 70px;
          }
        }
    }
</style>
