<template>
  <div class="globalheader" ref="header">
    <div class="globalheader-main">
      <div class="globalheader-main-left">
        <div><img src="" alt="" /></div>
        <h3>启服通</h3>
        <p>{{ title }}</p>
      </div>
      <div class="globalheader-main-right" @click="$router.push(url)">
        {{ name }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["title", "url", "name"],
  data() {
    return {
      windowFirstUrl: ""
    };
  },
  created() {
    this.windowFirstUrl = window.location.host.split(".")[0];
  },
  mounted() {
    switch (this.windowFirstUrl) {
      case "gsbweb":
        this.$refs.header.classList.add("globalheader-red");
        break;
      default:
        break;
    }
  }
};
</script>

<style lang="scss">
.globalheader-red {
  background: rgb(46, 35, 35) !important;
}
.globalheader {
  width: 100%;
  height: 60px;
  background: #222;
  .globalheader-main {
    max-width: 1240px;
    height: 100%;
    padding: 0 20px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
  }
}
.globalheader-main-left {
  height: 100%;
  line-height: 60px;
  display: flex;
  align-items: center;
  div {
    width: 28px;
    height: 28px;
    background: #e1e1e1;
    img {
      width: 100%;
      height: 100%;
    }
  }
  h3 {
    padding: 0 23px 0 15px;
    font-size: 16px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #fff;
    line-height: 16px;
    border-right: 2px solid #fff;
  }
  p {
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #fff;
    line-height: 22px;
    padding: 0 0 0 15px;
  }
}
.globalheader-main-right {
  font-size: 15px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #fff;
  line-height: 60px;
  cursor: pointer;
}
</style>
