1.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle_skin5">
  4. <span>
  5. <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
  6. <div>{{ titleLink.alias }}</div>
  7. </NuxtLink>
  8. </span>
  9. </div>
  10. <!--样式1-->
  11. <div class="listNewsContent" v-if="componentStyle == 1">
  12. <div class="listNewsContentItemTop">
  13. <div v-for="item in component_style1_News2Array">
  14. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  15. :target="item.islink == 1 ? '_blank' : '_self'">
  16. <span>精选</span>
  17. <em></em>
  18. {{ item.title }}
  19. </NuxtLink>
  20. </div>
  21. </div>
  22. <div class="listNewsContentItemBottom">
  23. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  24. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  25. :title="component_style1_News1Array[active].title"
  26. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  27. <img :src="component_style1_News1Array[active].imgurl" alt="">
  28. </NuxtLink>
  29. </div>
  30. <div class="contentBottomRIght">
  31. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  32. @mouseenter="active = index">
  33. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  34. :target="item.islink == 1 ? '_blank' : '_self'">
  35. {{ item.title }}
  36. </NuxtLink>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <!--样式2-->
  42. <div class="listNewsContent style2" v-if="componentStyle == 2">
  43. <div class="listNewsContentItemBottom">
  44. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  45. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  46. :title="component_style1_News1Array[active].title"
  47. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  48. <img :src="component_style1_News1Array[active].imgurl" alt="">
  49. </NuxtLink>
  50. </div>
  51. <div class="contentBottomRIght">
  52. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  53. @mouseenter="active = index">
  54. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  55. :target="item.islink == 1 ? '_blank' : '_self'">
  56. {{ item.title }}
  57. </NuxtLink>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="listNewsContentItemTop">
  62. <div v-for="item in component_style1_News2Array">
  63. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  64. :target="item.islink == 1 ? '_blank' : '_self'">
  65. <span>精选</span>
  66. <em></em>
  67. {{ item.title }}
  68. </NuxtLink>
  69. </div>
  70. </div>
  71. </div>
  72. <!--样式3-->
  73. <div class="listNewsContent" v-if="componentStyle == 3">
  74. <div class="listNewsContentItemTop">
  75. <div v-for="item in component_style1_News2Array">
  76. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  77. :target="item.islink == 1 ? '_blank' : '_self'">
  78. <span>精选</span>
  79. <em></em>
  80. {{ item.title }}
  81. </NuxtLink>
  82. </div>
  83. </div>
  84. <div class="listNewsContentItemBottom">
  85. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  86. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  87. :title="component_style1_News1Array[active].title"
  88. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  89. <img :src="component_style1_News1Array[active].imgurl" alt="">
  90. </NuxtLink>
  91. </div>
  92. <div class="contentBottomRIght bg_blue">
  93. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  94. @mouseenter="active = index">
  95. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  96. :target="item.islink == 1 ? '_blank' : '_self'">
  97. {{ item.title }}
  98. </NuxtLink>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <!--样式4-->
  104. <div class="listNewsContent style4" v-if="componentStyle == 4">
  105. <div class="listNewsContentItemBottom">
  106. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  107. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  108. :title="component_style1_News1Array[active].title"
  109. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  110. <img :src="component_style1_News1Array[active].imgurl" alt="">
  111. </NuxtLink>
  112. </div>
  113. <div class="contentBottomRIght bg_blue">
  114. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  115. @mouseenter="active = index">
  116. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  117. :target="item.islink == 1 ? '_blank' : '_self'">
  118. {{ item.title }}
  119. </NuxtLink>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="listNewsContentItemTop">
  124. <div v-for="item in component_style1_News2Array">
  125. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  126. :target="item.islink == 1 ? '_blank' : '_self'">
  127. <span>精选</span>
  128. <em></em>
  129. {{ item.title }}
  130. </NuxtLink>
  131. </div>
  132. </div>
  133. </div>
  134. <!--样式5-->
  135. <div class="listNewsContent style5" v-if="componentStyle == 5">
  136. <div class="listNewsContentItemTop">
  137. <div v-for="item in component_style1_News2Array">
  138. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  139. :target="item.islink == 1 ? '_blank' : '_self'">
  140. <span>精选</span>
  141. <em></em>
  142. {{ item.title }}
  143. </NuxtLink>
  144. </div>
  145. </div>
  146. <div class="listNewsContentItemBottom">
  147. <div class="contentBottomRIght">
  148. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  149. @mouseenter="active = index">
  150. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  151. :target="item.islink == 1 ? '_blank' : '_self'">
  152. {{ item.title }}
  153. </NuxtLink>
  154. </div>
  155. </div>
  156. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  157. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  158. :title="component_style1_News1Array[active].title"
  159. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  160. <img :src="component_style1_News1Array[active].imgurl" alt="">
  161. </NuxtLink>
  162. </div>
  163. </div>
  164. </div>
  165. <!--样式6-->
  166. <div class="listNewsContent style6" v-if="componentStyle == 6">
  167. <div class="listNewsContentItemBottom">
  168. <div class="contentBottomRIght">
  169. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  170. @mouseenter="active = index">
  171. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  172. :target="item.islink == 1 ? '_blank' : '_self'">
  173. {{ item.title }}
  174. </NuxtLink>
  175. </div>
  176. </div>
  177. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  178. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  179. :title="component_style1_News1Array[active].title"
  180. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  181. <img :src="component_style1_News1Array[active].imgurl" alt="">
  182. </NuxtLink>
  183. </div>
  184. </div>
  185. <div class="listNewsContentItemTop">
  186. <div v-for="item in component_style1_News2Array">
  187. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  188. :target="item.islink == 1 ? '_blank' : '_self'">
  189. <span>精选</span>
  190. <em></em>
  191. {{ item.title }}
  192. </NuxtLink>
  193. </div>
  194. </div>
  195. </div>
  196. <!--样式7-->
  197. <div class="listNewsContent style7" v-if="componentStyle == 7">
  198. <div class="listNewsContentItemTop">
  199. <div v-for="item in component_style1_News2Array">
  200. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  201. :target="item.islink == 1 ? '_blank' : '_self'">
  202. <span>精选</span>
  203. <em></em>
  204. {{ item.title }}
  205. </NuxtLink>
  206. </div>
  207. </div>
  208. <div class="listNewsContentItemBottom">
  209. <div class="contentBottomRIght bg_blue">
  210. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  211. @mouseenter="active = index">
  212. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  213. :target="item.islink == 1 ? '_blank' : '_self'">
  214. {{ item.title }}
  215. </NuxtLink>
  216. </div>
  217. </div>
  218. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  219. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  220. :title="component_style1_News1Array[active].title"
  221. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  222. <img :src="component_style1_News1Array[active].imgurl" alt="">
  223. </NuxtLink>
  224. </div>
  225. </div>
  226. </div>
  227. <!--样式8-->
  228. <div class="listNewsContent style8" v-if="componentStyle == 8">
  229. <div class="listNewsContentItemBottom">
  230. <div class="contentBottomRIght bg_blue">
  231. <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
  232. @mouseenter="active = index">
  233. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  234. :target="item.islink == 1 ? '_blank' : '_self'">
  235. {{ item.title }}
  236. </NuxtLink>
  237. </div>
  238. </div>
  239. <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
  240. <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
  241. :title="component_style1_News1Array[active].title"
  242. :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
  243. <img :src="component_style1_News1Array[active].imgurl" alt="">
  244. </NuxtLink>
  245. </div>
  246. </div>
  247. <div class="listNewsContentItemTop">
  248. <div v-for="item in component_style1_News2Array">
  249. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  250. :target="item.islink == 1 ? '_blank' : '_self'">
  251. <span>精选</span>
  252. <em></em>
  253. {{ item.title }}
  254. </NuxtLink>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </template>
  260. <script setup>
  261. //引入vue
  262. import { ref } from 'vue';
  263. //获得新闻数据
  264. const props = defineProps({
  265. titleLink: Object,//板块名称
  266. templateData: Array,//新闻数据
  267. componentStyle: Number,//样式编号
  268. });
  269. //定义变量并赋值 start ---------------------------------------->
  270. const active = ref(0);
  271. const component_style1_News1Array = ref({});
  272. const component_style1_News2Array = ref([]);
  273. component_style1_News1Array.value = props.templateData.imgnum.slice(0, 5);
  274. component_style1_News2Array.value = props.templateData.textnum.slice(0, 5);
  275. //定义变量并赋值 end ---------------------------------------->
  276. </script>
  277. <style lang="less" scoped>
  278. //基本样式 start ---------------------------------------->
  279. .listNewsBox {
  280. position: relative;
  281. .listNewsTitle_skin5 {
  282. display: flex;
  283. align-items: flex-start;
  284. justify-content: flex-start;
  285. border-bottom: 1px solid #999999;
  286. height: 38px;
  287. margin-bottom: 20px;
  288. div {
  289. height: 35px;
  290. width: 138px;
  291. line-height: 32px;
  292. font-size: 22px;
  293. font-weight: bold;
  294. color: #333333;
  295. cursor: pointer;
  296. overflow: hidden;
  297. text-overflow: ellipsis;
  298. white-space: nowrap;
  299. color: #3848A0;
  300. background: url("https://img.bjzxtw.org.cn/pre/image/png/20251104/1762224944805589.png") bottom left no-repeat;
  301. }
  302. }
  303. }
  304. //基本样式 end ---------------------------------------->
  305. //样式1 start ---------------------------------------->
  306. .listNewsBox {
  307. .listNewsContent {
  308. margin-bottom: 20px;
  309. .listNewsContentItemTop {
  310. width: 100%;
  311. height: 220px;
  312. margin-bottom: 25px;
  313. div {
  314. width: 580px;
  315. color: #333333;
  316. font-size: 18px;
  317. margin-bottom: 23px;
  318. cursor: pointer;
  319. overflow: hidden;
  320. white-space: nowrap;
  321. overflow: hidden;
  322. text-overflow: ellipsis;
  323. span {
  324. display: inline-block;
  325. width: 36px;
  326. height: 24px;
  327. line-height: 24px;
  328. font-size: 18px;
  329. font-weight: bold;
  330. color: #3848A0;
  331. padding-right: 15px;
  332. }
  333. em {
  334. display: inline-block;
  335. width: 1px;
  336. height: 15px;
  337. background-color: #b3b3b3;
  338. margin-right: 15px;
  339. }
  340. &:last-child {
  341. margin-bottom: 0;
  342. }
  343. a {
  344. color: #333333;
  345. }
  346. }
  347. }
  348. .listNewsContentItemBottom {
  349. width: 100%;
  350. height: 190px;
  351. background-color: #f9fafb;
  352. display: flex;
  353. .contenBottomLeft {
  354. width: 285px;
  355. height: 190px;
  356. position: relative;
  357. a {
  358. img {
  359. position: absolute;
  360. top: 0;
  361. left: 0;
  362. width: 285px;
  363. height: 190px;
  364. }
  365. }
  366. }
  367. .contentBottomRIght {
  368. height: 190px;
  369. padding-left: 20px;
  370. padding: 5px 0 5px 16px;
  371. div {
  372. width: 260px;
  373. white-space: nowrap;
  374. overflow: hidden;
  375. text-overflow: ellipsis;
  376. height: 24px;
  377. line-height: 24px;
  378. font-size: 18px;
  379. color: #333333;
  380. margin-bottom: 15px;
  381. padding-left: 16px;
  382. background: url("https://img.bjzxtw.org.cn/pre/image/png/20251111/1762854924444085.png") no-repeat left center;
  383. &:last-child {
  384. margin-bottom: 0;
  385. }
  386. &:hover {
  387. font-weight: bold;
  388. }
  389. a {
  390. color: #333333;
  391. }
  392. }
  393. }
  394. //文字前缀为主题色蓝色
  395. .bg_blue {
  396. div {
  397. background: url("https://img.bjzxtw.org.cn/pre/image/png/20251112/1762909332941464.png") no-repeat left center;
  398. }
  399. }
  400. }
  401. }
  402. //样式2
  403. .style2,
  404. .style4 {
  405. .listNewsContentItemBottom {
  406. margin-bottom: 25px;
  407. }
  408. .listNewsContentItemTop {
  409. margin-bottom: 0px;
  410. }
  411. }
  412. // 样式5
  413. .style5,
  414. .style7 {
  415. .listNewsContentItemBottom {
  416. .contenBottomLeft {
  417. margin-right: 0px;
  418. }
  419. .contentBottomRIght {
  420. margin-right: 7px;
  421. }
  422. }
  423. }
  424. // 样式6
  425. .style6,
  426. .style8 {
  427. .listNewsContentItemBottom {
  428. margin-bottom: 25px;
  429. .contenBottomLeft {
  430. margin-right: 0px;
  431. }
  432. .contentBottomRIght {
  433. margin-right: 7px;
  434. }
  435. }
  436. .listNewsContentItemTop {
  437. margin-bottom: 0px;
  438. }
  439. }
  440. }
  441. </style>