order-detail-item.vue 1.92 KB
<template>
  <div class="order-item-wrapper">
    <div class="item-img">
      <image-format
        alt=""
        :src="goodsInfo.goodImg"
        :width="180"
        :height="180"
      />
    </div>
    <div class="item-info">
      <div>
        <div class="price-status">
          <span class="price">¥{{ goodsInfo.goodPrice }}</span>
        </div>
        <p class="item-name">
          {{ goodsInfo.productName }}
        </p>
      </div>
      <p class="item-spec">
        <span>{{ goodsInfo.colorName }},</span>
        <span>{{ goodsInfo.sizeName }}码</span>
      </p>
    </div>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";

const { mapGetters } = createNamespacedHelpers("order/orderDetail");

export default {
  computed: {
    ...mapGetters(["goodsInfo"])
  }
};
</script>

<style lang="scss" scoped>
.order-item-wrapper {
  display: flex;

  .item-img {
    width: 180px;
    height: 180px;
    justify-content: center;
    display: flex;
    align-items: center;

    & > img {
      max-height: 100%;
      max-width: 100%;
    }
  }

  .item-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .item-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-left: 20px;
    font-size: 24px;
    justify-content: space-between;

    .price-status {
      display: flex;
      justify-content: space-between;
      margin-bottom: 12px;

      .price {
        font-size: 28px;
        color: #d0021b;
        letter-spacing: 0;
        font-weight: bold;
      }

      .status {
        color: #000;
        letter-spacing: 0;
        font-weight: bold;
      }
    }

    .item-name {
      color: #999;
      letter-spacing: 0;
      line-height: 36px;
    }

    .item-spec {
      font-weight: bold;

      & > :last-child {
        padding-left: 10px;
      }
    }
  }
}
</style>