<template>
  <div class="container" v-lz-skuid="exposure.skuId">
    <img
      alt="商品"
      :src="exposure.imagePath ? exposure.imagePath : exposure.skuImg"
    />
    <div class="exposure-info">
      <span class="name">
        {{ exposure.name ? exposure.name : exposure.skuName }}
      </span>
      <div class="price">
        <span>￥</span>
        {{ exposure.price ? exposure.price : exposure.skuPrice }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    exposure: {
      type: Object,
      require: true
    }
  }
};
</script>

<style lang="scss" scoped>
.container {
  height: 4.6rem;
  width: 3.15rem;
  background-color: white;
  padding: 0.18rem 0.26rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;

  img {
    width: calc(3.15rem - 0.52rem);
    height: calc(3.15rem - 0.52rem);
  }

  .exposure-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.24rem;
    gap: 0.15rem;
    width: 100%;
    .name {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2; // 控制多行的行数
      -webkit-box-orient: vertical;
    }

    .price {
      color: #e2231a;
    }
  }
}
</style>
