<template>
  <div
    class="item-list-con"
    @click="goGoods(data.goodsId, data.type, data.salesType)"
  >
    <div class="con-wrapper flex-default">
      <div class="left-img">
        <img class="thumb" :src="data.thumb" />
        <div class="goods-stock" v-if="data.stockCount">
          <m-icon icon="icon-hot-goods" :size="10" />
          <span>热销中</span>
        </div>
        <div class="goods-stock" v-else>
          <m-icon icon="icon-sell-out" :size="10" />
          <span>已售罄</span>
        </div>
      </div>
      <div class="right-con flex-default">
        <div class="title">
          {{ data.name }}
        </div>
        <div class="circulationCount flex-default">
          <div class="label">限量</div>
          <div class="num">{{ data.circulationCount }}份</div>
        </div>
        <div class="value">
          <span class="yen">￥</span>{{ data.defaultPrice || 0 }}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    data: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
};
</script>
<style lang="less" scoped>
.item-list-con {
  padding: 25px 0 0 0;
  .con-wrapper {
    background: url(~@/assets/img/blind-card.png) no-repeat;
    background-size: 100% 100%;
    margin-bottom: 10px;
    padding: 28px;
    height: 160px;
  }
  .left-img {
    position: relative;
    width: 120px;
    height: 146px;
    border-radius: 10px;
    // overflow: hidden;
    .thumb {
      width: 120px;
      height: 146px;
      border-radius: 10px;
      object-fit: cover;
      margin-top: -25px;
    }
    .goods-stock {
      position: absolute;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 0 0 10px 10px;
      width: 120px;
      height: 18px;
      bottom: 25px;
      left: 0;
      line-height: 18px;
      text-align: center;
      span {
        font-size: 11px;
        color: #ffffff;
        margin-left: 1px;
      }
    }
  }
  .right-con {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-around;
    height: 130px;
    padding: 5px 10px 10px;
    .title {
      width: 170px;
      font-size: 15px;
      font-weight: 500;
      color: #030711;
      line-height: 21px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .circulationCount {
      width: 86px;
      height: 16px;
      line-height: 16px;
      font-size: 10px;
      overflow: hidden;
      border-radius: 2px;
      margin-bottom: 22px;
      .label {
        width: 35px;
        height: 16px;
        text-align: center;
        background: #f3e0bc;
        color: #030711;
      }
      .num {
        // width: 51px;
        padding:0 8px;
        min-width: 51px;
        height: 16px;
        background: #4b4b4c;
        color: #f3e0bc;
        text-align: center;
      }
    }
    .value {
      font-size: 22px;
      color: #f78706;
      .yen {
        display: inline-block;
        font-size: 14px;
        transform: scale(0.8);
        font-weight: normal;
        width: 14px;
      }
    }
  }
}
</style>