<template>
  <div class="collection">
    <div class="d-body" v-if="paging.total>0">
      <ul>
        <li class="collectionHover" @click="clickItem(item)" v-for="(item,i) in tableData" :key="i">
          <div>
            <img :src="item.thumb" :alt="item.title">
          </div>
          <div>
            <span :title="item.name">{{item.name||'-'}}</span>
            <img :src="require('@/assets/images/xinjiang/enter.png')" alt="">
          </div>
        </li>
      </ul>
      <Paging class="paging" @changeCurrent="data=>{this.$emit('changeCurrent',data)}" v-if="paging.total>0" :paging="paging" />
    </div>

    <div class="norecord" v-else>暂无数据</div>
  </div>
</template>

<script>
import Paging from '@/components/Paging'

export default {
  props:{
    tableData:Array,
    paging:Object
  },
  components:{
    Paging
  },
  data(){
    return {
      
    }
    
  },
  mounted(){
  },
  watch:{
  
  },
  methods:{
    clickItem(item){
      this.$showBroadcast({
        item,
        zhuti:this.theme
      })
    },
  }
}
</script>

<style lang="less" scoped>
.collection{
  position: relative;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 30vh;
  
  .d-body{
    width: 100%;
    text-align: center;
    position: relative;
    padding-bottom: 104px;
    >ul{
      width: 100%;
      min-height: 70vh;
      text-align: left;
      >li{
        font-size: 0;
        display: inline-block;
        width: 310px;
        margin-right: 18px;
        text-align: center;
        margin-bottom: 37px;
        cursor: pointer;
        &:nth-child(3n){
          margin-right: 0;
        }
        >div{
          background: linear-gradient(180deg, #A2A2A2 0%, #606060 100%);
          &:first-child{
            height: 200px;
            position: relative;
            overflow: hidden;
            >img{
              position: absolute;
              top: 50%;
              left: 50%;
              transform: translate(-50%,-50%);
              width: 100%;
            }
          }

          &:last-child{
            height: 50px;
            padding: 0 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            color: #333;
            box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
            >span{
              width: calc(100% - 40px);
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
              word-break: break-all;
              font-weight: bold;
              text-align: left;
            }
            >img{
              width: 30px;
              height: 30px;
            }
          }
          
        }
        &:hover{
          >div{
            &:last-child{
              >span{
                color: #fff;
              }
            }
          }
        }
      }
    }
    .paging{
      margin-top: 27px;
      font-weight: normal;
    }
  }
  
  .norecord{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 16px;
    color: #000;
  }
}
</style>