<template>
  <section class="bind-cart-wrapper">
    <article class="left">
      <div class="top">
        <span class="discount">￥{{(cardInfo.preferentialPrice || cardInfo.costPrice) | formatMoney}}</span>
        <span v-show="cardInfo.preferentialPrice" class="price">
          <del>原价￥{{cardInfo.costPrice | formatMoney}}</del>
        </span>
      </div>
      <div class="bottom">
        <img src="../../images/cme/phrase2/info.png" />
        <span>激活或购买后可学习课程</span>
      </div>
    </article>
    <article class="right">
      <span class="left" @click="changeClick">去激活</span>
         <span @click="gotoBuy" class="right">去购买</span>
    </article>
  </section>
</template>
<script>
export default {
  props: {
    cardInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {};
  },
  methods: {
    changeClick(){
      this.$emit("changeClick")
    },
    gotoBuy() {
      this.$emit("gotoBuy");
    }
  }
};
</script>
<style  lang="less" scoped>
.bind-cart-wrapper {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: 100%;
  display: flex;
  flex-direction: row;
  height: 60px;
  line-height: 1;
  justify-content: space-between;
  padding: 10px 15px;
  font-size: 14px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.1);
  .left {
    display: flex;
    flex-direction: column;
    height: 40px;
    line-height: 1;
    font-size: 12px;
    // align-items: ;
    .top {
      margin-top: 3px;
      height: 24px;
      .discount {
        color: #fb5b52;
        font-size: 18px;
        font-weight: 700;
        margin-right: 4px;
      }
      .price {
        color: #979899;
      }
    }
    .bottom {
      display: flex;
      flex-direction: row;
      img {
        width: 12px;
        height: 12px;
        margin-left: 1px;
        margin-right: 4px;
      }
      color: #979899;
    }
  }
  .right {
    display: flex;
    flex-direction: row;
    span {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      width: 80px;
      font-size: 14px;
      font-weight: 400;
      text-align: center;
      color: #7f7f7f;
      border: 1px solid #d2b573;
      &.left {
        border-radius: 20px 0px 0px 20px;
        border-right-style: none;
        // color: #ff7a4b;
      }
      &.right {
        // background: linear-gradient(
        //   137deg,
        //   rgba(255, 166, 95, 1) 0%,
        //   rgba(255, 122, 75, 1) 100%
        // );
        border-radius: 0px 20px 20px 0px;
        // color: #fff;
      }
    }
  }
}
</style>