<template>
    <view
        class="hospital-doctor"
        :class="tags && tags.length ? 'title-space' : ''"
    >
        <screening-conditions
            v-if="tags && tags.length && expertList.more && expertList.more.link"
            :tags="tags"
            :source-page="sourcePage"
            @navigateToDoclist="navigateToDoclist"
        />
        <view
            v-for="(expert,index) in expertList.list"
            :key="index"
            class="hospital-doctor-item"
        >
            <doctor-item :doctor-item="expert"/>
            <view v-if="index !== expertList.list.length - 1" class="c-line-superfine-after"></view>
        </view>
    </view>
</template>

<script>
/**
 * @file 医院主页挂载医生
 * @author 赵强
 * @categories 医院主页
 * @tags [sub-component]
 */
import * as core from '@utils/core';
import {navigate} from '@utils/navigate';
import DoctorItem from '../../doctor/hospital-doctor';
import ScreeningConditions from '../../common/screening-conditions';
export default {
    config: {
        component: true
    },
    components: {
        DoctorItem,
        ScreeningConditions
    },
    props: {
        /**
        * 医生列表
        */
        expertList: {
            type: Object,
            default: () => ({})
        }
    },
    data() {
        return {
            tags: [],
            sourcePage: '0'
        };
    },
    mounted() {
        let objExpertList = this.expertList && !core.isEmptyObject(this.expertList);
        if (objExpertList) {
            this.tags = this.expertList.tag || [];
        }
    },
    methods: {
        navigateToDoclist(jumpUrl = '') {
            jumpUrl && navigate({
                url: jumpUrl,
            });
        },
    }
};
</script>

<style lang="less" scoped>
.hospital-doctor {
    .hospital-doctor-item {
        margin-top: 15px;
    }
}

.title-space {
    margin-top: 15px;
}
</style>

