<template>
  <div class="sideColumn">
    <div class="column">
      <!-- <div class="head"><img :src="$store.getters.user.org.org_logo" alt=""></div> -->
      <ul class="sidebar">
        <li style="position: relative;" :class="active_index == 0 ? 'active' : ''">
          <router-link to="/main">
            <span class="iconfont">&#xe6e6;</span>
            <p>记录</p>
          </router-link>
          <span
            class="redpoint"
            v-if="total_read_dot"
          >{{ total_read_dot > 99 ? total_read_dot + "+" : total_read_dot }}</span>
        </li>
        <li :class="active_index == 1 ? 'active' : ''">
          <router-link to="/monitoring">
            <span class="iconfont">&#xe6f5;</span>
            <p>监控</p>
          </router-link>
        </li>
        <li :class="active_index == 2 ? 'active' : ''">
          <router-link to="/advice">
            <span class="iconfont">&#xe6f4;</span>
            <p>医嘱</p>
          </router-link>
        </li>
        <li :class="active_index == 3 ? 'active' : ''">
          <router-link to="/my">
            <span class="iconfont">&#xe715;</span>
            <p>我的</p>
          </router-link>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "SideBar",
  props: {
    active_index: {
      type: Number,
      default: 0
    },
    total_read_dot: {
      type: Number,
      default: 0
    }
  }
};
</script>

<style style="stylesheet/scss" lang="scss" scoped>
.redpoint {
  display: inline-block;
  height: 26px;
  width: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 0.34rem;
  border-radius: 20px;
  color: #fff;
  background: #f56c6c;
  position: absolute;
  top: 3px;
  right: -16px;
  @media only screen and (max-width: 415px) {
    height: 16px;
    width: 16px;
    line-height: 16px;
    top: 1px;
    right: -8px;
  }
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    height: 20px;
    width: 20px;
    line-height: 21px;
    font-size: 0.36rem;
  }
}
.sideColumn {
  // float: left;
  // width: 1.58rem;
  background: #f5f8fb;
  // height: 100%;
  // border-right: 1px solid rgba(193, 193, 193, 0.8);
  border-top: 1px solid rgba(193, 193, 193, 0.8);
  // position: fixed;
  height: 50px;
  z-index: 999;
  @media only screen and (min-width: 768px) {
    height: 70px;
  }
  .column {
    .head {
      @include display-flex;
      @include align-items-center;
      @include text-align;
      @include justify-content-center;
      margin: 0.5rem auto 0.7rem auto;
      width: 1rem;
      height: 1rem;
      overflow: hidden;
      border-radius: 50%;
      img {
        width: 100%;
        height: auto;
        display: block;
      }
    }
    .sidebar {
      @include display-flex;
      @include align-items-center;
      // @include flex-direction;
      @include text-align;
      flex-direction: row;
      justify-content: space-around;
      height: 50px;
      padding: 0;
      @media only screen and (min-width: 768px) {
        height: 70px;
      }
      li {
        height: 100%;
        display: flex;
        align-items: center;
        // padding: 0 0 0.8rem 0;
        a {
          color: #a8b3ba;
          display: inline-block;
          padding: 0;
          margin: 0;
          @media only screen and (min-width: 768px) {
            display: flex;
            align-items: center;
            // margin-bottom: 20px;
          }
          @media only screen and (min-width: 416px) {
            display: flex;
            align-items: center;
            // margin-bottom: 20px;
          }
          p {
            font-size: 0.32rem;
            // margin-top: 0.05rem;
            @media only screen and (max-width: 812px) {
              font-size: 0.45rem;
            }
          }
          .iconfont {
            font-size: 0.52rem;
            @media only screen and (max-width: 768px) {
              font-size: 0.8rem;
            }
            display: inline-block;
          }
        }
        &.active {
          a {
            color: $main-color;
            .iconfont {
              color: $main-color;
            }
          }
        }
      }
    }
  }
}
</style>
