<template>
  <!-- 导航条 -->
  <div class="bar" :style="{ background: num ? '#005CCD' : '#f9f9f9', color: num ? '#fff' : 'rgba(0, 0, 0, 0.90)' }">
    <van-icon @click="back" name="arrow-left" />
    <div style="font-size: 16px;;">
      {{ tit }}
    </div>
    <div>
      <div style="font-size: 14px;" v-if="num">
        <slot name="btn"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    tit: {
      type: String,
      default: ''
    },
    num: {
      type: Number,
      default: 0
    },
    backPage: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      barBackColor: 'barBackColor'
    }
  },
  methods: {
    back() {
      if (this.backPage) {
        this.$router.push('/eva')
      } else {
        this.$router.go(-1)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.bar {
  width: 100%;
  height: 50px;
  z-index: 999;
  font-weight: 550;
  // background-color: #f9f9f9;
  display: flex;
  box-sizing: border-box;
  padding: 0 10px;
  // justify-content: center;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  font-size: 17px;
}
</style>
