<template>
  <div :class="{fixed: isFixed}">
    <div class="detail-btn" :class="{bt: needBT}">
      <span @click="btnClick" :style="{width: btnWidth}">{{btnText}}</span>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    isFixed: {
      type: Boolean | String,
      default: true,
    },
    btnWidth: {
      type: String,
      default: '100%'
    },
    btnText: {
      tpye: String,
      default: '获得更多勤奋分'
    },
    needBT: {
      type: Boolean | String,
      default: false
    }
  },
  methods: {
    btnClick() {
      this.$emit('btnClick');
    }
  },
}
</script>
<style lang="less">
  .fixed {
    width: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 3;
    background: #fff;
  }
  .detail-btn {
    display: flex;
    flex-direction: row;
    height: 50px;
    line-height: 50px;
    padding: 0 15px;
    align-items: center;
    text-align: center;
    &.bt {
      border-top: 1px solid #EDEDED;
    }
    span {
      height: 40px;
      line-height: 40px;
      margin: 0 auto;
      width: 100%;
      text-align: center;
      font-size: 15px;
      font-weight: 700;
      background:linear-gradient(90deg,rgba(241,104,57,1) 0%,rgba(220,49,81,1) 100%);
      border-radius: 20px;
      color: #fff;
    }
  }
</style>