<template>
  <div class="goods-list-template-con">
    <div class="hot-recommend-item-con">
      <div class="header flex-default">
        <div class="title flex-default">
          推荐版权
          <!-- {{title}} -->
        </div>
        <!-- <text class="more">更多</text> -->
      </div>
      <div class="item-list-con">
        <div
          class="item-con"
          v-for="(item, index) of list"
          :key="'goods-item-' + index"
          @click="goGoods(item.goodsId, item.type)"
        >
          <div class="left">
            <img
              class="thumb"
              :src="item.thumb"
            />
          </div>
          <div class="footer">
             <div class="title">
              {{ item.name }}
            </div>
            <div class="bottom flex-between">
              <!-- <div class="label"> 特价 </div> -->
              <div class="value">
                <span class="yen">￥</span>{{ item.defaultPrice || 0 }}
              </div>
              <div class="right">
                {{item.categoryName}}
              </div>
            </div>
            <!-- <div class="tips"> 抢 </div> -->
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "推荐NFT",
    },
    line: {
      type: Number,
      default: 2,
    },
    floorId: String,
  },
  data() {
    return {
      loading: true,
      list: []
    };
  },
  computed: {},
  methods: {
    requestData() {
      this.loading = true;
      let param = this.floorId;
      this.$api({
        apiName: "getFloorGoods",
        postData: {
          param,
          page: 1,
          size: this.line * 3,
        },
        success: (res) => {
          this.list = res.list;
          setTimeout(() => {
            this.loading = false;
            this.$emit("loadSuccess");
          }, 500);
        },
      });
    },
  },
};
</script>

<style lang="less">
.goods-list-template-con {
  padding: 18px 11px;
  .hot-recommend-item-con {
    height: 328px;
    background: #ffffff;
    border-radius: 8px;
    padding: 0 9px 20px;
    .header {
      justify-content: space-between;
      align-items: center;
      color: #140603;
      height: 50px;
      line-height: 20px;
      padding: 15px 0;
      .title {
        font-weight: bold;
        font-size: 16px;
        align-items: flex-start;
        line-height: 20px;
        // background: url(~@/assets/img/hot-recommend-nft-title.png) no-repeat;
        background-size: 100%;
        width: 83px;
        height: 15px;
      }
      .more {
        font-size: 14px;
      }
    }
    .item-list-con {
      justify-content: space-between;
      flex-wrap: wrap;
      justify-content: space-between;
      &::after {
        content: "";
        display: block;
        width: 107px;
      }
      .item-con {
        // width: 107px;
        // height: 124px;
        display: flex;
        margin-bottom: 10px;
        overflow: hidden;
        border-radius: 6px;
        .left {
          height: 104px;
          width: 104px;
          background-color: #F5F5F5;
          border-radius: 4px;
          overflow: hidden;
          .thumb {
            // height: 76px;
            width: 104px;
            background-position: center;
            margin: auto;
            object-fit: cover;
          }
          .title {
            flex: 1;
            width: 82rpx;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 12px;
            color: #222222;
            text-align: center;
            margin: 0 auto;
            line-height: 16px;
          }
        }
        .footer {
          flex: 1;
          display: flex;
          flex-direction: column;
          justify-content:space-around;
          margin-left: 12px;
          .bottom {
            width:100%;
            .label {
              font-size: 12px;
              transform: scale(0.8);
            }
            .value {
              font-size: 15px;
               color: #F78706;
              .yen {
                display: inline-block;
                font-size: 12px;
                transform: scale(0.8);
                font-weight: normal;
                width: 9px;
              }
            }
            .right{
              width: 65px;
              height: 19px;
              line-height: 19px;
              font-size: 12px;
              text-align: center;
              background: #F5F7FB;
              border-radius: 10px;
              color:#999999 ;
            }
          }
          .tips {
            height: 100%;
            width: 26px;
            font-size: 12px;
            color: #ffffff;
            background-color: #1a1d20;
            padding-left: 5px;
            position: relative;
            overflow: hidden;
            text-align: center;
            flex-shrink: 0;
            &::after,
            &::before {
              content: "";
              display: inline-block;
              width: 0;
              height: 0;
              border-left: 5px solid transparent;
              border-right: 5px solid transparent;
              border-top: 15px solid #dd2e41;
              position: absolute;
              left: -5px;
            }
            &::after {
              top: 13px;
            }
          }
        }
      }
    }
  }
}
</style>