<template>
    <div>
        <div class="channelMenuTitle" v-if="skinId==1">
            {{title}}
        </div>
        <div class="channelMenuTitle_skin2" v-if="skinId==2">
            {{title}}
        </div>
        <div class="channelMenuList" v-if="skinId==1">
            <div v-for="item in navigateData">
                <NuxtLink :to="{path:`${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment==item.aLIas_pinyin}">{{item.alias}}</NuxtLink>
            </div>
        </div>
        <div class="channelMenuList_skin2" v-if="skinId==2">
            <div v-for="item in navigateData">
                <NuxtLink :to="{path:`${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment==item.aLIas_pinyin}">{{item.alias}}</NuxtLink>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import {ref} from 'vue';
//获得新闻数据
const props = defineProps({
    skinId:String,//组件样式
    navigateData:Array,//子导航数据
    routeId:Number//导航对应的cid
});
//获得导航名称
const title = ref("")
const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
    method: 'GET',
    query: {
        'catid': props.routeId,
    },
});
if (mkdata.code == 200) {
    title.value = mkdata.data.alias;
} 
//获取当前url路径
const route = useRoute();
//获得当前的完整路径
const fullPath = route.path;
const segments = fullPath.split('/');
const targetSegment = segments[1];
</script>

<style lang="less" scoped>
.channelMenuTitle {
    width: 1200px;
    height: 32px;
    line-height: 32px;
    font-size: 24px;
    color:#1C5468;
    font-weight: bold;
    text-align: center;
    background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250620/1750381219965589.jpg') no-repeat center center;
    margin-bottom: 25px;
}
.channelMenuTitle_skin2 {
    width: 1200px;
    height: 32px;
    line-height: 32px;
    font-size: 24px;
    color:#A91B33;
    font-weight: bold;
    text-align: center;
    background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250626/1750914827434788.jpg') no-repeat center center;
    margin-bottom: 25px;
}
.channelMenuList {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: #333;
    padding-bottom: 15px;
    div {
        font-size: 16px;
        font-weight: bold;
        width: 120px;
        height: 22px;
        line-height: 22px;
        a {
            color: #333;
            display: block;
            text-align: center;
            &:hover {
                color: #004564;
            }
        }
        a.active {
            color: #004564;
        }
    }
}
.channelMenuList_skin2 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: #333;
    border-bottom: 2px solid #A91B33;
    padding-bottom: 15px;
    div {
        font-size: 16px;
        font-weight: bold;
        width: 120px;
        height: 22px;
        line-height: 22px;
        a {
            color: #333;
            display: block;
            text-align: center;
            &:hover {
                color: #A91B33;
            }
        }
        a.active {
            color: #A91B33;
        }
    }
}
</style>