SecondaryHeading.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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: `/${item.aLIas_pinyin}/list-1.html`}">{{ item.alias }}</NuxtLink>
  13. </span>
  14. <b v-else></b>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup>
  21. //1.设置组件数据 start---------------------------------------->
  22. //子导航
  23. const props = defineProps({
  24. titleData:Array,
  25. pinyinid:Number
  26. });
  27. //1.设置组件数据 end---------------------------------------->
  28. //2.设置组件标题 start ---------------------------------------->
  29. const title = ref("")
  30. async function getPageData() {
  31. const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
  32. method: 'GET',
  33. query: {
  34. 'catid': props.pinyinid,
  35. },
  36. });
  37. console.log("获取一级标题",mkdata);
  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. //2.设置组件标题 end ---------------------------------------->
  49. </script>
  50. <style lang="less" scoped>
  51. // 三农之窗
  52. .sannongzhichuang {
  53. margin: 25px 0 25px;
  54. .inner {
  55. width: 1200px;
  56. height: 67px;
  57. position: relative;
  58. }
  59. h2 {
  60. display: inline-block;
  61. //background-image: url("../../public/image/bg1.png");
  62. background: #139602;
  63. width: 156px;
  64. height: 43px;
  65. padding: 14px 31px 10px 25px;
  66. font-family: STXingkai, STXingkai;
  67. font-weight: 400;
  68. font-size: 39px;
  69. color: #FFFFFF;
  70. line-height: 46px;
  71. text-align: center;
  72. font-style: normal;
  73. text-transform: none;
  74. -webkit-text-stroke: 1px #3C6C47;
  75. position: absolute;
  76. top: 0;
  77. left: 0;
  78. z-index: 99;
  79. em {
  80. position: absolute;
  81. top: -16px;
  82. right: -12px;
  83. color: #185410;
  84. display: inline-block;
  85. width: 13px;
  86. height: 13px;
  87. }
  88. }
  89. div.introduction {
  90. display: inline-block;
  91. width: 1003px;
  92. height: 56px;
  93. line-height: 56px;
  94. background-color: #fafafa;
  95. position: absolute;
  96. bottom: 0;
  97. right: 0;
  98. display: flex;
  99. >strong:first-child {
  100. margin-left: 40px;
  101. display: inline-block;
  102. vertical-align: middle;
  103. width: 32px;
  104. height: 36px;
  105. padding: 3px 7px;
  106. border: 0.5px solid #129502;
  107. font-family: Microsoft YaHei, Microsoft YaHei;
  108. font-weight: bold;
  109. font-size: 14px;
  110. color: #139602;
  111. line-height: 18px;
  112. text-align: center;
  113. font-style: normal;
  114. text-transform: none;
  115. }
  116. div {
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. white-space: nowrap;
  120. >span {
  121. width: 64px;
  122. height: 21px;
  123. font-family: Microsoft YaHei, Microsoft YaHei;
  124. font-weight: 400;
  125. font-size: 16px;
  126. color: #000000;
  127. line-height: 21px;
  128. text-align: left;
  129. font-style: normal;
  130. text-transform: none;
  131. margin-top: 17px;
  132. padding: 0 24px;
  133. border-right: 1px solid #ccc;
  134. a {
  135. color: #000;
  136. }
  137. }
  138. >span:hover a {
  139. color: #139602;
  140. }
  141. >span:last-child {
  142. border: none;
  143. }
  144. }
  145. }
  146. }
  147. @media screen and (max-width:800px){/*ipad_phone*/
  148. // .sannongzhichuang h2{ display:none;}
  149. .sannongzhichuang div.introduction{ }
  150. .sannongzhichuang div.introduction > strong{ display:none!important;}
  151. .sannongzhichuang .inner{width: 92%;box-sizing:border-box;
  152. margin: 0px auto;height: 33px; display:flex;
  153. }
  154. .sannongzhichuang div.introduction{
  155. width:100%;display:block;word-break: keep-all; white-space: nowrap;
  156. box-sizing:border-box;height:100%;line-height:33px;
  157. position:relative;
  158. overflow-y:hidden;
  159. overflow-x:auto;
  160. flex:1;
  161. }
  162. .sannongzhichuang div.introduction::-webkit-scrollbar {
  163. background:rgba(0,0,0,0);
  164. height: 0px;
  165. }
  166. .sannongzhichuang div.introduction::-webkit-scrollbar-thumb {
  167. background:rgba(0,0,0,0);
  168. height: 0px;
  169. }
  170. .sannongzhichuang div.introduction::-webkit-scrollbar-track {
  171. background:rgba(0,0,0,0);
  172. height: 0px;
  173. }
  174. .sannongzhichuang div.introduction div{display:inline-block;box-sizing:border-box; }
  175. .farmingPartOne{height:auto;overflow:hidden;}
  176. .farmingPartOne .inner{height:auto;overflow:hidden;}
  177. .sannongzhichuang { margin:10px auto 10px; background:#fafafa;}
  178. .sannongzhichuang div.introduction div > span a{font-size:14px;}
  179. .sannongzhichuang div.introduction div > span{padding:0px 10px;}
  180. .sannongzhichuang div.introduction div:nth-of-type(1) > span{padding-left:0;}
  181. .sannongzhichuang h2{ line-height:26px;height:26px; margin-top:4px;
  182. width:auto;padding:0px 4px;font-size:12px; font-weight:normal;
  183. -webkit-text-stroke: 0px #fff;position:relative;
  184. display:none;
  185. }
  186. .sannongzhichuang h2 em{display:none;}
  187. }
  188. </style>