<template>
  <div class="menu">
    <div class="nav-left">
      <div class="logo-box">
        <img class="bank-logol" src="https://zws-imgs-pub.ezijing.com/pc/base/logo.svg" />
        <img class="bank-logor" src="@/assets/images/bank-logo2.png" alt="logo" />
      </div>
    </div>
    <!-- <div class="bank-title" @click="setStatus">中国公路建设行业协会</div> -->
    <!-- <s-language></s-language> -->
    <div class="nav-right">
      <div class="logo-name">{{ name }},欢迎您回到在线学习系统</div>
      <div class="notify" @click="goNotify()">
        通知
        <div class="num" v-if="this.$store.getters.myMsg != 0">{{ this.$store.getters.myMsg }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import LanguageSwitch from '@/components/languageSwitch/index.vue'
// import cAction from '../../action'
export default {
  components: { LanguageSwitch },
  data() {
    return {
      name: ''
    }
  },
  mounted() {
    const userInfo = window.G.UserInfo
    this.name = userInfo ? userInfo.student_info.personal_name : '你好'
    // cAction.Other.getNavMsg()
    //   .then(data => {
    //     this.$store.commit('myMsg', data.num)
    //   })
    //   .catch(e => {
    //     this.$message.error(e.message)
    //   })
  },
  methods: {
    goNotify() {
      this.$router.push({ path: '/app/other/message' })
    },
    setStatus() {
      if (this.status) {
        this.status = false
      } else {
        this.status = true
      }
      this.$root.$emit('updateStatus', this.status)
    }
  }
}
</script>

<style scoped lang="scss">
.menu {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000;
  .nav-left {
    // width: 30%;
    display: flex;
    position: relative;
    height: 100%;
    align-items: center;
    img.logo {
      position: absolute;
      left: 0;
      top: 50%;
      height: 37%;
      width: auto;
      transform: translateY(-50%);
    }
    .text-title {
      float: left;
      margin-left: 190px;
      line-height: 60px;
      font-size: 16px;
    }
  }
  .bank-title {
    font-size: 0.24rem;
    color: rgba(102, 102, 102, 1);
    text-align: center;
  }
  .nav-right {
    display: flex;
    align-items: center;
    .logo-name {
      font-size: 0.18rem;
      color: #000;
      line-height: 60px;
    }
  }
  .notify {
    position: relative;
    padding: 0 35px;
    line-height: 60px;
    font-size: 0.18rem;
    color: #000;
    cursor: pointer;
    .num {
      position: absolute;
      top: 9px;
      left: 50px;
      padding: 1px 5px 2px 4px;
      font-size: 12px;
      line-height: 14px;
      color: #ffffff;
      background: #fb2121;
      border-radius: 50%;
    }
  }
}
.logo-box {
  display: flex;
  align-items: center;
  padding: 0 40px;
  .bank-logol {
    height: 50px;
  }
  .bank-logor {
    margin-left: 40px;
    height: 40px;
  }
}

@media (max-width: 767px) {
  .menu {
    .nav-left {
      img.logo {
        display: none;
      }
      .text-title {
        margin-left: 0;
      }
    }
  }
}
</style>
