SecondaryHeading_zgzp.vue 3.2 KB

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