<template>
  <div class="hotbook-box">
    <div class="most-book">
      <div class="most-book-img">
        <img :src="bookdata[0].img">

      </div>
      <div class="most-book-txt book-rack">
        <div class="txt">
          <h3>书名：{{ bookdata[0].title }}</h3>
          <p>作者：{{ bookdata[0].author }}</p>
          <p>出版社：</p>
          <p>出版日期：</p>
        </div>
      </div>
    </div>
    <ul class="hotbook-list">
      <li v-for="(item,index) in bookdata" :key="index">
        <img :src="item.img">
        <p>{{ item.title }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'BookList',
  props: {
    bookdata: {
      type: Array,
      default: function() {
        return []
      }
    }
  },
  data() {
    return {

    }
  }

}
</script>

<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
.hotbook-box{
  overflow: hidden;
  overflow-y: auto;
  height: 100%;
}
.book-rack{
  margin: 160px 40px 28px 40px;
  padding: 38px 40px 40px 400px;
  height: 272px;
}
.most-book{
  position: relative;
  .most-book-img{
    position: absolute;
    left: 90px;
    bottom: 20px;
    img{
      width: 318px;
      height: 382px;
    }
  }
  .txt{
    // margin-left: 452px;
    color: #333;
    h3{
      font-size: 40px;
      font-weight: normal;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    p{
      font-size: 30px;
      margin-top: 8px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
}
.hotbook-list{
  margin: 0 40px;
  display: flex;
  flex-wrap: wrap;
  // justify-content: space-between;
  li{
    margin-bottom: 20px;
    margin-left: 48px;
    img{
      width: 300px;
      height: 360px;
    }
  }
  & li:nth-child(3n+1){
    margin-left: 0;
  }
}
</style>
