1.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <!-- 样式1 -->
  3. <div class="scrollTextSectorBox" v-if="componentStyle == 1">
  4. <div class="scrollTextSectorLeft">
  5. <div class="bannerSwiperStyle5">
  6. <el-carousel :interval="3333" height="480px" arrow="always" @change="change_fun"
  7. indicator-position="bottom">
  8. <el-carousel-item v-for="item in component_style1_News1Array" :key="item.id">
  9. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  10. :target="item.islink == 1 ? '_blank' : '_self'">
  11. <img :src="item.imgurl" />
  12. <span class="swiper_dot1 dot1">
  13. {{ item.title }}
  14. </span>
  15. </NuxtLink>
  16. </el-carousel-item>
  17. </el-carousel>
  18. </div>
  19. </div>
  20. <div class="scrollTextSectorRight">
  21. <div class="BannerListBox BannerListBoxStyle4">
  22. <div class="listNewsTitle">
  23. <span>{{ titleLink.alias }}</span>
  24. </div>
  25. <p class="listNewsText_img_li" v-for="item in component_style1_News1Array">
  26. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  27. :target="item.islink == 1 ? '_blank' : '_self'">
  28. <span class="listNewsText_li_img_box">
  29. <img :src="item.imgurl">
  30. </span>
  31. <span class="listNewsText_li_img_dot4">{{ item.title }}</span>
  32. </NuxtLink>
  33. </p>
  34. <div class="listNewsText" v-for="item in component_style1_News2Array">
  35. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  36. :target="item.islink == 1 ? '_blank' : '_self'">
  37. <span class="text">{{ item.title }}</span>
  38. <span class="time">{{ item.update_time }}</span>
  39. </NuxtLink>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <!-- 样式2 -->
  45. <div class="scrollTextSectorBox" v-if="componentStyle == 2">
  46. <div class="scrollTextSectorRight">
  47. <div class="BannerListBox BannerListBoxStyle2">
  48. <div class="listNewsTitle">
  49. <span>{{ titleLink.alias }}</span>
  50. </div>
  51. <p class="listNewsText_img_li" v-for="item in component_style1_News1Array">
  52. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  53. :target="item.islink == 1 ? '_blank' : '_self'">
  54. <span class="listNewsText_li_img_box">
  55. <img :src="item.imgurl">
  56. </span>
  57. <span class="listNewsText_li_img_dot4">{{ item.title }}</span>
  58. </NuxtLink>
  59. </p>
  60. <div class="listNewsText" v-for="item in component_style1_News2Array">
  61. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  62. :target="item.islink == 1 ? '_blank' : '_self'">
  63. <span class="text">{{ item.title }}</span>
  64. <span class="time">{{ item.update_time }}</span>
  65. </NuxtLink>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="scrollTextSectorLeft">
  70. <div class="bannerSwiperStyle5">
  71. <el-carousel :interval="3333" height="480px" arrow="always" @change="change_fun"
  72. indicator-position="bottom">
  73. <el-carousel-item v-for="item in component_style1_News1Array" :key="item.id">
  74. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  75. :target="item.islink == 1 ? '_blank' : '_self'">
  76. <img :src="item.imgurl" />
  77. <span class="swiper_dot1 dot1">
  78. {{ item.title }}
  79. </span>
  80. </NuxtLink>
  81. </el-carousel-item>
  82. </el-carousel>
  83. </div>
  84. </div>
  85. </div>
  86. <!-- 样式3 -->
  87. <div class="scrollTextSectorBox" v-if="componentStyle == 3">
  88. <div class="scrollTextSectorLeft">
  89. <div class="bannerSwiperStyle5">
  90. <el-carousel :interval="3333" height="480px" arrow="always" @change="change_fun"
  91. indicator-position="bottom">
  92. <el-carousel-item v-for="item in component_style1_News1Array" :key="item.id">
  93. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  94. :target="item.islink == 1 ? '_blank' : '_self'">
  95. <img :src="item.imgurl" />
  96. <span class="swiper_dot1 dot1">
  97. {{ item.title }}
  98. </span>
  99. </NuxtLink>
  100. </el-carousel-item>
  101. </el-carousel>
  102. </div>
  103. </div>
  104. <div class="scrollTextSectorRight">
  105. <div class="BannerListBox BannerListBoxStyle1">
  106. <div class="listNewsTitle">
  107. <span>{{ titleLink.alias }}</span>
  108. </div>
  109. <div class="listNewsText" v-for="item in component_style1_News3Array">
  110. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  111. :target="item.islink == 1 ? '_blank' : '_self'">
  112. <span class="text">{{ item.title }}</span>
  113. <span class="time">{{ item.update_time }}</span>
  114. </NuxtLink>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- 样式4 -->
  120. <div class="scrollTextSectorBox" v-if="componentStyle == 4">
  121. <div class="scrollTextSectorRight">
  122. <div class="BannerListBox BannerListBoxStyle1">
  123. <div class="listNewsTitle">
  124. <span>{{ titleLink.alias }}</span>
  125. </div>
  126. <div class="listNewsText" v-for="item in component_style1_News3Array">
  127. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  128. :target="item.islink == 1 ? '_blank' : '_self'">
  129. <span class="text">{{ item.title }}</span>
  130. <span class="time">{{ item.update_time }}</span>
  131. </NuxtLink>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="scrollTextSectorLeft">
  136. <div class="bannerSwiperStyle5">
  137. <el-carousel :interval="3333" height="480px" arrow="always" @change="change_fun"
  138. indicator-position="bottom">
  139. <el-carousel-item v-for="item in component_style1_News1Array" :key="item.id">
  140. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  141. :target="item.islink == 1 ? '_blank' : '_self'">
  142. <img :src="item.imgurl" />
  143. <span class="swiper_dot1 dot1">
  144. {{ item.title }}
  145. </span>
  146. </NuxtLink>
  147. </el-carousel-item>
  148. </el-carousel>
  149. </div>
  150. </div>
  151. </div>
  152. </template>
  153. <script setup>
  154. //引入vue
  155. import { ref } from 'vue';
  156. import { ElCarousel, ElCarouselItem } from 'element-plus'
  157. //获得新闻数据
  158. const props = defineProps({
  159. titleLink: Object,//板块名称
  160. templateData: Array,//新闻数据
  161. componentStyle: Number,//样式编号
  162. templateAdData: Object,//广告
  163. });
  164. //轮播图
  165. const roll_num_this = ref(0)
  166. const roll_num_lang = ref(props.templateData.imgnum.length - 1);
  167. const change_fun = (the_1) => {
  168. roll_num_this.value = the_1
  169. }
  170. //样式1与样式2共用 start ---------------------------------------->
  171. const component_style1_News1Array = ref([]);
  172. component_style1_News1Array.value = props.templateData.imgnum.slice(0, 1);
  173. const component_style1_News2Array = ref([]);
  174. component_style1_News2Array.value = props.templateData.textnum.slice(1, 7);
  175. const component_style1_News3Array = ref([]);
  176. component_style1_News3Array.value = props.templateData.textnum.slice(0, 9);
  177. //样式1与样式2共用 end ---------------------------------------->
  178. </script>
  179. <style lang="less" scoped>
  180. //基本样式 start ---------------------------------------->
  181. .scrollTextSectorBox {
  182. width: 1200px;
  183. height: 480px;
  184. position: relative;
  185. display: flex;
  186. align-items: center;
  187. justify-content: space-between;
  188. img {
  189. width: 720px;
  190. height: 480px;
  191. display: block;
  192. }
  193. .scrollTextSectorLeft {
  194. width: 720px;
  195. height: 480px;
  196. .bannerSwiperStyle5 {
  197. position: relative;
  198. img {
  199. width: 100%;
  200. height: 100%;
  201. display: block;
  202. }
  203. .roll_num_box {
  204. position: absolute;
  205. z-index: 2;
  206. right: 35px;
  207. bottom: 5px;
  208. height: 60px;
  209. line-height: 60px;
  210. color: #fff;
  211. font-size: 20px;
  212. .roll_num_box_new {
  213. font-size: 20px;
  214. }
  215. }
  216. .dot1 {
  217. display: block;
  218. word-break: keep-all;
  219. white-space: nowrap;
  220. overflow: hidden;
  221. text-overflow: ellipsis;
  222. }
  223. .swiper_dot1 {
  224. display: block;
  225. width: 100%;
  226. line-height: 60px;
  227. height: 60px;
  228. color: #fff;
  229. font-size: 18px;
  230. font-weight: bold;
  231. text-indent: 20px;
  232. position: absolute;
  233. bottom: 0;
  234. left: 0;
  235. z-index: 10;
  236. box-sizing: border-box;
  237. background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));
  238. box-sizing: border-box;
  239. padding-right: 40%;
  240. }
  241. .el-carousel {
  242. /deep/.el-carousel__arrow i {
  243. font-size: 33px !important;
  244. }
  245. .roll_1_box {
  246. position: relative;
  247. }
  248. /deep/.el-carousel__arrow--left {
  249. display: none;
  250. left: 20px;
  251. width: 34px;
  252. height: 80px;
  253. color: #eee;
  254. background: rgba(0, 0, 0, 0.5);
  255. border-radius: 50%;
  256. position: absolute;
  257. border: none;
  258. border-radius: 0px;
  259. }
  260. /deep/.el-icon-arrow-left:before {
  261. font-size: 24px;
  262. line-height: 56px;
  263. }
  264. /deep/.el-carousel__arrow--right {
  265. display: none;
  266. right: 20px;
  267. width: 34px;
  268. height: 80px;
  269. color: #eee;
  270. background: #00000080;
  271. position: absolute;
  272. border: none;
  273. border-radius: 0px;
  274. }
  275. /deep/.el-icon-arrow-right:before {
  276. font-size: 24px;
  277. line-height: 56px;
  278. }
  279. /deep/ .el-carousel__indicators {
  280. // 指示器
  281. left: unset;
  282. transform: unset;
  283. right: 10px;
  284. bottom: 11px;
  285. }
  286. /deep/ .el-carousel__button {
  287. // 指示器按钮
  288. width: 12px;
  289. height: 12px;
  290. border: none;
  291. background: #ccc;
  292. opacity: 1;
  293. }
  294. /deep/ .is-active .el-carousel__button {
  295. // 指示器激活按钮
  296. background: #fff;
  297. width: 12px;
  298. height: 12px;
  299. opacity: 1;
  300. border-radius: 0px;
  301. }
  302. /deep/ .el-carousel__container {
  303. height: 100%;
  304. }
  305. }
  306. .custom-indicator button {
  307. background-color: #fff;
  308. opacity: 1;
  309. width: 8px;
  310. height: 8px;
  311. }
  312. .custom-indicator button.is-active {
  313. background-color: #c82200;
  314. width: 58px;
  315. opacity: 1;
  316. }
  317. /deep/ .el-carousel__indicator--horizontal {
  318. padding: 12px 5px;
  319. }
  320. }
  321. }
  322. .scrollTextSectorRight {
  323. width: 450px;
  324. height: 480px;
  325. .listNewsTitle {
  326. font-size: 22px;
  327. font-weight: bold;
  328. color: #004564;
  329. margin-bottom: 20px;
  330. box-sizing: border-box;
  331. a {
  332. color: #004564;
  333. display: block;
  334. height: 25px;
  335. line-height: 25px;
  336. }
  337. }
  338. .scrollTextSectorList {
  339. div {
  340. font-size: 18px;
  341. height: 24px;
  342. line-height: 24px;
  343. margin-bottom: 16px;
  344. overflow: hidden;
  345. white-space: nowrap;
  346. text-overflow: ellipsis;
  347. span {
  348. margin-right: 5px;
  349. color: #004564;
  350. }
  351. a {
  352. color: #333333;
  353. }
  354. &:last-child {
  355. margin-bottom: 0;
  356. }
  357. }
  358. }
  359. }
  360. }
  361. //基本样式 end ---------------------------------------->
  362. //右侧新闻列表 end ---------------------------------------->
  363. //基本样式
  364. .BannerListBox {
  365. div {
  366. cursor: pointer;
  367. font-size: 18px;
  368. color: #333;
  369. overflow: hidden;
  370. text-overflow: ellipsis;
  371. white-space: nowrap;
  372. height: 24px;
  373. line-height: 24px;
  374. margin-bottom: 24px;
  375. &:last-child {
  376. margin-bottom: 0;
  377. }
  378. }
  379. .listNewsTitle {
  380. font-size: 22px;
  381. font-weight: bold;
  382. height: 47px;
  383. line-height: 47px;
  384. border-top: 2px solid #A72213;
  385. border-bottom: 1px solid #DCDDDF;
  386. color: #A72213;
  387. margin-bottom: 20px;
  388. box-sizing: border-box;
  389. span {
  390. display: inline-block;
  391. color: #A72213;
  392. height: 47px;
  393. line-height: 47px;
  394. // border-bottom: 6px solid #3848a0;
  395. font-weight: bold;
  396. /* 可选:为了避免内容紧贴边框,添加内边距 */
  397. }
  398. }
  399. .listNewsText {
  400. position: relative;
  401. a {
  402. color: #333;
  403. }
  404. .text {
  405. display: block;
  406. width: 100%;
  407. padding-right: 13px;
  408. overflow: hidden;
  409. box-sizing: border-box;
  410. text-overflow: ellipsis;
  411. white-space: nowrap;
  412. height: 24px;
  413. text-indent: 16px;
  414. line-height: 24px;
  415. }
  416. .time {
  417. position: absolute;
  418. top: 0;
  419. right: 0;
  420. display: inline-block;
  421. width: 51px;
  422. color: #999999;
  423. display: none;
  424. }
  425. }
  426. }
  427. //样式1
  428. .BannerListBoxStyle1 {
  429. .listNewsText::before {
  430. content: '';
  431. display: block;
  432. position: absolute;
  433. top: 9px;
  434. left: 0px;
  435. width: 6px;
  436. height: 6px;
  437. background-color: #d7daec;
  438. margin-right: 10px;
  439. vertical-align: 10px;
  440. }
  441. }
  442. //样式2
  443. .BannerListBoxStyle2 {
  444. .listNewsText::before {
  445. content: '';
  446. display: block;
  447. position: absolute;
  448. top: 9px;
  449. left: 0px;
  450. width: 6px;
  451. height: 6px;
  452. background-color: #d7daec;
  453. margin-right: 10px;
  454. vertical-align: 10px;
  455. }
  456. .listNewsText_img_li {
  457. width: 100%;
  458. display: flex;
  459. height: 130px;
  460. margin: 0px 0px 21px 0px;
  461. a {
  462. display: flex;
  463. align-items: center;
  464. img {
  465. width: 185px;
  466. height: 130px;
  467. }
  468. }
  469. }
  470. .listNewsText_li_img_box {
  471. margin-right: 20px;
  472. height: 100%;
  473. width: 185px;
  474. height: 130px;
  475. }
  476. .listNewsText_li_img_box img {
  477. display: block;
  478. width: 100%;
  479. height: 100%;
  480. }
  481. .listNewsText_li_img_dot4 {
  482. display: block;
  483. flex: 1;
  484. width: 100%;
  485. color: #333;
  486. font-size: 18px;
  487. overflow: hidden;
  488. margin-top: 17px;
  489. height: 96px;
  490. box-sizing: border-box;
  491. padding-right: 13px;
  492. line-height: 24px;
  493. overflow: hidden;
  494. display: -webkit-box !important;
  495. -webkit-box-orient: vertical;
  496. -webkit-line-clamp: 4;
  497. word-wrap: break-word;
  498. overflow-wrap: break-word;
  499. white-space: pre-wrap;
  500. word-break: break-all;
  501. }
  502. }
  503. //样式2
  504. .BannerListBoxStyle3 {
  505. .listNewsText::before {
  506. content: '';
  507. display: block;
  508. position: absolute;
  509. top: 9px;
  510. left: 0px;
  511. width: 6px;
  512. height: 6px;
  513. background-color: #d7daec;
  514. margin-right: 10px;
  515. vertical-align: 10px;
  516. }
  517. }
  518. //样式2
  519. .BannerListBoxStyle4 {
  520. .listNewsText::before {
  521. content: '';
  522. display: block;
  523. position: absolute;
  524. top: 9px;
  525. left: 0px;
  526. width: 6px;
  527. height: 6px;
  528. background-color: #d7daec;
  529. margin-right: 10px;
  530. vertical-align: 10px;
  531. }
  532. .listNewsText_img_li {
  533. width: 100%;
  534. display: flex;
  535. height: 130px;
  536. margin: 0px 0px 21px 0px;
  537. a {
  538. display: flex;
  539. align-items: center;
  540. justify-content: space-between;
  541. }
  542. }
  543. .listNewsText_li_img_box {
  544. margin-right: 20px;
  545. height: 100%;
  546. width: 185px;
  547. height: 130px;
  548. }
  549. .listNewsText_li_img_box img {
  550. display: block;
  551. width: 100%;
  552. height: 100%;
  553. }
  554. .listNewsText_li_img_dot4 {
  555. display: block;
  556. flex: 1;
  557. width: 100%;
  558. color: #333;
  559. font-size: 18px;
  560. overflow: hidden;
  561. margin-top: 17px;
  562. height: 96px;
  563. box-sizing: border-box;
  564. padding-right: 13px;
  565. line-height: 24px;
  566. overflow: hidden;
  567. display: -webkit-box !important;
  568. -webkit-box-orient: vertical;
  569. -webkit-line-clamp: 4;
  570. word-wrap: break-word;
  571. overflow-wrap: break-word;
  572. white-space: pre-wrap;
  573. word-break: break-all;
  574. }
  575. }
  576. //样式5
  577. .BannerListBoxStyle5 {
  578. .listNewsText::before {
  579. content: '';
  580. display: inline-block;
  581. width: 6px;
  582. height: 6px;
  583. background-color: #3848a0;
  584. margin-right: 10px;
  585. vertical-align: 10px;
  586. }
  587. }
  588. //样式6
  589. .BannerListBoxStyle6 {
  590. .listNewsText::before {
  591. content: '';
  592. display: inline-block;
  593. width: 6px;
  594. height: 6px;
  595. background-color: #3848a0;
  596. margin-right: 10px;
  597. vertical-align: 10px;
  598. }
  599. }
  600. //样式7
  601. .BannerListBoxStyle7 {
  602. .listNewsTitle {
  603. border-bottom: 1px dashed #999999;
  604. }
  605. .listNewsText::before {
  606. content: '';
  607. display: inline-block;
  608. width: 6px;
  609. height: 6px;
  610. background-color: #d7daec;
  611. margin-right: 10px;
  612. vertical-align: 10px;
  613. }
  614. }
  615. //样式8
  616. .BannerListBoxStyle8 {
  617. .listNewsTitle {
  618. border-bottom: 1px dashed #999999;
  619. }
  620. .listNewsText::before {
  621. content: '';
  622. display: inline-block;
  623. width: 6px;
  624. height: 6px;
  625. background-color: #d7daec;
  626. margin-right: 10px;
  627. vertical-align: 10px;
  628. }
  629. }
  630. //样式9
  631. .BannerListBoxStyle9 {
  632. .listNewsTitle {
  633. border-bottom: 1px dashed #999999;
  634. }
  635. }
  636. //样式10
  637. .BannerListBoxStyle10 {
  638. .listNewsTitle {
  639. border-bottom: 1px dashed #999999;
  640. }
  641. }
  642. //样式11
  643. .BannerListBoxStyle11 {
  644. .listNewsText::before {
  645. content: '';
  646. display: inline-block;
  647. width: 6px;
  648. height: 6px;
  649. background-color: #3848a0;
  650. margin-right: 10px;
  651. vertical-align: 10px;
  652. }
  653. }
  654. //样式12
  655. .BannerListBoxStyle12 {
  656. .listNewsText::before {
  657. content: '';
  658. display: inline-block;
  659. width: 6px;
  660. height: 6px;
  661. background-color: #3848a0;
  662. margin-right: 10px;
  663. vertical-align: 10px;
  664. }
  665. }
  666. </style>