1.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. <template>
  2. <div>
  3. <!--样式1-->
  4. <div class="bannerSwiperStyle1" v-if="this.$store.state.template.editWebsiteClass==1">
  5. <el-carousel :interval="3333" height="405px" indicator-position="none" arrow="always" @change="change_fun">
  6. <el-carousel-item v-for="item in imagelist" :key="item.id">
  7. <img src="https://img.bjzxtw.org.cn/master/image/jpeg/20251218/1766035561390591.jpg">
  8. <span class="swiper_dot1 dot1">
  9. {{ item.title }}
  10. </span>
  11. </el-carousel-item>
  12. <div class="roll_num_box">
  13. <span class="roll_num_box_new">{{ roll_num_this + 1 }}</span>/{{ roll_num_lang }}
  14. </div>
  15. </el-carousel>
  16. </div>
  17. <!--样式2-->
  18. <div class="bannerSwiperStyle2" v-if="this.$store.state.template.editWebsiteClass==2">
  19. <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
  20. <el-carousel-item v-for="item in imagelist" :key="item.id">
  21. <img src="https://img.bjzxtw.org.cn/master/image/jpeg/20251218/1766035561390591.jpg">
  22. <span class="swiper_dot1 dot1">
  23. {{ item.title }}
  24. </span>
  25. </el-carousel-item>
  26. </el-carousel>
  27. </div>
  28. <!--样式3-->
  29. <div class="bannerSwiperStyle3" v-if="this.$store.state.template.editWebsiteClass==3">
  30. <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
  31. <el-carousel-item v-for="item in imagelist" :key="item.id">
  32. <img src="https://img.bjzxtw.org.cn/master/image/jpeg/20251218/1766035561390591.jpg">
  33. <span class="swiper_dot1 dot1">
  34. {{ item.title }}
  35. </span>
  36. </el-carousel-item>
  37. </el-carousel>
  38. </div>
  39. <!--样式4-->
  40. <div class="bannerSwiperStyle4" v-if="this.$store.state.template.editWebsiteClass==4">
  41. <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
  42. <el-carousel-item v-for="item in imagelist" :key="item.id">
  43. <img src="https://img.bjzxtw.org.cn/master/image/jpeg/20251218/1766035561390591.jpg">
  44. <span class="swiper_dot1 dot1">
  45. {{ item.title }}
  46. </span>
  47. </el-carousel-item>
  48. </el-carousel>
  49. </div>
  50. <!--样式5-->
  51. <div class="bannerSwiperStyle5" v-if="this.$store.state.template.editWebsiteClass==5">
  52. <el-carousel :interval="3333" height="405px" indicator-position="none" arrow="always" @change="change_fun">
  53. <el-carousel-item v-for="item in imagelist" :key="item.id">
  54. <img src="https://img.bjzxtw.org.cn/master/image/jpeg/20251218/1766035561390591.jpg">
  55. <span class="swiper_dot1 dot1">
  56. {{ item.title }}
  57. </span>
  58. </el-carousel-item>
  59. <div class="roll_num_box">
  60. <span class="roll_num_box_new">{{ roll_num_this + 1 }}</span>/{{ roll_num_lang }}
  61. </div>
  62. </el-carousel>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import '@/styles/theme/body/index/banner/style1.less';
  68. export default {
  69. props: {
  70. dataSort: {
  71. type: Number,
  72. default: 0
  73. }
  74. },
  75. data() {
  76. return {
  77. roll_num_this: 0,
  78. roll_num_lang: 3,
  79. imagelist: [
  80. {
  81. id: 1,
  82. title: '香港海洋公园为大熊猫“盈盈”“家姐”“细佬”搬新居迎宾客'
  83. },
  84. {
  85. id: 2,
  86. title: '香港海洋公园为大熊猫“盈盈”“家姐”“细佬”搬新居迎宾客'
  87. },
  88. {
  89. id: 3,
  90. title: '香港海洋公园为大熊猫“盈盈”“家姐”“细佬”搬新居迎宾客'
  91. },
  92. ]
  93. };
  94. },
  95. methods: {
  96. change_fun(the_1) {
  97. this.roll_num_this = the_1
  98. }
  99. },
  100. mounted() {
  101. },
  102. };
  103. </script>
  104. <style scoped lang="less">
  105. //基本样式
  106. .bannerSwiperStyle1 {
  107. position: relative;
  108. .roll_num_box {
  109. position: absolute;
  110. z-index: 2;
  111. left: 60px;
  112. bottom: 5px;
  113. height: 60px;
  114. line-height: 60px;
  115. color: #fff;
  116. font-size: 16px;
  117. .roll_num_box_new {
  118. font-size: 20px;
  119. }
  120. }
  121. .dot1 {
  122. display: block;
  123. word-break: keep-all;
  124. white-space: nowrap;
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. }
  128. .swiper_dot1 {
  129. display: block;
  130. width: 100%;
  131. line-height: 60px;
  132. height: 60px;
  133. color: #fff;
  134. font-size: 18px;
  135. text-indent: 20px;
  136. position: absolute;
  137. bottom: 0;
  138. left: 0;
  139. z-index: 10;
  140. box-sizing: border-box;
  141. padding: 0 144px;
  142. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  143. }
  144. .el-carousel {
  145. /deep/.el-carousel__arrow i {
  146. font-size: 33px !important;
  147. }
  148. .roll_1_box {
  149. position: relative;
  150. }
  151. /deep/.el-carousel__arrow--left {
  152. position: absolute;
  153. width: 35px;
  154. height: 57px;
  155. color: #fff;
  156. background: rgba(0, 0, 0, 0);
  157. left: 9px;
  158. border: none;
  159. border-radius: 0;
  160. top: 100%;
  161. margin-top: -36px;
  162. }
  163. /deep/.el-carousel__arrow--right {
  164. width: 35px;
  165. height: 57px;
  166. color: #fff;
  167. background: rgba(0, 0, 0, 0);
  168. position: absolute;
  169. right: 9;
  170. border: none;
  171. border-radius: 0;
  172. top: 100%;
  173. margin-top: -36px;
  174. }
  175. /deep/ .el-carousel__indicators {
  176. // 指示器
  177. left: unset;
  178. transform: unset;
  179. right: 10px;
  180. bottom: 11px;
  181. }
  182. /deep/ .el-carousel__button {
  183. // 指示器按钮
  184. width: 10px;
  185. height: 10px;
  186. border: none;
  187. border-radius: 5px;
  188. background: #fff;
  189. opacity: 1;
  190. }
  191. /deep/ .is-active .el-carousel__button {
  192. // 指示器激活按钮
  193. background: #255590;
  194. width: 25px;
  195. opacity: 1;
  196. }
  197. /deep/ .el-carousel__container {
  198. height: 100%;
  199. }
  200. }
  201. .custom-indicator button {
  202. background-color: #fff;
  203. opacity: 1;
  204. width: 8px;
  205. height: 8px;
  206. }
  207. .custom-indicator button.is-active {
  208. background-color: #c82200;
  209. width: 58px;
  210. opacity: 1;
  211. }
  212. }
  213. //样式2
  214. .bannerSwiperStyle2 {
  215. width: 100%;
  216. height: 405px;
  217. position: relative;
  218. img {
  219. width: 100%;
  220. height: 405px;
  221. }
  222. .swiper_dot1 {
  223. display: block;
  224. width: 100%;
  225. line-height: 60px;
  226. height: 60px;
  227. color: #fff;
  228. font-size: 24px;
  229. text-indent: 20px;
  230. position: absolute;
  231. bottom: 0;
  232. left: 0;
  233. z-index: 10;
  234. box-sizing: border-box;
  235. padding-right: 244px;
  236. background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
  237. }
  238. .el-carousel {
  239. /deep/.el-carousel__arrow i {
  240. font-size: 16px !important;
  241. }
  242. /deep/.el-carousel__arrow--left {
  243. left: 20px;
  244. width: 36px;
  245. height: 36px;
  246. color: #eee;
  247. background: rgba(0,0,0,0.5);
  248. border-radius: 50%;
  249. position: absolute;
  250. border: none;
  251. border-radius: 50%;
  252. }
  253. /deep/.el-carousel__arrow--right {
  254. right: 20px;
  255. width: 36px;
  256. height: 36px;
  257. color: #eee;
  258. background: rgba(0,0,0,0.5);
  259. position: absolute;
  260. border: none;
  261. border-radius: 50%;
  262. }
  263. /deep/ .el-carousel__indicators {
  264. // 指示器
  265. left: unset;
  266. transform: unset;
  267. right: 10px;
  268. bottom: 11px;
  269. }
  270. /deep/ .el-carousel__button {
  271. // 指示器按钮
  272. width: 10px;
  273. height: 10px;
  274. border: none;
  275. background: #fff;
  276. opacity: 1;
  277. }
  278. /deep/ .is-active .el-carousel__button {
  279. // 指示器激活按钮
  280. background: #A91B33;
  281. width: 10px;
  282. height: 10px;
  283. opacity: 1;
  284. }
  285. /deep/ .el-carousel__container {
  286. height: 100%;
  287. }
  288. }
  289. .custom-indicator button {
  290. background-color: #fff;
  291. opacity: 1;
  292. width: 8px;
  293. height: 8px;
  294. }
  295. .custom-indicator button.is-active {
  296. background-color: #DD7D18;
  297. width: 58px;
  298. opacity: 1;
  299. }
  300. }
  301. //样式3
  302. .bannerSwiperStyle3 {
  303. width: 100%;
  304. height: 405px;
  305. position: relative;
  306. img {
  307. width: 100%;
  308. height: 405px;
  309. }
  310. .swiper_dot1 {
  311. display: block;
  312. width: 100%;
  313. line-height: 60px;
  314. height: 60px;
  315. color: #fff;
  316. font-size: 24px;
  317. text-indent: 20px;
  318. position: absolute;
  319. bottom: 0;
  320. left: 0;
  321. z-index: 10;
  322. box-sizing: border-box;
  323. padding-right: 244px;
  324. background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
  325. }
  326. .el-carousel {
  327. /deep/.el-carousel__arrow i {
  328. font-size: 16px !important;
  329. }
  330. /deep/.el-carousel__arrow--left {
  331. left: 20px;
  332. width: 36px;
  333. height: 36px;
  334. color: #eee;
  335. background: rgba(0,0,0,0.5);
  336. border-radius: 50%;
  337. position: absolute;
  338. border: none;
  339. border-radius: 50%;
  340. }
  341. /deep/.el-carousel__arrow--right {
  342. right: 20px;
  343. width: 36px;
  344. height: 36px;
  345. color: #eee;
  346. background: rgba(0,0,0,0.5);
  347. position: absolute;
  348. border: none;
  349. border-radius: 50%;
  350. }
  351. /deep/ .el-carousel__indicators {
  352. // 指示器
  353. left: unset;
  354. transform: unset;
  355. right: 10px;
  356. bottom: 11px;
  357. }
  358. /deep/ .el-carousel__button {
  359. // 指示器按钮
  360. width: 10px;
  361. height: 10px;
  362. border: none;
  363. background: #fff;
  364. opacity: 1;
  365. }
  366. /deep/ .is-active .el-carousel__button {
  367. // 指示器激活按钮
  368. background: #c82200;
  369. width: 10px;
  370. height: 10px;
  371. opacity: 1;
  372. }
  373. /deep/ .el-carousel__container {
  374. height: 100%;
  375. }
  376. }
  377. .custom-indicator button {
  378. background-color: #fff;
  379. opacity: 1;
  380. width: 8px;
  381. height: 8px;
  382. }
  383. .custom-indicator button.is-active {
  384. background-color: #DD7D18;
  385. width: 58px;
  386. opacity: 1;
  387. }
  388. }
  389. //样式4
  390. .bannerSwiperStyle4 {
  391. width: 100%;
  392. height: 405px;
  393. position: relative;
  394. img {
  395. width: 100%;
  396. height: 405px;
  397. }
  398. .swiper_dot1 {
  399. display: block;
  400. width: 100%;
  401. line-height: 60px;
  402. height: 60px;
  403. color: #fff;
  404. font-size: 24px;
  405. text-indent: 20px;
  406. position: absolute;
  407. bottom: 0;
  408. left: 0;
  409. z-index: 10;
  410. box-sizing: border-box;
  411. padding-right: 244px;
  412. background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
  413. }
  414. .el-carousel {
  415. /deep/.el-carousel__arrow i {
  416. font-size: 16px !important;
  417. }
  418. /deep/.el-carousel__arrow--left {
  419. left: 20px;
  420. width: 36px;
  421. height: 36px;
  422. color: #eee;
  423. background: rgba(0,0,0,0.5);
  424. border-radius: 50%;
  425. position: absolute;
  426. border: none;
  427. border-radius: 50%;
  428. }
  429. /deep/.el-carousel__arrow--right {
  430. right: 20px;
  431. width: 36px;
  432. height: 36px;
  433. color: #eee;
  434. background: rgba(0,0,0,0.5);
  435. position: absolute;
  436. border: none;
  437. border-radius: 50%;
  438. }
  439. /deep/ .el-carousel__indicators {
  440. // 指示器
  441. left: unset;
  442. transform: unset;
  443. right: 10px;
  444. bottom: 11px;
  445. }
  446. /deep/ .el-carousel__button {
  447. // 指示器按钮
  448. width: 10px;
  449. height: 10px;
  450. border: none;
  451. background: #fff;
  452. opacity: 1;
  453. }
  454. /deep/ .is-active .el-carousel__button {
  455. // 指示器激活按钮
  456. background: #fe8f00;
  457. width: 10px;
  458. height: 10px;
  459. opacity: 1;
  460. }
  461. /deep/ .el-carousel__container {
  462. height: 100%;
  463. }
  464. }
  465. .custom-indicator button {
  466. background-color: #fff;
  467. opacity: 1;
  468. width: 8px;
  469. height: 8px;
  470. }
  471. .custom-indicator button.is-active {
  472. background-color: #DD7D18;
  473. width: 58px;
  474. opacity: 1;
  475. }
  476. }
  477. //样式5
  478. .bannerSwiperStyle5 {
  479. position: relative;
  480. .roll_num_box {
  481. position: absolute;
  482. z-index: 2;
  483. right: 35px;
  484. bottom: 5px;
  485. height: 60px;
  486. line-height: 60px;
  487. color: #fff;
  488. font-size: 20px;
  489. .roll_num_box_new {
  490. font-size: 20px;
  491. }
  492. }
  493. .dot1 {
  494. display: block;
  495. word-break: keep-all;
  496. white-space: nowrap;
  497. overflow: hidden;
  498. text-overflow: ellipsis;
  499. }
  500. .swiper_dot1 {
  501. display: block;
  502. width: 100%;
  503. line-height: 60px;
  504. height: 60px;
  505. color: #fff;
  506. font-size: 18px;
  507. text-indent: 20px;
  508. position: absolute;
  509. bottom: 0;
  510. left: 0;
  511. z-index: 10;
  512. box-sizing: border-box;
  513. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  514. }
  515. .el-carousel {
  516. /deep/.el-carousel__arrow i {
  517. font-size: 33px !important;
  518. }
  519. .roll_1_box {
  520. position: relative;
  521. }
  522. /deep/.el-carousel__arrow--left {
  523. left: 20px;
  524. width: 30px;
  525. height: 56px;
  526. color: #eee;
  527. background: rgba(0,0,0,0.5);
  528. border-radius: 50%;
  529. position: absolute;
  530. border: none;
  531. border-radius: 4px;
  532. }
  533. /deep/.el-icon-arrow-left:before {
  534. font-size: 24px;
  535. line-height: 56px;
  536. }
  537. /deep/.el-carousel__arrow--right {
  538. right: 20px;
  539. width: 30px;
  540. height: 56px;
  541. color: #eee;
  542. background: rgba(0,0,0,0.5);
  543. position: absolute;
  544. border: none;
  545. border-radius: 4px;
  546. }
  547. /deep/.el-icon-arrow-right:before {
  548. font-size: 24px;
  549. line-height: 56px;
  550. }
  551. /deep/ .el-carousel__indicators {
  552. // 指示器
  553. left: unset;
  554. transform: unset;
  555. right: 10px;
  556. bottom: 11px;
  557. }
  558. /deep/ .el-carousel__button {
  559. // 指示器按钮
  560. width: 10px;
  561. height: 10px;
  562. border: none;
  563. border-radius: 5px;
  564. background: #fff;
  565. opacity: 1;
  566. }
  567. /deep/ .is-active .el-carousel__button {
  568. // 指示器激活按钮
  569. background: #255590;
  570. width: 25px;
  571. opacity: 1;
  572. }
  573. /deep/ .el-carousel__container {
  574. height: 100%;
  575. }
  576. }
  577. .custom-indicator button {
  578. background-color: #fff;
  579. opacity: 1;
  580. width: 8px;
  581. height: 8px;
  582. }
  583. .custom-indicator button.is-active {
  584. background-color: #c82200;
  585. width: 58px;
  586. opacity: 1;
  587. }
  588. }
  589. </style>