SecondaryHeading_shukan.vue 4.9 KB

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