timeBooking.vue 3.7 KB
<template>
	<view class="booking_time">
		<!-- 选择时间 -->
		<u-sticky>
			<view class="navSelectTime">
				<view class="time_card" :class="{active: current === index }" v-for="(item, index) in 5" :key="index" @click="current = index">
					<text style="font-weight: 500;">今天</text>
					<text>2月27日</text>
				</view>
			</view>
		</u-sticky>
		
		<!-- 时间场 -->
		<view class="pitch" v-for="king in 3" :key="king">
			<view class="pitch_title">上午场</view>
			<view class="pitch_list">
				<view class="pitch_item" v-for="item in 5" :key="item">
					<text>9:00-10:00</text>
					<text>¥ 128</text>
				</view>
			</view>
		</view>
		
		<!-- 小提示 -->
		<view class="tip_list">
			<view class="tip_item" v-for="(item, index) in tipList" :key="index">
				<view :style="{backgroundColor: item.bgColor}" class="tip_box"></view>
				<text>{{ item.title }}</text>
			</view>
		</view>
		
		<!-- 确认选择 -->
		<view class="footer">
			<view class="pay_money">需支付:<text style="font-size: 36rpx;font-weight: 500;">¥ 228</text></view>
			<view class="comfirn">确认</view>
		</view>
		
	</view>
</template>

<script>
	import ThemeColor from '@/utils/themeColor';
	export default {
		data() {
			return {
				current: 0,
				tipList: [
					{ title: '可预订', bgColor: '#FFFFFF' },
					{ title: '已约满', bgColor: '#CDCDCD' },
					{ title: '我的选择', bgColor: ThemeColor.PrimaryColor }
				]
			};
		}
	}
</script>

<style lang="scss" scoped>
.booking_time{
	position: relative;
	background-color: #F6F6F6;
	box-sizing: border-box;
	padding-bottom: 150rpx;
	.navSelectTime{
		display: flex;
		align-items: center;
		height: 104rpx;
		color: #333;
		font-size: 24rpx;
		line-height: 32rpx;
		background-color: #fff;
		.time_card{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			height: 100%;
			flex: 1;
			box-sizing: border-box;
			&.active{
				background-color: rgba(255, 161, 0, .2);
				border-top: 8rpx solid $uni-color-primary;
				color: $uni-color-primary;
			}
		}
	}
	// 选择时间卡片
	.pitch{
		padding: 0 30rpx;
		margin-top: 34rpx;
		.pitch_title{
			text-align: center;
			color: #333;
			font-size: 28rpx;
			margin-bottom: 20rpx;
		}
		.pitch_list{
			display: flex;
			flex-wrap: wrap;
			background-color: #fff;
			border-radius: 8rpx;
			box-sizing: border-box;
			overflow: hidden;
			border: 1px solid rgba(225,225,225,0.7);
			.pitch_item{
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				font-size: 28rpx;
				color: #999;
				line-height: 40rpx;
				width: calc(100% / 3);
				height: 124rpx;
				border: 1px solid rgba(225,225,225,0.7);
				box-sizing: border-box;
			}
		}
	}

	// 提示列表
	.tip_list{
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 42rpx;
		.tip_item{
			display: flex;
			flex-direction: column;
			align-items: center;
			color: #333;
			font-size: 24rpx;
			line-height: 28rpx;
			margin: 0 32rpx;
			.tip_box{
				width: 56rpx;
				height: 28rpx;
				border-radius: 4rpx;
				border: 1rpx solid rgba(225,225,225,0.7);
				margin-bottom: 14rpx;
			}
		}
	}
	
	.footer{
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: fixed;
		bottom: 0;
		left: 0;
		background-color: #fff;
		padding: 0 30rpx;
		width: 100%;
		height: 112rpx;
		box-sizing: border-box;
		.pay_money{
			font-size: 28rpx;
			color: $uni-color-primary;
		}
		.comfirn{
			width: 240rpx;
			height: 76rpx;
			background: linear-gradient( 270deg, $uni-color-primary 0%, #FCD723 100%);
			border-radius: 90rpx;
			font-size: 28rpx;
			text-align: center;
			color: #fff;
			line-height: 76rpx;
		}
	}
}
</style>