SecondaryHeading.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <!-- 一级标题页导航 -->
  3. <div class="sannongzhichuang">
  4. <div class="inner">
  5. <h2>
  6. <!-- 三农之窗 -->
  7. {{ title.name }}
  8. <em class="iconfont icon-xingzhuang-zhijiaosanjiaoxing-copy"></em>
  9. </h2>
  10. <p class="introduction">
  11. <strong>频道介绍</strong>
  12. <div v-for="(item,index) in titleData">
  13. <span v-if="index<=7">
  14. <!-- <NuxtLink :to="`/newsList/${item.id}`" target="_blank">{{ item.name }}</NuxtLink> -->
  15. <NuxtLink :to="{ path: `/newsList/${item.category_id}`, query: { catid: item.category_id } }" target="_blank">{{ item.name }}</NuxtLink>
  16. </span>
  17. </div>
  18. </p>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { onMounted } from 'vue'
  24. const props = defineProps({
  25. titleName: String,
  26. titleData:Array
  27. });
  28. //获得axios
  29. const nuxtApp = useNuxtApp();
  30. const axios = nuxtApp.$axios;
  31. //let ChannelList = ['理论前沿', '典型经验', '魅力乡村', '农民之家', '农业天地', '农村建设', '高端资讯', '实践探索']
  32. //获得跳转过来的id
  33. const route = useRoute();
  34. const routeId = route.params.id; //获得该页面的id
  35. const routeName = route.query.name; //获得该页面的名称
  36. const title = ref("")
  37. const getTitle = async () => {
  38. try {
  39. const response = await axios.get(`/web/getOneWebsiteCategory?catid=${routeId}`);
  40. title.value = response.data;
  41. } catch (error) {
  42. console.error(error);
  43. }
  44. }
  45. onMounted(() => {
  46. getTitle()
  47. })
  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("../../static/images/bg1.png");
  61. width: 156px;
  62. height: 43px;
  63. padding: 14px 31px 10px 25px;
  64. font-family: STXingkai, STXingkai;
  65. font-weight: 400;
  66. font-size: 39px;
  67. color: #FFFFFF;
  68. line-height: 46px;
  69. text-align: center;
  70. font-style: normal;
  71. text-transform: none;
  72. -webkit-text-stroke: 1px #3C6C47;
  73. position: absolute;
  74. top: 0;
  75. left: 0;
  76. z-index: 99;
  77. em {
  78. position: absolute;
  79. top: -16px;
  80. right: -12px;
  81. color: #185410;
  82. display: inline-block;
  83. width: 13px;
  84. height: 13px;
  85. }
  86. }
  87. p.introduction {
  88. display: inline-block;
  89. width: 1003px;
  90. height: 56px;
  91. line-height: 56px;
  92. background-color: #fafafa;
  93. position: absolute;
  94. bottom: 0;
  95. right: 0;
  96. display: flex;
  97. >strong:first-child {
  98. margin-left: 40px;
  99. display: inline-block;
  100. vertical-align: middle;
  101. width: 28px;
  102. height: 36px;
  103. padding: 3px 7px;
  104. border: 0.5px solid #129502;
  105. font-family: Microsoft YaHei, Microsoft YaHei;
  106. font-weight: bold;
  107. font-size: 14px;
  108. color: #139602;
  109. line-height: 18px;
  110. text-align: center;
  111. font-style: normal;
  112. text-transform: none;
  113. }
  114. div {
  115. >span {
  116. width: 64px;
  117. height: 21px;
  118. font-family: Microsoft YaHei, Microsoft YaHei;
  119. font-weight: 400;
  120. font-size: 16px;
  121. color: #000000;
  122. line-height: 21px;
  123. text-align: left;
  124. font-style: normal;
  125. text-transform: none;
  126. margin-top: 17px;
  127. padding: 0 24px;
  128. border-right: 1px solid #ccc;
  129. a {
  130. color: #000;
  131. }
  132. }
  133. >span:hover a {
  134. color: #139602;
  135. }
  136. >span:last-child {
  137. border: none;
  138. }
  139. }
  140. }
  141. }
  142. </style>