<template>
  <div
    class="item-list-con"
    @click="goGoods(data.goodsId, data.type, data.salesType)"
  >
    <div class="img-box">
      <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="goods-desc">
      <div class="name">{{ data.name }}</div>
      <div class="desc flex-between">
        <div class="circulationCount flex-default">
          <div class="label">限量</div>
          <div class="num">{{ data.circulationCount }}份</div>
        </div>
        <div class="value">
          <m-price class="price" :amt="data.defaultPrice" :rmbSize="14" :intSize="22" :floatSize="22"/>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    data: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
};
</script>
<style lang="less" scoped>
.item-list-con{
    margin: 0 5px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 18px;
    .img-box{
        position: relative;
        width: 343px;
        height: 270px;
        .thumb{
            width: 100%;
            height: 100%;
            border-radius: 10px;
            object-fit: cover;
        }
        .goods-stock{
          position: absolute;
          top: 14px;
          left: 12px;
          background: rgba(0, 0, 0, 0.2);
          border-radius: 0 0 2px 2px;
          // width: 120px;
          height: 18px;
          line-height: 18px;
          text-align: center;
          padding: 0 4px;
          span {
            font-size: 11px;
            color: #ffffff;
            margin-left: 1px;
            margin-right: 1px;
          }
        }
    }
    .goods-desc{
        padding: 10px 15px 16px;
        border-radius: 0 0 8px 8px;
        .name{
            font-size: 18px;
            font-weight: 500;
            font-family: PingFangSC-Medium, PingFang SC;
            color: #030711;
            line-height: 25px;
            margin-bottom: 8px;
        }
        .desc{
          .circulationCount {
            // width: 86px;
            height: 16px;
            line-height: 16px;
            font-size: 10px;
            overflow: hidden;
            border-radius: 2px;
            .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;
            }
          }
        }
    }
}

</style>