| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- <template>
- <div>
- <div class="channelMenuTitle_skin3" v-if="componentStyle == 1 || componentStyle == 2 || componentStyle == 3">
- {{title}}
- </div>
- <!--样式1-->
- <div class="channelMenuList" v-if="componentStyle==1">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">{{item.alias}}</NuxtLink>
- </div>
- </div>
- <!--样式2-->
- <div class="channelMenuList menuListStyle2" v-if="componentStyle==2">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">{{item.alias}}</NuxtLink>
- </div>
- </div>
- <!-- 样式3 -->
- <div class="channelMenuList menuListStyle3" v-if="componentStyle == 3">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">{{item.alias}}</NuxtLink>
- </div>
- </div>
- <!-- 样式4 -->
- <div class="channelMenuList menuListStyle4" v-if="componentStyle == 4">
- <div class="menuTitle">{{ title }}</div>
- <div class="menulist" v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
- </NuxtLink>
- </div>
- </div>
- <!-- 样式5 -->
- <div class="channelMenuList menuListStyle4 menuListStyle5" v-if="componentStyle == 5">
- <div class="menuTitle">{{ title }}</div>
- <div class="menulist" v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
- </NuxtLink>
- </div>
- </div>
- <!-- 样式6 -->
- <div class="channelMenuList menuListStyle4 menuListStyle6" v-if="componentStyle == 6">
- <div class="menuTitle">{{ title }}</div>
- <div class="menulist" v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
- </NuxtLink>
- </div>
- </div>
- <!--样式7-->
- <div class="menuListStyle7" v-if="componentStyle == 7">
- <div class="channelMenuListTitle">{{ title }}</div>
- <div class="hannelMenuListFloatMenu">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式8-->
- <div class="menuListStyle7 menuListStyle8" v-if="componentStyle == 8">
- <div class="channelMenuListTitle">{{ title }}</div>
- <div class="hannelMenuListFloatMenu">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式9-->
- <div class="menuListStyle7 menuListStyle9" v-if="componentStyle == 9">
- <div class="channelMenuListTitle">{{ title }}</div>
- <div class="hannelMenuListFloatMenu">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式10-->
- <div class="menuListStyle7 menuListStyle9 menuListStyle8" v-if="componentStyle == 10">
- <div class="channelMenuListTitle">{{ title }}</div>
- <div class="hannelMenuListFloatMenu">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式11-->
- <div class="menuListStyle11" v-if="componentStyle == 11">
- <div class="style11">
- <div class="channelMenuListTitle">
- <span>{{ title }}</span>
- </div>
- <div class="hannelMenuListFloatMenu">
- <div v-for="item in navigateData">
- <NuxtLink :to="{path:`/${targetSegment}/${item.aLIas_pinyin}/list-1.html`}" :class="{active:targetSegment2 == item.aLIas_pinyin}">
- <span class="title">{{item.alias}}</span>
- </NuxtLink>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import {ref} from 'vue';
- //获得新闻数据
- const props = defineProps({
- componentStyle:Number,//样式编号
- 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.parent_name;
- }
- //获取当前url路径
- const route = useRoute();
- //获得当前的完整路径
- const fullPath = route.path;
- const segments = fullPath.split('/');
- const targetSegment = segments[1];
- const targetSegment2 = segments[2];
- //判断当前为第几层的列表页
- // const routeLevel = ref(0);
- // if(route.name == "dir-list-id"){
- // routeLevel.value = 1;
- // console.log("当前的路由层级为:" + routeLevel.value);
- // }
- // if(route.name == "dir-dir-list-id"){
- // routeLevel.value = 2;
- // console.log("当前的路由层级为:" + routeLevel.value);
- // }
- </script>
- <style lang="less" scoped>
- //基本样式 start ---------------------------------------->
- .channelMenuTitle_skin3 {
- width: 1200px;
- height: 32px;
- line-height: 32px;
- font-size: 24px;
- color:#c82200;
- font-weight: bold;
- text-align: center;
- background: url('https://img.bjzxtw.org.cn/pre/image/png/20251010/176008410726316.png') no-repeat center center;
- margin-bottom: 25px;
- }
- .channelMenuList {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- color: #333;
- border-bottom: 2px solid #c82200;
- padding-bottom: 15px;
- div {
- font-size: 16px;
- font-weight: bold;
- width: 150px;
- height: 22px;
- line-height: 22px;
- a {
- color: #333;
- display: block;
- text-align: center;
- &:hover {
- color: #c82200;
- }
- }
- a.active {
- color: #c82200;
- }
- &:first-child {
- color: #c82200;
- }
- }
- }
- //基本样式 end ---------------------------------------->
- //样式2 start ---------------------------------------->
- .menuListStyle2 {
- border-bottom: 0;
- }
- //样式2 end ---------------------------------------->
- //样式3
- .menuListStyle3 {
- border-bottom: 0;
- div{
- text-align: center;
- height: 36px;
- &:hover {
- color: #c82200;
- padding-bottom: 15px;
- border-bottom: 2px solid #c82200;
- box-sizing: border-box;
- }
- }
- }
- //样式4
- .menuListStyle4 {
- height: 54px;
- padding-top: 23px;
- padding-bottom: 0px;
- .menuTitle {
- width: 140px;
- font-size: 26px;
- font-weight: bold;
- color: #c82200;
- margin-right: 80px;
- }
- .menulist {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- font-size: 16px;
- font-weight: bold;
- color: #333;
- padding: 15px 0;
- a{
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .title{
- width: 120px;
- height: 16px;
- text-align: center;
- &:hover{
- color: #c82200;
- }
- }
- .line{
- color: #c82200;
- padding-top: 5px;
- }
- }
- }
- }
- //样式5
- .menuListStyle5 {
- border-bottom: none;
- }
- //样式6
- .menuListStyle6 {
- border-bottom: none;
- position: relative;
- }
- .menuListStyle6::after {
- content: '';
- position: absolute;
- bottom: -2px;
- left: 0;
- width: 8%;
- height: 2px;
- background-color: #c82200;
- }
- //样式7
- .menuListStyle7 {
- margin-top: 30px;
- position: relative;
- padding-top: 25px;
- padding-bottom: 15px;
- border-bottom: 2px solid #E4E4E4;
- .channelMenuListTitle {
- background: url(https://img.bjzxtw.org.cn/pre/image/png/20251013/176033405969221.png) no-repeat center center;
- width: 200px;
- height: 40px;
- line-height: 40px;
- color: #ffffff;
- font-size: 24px;
- padding-left: 30px;
- box-sizing: border-box;
- }
- .hannelMenuListFloatMenu {
- position: absolute;
- display: flex;
- flex-wrap: wrap;
- font-size: 12px;
- color: #333333;
- font-weight: bold;
- top:33px;
- right: 0;
- div {
- width: 123px;
- font-size: 16px;
- text-align: center;
- font-weight: bold;
- &:last-child{
- background: none;
- }
- &.active {
- color:#c82200
- }
- a{
- color: #333333;
- }
- a:hover{
- color: #c82200;
- }
-
- }
- }
- }
- //样式8
- .menuListStyle8 {
- border-bottom: none;
- }
- //样式9
- .menuListStyle9 {
- .hannelMenuListFloatMenu {
- div {
- width: 123px;
- font-size: 16px;
- text-align: center;
- font-weight: bold;
- height: 43px;
- &:last-child{
- background: none;
- }
- &.active {
- color:#c82200;
- border-bottom: 2px solid #c82200;
- }
- &:hover{
- color: #c82200;
- border-bottom: 2px solid #c82200;
- }
- }
- }
- }
- //样式11
- .menuListStyle11{
- padding-top: 1px;
- .style11{
- width: 1200px;
- height: 61px;
- display: flex;
- background-color: #c82200;
- color: #fff;
- margin-top: 20px;
- .channelMenuListTitle{
- width: 144px;
- height: 51px;
- text-align: center;
- background-color: #fff;
- color: #c82200;
- margin-top: 10px;
- margin-left: 35px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- span{
- display: inline-block;
- font-size: 16px;
- font-weight: bold;
- padding: 10px 0;
- box-sizing: border-box;
- border-bottom: 2px solid #c82200;
- }
- }
- .hannelMenuListFloatMenu{
- width: 925px;
- height: 21px;
- margin-top: 23px;
- padding: 0 50px 0 45px;
- display: flex;
- justify-content: space-between;
- font-size: 16px;
- font-weight: bold;
- div {
- width: 122px;
- height: 20px;
- line-height: 16px;
- text-align: center;
- background: url(https://img.bjzxtw.org.cn/pre/image/png/20251010/1760086774438601.png) no-repeat right 2px;
- &:last-child{
- background: none;
- }
- &.active {
- color:#c82200
- }
- a{
- color: #fff;
- }
- }
- }
- }
-
- }
- </style>
|