<view class="top_swiper">
<swiper class="top_swiper_all" circular="{{circular}}" indicator-dots="{{indicatorDots}}" autoplay="true"
interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{background}}" wx:key="*this">
<swiper-item>
//轮播内容
</swiper-item>
</block>
</swiper>
<!-- 指示点 -->
<view class="dots">
<block wx:for="{{background}}" wx:key="unique">
<view class='dot {{swiperCurrent == index ? "dot-active" : "no_active"}}'></view>
</block>
</view>
</view>
.top_swiper {
position: relative;
}
.top_swiper_all {
width: 630rpx;
height: 390rpx;
background: #FFFFFF;
box-shadow: 0px 3rpx 6rpx rgba(72, 82, 216, 0.1);
opacity: 1;
border-radius: 40rpx;
padding: 20rpx 15rpx 50rpx;
box-sizing: border-box;
}
.top_swiper .dots {
bottom: 10rpx;
position: absolute;
display: flex;
align-items: center;
left: unset !important;
right: 251rpx;
}
.top_swiper .dots .dot {
margin-right: 19rpx;
}
.top_swiper .dots .no_active {
width: 30rpx;
height: 8rpx;
background: #EEF8FF;
border-radius: 4rpx;
}
.top_swiper .dots .dot-active {
width: 30rpx;
height: 8rpx;
background: #289FE1;
border-radius: 4rpx;
}
bindswiperCurrent:function(e){//监听 获取下标
console.log(e)
this.setData({
swiperCurrent:e.detail.current
})
},