4.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle_skin4">
  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_skin4 {
  287. font-size:22px;
  288. font-weight:bold;
  289. height: 40px;
  290. line-height: 40px;
  291. border-bottom: 1px solid #fe8f00;
  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: #fe8f00;
  300. border-top-left-radius: 4px;
  301. border-top-right-radius: 4px;
  302. color:#fff;
  303. text-align: center;
  304. a{
  305. color: #fff;
  306. }
  307. }
  308. }
  309. .listNewsContent {
  310. .listNewsContentTop {
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-between;
  314. margin-bottom: 20px;
  315. height: 110px;
  316. .listNewsContentTopItem {
  317. width: 350px;
  318. height: 110px;
  319. a {
  320. display: block;
  321. display: flex;
  322. align-items: center;
  323. justify-content: space-between;
  324. }
  325. img {
  326. display: block;
  327. width: 170px;
  328. height: 110px;
  329. }
  330. .listNewsContentTopItemTitle {
  331. font-size: 18px;
  332. color: #333333;
  333. margin-left: 8px;
  334. margin-right: 8px;
  335. overflow: hidden;
  336. text-overflow: ellipsis;
  337. display: -webkit-box;
  338. -webkit-box-orient: vertical;
  339. -webkit-line-clamp: 3;
  340. }
  341. }
  342. }
  343. .listNewsContentBottom {
  344. display: flex;
  345. flex-wrap: wrap;
  346. align-items: flex-start;
  347. justify-content: space-between;
  348. div {
  349. width: 350px;
  350. height: 24px;
  351. line-height: 24px;
  352. overflow: hidden;
  353. text-overflow: ellipsis;
  354. white-space: nowrap;
  355. margin-bottom: 20px;
  356. &:nth-last-child(-n+2) {
  357. margin-bottom: 0;
  358. }
  359. &:nth-child(1),
  360. &:nth-child(2),
  361. &:nth-child(7),
  362. &:nth-child(8) {
  363. font-weight: bold;
  364. }
  365. a {
  366. font-size: 18px;
  367. color: #333333;
  368. }
  369. }
  370. }
  371. }
  372. }
  373. //基本样式 end ---------------------------------------->
  374. //样式2 start ---------------------------------------->
  375. .listNewsStyle2 {
  376. .listNewsContentTop {
  377. margin-bottom: 0;
  378. margin-top: 20px;
  379. }
  380. }
  381. //样式2 end ---------------------------------------->
  382. //样式3
  383. .listNewsBox {
  384. .listNewsStyle3 {
  385. display: flex;
  386. .listNewsContent_left {
  387. width: 350px;
  388. height: 440px;
  389. margin-right: 20px;
  390. .listNewsContent_leftTop {
  391. width: 350px;
  392. height: 110px;
  393. margin-bottom: 20px;
  394. .listNewsContentTopItem {
  395. width: 350px;
  396. height: 110px;
  397. background-color: #f9fafb;
  398. a {
  399. display: flex;
  400. align-items: center;
  401. justify-content: space-between;
  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. }
  421. .listNewsContent_leftBottom {
  422. width: 350px;
  423. div {
  424. width: 350px;
  425. height: 24px;
  426. line-height: 24px;
  427. overflow: hidden;
  428. text-overflow: ellipsis;
  429. white-space: nowrap;
  430. font-size: 18px;
  431. margin-bottom: 20px;
  432. color: #333333;
  433. a {
  434. color: #333333;
  435. }
  436. &:nth-child(1),
  437. &:nth-child(4) {
  438. font-weight: bold;
  439. }
  440. &:last-child {
  441. margin-bottom: 0;
  442. }
  443. }
  444. }
  445. }
  446. .listNewsContent_right {
  447. width: 350px;
  448. height: 440px;
  449. .listNewsContent_leftTop {
  450. width: 350px;
  451. height: 110px;
  452. .listNewsContentTopItem {
  453. width: 350px;
  454. height: 110px;
  455. background-color: #f9fafb;
  456. a {
  457. display: flex;
  458. align-items: center;
  459. justify-content: space-between;
  460. img {
  461. display: block;
  462. width: 170px;
  463. height: 110px;
  464. }
  465. .listNewsContentTopItemTitle {
  466. font-size: 18px;
  467. color: #333333;
  468. margin-left: 8px;
  469. margin-right: 8px;
  470. overflow: hidden;
  471. text-overflow: ellipsis;
  472. display: -webkit-box;
  473. -webkit-box-orient: vertical;
  474. -webkit-line-clamp: 3;
  475. }
  476. }
  477. }
  478. }
  479. .listNewsContent_leftBottom {
  480. width: 350px;
  481. margin-bottom: 20px;
  482. div {
  483. width: 350px;
  484. height: 24px;
  485. line-height: 24px;
  486. overflow: hidden;
  487. text-overflow: ellipsis;
  488. white-space: nowrap;
  489. font-size: 18px;
  490. margin-bottom: 20px;
  491. color: #333333;
  492. a {
  493. color: #333333;
  494. }
  495. &:nth-child(1),
  496. &:nth-child(4) {
  497. font-weight: bold;
  498. }
  499. &:last-child {
  500. margin-bottom: 0;
  501. }
  502. }
  503. }
  504. }
  505. }
  506. }
  507. //样式4
  508. .listNewsBox {
  509. .listNewsStyle4 {
  510. display: flex;
  511. .listNewsContent_left {
  512. .listNewsContent_leftBottom {
  513. margin-bottom: 20px;
  514. }
  515. .listNewsContent_leftTop {
  516. margin-bottom: 0px;
  517. }
  518. }
  519. .listNewsContent_right {
  520. .listNewsContent_leftBottom {
  521. margin-bottom: 0px;
  522. }
  523. .listNewsContent_leftTop {
  524. margin-bottom: 20px;
  525. }
  526. }
  527. }
  528. }
  529. // 样式5
  530. .listNewsBox {
  531. .listNewsStyle5 {
  532. .listNewsContentBottom {
  533. div {
  534. &:nth-child(1),
  535. &:nth-child(2),
  536. &:nth-child(7),
  537. &:nth-child(8) {
  538. font-weight: 400;
  539. }
  540. }
  541. }
  542. }
  543. }
  544. // 样式6
  545. .listNewsBox {
  546. .listNewsStyle6 {
  547. .listNewsContentBottom {
  548. div {
  549. &:nth-child(1),
  550. &:nth-child(2),
  551. &:nth-child(7),
  552. &:nth-child(8) {
  553. font-weight: 400;
  554. }
  555. }
  556. }
  557. .listNewsContentTop {
  558. margin-top: 20px;
  559. .listNewsContentTopItem {
  560. margin-bottom: 0;
  561. }
  562. }
  563. }
  564. }
  565. // 样式7
  566. .listNewsBox {
  567. .listNewsStyle7 {
  568. .listNewsContent_left {
  569. .listNewsContent_leftBottom {
  570. div {
  571. &:nth-child(1),
  572. &:nth-child(4) {
  573. font-weight: 400;
  574. }
  575. }
  576. }
  577. }
  578. .listNewsContent_right {
  579. .listNewsContent_leftBottom {
  580. div {
  581. &:nth-child(1),
  582. &:nth-child(4) {
  583. font-weight: 400;
  584. }
  585. }
  586. }
  587. }
  588. }
  589. }
  590. //样式8
  591. .listNewsBox {
  592. .listNewsStyle8 {
  593. display: flex;
  594. .listNewsContent_left {
  595. .listNewsContent_leftBottom {
  596. margin-bottom: 20px;
  597. div {
  598. &:nth-child(1),
  599. &:nth-child(4) {
  600. font-weight: 400;
  601. }
  602. }
  603. }
  604. .listNewsContent_leftTop {
  605. margin-bottom: 0px;
  606. }
  607. }
  608. .listNewsContent_right {
  609. .listNewsContent_leftBottom {
  610. margin-bottom: 0px;
  611. div {
  612. &:nth-child(1),
  613. &:nth-child(4) {
  614. font-weight: 400;
  615. }
  616. }
  617. }
  618. .listNewsContent_leftTop {
  619. margin-bottom: 20px;
  620. }
  621. }
  622. }
  623. }
  624. </style>