SecondaryHeading.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <section class="channel_1 clearfix">
  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. </template>
  14. <script setup>
  15. //1.设置组件数据 start---------------------------------------->
  16. //子导航
  17. const props = defineProps({
  18. titleData:Array,
  19. pinyinid:Number
  20. });
  21. //获取当前url路径
  22. const route = useRoute();
  23. //获得当前的完整路径
  24. const fullPath = route.path;
  25. const segments = fullPath.split('/');
  26. const targetSegment = segments[1];
  27. //1.设置组件数据 end---------------------------------------->
  28. //2.设置组件标题 start ---------------------------------------->
  29. const title = ref("")
  30. async function getPageData() {
  31. const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
  32. method: 'GET',
  33. query: {
  34. 'catid': props.pinyinid,
  35. },
  36. });
  37. if(mkdata.code == 200){
  38. title.value = mkdata.data.alias;
  39. }else{
  40. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  41. console.log("错误位置:获取二级标题")
  42. console.log("后端错误反馈:",mkdata.message)
  43. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  44. }
  45. }
  46. getPageData();
  47. //2.设置组件标题 end ---------------------------------------->
  48. </script>
  49. <style lang="less" scoped>
  50. /*农民工网-频道页*/
  51. .channel_1 {
  52. width: 1200px;
  53. margin: 0 auto;
  54. }
  55. .channel_head_box {
  56. border-top-left-radius: 3px;
  57. border-top-right-radius: 3px;
  58. border: solid 1px #D9D9D9;
  59. margin-top: 40px;
  60. box-sizing: border-box;
  61. border-bottom: solid 2px #489D97;
  62. background: #fafafa;
  63. box-sizing: border-box;
  64. display: flex;
  65. align-items: center;
  66. .channel_nav_box {
  67. flex: 1;
  68. padding: 9px 0px;
  69. }
  70. .channel_head_a {
  71. position: relative;
  72. height: 18px;
  73. line-height: 18px;
  74. color: #333;
  75. font-size: 14px;
  76. border-top-left-radius: 3px;
  77. border-top-right-radius: 3px;
  78. float: left;
  79. padding: 0px 24px;
  80. text-align: center;
  81. box-sizing: border-box;
  82. margin: 5px 0px 5px -2px;
  83. // width: 101px;
  84. &:hover {
  85. color: #489D97;
  86. }
  87. }
  88. .channel_head_a::after {
  89. content: '';
  90. display: block;
  91. position: absolute;
  92. width: 2px;
  93. height: 12px;
  94. background: #DBDBDB;
  95. top: 3px;
  96. left: -1px;
  97. }
  98. }
  99. .channel_head_a_name_box {
  100. display: flex;
  101. margin-top: auto;
  102. }
  103. .channel_head_a_name {
  104. background: #489D97;
  105. font-size: 18px;
  106. font-weight: bold;
  107. color: #fff;
  108. padding: 0px 15px;
  109. position: relative;
  110. height: 44px;
  111. line-height: 44px;
  112. font-size: 18px;
  113. border-top-left-radius: 3px;
  114. border-top-right-radius: 3px;
  115. padding: 0px 15px;
  116. text-align: center;
  117. }
  118. .channel_head_a_img_box {
  119. width: 36px;
  120. height: 34px;
  121. float: left;
  122. background-image: url(@/public/img/25.png);
  123. margin: 0px 20px 0px 19px;
  124. }
  125. .channel_head_a:nth-of-type(1)::after,.channel_head_a:nth-of-type(11)::after {
  126. content: '';
  127. display: none;
  128. }
  129. </style>