<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">
            <wenzhanList currentName='index' :listdata="menuslist" ></wenzhanList>
        </view>

    </view>
</template>
<script>
import wenzhanList from '@/pages/components/wenzhanList.vue'

import {moduleByFour} from '@/http/api/common.js'
export default {
components: {
    wenzhanList,
},
data() {
    return {
        menuslist:[],
        info:{
            title:'最新资讯'
        }
    }
},
async mounted() {
   this.getmoduleByFour()
},
methods: {
    async getmoduleByFour(){
        //获取模块4
        let res = await moduleByFour()
        this.menuslist = []
        if (res.data.code == 200) {
            this.info = res.data.data
            this.menuslist = res.data.data.articleVoList

        }
    },
    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 auto;
    justify-content: flex-start;
    width: 90vw;
    height: 160rpx;
}
.box_img{
    width: 224rpx;
    height: 150rpx;
    border-radius: 16rpx;
    background-color: #999999;
}
.box_right{
    margin-left: 10rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
.box_title{
    width: 454rpx;
    height: 80rpx;
    font-size: 28rpx;
    font-weight: bold;
    color: #333333;
    line-height: 40rpx;

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

    font-size: 28rpx;
    font-weight: 400;
    color: #999999;
    line-height: 40rpx;
}

</style>
    