<template>
    <router-link
        :to="{
            path: '/' + $route.params.companyId + '/newsDetail',
            query: {
                id: info.id
            }
        }"
        class="news"
    >
        <van-image
            width="calc(100vw - 32px)"
            height="calc(37vw - 12px)"
            :radius="30"
            :src="getImg(info.pic)"
            fit="cover"
        />
        <div class="news-content">
            <div class="text1">{{ info.title }}</div>
            <div class="text2">{{ info.subtitle }}</div>
        </div>
    </router-link>
</template>

<script>
export default {
    props: {
        info: {
            type: Object,
            default: () => {
                return {};
            }
        }
    }
};
</script>

<style lang="less" scoped>
.news {
    background: #1c1e25;
    border-radius: 30px;
    overflow: hidden;
    margin: 16px;
    display: block;
    .van-image {
        display: block;
    }

    .news-content {
        padding: 10px 16px;
        .text1 {
            font-size: 14px;
            font-weight: bold;
            line-height: 24px;
            color: #ffffff;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .text2 {
            color: @text3;
            line-height: 17px;
            font-size: 12px;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
            margin-top: 2px;
        }
    }
}
</style>
