| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <template>
- <div class="index_main">
- <nav class="index_nav clearfix phone_none">
- <div class="index_navTitle_box">
- <span class="index_nav_a_one" href="javascript:(void)" title="">{{ title }}</span>
- </div>
- <div class="index_nav_box">
- <span v-for="(item, index) in titleData"
- :class="['index_nav_a', { 'index_nav_a_only': targetSegment === item.aLIas_pinyin }]">
- <span v-if="index <= 20">
- <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html` }">{{ item.alias }}</NuxtLink>
- </span>
- </span>
- </div>
- </nav>
- <div class="phone_nav pc_none">
- <div class="phone_nav_in">
-
- <NuxtLink
- v-for="(item, index) in titleData" :key="index"
- :to="{ path: `/${item.aLIas_pinyin}/list-1.html`}" :title="item.alias"
- class="phone_nav_a"
- :target="item.is_url == 1 ? '_blank' : '_self'">
- {{ item.alias }}
- </NuxtLink>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //1.设置组件数据 start---------------------------------------->
- //子导航
- const props = defineProps({
- titleData: Array,
- pinyinid: Number
- });
- //获取当前url路径
- const route = useRoute();
- //获得当前的完整路径
- const fullPath = route.path;
- const segments = fullPath.split('/');
- const targetSegment = segments[1];
- //1.设置组件数据 end---------------------------------------->
- //2.设置组件标题 start ---------------------------------------->
- const title = ref("")
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
- method: 'GET',
- query: {
- 'catid': props.pinyinid,
- },
- });
- if (mkdata.code == 200) {
- title.value = mkdata.data.alias;
- } else {
- // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- // console.log("错误位置:获取二级标题")
- // console.log("后端错误反馈:", mkdata.message)
- // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getPageData();
- //2.设置组件标题 end ---------------------------------------->
- </script>
- <style lang="less" scoped>
- .index_main {
- width: 1200px;
- margin: 0 auto;
- margin-bottom: 40px;
- }
- .index_nav {
- width: 1200px;
- margin: 0 auto;
- margin-top: 20px;
- border-bottom: solid 1px #D9D9D9;
- height: 88px;
- .index_navTitle_box {
- float: left;
- height: 88px;
- line-height: 88px;
- font-size: 16px;
- font-weight: bold;
- color: #333;
- width: 153px;
- // margin: 0px 30px;
- }
- .index_nav_a_one {
- float: left;
- color: #333;
- font-size: 16px;
- margin: 0px 30px;
- height: 88px;
- line-height: 88px;
- font-weight: bold;
- border-bottom: solid 3px #fff;
- box-sizing: border-box;
- position: relative;
- overflow: hidden;
- height: 56px;
- line-height: 56px;
- color: #fff;
- font-size: 18px;
- font-weight: bold;
- width: 153px;
- margin: 14px 30px 0px 0px;
- text-indent: 46px;
- background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
- background-size: 100% 100%;
- }
- .index_nav_box {
- float: left;
- // height: 88px;
- // line-height: 88px;
- font-size: 16px;
- font-weight: bold;
- color: #333;
- width: 1009px;
- margin-top: 15px;
- margin-left: 25px;
- }
- .index_nav_a {
- float: left;
- color: #333;
- font-size: 16px;
- margin: 5px 30px;
- font-weight: bold;
- border-bottom: solid 3px #fff;
- box-sizing: border-box;
- position: relative;
- a {
- color: #333333
- }
- &:hover {
- border-bottom: solid 3px #D2600F;
- }
- }
- .index_nav_a a:hover {
- color: #D2600F;
- // border-bottom: solid 3px #D2600F;
- }
- .index_nav_a_only {
- border-bottom: solid 3px #D2600F;
- }
- .index_nav_a::after {
- content: '';
- display: block;
- position: absolute;
- width: 2px;
- height: 12px;
- background: #DBDBDB;
- right: -28px;
- top: 6px;
- }
- // .index_nav_a:nth-last-of-type(1) {
- // overflow: hidden;
- // }
- // a.index_nav_a:nth-of-type(1) {
- // overflow: hidden;
- // height: 56px;
- // line-height: 56px;
- // color: #fff;
- // font-size: 18px;
- // font-weight: bold;
- // width: 153px;
- // margin: 14px 30px 0px 0px;
- // text-indent: 46px;
- // background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
- // background-size: 100% 100%;
- // }
- }
- </style>
- <style lang="less" scoped>
-
- @media screen and (min-width:801px){/*pc*/
-
-
- .pc_none{display:none;}
- }
- @media screen and (max-width:800px){/*ipad_phone*/
- .index_nav{width:100%;}
- .phone_nav{
- width:100%; box-sizing:border-box;background:#fafafa;
- margin:10px auto;height:33px;
- .phone_nav_in{ width:92%;margin:0px auto;
- overflow-x:auto;overflow-y:hidden;
- word-break: keep-all; white-space: nowrap;
- line-height:33px;
- height:33px;
- }
- .phone_nav_in::-webkit-scrollbar{height:0px;}
- .phone_nav_a{display:inline-block;line-height:33px;height:33px;
- color:#333;font-size:14px;margin:0px 10px;
- }
- .phone_nav_a:nth-of-type(1){margin-left:0px; }
- }
-
- .phone_nav_in .phone_nav_a.router-link-exact-active{
- color:#D2600F;
- }
- .phone_none{display:none;}
- }
- </style>
|