@ -0,0 +1,74 @@ |
|||||
|
<template> |
||||
|
<view class="bg"> |
||||
|
<image :src="`/static/2/${current + 1}s.png`" class="text-img"></image> |
||||
|
|
||||
|
<swiper class="swiper-box" :circular="false" previous-margin="210rpx" next-margin="210rpx" :duration="800" |
||||
|
:current="current" circular="true" @change="swiperChange"> |
||||
|
<swiper-item v-for="(item, index) in 3" :key="index" class="flex-center"> |
||||
|
<view :class="['swiper-item', {'swiper-items': index != current}]"> |
||||
|
<image :src="`/static/2/${item}.png`" mode="aspectFill"></image> |
||||
|
</view> |
||||
|
</swiper-item> |
||||
|
</swiper> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
current: 0 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
//轮播图左右滑动 |
||||
|
swiperChange(e) { |
||||
|
let { |
||||
|
current, |
||||
|
source |
||||
|
} = e.detail; |
||||
|
//在自动或手动的时候才赋予current值 |
||||
|
if (source === 'autoplay' || source === 'touch') { |
||||
|
this.current = current; |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.bg { |
||||
|
width: 100vw; |
||||
|
height: 100vh; |
||||
|
background-image: url('/static/2/bg.png'); |
||||
|
background-size: 100% 100%; |
||||
|
position: relative; |
||||
|
padding-top: 780rpx; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.text-img { |
||||
|
width: 656rpx; |
||||
|
height: 546rpx; |
||||
|
position: absolute; |
||||
|
top: 1.3rpx; |
||||
|
left: 47rpx; |
||||
|
} |
||||
|
|
||||
|
.swiper-box { |
||||
|
height: 746rpx; |
||||
|
} |
||||
|
.swiper-item { |
||||
|
width: 337rpx; |
||||
|
height: 746rpx; |
||||
|
|
||||
|
image { |
||||
|
width: 337rpx; |
||||
|
height: 746rpx; |
||||
|
} |
||||
|
} |
||||
|
.swiper-items { |
||||
|
transform: scale(.8); |
||||
|
filter: blur(2px) |
||||
|
} |
||||
|
</style> |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 3.1 MiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 257 KiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 302 KiB |
After Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 327 KiB |
After Width: | Height: | Size: 2.3 MiB |
Before Width: | Height: | Size: 3.9 KiB |