| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <template>
- <nav class="channel_nav_box phone_none">
- <a class="channel_nav_head" href="javascript:(void)" title="title">{{ title }}</a>
- <div class="channel_nav_a_box clearfix">
- <NuxtLink
- :to="{ path: `/${item.aLIas_pinyin}/list-1.html`}"
- class="channel_nav_a"
- v-for="item in titleData"
- >
- {{ item.alias }}
- </NuxtLink>
- </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`}"
- class="phone_nav_a"
- :target="item.is_url == 1 ? '_blank' : '_self'">
- {{ item.alias }}
- </NuxtLink>
- </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>
- .channel_nav_box {
- display:flex;
- width: 1200px;
- margin: 0 auto;
- background: url(http://img.bjzxtw.org.cn/master/www/snscw/5.png) no-repeat bottom;
- background-size:100% auto;
- margin-top: 20px;
- .channel_nav_head {
- width: 122px;
- text-align: center;
- height: 60px;
- line-height: 60px;
- color: #fff;
- margin: 0px 70px 0px 31px;
- box-sizing:border-box;
- margin-top:auto;
- font-size:20px;
- font-weight:bold;
- }
- .channel_nav_a_box{
- flex:1;
- padding:12px 0px;
- }
-
- .channel_nav_a {
- float: left;
- height: 26px;
- line-height: 26px;
- color: #255590;
- font-size: 20px;
- margin: 5px 19px;
- font-weight: bold;
- }
- }
- </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_none{display:none;}
- }
- </style>
|