SecondaryHeading.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <section class="channel_1 clearfix">
  3. <div class="channel_head_box clearfix phone_none">
  4. <div class="channel_head_a_name_box clearfix">
  5. <a class="channel_head_a_name" href="javascript:(void)" title="title">{{ title }}</a>
  6. </div>
  7. <div class="channel_head_a_img_box back100"></div>
  8. <nav class="channel_nav_box clearfix">
  9. <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html`}" class="channel_head_a" v-for="(item,index) in titleData">{{ item.alias }}</NuxtLink>
  10. </nav>
  11. </div>
  12. <div class="phone_nav pc_none">
  13. <div class="phone_nav_in">
  14. <NuxtLink
  15. v-for="(item, index) in titleData" :key="index"
  16. :to="{ path: `/${item.aLIas_pinyin}/list-1.html`}" :title="item.alias"
  17. class="phone_nav_a"
  18. :target="item.is_url == 1 ? '_blank' : '_self'">
  19. {{ item.alias }}
  20. </NuxtLink>
  21. </div>
  22. </div>
  23. </section>
  24. </template>
  25. <script setup>
  26. //1.设置组件数据 start---------------------------------------->
  27. //子导航
  28. const props = defineProps({
  29. titleData:Array,
  30. pinyinid:Number
  31. });
  32. //获取当前url路径
  33. const route = useRoute();
  34. //获得当前的完整路径
  35. const fullPath = route.path;
  36. const segments = fullPath.split('/');
  37. const targetSegment = segments[1];
  38. //1.设置组件数据 end---------------------------------------->
  39. //2.设置组件标题 start ---------------------------------------->
  40. const title = ref("")
  41. async function getPageData() {
  42. const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
  43. method: 'GET',
  44. query: {
  45. 'catid': props.pinyinid,
  46. },
  47. });
  48. if(mkdata.code == 200){
  49. title.value = mkdata.data.alias;
  50. }else{
  51. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  52. console.log("错误位置:获取二级标题")
  53. console.log("后端错误反馈:",mkdata.message)
  54. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  55. }
  56. }
  57. getPageData();
  58. //2.设置组件标题 end ---------------------------------------->
  59. </script>
  60. <style lang="less" scoped>
  61. /*农民工网-频道页*/
  62. .channel_1 {
  63. width: 1200px;
  64. margin: 0 auto;
  65. }
  66. .channel_head_box {
  67. border-top-left-radius: 3px;
  68. border-top-right-radius: 3px;
  69. border: solid 1px #D9D9D9;
  70. margin-top: 20px;
  71. box-sizing: border-box;
  72. border-bottom: solid 2px #489D97;
  73. background: #fafafa;
  74. box-sizing: border-box;
  75. display: flex;
  76. align-items: center;
  77. .channel_nav_box {
  78. flex: 1;
  79. padding: 9px 0px;
  80. }
  81. .channel_head_a {
  82. position: relative;
  83. height: 18px;
  84. line-height: 18px;
  85. color: #333;
  86. font-size: 14px;
  87. border-top-left-radius: 3px;
  88. border-top-right-radius: 3px;
  89. float: left;
  90. padding: 0px 24px;
  91. text-align: center;
  92. box-sizing: border-box;
  93. margin: 5px 0px 5px -2px;
  94. // width: 101px;
  95. &:hover {
  96. color: #489D97;
  97. }
  98. }
  99. .channel_head_a::after {
  100. content: '';
  101. display: block;
  102. position: absolute;
  103. width: 2px;
  104. height: 12px;
  105. background: #DBDBDB;
  106. top: 3px;
  107. left: -1px;
  108. }
  109. }
  110. .channel_head_a_name_box {
  111. display: flex;
  112. margin-top: auto;
  113. }
  114. .channel_head_a_name {
  115. background: #489D97;
  116. font-size: 18px;
  117. font-weight: bold;
  118. color: #fff;
  119. padding: 0px 15px;
  120. position: relative;
  121. height: 44px;
  122. line-height: 44px;
  123. font-size: 18px;
  124. border-top-left-radius: 3px;
  125. border-top-right-radius: 3px;
  126. padding: 0px 15px;
  127. text-align: center;
  128. }
  129. .channel_head_a_img_box {
  130. width: 36px;
  131. height: 34px;
  132. float: left;
  133. background-image: url(@/public/img/25.png);
  134. margin: 0px 20px 0px 19px;
  135. }
  136. .channel_head_a:nth-of-type(1)::after,.channel_head_a:nth-of-type(11)::after {
  137. content: '';
  138. display: none;
  139. }
  140. </style>
  141. <style lang="less" scoped>
  142. @media screen and (min-width:801px){/*pc*/
  143. .pc_none{display:none;}
  144. }
  145. @media screen and (max-width:800px){/*ipad_phone*/
  146. .index_main{width:100%;}
  147. .index_nav{width:100%;}
  148. .channel_1{width:100%;}
  149. .phone_nav{
  150. width:100%; box-sizing:border-box;background:#fafafa;
  151. margin:10px auto;height:33px;
  152. .phone_nav_in{ width:92%;margin:0px auto;
  153. overflow-x:auto;overflow-y:hidden;
  154. word-break: keep-all; white-space: nowrap;
  155. line-height:33px;
  156. height:33px;
  157. }
  158. .phone_nav_in::-webkit-scrollbar{height:0px;}
  159. .phone_nav_in .router-link-exact-active.phone_nav_a{
  160. color:#489D97;
  161. }
  162. .phone_nav_a{display:inline-block;line-height:33px;height:33px;
  163. color:#333;font-size:14px;margin:0px 10px;
  164. }
  165. .phone_nav_a:nth-of-type(1){margin-left:0px; }
  166. }
  167. .phone_none{display:none;}
  168. }
  169. </style>