SecondaryHeading.vue 3.8 KB

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