SecondaryHeading.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="sannongzhichuang">
  3. <div class="inner">
  4. <h2>
  5. {{ title }}
  6. <em class="iconfont icon-xingzhuang-zhijiaosanjiaoxing-copy"></em>
  7. </h2>
  8. <div class="introduction">
  9. <strong>频道介绍</strong>
  10. <div v-for="(item,index) in titleData">
  11. <span v-if="index<=7">
  12. <NuxtLink :to="{ path: `/newsList/${item.cid}`}">{{item.alias}}</NuxtLink>
  13. </span>
  14. <b v-else></b>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup>
  21. //设置组件数据 start---------------------------------------->
  22. //子导航
  23. const props = defineProps({
  24. titleData:Array
  25. });
  26. //二级标题名称
  27. const route = useRoute();
  28. const routeId = route.params.id; //获得该页面的id
  29. const routeName = route.query.name; //获得该页面的名称
  30. const title = ref("")
  31. async function getPageData() {
  32. const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
  33. method: 'GET',
  34. query: {
  35. 'catid': routeId,
  36. },
  37. });
  38. if(mkdata.code == 200){
  39. title.value = mkdata.data.alias;
  40. }else{
  41. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  42. console.log("错误位置:获取二级标题")
  43. console.log("后端错误反馈:",mkdata.message)
  44. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  45. }
  46. }
  47. getPageData();
  48. </script>
  49. <style lang="less" scoped>
  50. // 三农之窗
  51. .sannongzhichuang {
  52. margin: 30px 0 40px;
  53. .inner {
  54. width: 1200px;
  55. height: 67px;
  56. position: relative;
  57. }
  58. h2 {
  59. display: inline-block;
  60. //background-image: url("../../public/image/bg1.png");
  61. background: #139602;
  62. width: 156px;
  63. height: 43px;
  64. padding: 14px 31px 10px 25px;
  65. font-family: STXingkai, STXingkai;
  66. font-weight: 400;
  67. font-size: 39px;
  68. color: #FFFFFF;
  69. line-height: 46px;
  70. text-align: center;
  71. font-style: normal;
  72. text-transform: none;
  73. -webkit-text-stroke: 1px #3C6C47;
  74. position: absolute;
  75. top: 0;
  76. left: 0;
  77. z-index: 99;
  78. em {
  79. position: absolute;
  80. top: -16px;
  81. right: -12px;
  82. color: #185410;
  83. display: inline-block;
  84. width: 13px;
  85. height: 13px;
  86. }
  87. }
  88. div.introduction {
  89. display: inline-block;
  90. width: 1003px;
  91. height: 56px;
  92. line-height: 56px;
  93. background-color: #fafafa;
  94. position: absolute;
  95. bottom: 0;
  96. right: 0;
  97. display: flex;
  98. >strong:first-child {
  99. margin-left: 40px;
  100. display: inline-block;
  101. vertical-align: middle;
  102. width: 32px;
  103. height: 36px;
  104. padding: 3px 7px;
  105. border: 0.5px solid #129502;
  106. font-family: Microsoft YaHei, Microsoft YaHei;
  107. font-weight: bold;
  108. font-size: 14px;
  109. color: #139602;
  110. line-height: 18px;
  111. text-align: center;
  112. font-style: normal;
  113. text-transform: none;
  114. }
  115. div {
  116. overflow: hidden;
  117. text-overflow: ellipsis;
  118. white-space: nowrap;
  119. >span {
  120. width: 64px;
  121. height: 21px;
  122. font-family: Microsoft YaHei, Microsoft YaHei;
  123. font-weight: 400;
  124. font-size: 16px;
  125. color: #000000;
  126. line-height: 21px;
  127. text-align: left;
  128. font-style: normal;
  129. text-transform: none;
  130. margin-top: 17px;
  131. padding: 0 24px;
  132. border-right: 1px solid #ccc;
  133. a {
  134. color: #000;
  135. }
  136. }
  137. >span:hover a {
  138. color: #139602;
  139. }
  140. >span:last-child {
  141. border: none;
  142. }
  143. }
  144. }
  145. }
  146. </style>