<template>
  <span class="btn" @click="btnClick" :class="topClass">在线咨询</span>

</template>

<script>
export default {
  name: "onlineInformation",
  props: {
    myType: {
      type: String,
      default: '1'
    }
  },
  methods: {
    btnClick() {
      this.$router.push({name: 'courseware'});
    }
  },
  computed: {
    topClass() {
      const obj = {
        1: 'level_1',
        2: 'level_2',
        3: 'level_3',
        4: 'level_4',
      }
      return [obj[this.myType]];
    }
  }
}
</script>

<style lang="scss" scoped>
.btn {
  &.level_1 {
    width: 154px;
    height: 47px;
    color: #00b96b;
    border-radius: 24px;
    padding: 10px 30px;
    background: #fff;
    border: 1px solid #00b96b;
    cursor: pointer;
  }
  &.level_2 {
    width: 154px;
    height: 47px;
    color: #fff;
    border-radius: 24px;
    padding: 10px 30px;
    background: #00B96B;
    border: 1px solid #00b96b;
    cursor: pointer;
  }
  @media (max-width: 768px) {
    width: 44%;max-width: 100px;margin: 0 3%;
  }
}

</style>
