<template>
    <view
        class="directory"
    >
        <view
            v-for="(directory, index) in directories"
            :key="index"
        >
            <!-- 大图样式 -->
            <directory-big-pic-item
                v-if="directory.status == '0'"
                :top-line="index !== 0"
                :title="directory.title || ''"
                :image="directory.img"
                :status-text="directory.statusText"
                :status="directory.status"                    
                :audience="directory.audience"
                :url="directory.ori_url || ''"
                :out-link="directory.outLink"
                :date="directory.date"
                :time="directory.time"
                :is-na-link="directory.status !== -1"
                :module="mod"
                :livesource="livesource"
            />
            <!-- 左文右图 -->
            <directory-item
                v-else
                :top-line="index !== 0"
                :title="directory.title || ''"
                :image="directory.img"
                :status-text="directory.statusText"
                :status="directory.status"
                :audience="directory.audience"
                :url="directory.ori_url || ''"
                :date="directory.date"
                :time="directory.time"
                :out-link="directory.outLink"
                :is-baijiahao="isBaijiahao"
                :is-na-link="directory.status !== -1"
                :module="mod"
                :livesource="livesource"
                :theme-color="themeColor"
                @liveItem="liveItem"
            />
        </view>
    </view>
</template>

<script>

import DirectoryItem from './DirectoryItem';
import DirectoryBigPicItem from './DirectoryBigPicItem';

export default {
    config: {
        component: true
    },
    options: {
        addGlobalClass: true
    },
    props: {
        directories: {
            type: Array,
            default: () => []
        },
        showLogClass: String,
        isBaijiahao: {
            type: Boolean,
            default: false
        },
        mod: {
            type: String,
            default: ''
        },
        livesource: {
            type: String,
            default: ''
        },
        themeColor: {
            type: String,
            default: ''
        },
    },
    components: {
        'directory-item': DirectoryItem,
        'directory-big-pic-item': DirectoryBigPicItem
    },
    methods: {
        liveItem() {
            this.$emit('liveItem');
        }
    }
};
</script>

<style lang="less" scoped>
.directory {
    background: #FFF;
}
</style>
