<template>
  <div class="product">
    <div class="product-header">全部产品信息</div>
    <div v-for="(item, index) in goodInfo" :key="index" class="product-body">
      <div class="product-body-title">{{ item.groupName }}</div>
      <div v-for="(i, inde) in item.groupAtts" :key="inde" class="product-body-table">
        <span>{{ i.attsName }}</span>
        <span>{{ i.attsValue }}</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return { goodInfo: [] };
  },
  created() {
    const data = this.$route.params.data || '';
    this.goodInfo = data;
  }
};
</script>
<style lang="less" scoped>
.product {
  padding: @padding-lg;
  min-height: 100%;
  background: @white;
  &-header {
    display: inline-block;
    padding-left: @padding-sd;
    width: ~'calc(100% - @{padding-xs} - 6px )';
    height: 40px;
    line-height: 40px;
    // .text-size(16);
    font-size: 16px;
    color: @black;
    background: @gray-1;
    border: 1px solid @gray-2;
    border-bottom: 0;
    font-weight: @font-weight-bold;
  }
  &-body {
    display: grid;
    &-title {
      display: inline-block;
      padding-left: @padding-sd;
      width: ~'calc(100% - @{padding-xs} - 6px )';
      height: 35px;
      line-height: 35px;
      border: 1px solid @gray-2;
      border-bottom: 0;
      font-size: 13px;
      font-weight: @font-weight-bold;
    }
    &-table {
      display: flex;
      span {
        display: inline-block;
        .text-size(12);
        border: 1px solid @gray-2;
        border-bottom: 0;
        &:first-child {
          display: flex;
          align-items: center;
          padding-left: @padding-x;
          width: 92px;
          color: @gray-4;
          border-right: 0;
        }
        &:last-child {
          padding: @padding-x;
          flex: 1;
          color: @gray-5;
        }
      }
    }
    &:last-child {
      .product-body-table {
        &:last-child {
          span {
            border-bottom: 1px solid @gray-2;
          }
        }
      }
    }
  }
}
</style>
