StoreCard.vue 2.2 KB
<template>
	<view class="price_list">
		<u-scroll-list :indicator="false">
		  <view v-for="(item, index) in priceList" :key="index" class="scroll_box" >
		  	<view class="price_card" :class="{active: current === index}" @click="current = index">
		  		<view style="color: #fff;" class="f-24 l-h-32">¥<text class="price">{{ item.price }}</text></view>
					<text class="col-f f-28 l-h-38 f-w-500">尝鲜套餐</text>
					<text style="line-height: 26rpx;margin: 4rpx 0;" class="col-f f-22">剧本杀+密室逃脱</text>
		  		<text style="color: #fff;" class="f-24 l-h-32">限6个场地</text>
		  	</view>
				<view class="tip" :class="{active: current === index}">30天</view>
		  </view>
		</u-scroll-list>
		<view class="col-f f-24 l-h-32 m-top30">*激活门店类型超过<text style="color: #FFC8A1;">2</text>个,每个月享受<text style="color: #FFC8A1;">7</text>折优惠!</view>
	</view>
</template>

<script>
export default {
	props: {
		priceList: {
			type: Array,
			require: true
		}
	},
	data(){
		return {
			current: 0
		}
	}
}
</script>

<style lang="scss" scoped>
.price_list{
	padding: 30rpx;
	border-bottom: 2rpx solid #666;
	.scroll_box{
		position: relative;
		margin-right: 16rpx;
		&:last-child{
			margin-right: 0;
		}
		.tip{
			position: absolute;
			top: 0;
			right: 0;
			width: 80rpx;
			height: 32rpx;
			background: #47878A;
			border-radius: 0rpx 12rpx 0rpx 12rpx;
			text-align: center;
			line-height: 32rpx;
			color: #fff;
			font-size: 24rpx;
			&.active{
				color: #47878A;
				background: #fff;
			}
		}
	}
	.price_card{
		display: flex;
		flex-direction: column;
		align-items: center;
		box-sizing: border-box;
		padding-top: 42rpx;
		width: 220rpx;
		height: 240rpx;
		background: #3B696B;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		&.active{
			border: 4rpx solid #fff;
		}
		.price{
			font-weight: 600;
			font-size: 60rpx;
			line-height: 80rpx;
			margin: 2rpx 0 8rpx 0;
		}
		.oldPrice{
			text-decoration: line-through;
			color: #bbb;
			font-size: 24rpx;
			line-height: 32rpx;
			margin: 8rpx 0 10rpx 0;
		}
		.tip{
			width: 140rpx;
			height: 40rpx;
			line-height: 40rpx;
			text-align: center;
			font-size: 24rpx;
			color: #fff;
			background: #F2D4A2;
			border-radius: 200rpx;
		}
	}
}
</style>