小程序旋转木马

<!--wxml-->
<view class='list'>
<swiper autoplay="{{false}}" previous-margin="{{'64rpx'}}" next-margin="{{'64rpx'}}" bindchange="swiperChange">
<block wx:for="{{snenicCards}}" wx:key="{{index}}">
<swiper-item bindtap='card_click' data-id="{{item.id}}" data-sort="{{item.sort}}" >
<image src="{{host+item.coverImg}}" class="slide-image {{swiperIndex == index ? 'active' : ''}}">
<view class="prompt-textwrap">
<view class="prompt-text">{{item.title}}</view>
<view class='prompt-destext'>{{item.subTitle}}</view>
</view>
<text class="slogan">{{item.slogan}}</text>
</image>
</swiper-item>
</block>
</swiper>
</view>
/*wxss*/
swiper {
width: 100%;
height: 1060rpx;
margin: 0 auto;
}

swiper-item {
background: #fff;
padding-top: 90rpx;
}

/* .imgpic3{

} */

image {
width: 86%;
box-shadow: 0rpx 0rpx 2rpx #d6d6d6;
border-radius: 4px;
padding: 2rpx;
background: #fff;
margin: 0 auto;
border: 1px solid #d6d6d6;
opacity: 0.6;
display: block;
}

image.active {
transform: scale(1.14);
transition: all 0.2s ease-in 0s;
opacity: 1;
}

image.active .prompt-textwrap {
display: block;
}

.slogan {
color: #d4d2d3;
font-size: 47rpx;
position: absolute;
bottom: -90rpx;
left: 0;
display: none;
}

image.active .slogan {
display: block;
}

/*js*/

Page({
data: {
swiperIndex: 0,
},
swiperChange(e) {
this.setData({
swiperIndex: e.detail.current
})
},



})


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值