<template>
  <vm-image-list
    :data="dataImageList"
    :total="total"
    @delete-ok="deletefn"
    class="vm-margin"
    @getList="getActorList"
    @updateList="getActorList(1,'')"
  ></vm-image-list>
</template>

<script>
import VmImageList from '@/components/ctop/vm-image-list'
import { actorList  } from '@/api/actor'
export default {
  name: 'ImageList',
  components: {
    VmImageList
  },
  mounted() {
    this.$nextTick(() => {
      this.getActorList(1)
    })
  },
  methods: {
    deletefn: function(data) {
      for (let i = 0; i < this.dataImageList.length; i++) {
        if (this.dataImageList[i].id === data.id) {
          this.dataImageList.splice(i, 1)
        }
      }
    },
    getActorList(page,name) {
      this.dataImageList = []
      actorList({ pageNo: page, pageSize: 8,name:name }).then(res => {
        if (res.code == 0) {
          this.dataImageList = res.result.records
          this.total = res.result.total
        }
      })
    }
  },
  data: function() {
    return {
      dataImageList: [
        {
          id: '1',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '2',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569379371&di=cc78b98e59098b91b71b86aef92dcf43&imgtype=jpg&er=1&src=http%3A%2F%2Fi3.sinaimg.cn%2Fent%2Fj%2F2009-08-31%2FU2223P28T3D2676725F358DT20090831022144.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '3',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '4',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '5',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '6',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '7',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '8',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '9',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '10',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '11',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        },
        {
          id: '12',
          title: '佟丽娅',
          img:
            'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569329515&di=192e14566c758fcd55c1cc71fa19421a&imgtype=jpg&er=1&src=http%3A%2F%2Fstatic.ws.126.net%2Fent%2F2015%2F8%2F5%2F20150805175229d97cb.jpg',
          desc: '代表作《北京爱情故事》',
          detailUrl: 'http://www.baidu.com',
          editUrl: 'http://www.baidu.com'
        }
      ],
      total: null
    }
  }
}
</script>
