uniapp轮播图中间放大,两边缩小动态绑定

业务需要一个轮播图,中间大两边小的那种

业务代码:

        <view class="environmentSwiper">
		    <swiper @change="partSwiperChange" :indicator-dots="false" circular='true' :interval="3000":duration="1000" previous-margin="180rpx" next-margin="180rpx" style="height: 500rpx;">
				<swiper-item v-for="(item,index) in videolists" :key="index">
					<view class="items">
						<view class="swiper-item":class="indexc === index?'active':''">
							<view class="">
								<view class="">
									<image :src="item.cover" mode="scaleToFill">
										<view class="" :class="indexc === index?'aac':'aad'"style="">
											<view class="qqc">
												#{{item.mark}}
											</view>
										</view>
									</image>
								</view>
							</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
        </view>
.environmentSwiper {
		margin-top: 17rpx;
		// height: 400;
		.items {
			display: flex;padding-top: 30rpx;
			.swiper-item {
				width: 360rpx;
				border-radius: 20rpx;
				text-align: center;
				image {
					width: 80% !important;
					height: 400rpx !important;
					border-radius: 25rpx;
					position: relative;
					z-index: 2;
				}
			}
		}
	}
videolists: [],
indexc: 0,


// videolists是从后端获取的数组

partSwiperChange(event) {
	this.indexc = event.detail.current
},

动态绑定样式

.active {
	width: 110%;
	height: 430rpx;
	transform: scale(1.14);
	transition: all 0.2s ease-in 0s;
}
    .aac {
		color: #000;
		position: absolute;
		bottom: 30rpx;
		left: 0;
		width: 80%;
		margin-left: 10%;
		z-index: 3;
		background-color: #fff;
		opacity: 0.8;
		border-radius: 0 0 25rpx 25rpx;
		height: 120rpx;

		.qqc {
			margin-top: 10rpx;
			padding: 0 20rpx;
			font-size: 26rpx;
			text-align: left;
		}
	}

	.aad {
		color: #000;
		position: absolute;
		bottom: 60rpx;
		left: 0;
		width: 80%;
		margin-left: 10%;
		z-index: 3;
		background-color: #fff;
		opacity: 0.8;
		border-radius: 0 0 25rpx 25rpx;
		height: 100rpx;

		.qqc {
			margin-top: 10rpx;
			padding: 0 20rpx;
			font-size: 20rpx;
			text-align: left;
		}
	}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

超崽崽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值