3.vue 24 KB

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