<template>
    <view>
        <view class="title" >
            <view class="title_text">{{info.title}}</view>
            <view class="title_more" @click="clicktoMore">更多></view>
        </view>
        <view v-if="menuslist.length>0">
            <videoList :listdata="menuslist" ></videoList>
        </view>
    </view>
</template>
<script>
import videoList from '@/pages/components/videoList.vue'
import {moduleByFive} from '@/http/api/common.js'
export default {
    components: {
        videoList,
    },
data() {
    return {
        menuslist:[],
        info:{
            title:'最新资讯'
        }
    }
},
async mounted() {
   this.getmoduleByFive()
},
methods: {
    async getmoduleByFive(){
        //获取模块5
        let res = await moduleByFive()
        this.menuslist = []
        if (res.data.code == 200) {
            this.info = res.data.data
            if (res.data.data.articleVoList) {
                const arr = res.data.data.articleVoList;
                this.menuslist = arr.slice(0, 2);
            }
        }
    },
    clicktoMore(){
        if (this.info?.moreToSubId && this.info?.moreToColumnId) {
            let data = {
                curNowid:this.info?.moreToColumnId,
                curNowsubid:this.info?.moreToSubId,
            }
            uni.setStorageSync('curNowdata',JSON.stringify(data) );
            uni.switchTab({
                url: '/pages/home/Information',
            });
        }
    },
}
}
</script>

<style>
.title{
    display: flex;
    width: 90vw;
    justify-content: space-between;
    margin: 0 auto;
}
.title_text{
    width: 128rpx;
    height: 45rpx;
    font-size: 32rpx;
    font-weight: bold;
    color: #333333;
    line-height: 45rpx;
}
.title_more{
    width: 80rpx;
    height: 40rpx;
    font-size: 28rpx;
    font-weight: 500;
    color: #999999;
    line-height: 40rpx;
}
.box{
    display: flex;
    margin: 20rpx 0;
    justify-content: flex-start;
    width: 90vw;
    flex-direction: column;
    align-items: center;
}
.box_img{
    width: 100%;
    height: 395rpx;
    border-radius: 16rpx;
    background-color: #999999;
}
.box_right{
    margin-left: 10rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
.box_title{
    width: 100%;
    height: 45rpx;
    font-size: 32rpx;
    font-weight: bold;
    color: #333333;
    line-height: 45rpx;

    display: -webkit-box;
    word-break: break-all;
    text-overflow: ellipsis;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp:1;
}
.box_bottom{
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.box_type{
    display: flex;
    justify-content: space-between;

    font-size: 28rpx;
    font-weight: 500;
    color: #999999;
    line-height: 40rpx;
}
.iconm_play{
    position: relative;
    left: 40%;
    top: -260rpx;
    z-index: 150;
}
</style>
    