uniapp 小程序优惠劵样式

先看效果图

上代码

html 复制代码
<view class="coupon">
	<view class="tickets" v-for="(item,index) in 10" :key="item">
		<view class="l-tickets">
			<view class="name">10元优惠劵</view>
			<view class="effect">满120元可用</view>
			<view class="end-date">	有效期至:2023-10-30</view>
		</view>
		<view class="r-tickets">立即使用</view>
	</view>
</view>
css 复制代码
.coupon {
				width: 100%;
				.tickets {
					display: flex;
					// padding: 20rpx;
					width: 100%;
					height: 220rpx;
					box-sizing: border-box;
					margin-bottom: 30rpx;
				}

				.l-tickets {
					width: 75%;
					height: 100%;
					position: relative;
					background: radial-gradient(circle at right top, transparent 16rpx, #fff 0) right top / 100% 50% no-repeat,
						radial-gradient(circle at right bottom, transparent 16rpx, #fff 0) right bottom / 100% 50% no-repeat;
					filter: drop-shadow(0px 8rpx 4rpx rgba(0, 0, 0, 0.05)) drop-shadow(-4px 0px 4px rgba(0, 0, 0, 0.05)) drop-shadow(0px -4px 4px rgba(0, 0, 0, 0.05));
					padding: 20rpx;
					@include flex-sb;
					align-items: flex-start;
					flex-direction: column;
					.name{
						font-weight: bold;
					}
					.effect{
						font-size: 26rpx;
						color: #999;
					}
					.end-date{
						font-size: 24rpx;
						color: #999;
					}
				}

				.l-tickets::after {
					content: '';
					position: absolute;
					height: 100%;
					width: 8rpx;
					top: 0;
					left: -8rpx;
					background: radial-gradient(circle at left center, transparent 8rpx, #fff 0) left center / 8rpx 20rpx;
				}

				.r-tickets {
					flex: 1;
					background: #F3993A;
					position: relative;
					background: radial-gradient(circle at left top, transparent 16rpx, #F3993A 0) right top / 100% 50% no-repeat,
						radial-gradient(circle at left bottom, transparent 16rpx, #F3993A 0) right bottom / 100% 50% no-repeat;
					font-size: 36rpx;
					color: #fff;
					text-align: center;
					@include flex-center;
					font-weight: bold;
					border-top-right-radius: 10rpx;
					border-bottom-right-radius: 10rpx;
				}

				.r-tickets::after {
					content: '';
					width: 1rpx;
					background: linear-gradient(to top, #fff 0%, #fff 50%, transparent 50%) top left / 1rpx 20rpx repeat-y;
					position: absolute;
					left: 0;
					top: 16rpx;
					bottom: 16rpx;
				}

			}

换一边

html 复制代码
<view class="coupon">
				<view class="tickets" v-for="(item,index) in 10" :key="item">
					<view class="l-tickets">
						
					</view>
					<view class="r-tickets">
						<view class="name">
							10元优惠劵
						</view>
						<view class="effect">
							满120元可用
						</view>
						<view class="end-date">
							有效期至:2023-10-30
						</view>
					</view>
				</view>
			</view>
css 复制代码
.coupon {
				width: 100%;
				.tickets {
					display: flex;
					// padding: 20rpx;
					width: 100%;
					height: 220rpx;
					box-sizing: border-box;
					margin-bottom: 30rpx;
					filter: drop-shadow(0px 8rpx 4rpx rgba(0, 0, 0, 0.05)) drop-shadow(-4px 0px 4px rgba(0, 0, 0, 0.05)) drop-shadow(0px -4px 4px rgba(0, 0, 0, 0.05));
				}
				.l-tickets {
					flex: 1;
					background: #F3993A;
					position: relative;
					background: radial-gradient(circle at right top, transparent 16rpx, #fff 0) right top / 100% 50% no-repeat,
						radial-gradient(circle at right bottom, transparent 16rpx, #fff 0) right bottom / 100% 50% no-repeat;
					font-size: 36rpx;
					color: #fff;
					text-align: center;
					@include flex-center;
					font-weight: bold;
					border-top-right-radius: 10rpx;
					border-bottom-right-radius: 10rpx;
				}
				.l-tickets::after {
					content: '';
					position: absolute;
					height: 100%;
					width: 8rpx;
					top: 0;
					left: -8rpx;
					background: radial-gradient(circle at left center, transparent 8rpx, #fff 0) left center / 8rpx 20rpx;
				}
				.r-tickets {
					width: 75%;
					height: 100%;
					position: relative;
					background: radial-gradient(circle at left top, transparent 16rpx, #fff 0) right top / 100% 50% no-repeat,
						radial-gradient(circle at left bottom, transparent 16rpx, #fff 0) right bottom / 100% 50% no-repeat;
					padding: 20rpx;
					@include flex-sb;
					align-items: flex-start;
					flex-direction: column;
					border-top-right-radius: 20rpx;
					border-bottom-right-radius: 20rpx;
					.name{
						font-weight: bold;
					}
					.effect{
						font-size: 26rpx;
						color: #999;
					}
					.end-date{
						font-size: 24rpx;
						color: #999;
					}
				}
				.r-tickets::after {
					content: '';
					width: 2rpx;
					background: linear-gradient(to top, #ddd 0%, #ddd 50%, transparent 50%) top left / 1rpx 20rpx repeat-y;
					position: absolute;
					left: 0;
					top: 16rpx;
					bottom: 16rpx;
					z-index: 999;
				}
				
			}
相关推荐
2501_915106327 分钟前
App Store 软件上架全流程详解,iOS 应用发布步骤、uni-app 打包上传与审核要点完整指南
android·ios·小程序·https·uni-app·iphone·webview
快起来搬砖了8 分钟前
实现一个优雅的城市选择器组件 - Uniapp实战
开发语言·javascript·uni-app
数学分析分析什么?12 分钟前
Uniapp中使用renderjs实现OpenLayers+天地图的展示与操作
uni-app·openlayers·天地图·renderjs
海绵宝宝不喜欢侬13 分钟前
UniApp微信小程序-实现蓝牙功能
微信小程序·uni-app
开发加微信:hedian1162 小时前
微信推客小程序系统开发技术实践
微信·小程序
Python大数据分析3 小时前
uniapp微信小程序商品列表数据分页+本地缓存+下拉刷新+图片懒加载
缓存·微信小程序·uni-app
机构师3 小时前
<uniapp><指针组件>基于uniapp,编写一个自定义箭头指针组件
javascript·uni-app·vue·html
小白_ysf3 小时前
uniapp和vue3项目中引入echarts 、lime-echart(微信小程序、H5等)
微信小程序·uni-app·echarts·h5·lime-echart
imHere·3 小时前
UniApp 分包异步化配置及组件引用解决方案
微信小程序·uni-app·分包
说私域5 小时前
开源AI智能名片链动2+1模式S2B2C商城小程序在淘宝公域流量运营中的应用研究
人工智能·小程序·开源