4.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="hotNewsBox">
  3. <div class="listNewsTitle_skin4" >
  4. <span><b>热点精选</b></span>
  5. </div>
  6. <!--样式1-->
  7. <div class="hotNewsContent_skin2" v-if="componentStyle==1">
  8. <div v-for="(item,index) in component_style1_News1Array">
  9. <NuxtLink
  10. :href="getLinkPathDetail(item)"
  11. :title="item.title"
  12. :target="item.islink == 1 ? '_blank' : '_self'"
  13. >
  14. <span>{{ index+1 }}</span>
  15. {{ item.title }}
  16. </NuxtLink>
  17. </div>
  18. </div>
  19. <!--样式2-->
  20. <div class="hotNewsContent_skin2 hotNewsStyle2" v-if="componentStyle==2">
  21. <div v-for="(item,index) in component_style1_News1Array">
  22. <NuxtLink
  23. :href="getLinkPathDetail(item)"
  24. :title="item.title"
  25. :target="item.islink == 1 ? '_blank' : '_self'"
  26. >
  27. <span>{{ index+1 }}</span>
  28. {{ item.title }}
  29. </NuxtLink>
  30. </div>
  31. </div>
  32. <!-- 样式3 -->
  33. <div class="hotNewsContent_skin2 hotNewsStyle3" v-if="componentStyle == 3">
  34. <div v-for="(item,index) in component_style1_News1Array">
  35. <NuxtLink
  36. :href="getLinkPathDetail(item)"
  37. :title="item.title"
  38. :target="item.islink == 1 ? '_blank' : '_self'"
  39. >
  40. <span>{{ index+1 }}</span>
  41. {{ item.title }}
  42. </NuxtLink>
  43. </div>
  44. </div>
  45. <!-- 样式4 -->
  46. <div class="hotNewsContent_skin2 hotNewsStyle4" v-if="componentStyle == 4">
  47. <div v-for="(item,index) in component_style1_News1Array">
  48. <NuxtLink
  49. :href="getLinkPathDetail(item)"
  50. :title="item.title"
  51. :target="item.islink == 1 ? '_blank' : '_self'"
  52. >
  53. <span>{{ index+1 }}</span>
  54. {{ item.title }}
  55. </NuxtLink>
  56. </div>
  57. </div>
  58. <!-- 样式5 -->
  59. <div class="hotNewsContent_skin2 hotNewsStyle5" v-if="componentStyle == 5">
  60. <div v-for="(item,index) in component_style1_News1Array" :key="index">
  61. <NuxtLink
  62. :href="getLinkPathDetail(item)"
  63. :title="item.title"
  64. :target="item.islink == 1 ? '_blank' : '_self'"
  65. >
  66. {{ item.title }}
  67. </NuxtLink>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script setup>
  73. //引入vue
  74. import {ref} from 'vue';
  75. //获得新闻数据
  76. const props = defineProps({
  77. componentStyle:Number,//样式编号
  78. });
  79. const component_style1_News1Array = ref([]);
  80. //component_style1_News1Array.value = props.templateData.text.slice(0,8);
  81. async function getPageData() {
  82. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  83. method: 'GET',
  84. query: {
  85. 'imgnum': 0,
  86. 'textnum': 8,
  87. 'level': 5,
  88. 'placeid': 0,
  89. 'id': 0
  90. },
  91. });
  92. if (mkdata.code == 200) {
  93. component_style1_News1Array.value = mkdata.data.text;
  94. }
  95. }
  96. getPageData();
  97. </script>
  98. <style lang="less" scoped>
  99. //基本样式 start ---------------------------------------->
  100. .hotNewsBox {
  101. .listNewsTitle_skin4 {
  102. font-size:22px;
  103. font-weight:bold;
  104. height: 40px;
  105. line-height: 40px;
  106. border-bottom: 1px solid #fe8f00;
  107. margin-bottom: 20px;
  108. box-sizing: border-box;
  109. span {
  110. display: inline-block;
  111. width: 112px;
  112. height: 40px;
  113. line-height: 40px;
  114. background: #fe8f00;
  115. border-top-left-radius: 4px;
  116. border-top-right-radius: 4px;
  117. color:#fff;
  118. text-align: center;
  119. a{
  120. color: #fff;
  121. }
  122. }
  123. }
  124. .hotNewsContent_skin2 {
  125. font-size:18px;
  126. color:#333333;
  127. div {
  128. a {
  129. display: block;
  130. color:#333333;
  131. overflow: hidden;
  132. white-space: nowrap;
  133. text-overflow: ellipsis;
  134. }
  135. padding-bottom:20px;
  136. border-bottom:1px solid #E4E4E4;
  137. margin-bottom: 22px;
  138. overflow: hidden;
  139. white-space: nowrap;
  140. text-overflow: ellipsis;
  141. span {
  142. margin-right: 15px;
  143. font-size:20px;
  144. font-weight:bold;
  145. font-style: italic;
  146. color: #D9D9D9;
  147. }
  148. &:nth-child(1) span,
  149. &:nth-child(2) span,
  150. &:nth-child(3) span {
  151. color: #fe8f00;
  152. }
  153. }
  154. }
  155. }
  156. //基本样式 end ---------------------------------------->
  157. //样式2 start ---------------------------------------->
  158. .hotNewsBox {
  159. .hotNewsStyle2 {
  160. font-size:18px;
  161. color:#333333;
  162. div {
  163. padding-bottom:20px;
  164. border-bottom:1px solid #E4E4E4;
  165. margin-bottom: 22px;
  166. overflow: hidden;
  167. white-space: nowrap;
  168. text-overflow: ellipsis;
  169. span {
  170. margin-right: 15px;
  171. font-size:20px;
  172. font-weight:bold;
  173. font-style: italic;
  174. color: #fe8f00;
  175. }
  176. }
  177. }
  178. }
  179. //样式2 end ---------------------------------------->
  180. //样式3 start ---------------------------------------->
  181. .hotNewsBox {
  182. .hotNewsStyle3 {
  183. font-size:18px;
  184. color:#333333;
  185. div {
  186. border-bottom:1px dashed #E4E4E4;
  187. }
  188. }
  189. }
  190. //样式3 end ---------------------------------------->
  191. //样式4 start ---------------------------------------->
  192. .hotNewsBox {
  193. .hotNewsStyle4 {
  194. font-size:18px;
  195. color:#333333;
  196. div {
  197. padding-bottom:20px;
  198. border-bottom:1px dashed #E4E4E4;
  199. margin-bottom: 22px;
  200. overflow: hidden;
  201. white-space: nowrap;
  202. text-overflow: ellipsis;
  203. span {
  204. margin-right: 15px;
  205. font-size:20px;
  206. font-weight:bold;
  207. font-style: italic;
  208. color: #fe8f00;
  209. }
  210. }
  211. }
  212. }
  213. //样式4 end ---------------------------------------->
  214. //样式5 start ---------------------------------------->
  215. .hotNewsBox {
  216. .hotNewsStyle5 {
  217. font-size:18px;
  218. color:#333333;
  219. div {
  220. padding-bottom:20px;
  221. border-bottom:1px dashed #E4E4E4;
  222. margin-bottom: 22px;
  223. overflow: hidden;
  224. white-space: nowrap;
  225. text-overflow: ellipsis;
  226. span {
  227. margin-right: 15px;
  228. font-size:20px;
  229. font-weight:bold;
  230. font-style: italic;
  231. color: #fe8f00;
  232. }
  233. }
  234. }
  235. }
  236. </style>