<template>
    <view class="feed-rumor--wrapper">
        <b-navigate
            v-for="(rumor, rumorIndex) in data"
            :key="rumorIndex"
            :url="rumor.unifiUrl"
            :extra="{
                mod: page + '-rumor-' + rumorIndex
            }"
        >
            <view
                :class="{
                    'c-gap-bottom-large': rumorIndex < data.length - 1
                }"
                class="feed-rumor"
            >
                <view class="feed-rumor-left">
                    <view
                        :class="[
                            rumor.attitude === 0 ? 'feed-rumor-icon--error' : 'feed-rumor-icon--right',
                            rumor.attitude === 0 ? 'm-icon-cuo' : 'm-icon-right'
                        ]"
                        class="feed-rumor-icon m-icon"
                    ></view>
                </view>
                <view class="feed-rumor-content">
                    <view class="feed-rumor-content-title">{{ rumor.title }}</view>
                    <view class="feed-rumor-content-description c-line-clamp2">{{ rumor.description }}</view>
                </view>
            </view>
        </b-navigate>
    </view>
</template>

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

<style lang="less" scoped>
.feed-rumor {
    display: flex;
    justify-content: space-between;
    background: #FFFFFF;
    box-shadow: 0 3px 16px 0 rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 12px 0;

    &-left {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }
    &-icon {
        font-size: .3rem;
        width: 30px;
        height: 30px;
        margin: 0 26px;
        &--error {
            color: #ff6050;
        }
        &--right {
            color: #00C8C8;
        }
    }

    &-content {
        flex: 1 1 auto;
        padding-right: 16px;

        &-title {
            font-size: .17rem;
            color: #333;
            font-weight: bold;
        }
        &-description {
            font-size: .14rem;
            color: #252525;
        }
    }
}
</style>