<template>
    <view
        class="feeds-featured">
        <view
            v-for="(item, index) in data"
            :key="index"
            class="feeds-featured__item--wrapper c-gap-top-large">
        <b-navigate
            :url="item.url"
            :extra="{
                mod: page + '-featured-' + index
            }"
        >
            <view class="feeds-featured__item">
                <image
                    :src="item.logo"
                    mod="center"
                    class="feeds-featured__item__logo c-gap-right"/>
                <view class="feeds-featured__item__text">{{item.text}}</view>
            </view>
        </b-navigate>
        </view>
    </view>
</template>

<script>
/**
 * @file 精选
 * @author yantingxi
*/
import BNavigate from '../../../components/common/navigate';
export default {
    config: {
        component: true
    },
    props: {
        data: {
            type: Array,
            default: () => []
        },
        page: {
            type: String,
            default: 'feed'
        }
    },
    components: {
        BNavigate
    },
    methods: {
    }
};
</script>

<style lang="less" scoped>
.feeds-featured {
    display: flex;
    flex-wrap: wrap;
    &__item {
        display: flex;
        align-items: center;
        color: #333;

        &--wrapper {
            width: calc((100% - 10px) / 2);
            background: #FFFFFF;
            border: 1px solid #F1F1F1;
            box-shadow: 0 2px 10px 0 rgba(0,0,0,0.05);
            border-radius: 25px;
            box-sizing: border-box;

            &:nth-child(2n) {
                margin-left: 10px;
            }

            &:nth-child(1),
            &:nth-child(2) {
                margin-top: 0;
            }
        }

        &__logo {
            margin-left: 7px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            flex: 0 0 auto;
        }

        &__text {
            font-size: .15rem;
            padding: 15px 0;
        }
    }
}
</style>