SecondaryHeading.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. <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}`}">{{item.alias}}</NuxtLink>
  13. </span>
  14. <b v-else></b>
  15. </div>
  16. </p>
  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. title.value = mkdata.data.alias;
  39. }
  40. getPageData();
  41. </script>
  42. <style lang="less" scoped>
  43. // 三农之窗
  44. .sannongzhichuang {
  45. margin: 30px 0 40px;
  46. .inner {
  47. width: 1200px;
  48. height: 67px;
  49. position: relative;
  50. }
  51. h2 {
  52. display: inline-block;
  53. //background-image: url("../../public/image/bg1.png");
  54. background: #139602;
  55. width: 156px;
  56. height: 43px;
  57. padding: 14px 31px 10px 25px;
  58. font-family: STXingkai, STXingkai;
  59. font-weight: 400;
  60. font-size: 39px;
  61. color: #FFFFFF;
  62. line-height: 46px;
  63. text-align: center;
  64. font-style: normal;
  65. text-transform: none;
  66. -webkit-text-stroke: 1px #3C6C47;
  67. position: absolute;
  68. top: 0;
  69. left: 0;
  70. z-index: 99;
  71. em {
  72. position: absolute;
  73. top: -16px;
  74. right: -12px;
  75. color: #185410;
  76. display: inline-block;
  77. width: 13px;
  78. height: 13px;
  79. }
  80. }
  81. p.introduction {
  82. display: inline-block;
  83. width: 1003px;
  84. height: 56px;
  85. line-height: 56px;
  86. background-color: #fafafa;
  87. position: absolute;
  88. bottom: 0;
  89. right: 0;
  90. display: flex;
  91. >strong:first-child {
  92. margin-left: 40px;
  93. display: inline-block;
  94. vertical-align: middle;
  95. width: 32px;
  96. height: 36px;
  97. padding: 3px 7px;
  98. border: 0.5px solid #129502;
  99. font-family: Microsoft YaHei, Microsoft YaHei;
  100. font-weight: bold;
  101. font-size: 14px;
  102. color: #139602;
  103. line-height: 18px;
  104. text-align: center;
  105. font-style: normal;
  106. text-transform: none;
  107. }
  108. div {
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  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>