7.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <div class="hotNewsBox">
  3. <div class="list_right_box_hot_1" v-if="componentStyle == 1">
  4. <h4 class="list_right_head">
  5. <span>热点精选</span>
  6. </h4>
  7. <div class="list_right_box_hot_ul">
  8. <div class="list_right_box_hot_li" v-for="(item, index) in component_style1_News1Array">
  9. <div class="list_right_box_hot_li_num">{{ index + 1 }}</div>
  10. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  11. :target="item.islink == 1 ? '_blank' : '_self'" class="list_right_box_hot_li_a">
  12. {{ item.title }}
  13. </NuxtLink>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="list_right_box_hot_2" v-if="componentStyle == 2">
  18. <h4 class="list_right_head">
  19. <span>热点精选</span>
  20. </h4>
  21. <div class="list_right_box_hot_ul">
  22. <div class="list_right_box_hot_li" v-for="(item, index) in component_style1_News1Array">
  23. <div class="list_right_box_hot_li_num">{{ index + 1 }}</div>
  24. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  25. :target="item.islink == 1 ? '_blank' : '_self'" class="list_right_box_hot_li_a">
  26. {{ item.title }}
  27. </NuxtLink>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="list_right_box_hot_3" v-if="componentStyle == 3">
  32. <h4 class="list_right_head">
  33. <span>热点精选</span>
  34. </h4>
  35. <div class="list_right_box_hot_ul">
  36. <div class="list_right_box_hot_li" v-for="(item, index) in component_style1_News1Array">
  37. <div class="list_right_box_hot_li_num">{{ index + 1 }}</div>
  38. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  39. :target="item.islink == 1 ? '_blank' : '_self'" class="list_right_box_hot_li_a">
  40. {{ item.title }}
  41. </NuxtLink>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="list_right_box_hot_4" v-if="componentStyle == 4">
  46. <h4 class="list_right_head">
  47. <span>热点精选</span>
  48. </h4>
  49. <div class="list_right_box_hot_ul">
  50. <div class="list_right_box_hot_li" v-for="(item, index) in component_style1_News1Array">
  51. <div class="list_right_box_hot_li_num">{{ index + 1 }}</div>
  52. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  53. :target="item.islink == 1 ? '_blank' : '_self'" class="list_right_box_hot_li_a">
  54. {{ item.title }}
  55. </NuxtLink>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="list_right_box_hot_5" v-if="componentStyle == 5">
  60. <h4 class="list_right_head">
  61. <span>热点精选</span>
  62. </h4>
  63. <div class="list_right_box_hot_ul">
  64. <div class="list_right_box_hot_li" v-for="(item, index) in component_style1_News1Array">
  65. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  66. :target="item.islink == 1 ? '_blank' : '_self'" class="list_right_box_hot_li_a">
  67. {{ item.title }}
  68. </NuxtLink>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script setup>
  75. //引入vue
  76. import { ref } from 'vue';
  77. //获得新闻数据
  78. const props = defineProps({
  79. componentStyle: Number,//样式编号
  80. });
  81. const component_style1_News1Array = ref([]);
  82. //component_style1_News1Array.value = props.templateData.text.slice(0,8);
  83. async function getPageData() {
  84. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  85. method: 'GET',
  86. query: {
  87. 'imgnum': 0,
  88. 'textnum': 8,
  89. 'level': 5,
  90. 'placeid': 0,
  91. 'id': 0
  92. },
  93. });
  94. if (mkdata.code == 200) {
  95. component_style1_News1Array.value = mkdata.data.text;
  96. }
  97. }
  98. getPageData();
  99. </script>
  100. <style lang="less" scoped>
  101. .list_right_box_hot_1 {
  102. width: 100%;
  103. overflow: hidden;
  104. .list_right_head {
  105. height: 47px;
  106. border-top: solid 2px #A72213;
  107. border-bottom: solid 1px #DCDDDF;
  108. margin: 0px;
  109. box-sizing: border-box;
  110. }
  111. .list_right_head * {
  112. float: left;
  113. height: 100%;
  114. line-height: 47px;
  115. box-sizing: border-box;
  116. font-weight: bold;
  117. color: #A72213;
  118. font-size: 20px;
  119. }
  120. .list_right_box_hot_li {
  121. height: 64px;
  122. border-bottom: solid 1px #E4E4E4;
  123. position: relative;
  124. }
  125. .list_right_box_hot_li_num {
  126. position: absolute;
  127. width: 22px;
  128. height: 100%;
  129. line-height: 64px;
  130. color: #D9D9D9;
  131. font-size: 20px;
  132. left: 0px;
  133. top: 0px;
  134. font-style: italic;
  135. }
  136. .list_right_box_hot_li_a {
  137. display: block;
  138. width: 100%;
  139. height: 100%;
  140. text-indent: 24px;
  141. color: #333;
  142. font-size: 18px;
  143. line-height: 64px;
  144. display: block;
  145. word-break: keep-all;
  146. white-space: nowrap;
  147. overflow: hidden;
  148. text-overflow: ellipsis;
  149. }
  150. .list_right_box_hot_li:nth-of-type(-n+3) .list_right_box_hot_li_num {
  151. color: #A72213;
  152. }
  153. }
  154. .list_right_box_hot_2 {
  155. width: 100%;
  156. overflow: hidden;
  157. .list_right_head {
  158. height: 47px;
  159. border-top: solid 2px #A72213;
  160. border-bottom: solid 1px #DCDDDF;
  161. margin: 0px;
  162. box-sizing: border-box;
  163. }
  164. .list_right_head * {
  165. float: left;
  166. height: 100%;
  167. line-height: 47px;
  168. box-sizing: border-box;
  169. font-weight: bold;
  170. color: #A72213;
  171. font-size: 20px;
  172. }
  173. .list_right_box_hot_li {
  174. height: 64px;
  175. border-bottom: solid 1px #E4E4E4;
  176. position: relative;
  177. }
  178. .list_right_box_hot_li_num {
  179. position: absolute;
  180. width: 22px;
  181. height: 100%;
  182. line-height: 64px;
  183. color: #A72213;
  184. font-size: 20px;
  185. left: 0px;
  186. top: 0px;
  187. font-style: italic;
  188. }
  189. .list_right_box_hot_li_a {
  190. display: block;
  191. width: 100%;
  192. height: 100%;
  193. text-indent: 24px;
  194. color: #333;
  195. font-size: 18px;
  196. line-height: 64px;
  197. display: block;
  198. word-break: keep-all;
  199. white-space: nowrap;
  200. overflow: hidden;
  201. text-overflow: ellipsis;
  202. }
  203. }
  204. .list_right_box_hot_3 {
  205. width: 100%;
  206. overflow: hidden;
  207. .list_right_head {
  208. height: 47px;
  209. border-top: solid 2px #A72213;
  210. border-bottom: solid 1px #DCDDDF;
  211. margin: 0px;
  212. box-sizing: border-box;
  213. }
  214. .list_right_head * {
  215. float: left;
  216. height: 100%;
  217. line-height: 47px;
  218. box-sizing: border-box;
  219. font-weight: bold;
  220. color: #A72213;
  221. font-size: 20px;
  222. }
  223. .list_right_box_hot_li {
  224. height: 64px;
  225. border-bottom: dashed 1px #E4E4E4;
  226. position: relative;
  227. }
  228. .list_right_box_hot_li_num {
  229. position: absolute;
  230. width: 22px;
  231. height: 100%;
  232. line-height: 64px;
  233. color: #D9D9D9;
  234. font-size: 20px;
  235. left: 0px;
  236. top: 0px;
  237. font-style: italic;
  238. }
  239. .list_right_box_hot_li_a {
  240. display: block;
  241. width: 100%;
  242. height: 100%;
  243. text-indent: 24px;
  244. color: #333;
  245. font-size: 18px;
  246. line-height: 64px;
  247. display: block;
  248. word-break: keep-all;
  249. white-space: nowrap;
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. }
  253. .list_right_box_hot_li:nth-of-type(-n+3) .list_right_box_hot_li_num {
  254. color: #A72213;
  255. }
  256. }
  257. .list_right_box_hot_4 {
  258. width: 100%;
  259. overflow: hidden;
  260. .list_right_head {
  261. height: 47px;
  262. border-top: solid 2px #A72213;
  263. border-bottom: solid 1px #DCDDDF;
  264. margin: 0px;
  265. box-sizing: border-box;
  266. }
  267. .list_right_head * {
  268. float: left;
  269. height: 100%;
  270. line-height: 47px;
  271. box-sizing: border-box;
  272. font-weight: bold;
  273. color: #A72213;
  274. font-size: 20px;
  275. }
  276. .list_right_box_hot_li {
  277. height: 64px;
  278. border-bottom: dashed 1px #E4E4E4;
  279. position: relative;
  280. }
  281. .list_right_box_hot_li_num {
  282. position: absolute;
  283. width: 22px;
  284. height: 100%;
  285. line-height: 64px;
  286. color: #A72213;
  287. font-size: 20px;
  288. left: 0px;
  289. top: 0px;
  290. font-style: italic;
  291. }
  292. .list_right_box_hot_li_a {
  293. display: block;
  294. width: 100%;
  295. height: 100%;
  296. text-indent: 24px;
  297. color: #333;
  298. font-size: 18px;
  299. line-height: 64px;
  300. display: block;
  301. word-break: keep-all;
  302. white-space: nowrap;
  303. overflow: hidden;
  304. text-overflow: ellipsis;
  305. }
  306. }
  307. .list_right_box_hot_5 {
  308. width: 100%;
  309. overflow: hidden;
  310. .list_right_head {
  311. height: 47px;
  312. border-top: solid 2px #A72213;
  313. border-bottom: solid 1px #DCDDDF;
  314. margin: 0px;
  315. box-sizing: border-box;
  316. }
  317. .list_right_head * {
  318. float: left;
  319. height: 100%;
  320. line-height: 47px;
  321. box-sizing: border-box;
  322. font-weight: bold;
  323. color: #A72213;
  324. font-size: 20px;
  325. }
  326. .list_right_box_hot_li {
  327. height: 64px;
  328. border-bottom: dashed 1px #E4E4E4;
  329. position: relative;
  330. }
  331. .list_right_box_hot_li_a {
  332. display: block;
  333. width: 100%;
  334. height: 100%;
  335. color: #333;
  336. font-size: 18px;
  337. line-height: 64px;
  338. display: block;
  339. word-break: keep-all;
  340. white-space: nowrap;
  341. overflow: hidden;
  342. text-overflow: ellipsis;
  343. }
  344. }
  345. </style>