2.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle_skin2">
  4. <span>
  5. <NuxtLink
  6. v-if="titleLink.cid"
  7. :href="getLinkPath(titleLink)"
  8. :title="titleLink.alias"
  9. >
  10. {{titleLink.alias}}
  11. </NuxtLink>
  12. </span>
  13. </div>
  14. <!--样式1-->
  15. <div class="listNewsContent" v-if="componentStyle==1">
  16. <div class="listNewsContentTop">
  17. <div v-for="item in component_style1_News1Array" class="listNewsContentTopItem">
  18. <NuxtLink
  19. :href="getLinkPathDetail(item)"
  20. :title="item.title"
  21. :target="item.islink == 1 ? '_blank' : '_self'"
  22. >
  23. <img :src="item.imgurl" />
  24. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  25. </NuxtLink>
  26. </div>
  27. </div>
  28. <div class="listNewsContentBottom">
  29. <div v-for="item in component_style1_News2Array" class="listNewsContentTopItem">
  30. <NuxtLink
  31. :href="getLinkPathDetail(item)"
  32. :title="item.title"
  33. :target="item.islink == 1 ? '_blank' : '_self'"
  34. >
  35. {{ item.title }}
  36. </NuxtLink>
  37. </div>
  38. </div>
  39. </div>
  40. <!--样式2-->
  41. <div class="listNewsContent listNewsStyle2" v-if="componentStyle==2">
  42. <div class="listNewsContentBottomBox">
  43. <div class="listNewsContentBottom">
  44. <div v-for="item in component_style1_News2Array" class="listNewsContentTopItem">
  45. <NuxtLink
  46. :href="getLinkPathDetail(item)"
  47. :title="item.title"
  48. :target="item.islink == 1 ? '_blank' : '_self'"
  49. >
  50. {{ item.title }}
  51. </NuxtLink>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="listNewsContentTop">
  56. <div v-for="item in component_style1_News1Array" class="listNewsContentTopItem">
  57. <NuxtLink
  58. :href="getLinkPathDetail(item)"
  59. :title="item.title"
  60. :target="item.islink == 1 ? '_blank' : '_self'"
  61. >
  62. <img :src="item.imgurl" />
  63. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  64. </NuxtLink>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- 样式3 -->
  69. <div class="listNewsStyle3" v-if="componentStyle == 3">
  70. <div class="listNewsContent_left">
  71. <div class="listNewsContent_leftTop">
  72. <div v-for="item in component_style1_News1Array_1" class="listNewsContentTopItem">
  73. <NuxtLink
  74. :href="getLinkPathDetail(item)"
  75. :title="item.title"
  76. :target="item.islink == 1 ? '_blank' : '_self'"
  77. >
  78. <img :src="item.imgurl" />
  79. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  80. </NuxtLink>
  81. </div>
  82. </div>
  83. <div class="listNewsContent_leftBottom">
  84. <div v-for="item in component_style1_News2Array_1" class="listNewsContentTopItem">
  85. <NuxtLink
  86. :href="getLinkPathDetail(item)"
  87. :title="item.title"
  88. :target="item.islink == 1 ? '_blank' : '_self'"
  89. >
  90. {{ item.title }}
  91. </NuxtLink>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="listNewsContent_right">
  96. <div class="listNewsContent_leftBottom">
  97. <div v-for="item in component_style1_News2Array_2" class="listNewsContentTopItem">
  98. <NuxtLink
  99. :href="getLinkPathDetail(item)"
  100. :title="item.title"
  101. :target="item.islink == 1 ? '_blank' : '_self'"
  102. >
  103. {{ item.title }}
  104. </NuxtLink>
  105. </div>
  106. </div>
  107. <div class="listNewsContent_leftTop">
  108. <div v-for="item in component_style1_News1Array_2" class="listNewsContentTopItem">
  109. <NuxtLink
  110. :href="getLinkPathDetail(item)"
  111. :title="item.title"
  112. :target="item.islink == 1 ? '_blank' : '_self'"
  113. >
  114. <img :src="item.imgurl" />
  115. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  116. </NuxtLink>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <!-- 样式4 -->
  122. <div class="listNewsStyle3 listNewsStyle4" v-if="componentStyle == 4">
  123. <div class="listNewsContent_left">
  124. <div class="listNewsContent_leftBottom">
  125. <div v-for="item in component_style1_News2Array_1" class="listNewsContentTopItem">
  126. <NuxtLink
  127. :href="getLinkPathDetail(item)"
  128. :title="item.title"
  129. :target="item.islink == 1 ? '_blank' : '_self'"
  130. >
  131. {{ item.title }}
  132. </NuxtLink>
  133. </div>
  134. </div>
  135. <div class="listNewsContent_leftTop">
  136. <div v-for="item in component_style1_News1Array_1" class="listNewsContentTopItem">
  137. <NuxtLink
  138. :href="getLinkPathDetail(item)"
  139. :title="item.title"
  140. :target="item.islink == 1 ? '_blank' : '_self'"
  141. >
  142. <img :src="item.imgurl" />
  143. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  144. </NuxtLink>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="listNewsContent_right">
  149. <div class="listNewsContent_leftTop">
  150. <div v-for="item in component_style1_News1Array_2" class="listNewsContentTopItem">
  151. <NuxtLink
  152. :href="getLinkPathDetail(item)"
  153. :title="item.title"
  154. :target="item.islink == 1 ? '_blank' : '_self'"
  155. >
  156. <img :src="item.imgurl" />
  157. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  158. </NuxtLink>
  159. </div>
  160. </div>
  161. <div class="listNewsContent_leftBottom">
  162. <div v-for="item in component_style1_News2Array_2" class="listNewsContentTopItem">
  163. <NuxtLink
  164. :href="getLinkPathDetail(item)"
  165. :title="item.title"
  166. :target="item.islink == 1 ? '_blank' : '_self'"
  167. >
  168. {{ item.title }}
  169. </NuxtLink>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <!-- 样式5 -->
  175. <div class="listNewsContent listNewsStyle5" v-if="componentStyle == 5">
  176. <div class="listNewsContentTop">
  177. <div v-for="item in component_style1_News1Array" class="listNewsContentTopItem">
  178. <NuxtLink
  179. :href="getLinkPathDetail(item)"
  180. :title="item.title"
  181. :target="item.islink == 1 ? '_blank' : '_self'"
  182. >
  183. <img :src="item.imgurl" />
  184. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  185. </NuxtLink>
  186. </div>
  187. </div>
  188. <div class="listNewsContentBottom">
  189. <div v-for="item in component_style1_News2Array" class="listNewsContentTopItem">
  190. <NuxtLink
  191. :href="getLinkPathDetail(item)"
  192. :title="item.title"
  193. :target="item.islink == 1 ? '_blank' : '_self'"
  194. >
  195. {{ item.title }}
  196. </NuxtLink>
  197. </div>
  198. </div>
  199. </div>
  200. <!-- 样式6 -->
  201. <div class="listNewsContent listNewsStyle6" v-if="componentStyle == 6">
  202. <div class="listNewsContentBottom">
  203. <div v-for="item in component_style1_News2Array" class="listNewsContentTopItem">
  204. <NuxtLink
  205. :href="getLinkPathDetail(item)"
  206. :title="item.title"
  207. :target="item.islink == 1 ? '_blank' : '_self'"
  208. >
  209. {{ item.title }}
  210. </NuxtLink>
  211. </div>
  212. </div>
  213. <div class="listNewsContentTop">
  214. <div v-for="item in component_style1_News1Array" class="listNewsContentTopItem">
  215. <NuxtLink
  216. :href="getLinkPathDetail(item)"
  217. :title="item.title"
  218. :target="item.islink == 1 ? '_blank' : '_self'"
  219. >
  220. <img :src="item.imgurl" />
  221. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  222. </NuxtLink>
  223. </div>
  224. </div>
  225. </div>
  226. <!-- 样式7 -->
  227. <div class="listNewsStyle3 listNewsStyle7" v-if="componentStyle == 7">
  228. <div class="listNewsContent_left">
  229. <div class="listNewsContent_leftTop">
  230. <div v-for="item in component_style1_News1Array_1" class="listNewsContentTopItem">
  231. <NuxtLink
  232. :href="getLinkPathDetail(item)"
  233. :title="item.title"
  234. :target="item.islink == 1 ? '_blank' : '_self'"
  235. >
  236. <img :src="item.imgurl" />
  237. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  238. </NuxtLink>
  239. </div>
  240. </div>
  241. <div class="listNewsContent_leftBottom">
  242. <div v-for="item in component_style1_News2Array_1" class="listNewsContentTopItem">
  243. <NuxtLink
  244. :href="getLinkPathDetail(item)"
  245. :title="item.title"
  246. :target="item.islink == 1 ? '_blank' : '_self'"
  247. >
  248. {{ item.title }}
  249. </NuxtLink>
  250. </div>
  251. </div>
  252. </div>
  253. <div class="listNewsContent_right">
  254. <div class="listNewsContent_leftBottom">
  255. <div v-for="item in component_style1_News2Array_2" class="listNewsContentTopItem">
  256. <NuxtLink
  257. :href="getLinkPathDetail(item)"
  258. :title="item.title"
  259. :target="item.islink == 1 ? '_blank' : '_self'"
  260. >
  261. {{ item.title }}
  262. </NuxtLink>
  263. </div>
  264. </div>
  265. <div class="listNewsContent_leftTop">
  266. <div v-for="item in component_style1_News1Array_2" class="listNewsContentTopItem">
  267. <NuxtLink
  268. :href="getLinkPathDetail(item)"
  269. :title="item.title"
  270. :target="item.islink == 1 ? '_blank' : '_self'"
  271. >
  272. <img :src="item.imgurl" />
  273. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  274. </NuxtLink>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <!-- 样式8 -->
  280. <div class="listNewsStyle3 listNewsStyle8" v-if="componentStyle == 8">
  281. <div class="listNewsContent_left">
  282. <div class="listNewsContent_leftBottom">
  283. <div v-for="item in component_style1_News2Array_1" class="listNewsContentTopItem">
  284. <NuxtLink
  285. :href="getLinkPathDetail(item)"
  286. :title="item.title"
  287. :target="item.islink == 1 ? '_blank' : '_self'"
  288. >
  289. {{ item.title }}
  290. </NuxtLink>
  291. </div>
  292. </div>
  293. <div class="listNewsContent_leftTop">
  294. <div v-for="item in component_style1_News1Array_1" class="listNewsContentTopItem">
  295. <NuxtLink
  296. :href="getLinkPathDetail(item)"
  297. :title="item.title"
  298. :target="item.islink == 1 ? '_blank' : '_self'"
  299. >
  300. <img :src="item.imgurl" />
  301. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  302. </NuxtLink>
  303. </div>
  304. </div>
  305. </div>
  306. <div class="listNewsContent_right">
  307. <div class="listNewsContent_leftTop">
  308. <div v-for="item in component_style1_News1Array_2" class="listNewsContentTopItem">
  309. <NuxtLink
  310. :href="getLinkPathDetail(item)"
  311. :title="item.title"
  312. :target="item.islink == 1 ? '_blank' : '_self'"
  313. >
  314. <img :src="item.imgurl" />
  315. <div class="listNewsContentTopItemTitle">{{ item.title }}</div>
  316. </NuxtLink>
  317. </div>
  318. </div>
  319. <div class="listNewsContent_leftBottom">
  320. <div v-for="item in component_style1_News2Array_2" class="listNewsContentTopItem">
  321. <NuxtLink
  322. :href="getLinkPathDetail(item)"
  323. :title="item.title"
  324. :target="item.islink == 1 ? '_blank' : '_self'"
  325. >
  326. {{ item.title }}
  327. </NuxtLink>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </template>
  334. <script setup>
  335. //引入vue
  336. import {ref} from 'vue';
  337. //获得新闻数据
  338. const props = defineProps({
  339. titleLink:Object,//板块名称
  340. templateData:Array,//新闻数据
  341. componentStyle:Number,//样式编号
  342. });
  343. //样式1与样式2共用 start ---------------------------------------->
  344. const component_style1_News1Array = ref({});
  345. const component_style1_News1Array_1 = ref({});
  346. const component_style1_News1Array_2 = ref({});
  347. const component_style1_News2Array = ref([]);
  348. const component_style1_News2Array_1 = ref([]);
  349. const component_style1_News2Array_2 = ref([]);
  350. component_style1_News1Array.value = props.templateData.imgnum.slice(0,2);
  351. component_style1_News1Array_1.value = props.templateData.imgnum.slice(0,1);
  352. component_style1_News1Array_2.value = props.templateData.imgnum.slice(1,2);
  353. component_style1_News2Array.value = props.templateData.textnum;
  354. component_style1_News2Array_1.value = props.templateData.textnum.slice(0,6);
  355. component_style1_News2Array_2.value = props.templateData.textnum.slice(6,12);
  356. //样式1与样式2共用 end ---------------------------------------->
  357. </script>
  358. <style lang="less" scoped>
  359. //基本样式 start ---------------------------------------->
  360. .listNewsBox {
  361. position: relative;
  362. .listNewsTitle_skin2 {
  363. font-size:22px;
  364. font-weight:bold;
  365. height: 40px;
  366. line-height: 40px;
  367. border-bottom: 2px solid #A91B33;
  368. color:#A91B33;
  369. margin-bottom: 20px;
  370. box-sizing: border-box;
  371. a {
  372. color:#A91B33;
  373. display: block;
  374. height: 25px;
  375. line-height: 25px;
  376. }
  377. span {
  378. color:#A91B33;
  379. height: 25px;
  380. line-height: 25px;
  381. border-left: 3px solid #A91B33;
  382. padding-left: 12px;
  383. display: block;
  384. }
  385. }
  386. .listNewsContent {
  387. .listNewsContentTop {
  388. display: flex;
  389. align-items: center;
  390. justify-content: space-between;
  391. margin-bottom: 20px;
  392. height: 110px;
  393. .listNewsContentTopItem {
  394. width: 350px;
  395. height: 110px;
  396. a{
  397. display: block;
  398. display: flex;
  399. align-items: center;
  400. justify-content: space-between;
  401. }
  402. img {
  403. display: block;
  404. width: 170px;
  405. height: 110px;
  406. }
  407. .listNewsContentTopItemTitle {
  408. font-size: 18px;
  409. color: #333333;
  410. margin-left: 8px;
  411. margin-right: 8px;
  412. overflow: hidden;
  413. text-overflow: ellipsis;
  414. display: -webkit-box;
  415. -webkit-box-orient: vertical;
  416. -webkit-line-clamp: 3;
  417. }
  418. }
  419. }
  420. .listNewsContentBottom {
  421. display: flex;
  422. flex-wrap: wrap;
  423. align-items: flex-start;
  424. justify-content: space-between;
  425. div {
  426. width: 350px;
  427. height: 24px;
  428. line-height: 24px;
  429. overflow: hidden;
  430. text-overflow: ellipsis;
  431. white-space: nowrap;
  432. margin-bottom: 20px;
  433. &:nth-last-child(-n+2) {
  434. margin-bottom: 0;
  435. }
  436. &:nth-child(1),
  437. &:nth-child(2),
  438. &:nth-child(7),
  439. &:nth-child(8) {
  440. font-weight: bold;
  441. }
  442. a {
  443. font-size: 18px;
  444. color: #333333;
  445. }
  446. }
  447. }
  448. }
  449. }
  450. //基本样式 end ---------------------------------------->
  451. //样式2 start ---------------------------------------->
  452. .listNewsStyle2 {
  453. .listNewsContentTop {
  454. margin-bottom: 0;
  455. margin-top: 20px;
  456. }
  457. }
  458. //样式2 end ---------------------------------------->
  459. //样式3
  460. .listNewsBox {
  461. .listNewsStyle3 {
  462. display: flex;
  463. .listNewsContent_left {
  464. width: 350px;
  465. height: 440px;
  466. margin-right: 20px;
  467. .listNewsContent_leftTop {
  468. width: 350px;
  469. height: 110px;
  470. margin-bottom: 20px;
  471. .listNewsContentTopItem {
  472. width: 350px;
  473. height: 110px;
  474. background-color: #f9fafb;
  475. a{
  476. display: flex;
  477. align-items: center;
  478. justify-content: space-between;
  479. img {
  480. display: block;
  481. width: 170px;
  482. height: 110px;
  483. }
  484. .listNewsContentTopItemTitle {
  485. font-size: 18px;
  486. color: #333333;
  487. margin-left: 8px;
  488. margin-right: 8px;
  489. overflow: hidden;
  490. text-overflow: ellipsis;
  491. display: -webkit-box;
  492. -webkit-box-orient: vertical;
  493. -webkit-line-clamp: 3;
  494. }
  495. }
  496. }
  497. }
  498. .listNewsContent_leftBottom {
  499. width: 350px;
  500. div {
  501. width: 350px;
  502. height: 24px;
  503. line-height: 24px;
  504. overflow: hidden;
  505. text-overflow: ellipsis;
  506. white-space: nowrap;
  507. font-size: 18px;
  508. margin-bottom: 20px;
  509. color: #333333;
  510. a{
  511. color: #333333;
  512. }
  513. &:nth-child(1),
  514. &:nth-child(4) {
  515. font-weight: bold;
  516. }
  517. &:last-child {
  518. margin-bottom: 0;
  519. }
  520. }
  521. }
  522. }
  523. .listNewsContent_right {
  524. width: 350px;
  525. height: 440px;
  526. .listNewsContent_leftTop {
  527. width: 350px;
  528. height: 110px;
  529. .listNewsContentTopItem {
  530. width: 350px;
  531. height: 110px;
  532. background-color: #f9fafb;
  533. a{
  534. display: flex;
  535. align-items: center;
  536. justify-content: space-between;
  537. img {
  538. display: block;
  539. width: 170px;
  540. height: 110px;
  541. }
  542. .listNewsContentTopItemTitle {
  543. font-size: 18px;
  544. color: #333333;
  545. margin-left: 8px;
  546. margin-right: 8px;
  547. overflow: hidden;
  548. text-overflow: ellipsis;
  549. display: -webkit-box;
  550. -webkit-box-orient: vertical;
  551. -webkit-line-clamp: 3;
  552. }
  553. }
  554. }
  555. }
  556. .listNewsContent_leftBottom {
  557. width: 350px;
  558. margin-bottom: 20px;
  559. div {
  560. width: 350px;
  561. height: 24px;
  562. line-height: 24px;
  563. overflow: hidden;
  564. text-overflow: ellipsis;
  565. white-space: nowrap;
  566. font-size: 18px;
  567. margin-bottom: 20px;
  568. color: #333333;
  569. a{
  570. color: #333333;
  571. }
  572. &:nth-child(1),
  573. &:nth-child(4) {
  574. font-weight: bold;
  575. }
  576. &:last-child {
  577. margin-bottom: 0;
  578. }
  579. }
  580. }
  581. }
  582. }
  583. }
  584. //样式4
  585. .listNewsBox {
  586. .listNewsStyle4 {
  587. display: flex;
  588. .listNewsContent_left {
  589. .listNewsContent_leftBottom {
  590. margin-bottom: 20px;
  591. }
  592. .listNewsContent_leftTop {
  593. margin-bottom: 0px;
  594. }
  595. }
  596. .listNewsContent_right {
  597. .listNewsContent_leftBottom {
  598. margin-bottom: 0px;
  599. }
  600. .listNewsContent_leftTop {
  601. margin-bottom: 20px;
  602. }
  603. }
  604. }
  605. }
  606. // 样式5
  607. .listNewsBox {
  608. .listNewsStyle5 {
  609. .listNewsContentBottom {
  610. div {
  611. &:nth-child(1),
  612. &:nth-child(2),
  613. &:nth-child(7),
  614. &:nth-child(8) {
  615. font-weight: 400;
  616. }
  617. }
  618. }
  619. }
  620. }
  621. // 样式6
  622. .listNewsBox {
  623. .listNewsStyle6 {
  624. .listNewsContentBottom {
  625. div {
  626. &:nth-child(1),
  627. &:nth-child(2),
  628. &:nth-child(7),
  629. &:nth-child(8) {
  630. font-weight: 400;
  631. }
  632. }
  633. }
  634. .listNewsContentTop {
  635. margin-top: 20px;
  636. .listNewsContentTopItem {
  637. margin-bottom: 0;
  638. }
  639. }
  640. }
  641. }
  642. // 样式7
  643. .listNewsBox {
  644. .listNewsStyle7 {
  645. .listNewsContent_left {
  646. .listNewsContent_leftBottom {
  647. div {
  648. &:nth-child(1),
  649. &:nth-child(4) {
  650. font-weight: 400;
  651. }
  652. }
  653. }
  654. }
  655. .listNewsContent_right {
  656. .listNewsContent_leftBottom {
  657. div {
  658. &:nth-child(1),
  659. &:nth-child(4) {
  660. font-weight: 400;
  661. }
  662. }
  663. }
  664. }
  665. }
  666. }
  667. //样式8
  668. .listNewsBox {
  669. .listNewsStyle8 {
  670. display: flex;
  671. .listNewsContent_left {
  672. .listNewsContent_leftBottom {
  673. margin-bottom: 20px;
  674. div {
  675. &:nth-child(1),
  676. &:nth-child(4) {
  677. font-weight: 400;
  678. }
  679. }
  680. }
  681. .listNewsContent_leftTop {
  682. margin-bottom: 0px;
  683. }
  684. }
  685. .listNewsContent_right {
  686. .listNewsContent_leftBottom {
  687. margin-bottom: 0px;
  688. div {
  689. &:nth-child(1),
  690. &:nth-child(4) {
  691. font-weight: 400;
  692. }
  693. }
  694. }
  695. .listNewsContent_leftTop {
  696. margin-bottom: 20px;
  697. }
  698. }
  699. }
  700. }
  701. </style>