<template>
    <div class="literacy-container">
        <div class="literacy-search">
            <Input v-model="keyword" suffix="ios-search" placeholder="搜索" style="width: 200px;margin-top:0px" @on-change="search" />
        </div>
        <!-- <div class="literacy-mgt-top">
            <Input v-model="keyword" suffix="ios-search" placeholder="搜索" style="width: 200px;margin-top:0px" @on-change="search" />
        </div> -->
        <vuescroll>
            <div class="literacy-block-box">
                <div class="literacy-item" v-for="(item,index) in videoListShow" :key="index"  @click="toDetailPage(index)">
                    <div :class="['literacy-img',index == 5 || index == 6 ? 'last-img' : '']" :style="{backgroundImage: `url(${item.img})`}"></div>
                    <div class="info-item">
                        <!-- <span class="info-label">报告人：</span> -->
                        <span>{{item.name}}</span>
                    </div>
                </div>
            </div>
            <EmptyData textContent="未搜到相关课程" v-show="!videoListShow.length" :top="100"></EmptyData>
        </vuescroll>
    </div>
</template>
<script>
export default {
    data() {
        return {
            keyword: '',
            videoList: [],
            videoListShow: []
        }
    },
    methods: {
        search() {
            if (this.keyword) {
                this.videoListShow = this.videoList.filter(item => {
                    return JSON.stringify(item).includes(this.keyword)
                })
            } else {
                this.videoListShow = this.videoList
            }

        },
        toDetailPage(index) {
            window.open(this.videoListShow[index].link)
        }
    },
    created() {
        this.videoList = [
            {
                name: '《中国教育学刊》课堂变革于教学领导力提升专题培训',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/%E4%B8%AD%E5%9B%BD%E6%95%99%E8%82%B2%E5%AD%A6%E5%88%8A.PNG',
                link: 'https://sokrates.teammodel.cn/exhibition/tbavideo#/myChannel/858'
            },
            {
                name: '《中国教育学刊》基础教育国家级教学成果推广会',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/%E4%B8%AD%E5%9B%BD%E6%95%99%E8%82%B2%E5%AD%A6%E5%88%8A1.PNG',
                link: 'https://sokrates.teammodel.cn/exhibition/tbavideo#/myChannel/837'
            },
            {
                name: '智慧教学实验学校联盟（西南大学）',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/%E8%A5%BF%E5%8D%97%E5%A4%A7%E5%AD%A6.PNG',
                link: 'https://sokrates.teammodel.cn/district/JXLMPT#/'
            },
            {
                name: '全球醍摩豆AI智慧学校联盟',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/%E6%99%BA%E6%85%A7%E5%AD%A6%E6%A0%A1%E8%81%94%E7%9B%9F.PNG',
                link: 'https://sokrates.teammodel.cn/exhibition/tbavideo#/myChannel/82'
            },
            {
                name: '苏格拉底平台',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/team-model.jpg',
                link: 'https://sokrates.teammodel.cn/exhibition/tbavideo#/'
            },
            {
                name: '国家公共资源教育平台',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/%E5%85%AC%E5%85%B1%E6%9C%8D%E5%8A%A1%E5%B9%B3%E5%8F%B0.png',
                link: 'https://www.eduyun.cn/'
            },
            {
                name: '中国大学慕课MOOC',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/MOOC.png',
                link: 'https://www.icourse163.org/'
            },
            {
                name: '政策解读',
                img: 'https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/image/%E6%94%BF%E7%AD%96%E8%A7%A3%E8%AF%BB1.jpg',
                link: '/home/policy'
            }
        ]
        this.videoListShow = this.videoList
    }
}
</script>
<style lang="less" scoped>
.last-img {
    background-size: contain !important;
    background-position: center;
}
.literacy-container {
    width: 100%;
    height: 100%;
    background: white;
    padding: 15px;
}
.literacy-block-box {
    // background: white;
    width: 100%;
    // min-height: 800px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
}
.literacy-item {
    width: 200px;
    height: 200px;
    background: #fcfcfc;
    border: 1px solid #f0f0f0;
    padding-bottom: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 30px;
    margin-right: 30px;
    cursor: pointer;
    height: fit-content;
    padding: 10px;
    box-sizing: content-box;
    transition: all 0.2s ease 0s;
    .info-label {
        color: #a5a5a5;
    }
    &:hover {
        box-shadow: 0 26px 40px -24px #aaa;
        transform: translateY(-4px);
    }
    .literacy-img {
        width: 200px;
        height: 200px;
        background-size: cover;
        background-repeat: no-repeat;
        border-radius: 50%;
    }
    .info-item {
        margin-top: 10px;
        width: 100%;
        padding-left: 5px;
        font-size: 16px;
        text-align: center;
    }
}
.literacy-mgt-top {
    width: ~"calc(100% - 20px)";
    height: 40px;
    box-shadow: 0px 2px 5px #e9e9e9;
    margin-left: 10px;
    padding-left: 10px;
    padding-right: 20px;
    margin-bottom: 10px;
    line-height: 40px;
}
.literacy-search{
    float: right;
    margin-top: -52px;
    margin-right: 20px;
}
</style>