|
|
@ -1,37 +1,43 @@ |
|
|
|
<template> |
|
|
|
<swiper |
|
|
|
:pagination="pagination" |
|
|
|
:modules="modules" |
|
|
|
:loop="true" |
|
|
|
@autoplayTimeLeft="onAutoplayTimeLeft" |
|
|
|
:autoplay="{ |
|
|
|
delay: 5000, |
|
|
|
disableOnInteraction: false, |
|
|
|
}" |
|
|
|
class="header_swiper" |
|
|
|
> |
|
|
|
<swiper-slide> |
|
|
|
<SlideOne /> |
|
|
|
</swiper-slide> |
|
|
|
<swiper-slide> |
|
|
|
<SlideTwo /> |
|
|
|
</swiper-slide> |
|
|
|
<swiper-slide> |
|
|
|
<SlideThree /> |
|
|
|
</swiper-slide> |
|
|
|
<swiper-slide> |
|
|
|
<SlideFour /> |
|
|
|
</swiper-slide> |
|
|
|
<template #container-end> |
|
|
|
<div class="autoplay-progress"> |
|
|
|
<svg viewBox="0 0 48 48" ref="progressLine"> |
|
|
|
<line x1="-190" y1="2" x2="300" y2="2"></line> |
|
|
|
</svg> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</swiper> |
|
|
|
<div class="header_container"> |
|
|
|
<swiper |
|
|
|
:pagination="pagination" |
|
|
|
:modules="modules" |
|
|
|
:loop="true" |
|
|
|
@autoplayTimeLeft="onAutoplayTimeLeft" |
|
|
|
class="header_swiper" |
|
|
|
> |
|
|
|
<swiper-slide> |
|
|
|
<SlideOne /> |
|
|
|
</swiper-slide> |
|
|
|
<swiper-slide> |
|
|
|
<SlideTwo /> |
|
|
|
</swiper-slide> |
|
|
|
<swiper-slide> |
|
|
|
<SlideThree /> |
|
|
|
</swiper-slide> |
|
|
|
<swiper-slide> |
|
|
|
<SlideFour /> |
|
|
|
</swiper-slide> |
|
|
|
<template #container-end> |
|
|
|
<div class="autoplay-progress"> |
|
|
|
<svg viewBox="0 0 48 48" ref="progressLine"> |
|
|
|
<line x1="-200" y1="2" x2="300" y2="2"></line> |
|
|
|
</svg> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</swiper> |
|
|
|
<div class="down_circle" @click="toNext"> |
|
|
|
<img :src="Arrow" alt="arrow" class="arrow" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
// :autoplay="{ |
|
|
|
// delay: 5000, |
|
|
|
// disableOnInteraction: false, |
|
|
|
// }" |
|
|
|
import { useSwiperStore } from '@/store' |
|
|
|
// Import Swiper Vue.js components |
|
|
|
import { Swiper, SwiperSlide } from 'swiper/vue' |
|
|
|
// Import Swiper styles |
|
|
@ -43,6 +49,7 @@ import SlideOne from './SlideOne' |
|
|
|
import SlideTwo from './SlideTwo' |
|
|
|
import SlideThree from './SlideThree' |
|
|
|
import SlideFour from './SlideFour' |
|
|
|
import Arrow from '@/assets/img/banner/arrow.png' |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Swiper, |
|
|
@ -52,6 +59,12 @@ export default { |
|
|
|
SlideThree, |
|
|
|
SlideFour, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
toNext() { |
|
|
|
const swiperStore = useSwiperStore() |
|
|
|
swiperStore.slideTo(1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
setup() { |
|
|
|
const progressLine = ref(null) |
|
|
|
const onAutoplayTimeLeft = (s, time, progress) => { |
|
|
@ -60,7 +73,9 @@ export default { |
|
|
|
return { |
|
|
|
onAutoplayTimeLeft, |
|
|
|
progressLine, |
|
|
|
Arrow, |
|
|
|
pagination: { |
|
|
|
clickable: true, |
|
|
|
renderBullet: function (index, className) { |
|
|
|
return '<div class="' + className + '"></div>' |
|
|
|
}, |
|
|
@ -72,6 +87,28 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.header_swiper { |
|
|
|
.header_container { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
position: relative; |
|
|
|
.down_circle { |
|
|
|
position: absolute; |
|
|
|
bottom: 67px; |
|
|
|
left: 50%; |
|
|
|
transform: translate(-50%); |
|
|
|
width: 28px; |
|
|
|
height: 28px; |
|
|
|
border: 2px solid #ffffff; |
|
|
|
z-index: 11; |
|
|
|
border-radius: 50%; |
|
|
|
cursor: pointer; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
.arrow { |
|
|
|
width: 12px; |
|
|
|
height: 8px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |