<template>
    <div class="literacy-detail-container">
        <div class="literacy-mgt-top" @click="backList">
            <Icon type="md-arrow-round-back" size="20" />
            <span style="margin-left:10px">返回素养课程</span>
        </div>
        <vuescroll>
            <div class="literacy-block-box">
                <div class="video-info-wrap">
                    <h1 class="video-title">{{videoInfo.title}}</h1>
                    <video :src="videoInfo.link" class="video-box" controls="controls"  autoplay="autoplay"></video>
                    <p class="info-item" v-show="videoInfo.reporter">
                        <span class="info-label">报告人：</span>
                        <span>{{videoInfo.reporter}}</span>
                    </p>
                    <p class="info-item" v-show="videoInfo.unit">
                        <span class="info-label">单位：</span>
                        <span>{{videoInfo.unit}}</span>
                    </p>
                    <p class="info-item"  v-show="videoInfo.content">
                        <span class="info-label">简介：</span>
                        <span>{{videoInfo.content}}</span>
                    </p>
                </div>
                <div class="more-link-wrap">
                    <p class="more-title">
                        更多课程
                        <Icon custom="iconfont icon-handle-down" size="20" />
                    </p>
                    <div class="video-list-box">
                        <vuescroll>
                            <div class="video-item" v-for="(item,index) in videoList" :key="index" @click="chooseCus(index)">
                                <img :src="item.poster" class="video-poster">
                                <div style="margin-left:15px">
                                    <p class="video-attr-item">
                                        <span class="info-label">报告人：</span>
                                        <span>{{item.reporter}}</span>
                                    </p>
                                    <p class="video-attr-item">
                                        <span class="info-label">单位：</span>
                                        <span>{{item.unit}}</span>
                                    </p>
                                    <p class="video-attr-item">
                                        <span class="info-label">主题：</span>
                                        <span>{{item.title}}</span>
                                    </p>
                                </div>
                            </div>
                        </vuescroll>
                    </div>

                </div>
            </div>
        </vuescroll>
    </div>
</template>
<script>
export default {
    data() {
        return {
            keyword: '',
            videoInfo: {},
            videoList: []
        }
    },
    methods: {
        search() {

        },
        backList() {
            this.$router.push({
                name: 'literacy'
            })
        },
        chooseCus(index){
            this.videoInfo = this.videoList[index]
        }
    },
    created() {
        this.videoList = require('@/static/video.json')
        this.videoInfo = this.$route.params.videoInfo || this.videoList[0]
    }
}
</script>
<style lang="less" scoped>
.info-label{
    color: #808695;
}
.video-list-box {
    height: 620px;
}
.video-attr-item {
    font-size: 12px;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 180px;
    white-space: nowrap;
}
.video-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    cursor: pointer;
    &:hover{
        background: #f0f0f0;
    }
}
.video-poster {
    width: 120px;
}
.more-title {
    height: 35px;
    line-height: 35px;
    font-size: 12px;
    border-bottom: 1px solid #eee;
    padding-left: 10px;
}
.video-title {
    margin-bottom: 15px;
}
.info-item {
    margin: 10px 0px;
    font-size: 16px;
}
.video-box {
    // height: 600px;
    width: 60%;
}
.literacy-detail-container {
    width: 100%;
    height: 100%;
    padding: 15px;
}
.literacy-block-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
}
.video-info-wrap {
    width: 78%;
    min-height: 600px;
    background: white;
    padding: 15px;
}
.more-link-wrap {
    width: 20%;
    min-height: 600px;
    background: white;
}
.literacy-mgt-top {
    width: 100%;
    height: 40px;
    background: white;
    box-shadow: 0px 2px 5px #e9e9e9;
    padding-left: 10px;
    padding-right: 20px;
    margin-bottom: 10px;
    line-height: 40px;
    cursor: pointer;
}
</style>