1.vue 21 KB

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