<template>
    <router-link :to="info.path" class="service-box">
        <div class="service-top">
            <img :src="require(`../../assets/svgs/${info.icon}.svg`)" alt="" />
        </div>
        <div class="service-text">
            <div class="text1">0{{ index + 1 }}.</div>
            <div class="text2">{{ info.name }}</div>
        </div>

        <div class="service-hover">
            <div class="top">
                <div class="text">
                    <div>0{{ index + 1 }}.</div>
                    <div>{{ info.name }}</div>
                </div>
                <img :src="require(`../../assets/svgs/${info.icon}-02.svg`)" alt="" />
            </div>
            <div class="content">
                {{ info.content }}
            </div>
            <i class="iconfont iconfont-next"></i>
        </div>
    </router-link>
</template>

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

<style lang="less" scoped>
.service-box {
    display: block;
    width: 208px;
    border-radius: 2px;
    border: 1px solid rgba(56, 85, 142, 0.04);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    &::after {
        content: '';
        height: 4px;
        background: @prim;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2;
    }

    &:hover {
        .service-hover {
            top: 0;
        }
    }
}
.service-top {
    height: 170px;
    background: #fbfbfb;
    border-radius: 2px 2px 0px 0px;
    .flex();
    justify-content: center;
    .text {
        font-size: 16px;
        font-weight: bold;
        color: @prim;
        line-height: 24px;

        div {
            &:first-child {
                font-size: 25px;
                font-family: Impact;
                padding-bottom: 15px;
            }
        }
    }
    img {
        width: 88px;
        height: 88px;
        display: block;
        margin-left: 10px;
    }
}
.service-text {
    color: #ff8700;
    line-height: 24px;
    .flex();
    padding: 46px 0 64px;
    justify-content: center;
    .text2 {
        font-size: 20px;
        font-weight: bold;
    }

    .text1 {
        font-family: Impact;
        font-size: 22px;
    }
}
.service-content {
    font-size: 14px;
    color: #515151;
    line-height: 24px;
    padding: 24px 16px 16px;
    min-height: 130px;
    box-sizing: border-box;
}

.service-hover {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: #008a69;
    color: #fff;
    z-index: 3;
    padding: 16px;
    height: 100%;
    transition: top ease-in-out 0.3s;
    box-sizing: border-box;
    .top {
        height: 133px;
        .flex();
        justify-content: space-between;
        box-sizing: border-box;
        .text {
            font-size: 16px;
            font-weight: bold;
            line-height: 24px;

            div {
                &:first-child {
                    font-size: 25px;
                    font-family: Impact;
                    padding-bottom: 15px;
                }
            }
        }
        img {
            width: 70px;
            height: 70px;
            display: block;
            margin-left: 10px;
        }
    }
    .content {
        font-size: 14px;
        line-height: 24px;
        padding-top: 20px;
        border-top: 1px solid #ffffff;
    }
    .iconfont {
        font-size: 16px;
        position: absolute;
        right: 16px;
        bottom: 16px;
    }
}
</style>
