宜兴数字资产-善卷洞
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

74 lines
1.4 KiB

<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>