<template>
  <div class="q-pa-md businessModel">
    <div class="full-width business-header">
      请选择上课模式：
    </div>
    <div class="box-businessModel" :class="{ 'checked-border': type == 1 }" @click="chooseChange(1)">
      <i class="iconfont icon-banjixinxi" style="font-size:38px"></i>
      <div>班课学习</div>
      <div class="right" v-if="type == 1">
        <q-icon name="check" class="check-icon" />
      </div>
    </div>
    <div class="box-businessModel" :class="{ 'checked-border': type == 2 }" @click="chooseChange(2)">
      <i class="iconfont icon-yueke" style="font-size:38px"></i>
      <div>约课学习</div>
      <div class="right" v-if="type == 2">
        <q-icon name="check" class="check-icon" />
      </div>
    </div>
    <div class="box-businessModel" style="margin-right:0;" :class="{ 'checked-border': type == 3 }" @click="chooseChange(3)">
      <i class="iconfont icon-vipkecheng" style="font-size:38px"></i>
      <div>VIP课程</div>
      <div class="right" v-if="type == 3">
        <q-icon name="check" class="check-icon" />
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    model:{
      prop:'type',
      event:"changeType"
    },
    props: {
      type: {
        type: [String, Number],
        default: 1
      }
    },
    methods: {
      chooseChange(n) {
        this.$emit('changeType',n)
      }
    }
  };

</script>
<style lang="scss" scoped>
  .businessModel {
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    width: 700px;
    margin: 50px 0;

    .business-header {
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 15px;
    }

    .box-businessModel {
      cursor: pointer;
      width: 209px;
      // width: 314px;
      height: 198px;
      background: #f9f9f9;
      border-radius: 5px;
      display: flex;
      justify-content: center;
      flex-direction: column;
      align-items: center;
      position: relative;
      margin-right:20px;
      .right {
        position: absolute;
        right: -20px;
        bottom: -20px;
        display: block;
        width: 0;
        height: 0;
        transform: rotate(45deg);
        border: 20px solid transparent;
        border-left: 20px solid #3470ff;

        .check-icon {
          position: absolute;
          top: -8px;
          left: -19px;
          transform: rotate(-45deg);
          font-size: 14px;
          font-weight: 700;
          color: #fff;
        }
      }
    }
  }

  .checked-border {
    background-color: #edf2fd !important;
    border: 2px solid #3470ff !important;
    color: #3470ff;
  }

</style>
