ballNav.vue 3.2 KB
<template>
	<view class="ballNav">
		<view class="headerNav">
			<u-tabs :list="navlist" lineColor="#FFA100"></u-tabs>
			<view class="classify">
				<u-icon name="grid" color="#FFA100" size="24" :activeStyle="activeStyle" @click="isShow = !isShow"></u-icon>
			</view>
			<view class="select_ball" :class="{show: isShow}">
				<view class="ball_item" @click="isShow = false">飞盘</view>
				<view class="line"></view>
				<view class="ball_item" @click="isShow = false">网球</view>
			</view>
		</view>
		
		<view class="date_show">
			<view class="date_item" v-for="(item, index) in timeList" :key="index">
				<view class="left">
					<u-icon :name="item.iconName" color="#FFA100" size="22"></u-icon>
					<text style="margin-left: 18rpx;">{{ item.time }}</text>
				</view>
				<view class="right">
					<u-icon name="more-dot-fill" color="#999"></u-icon>
				</view>
			</view>
		</view>
	
		<view class="btn_list">
			<view class="boking">立即找场</view>
			<view class="ball">发起约球</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				isShow: false, //  是否显示下拉列表
				navlist: [
					{ name: '篮球', id: '1'},
					{ name: '足球', id: '2'},
					{ name: '羽毛球', id: '3'},
					{ name: '乒乓球', id: '4'}
				],
				activeStyle: {
					color: '#111111',
					fontSize: '30rpx'
				},
				timeList: [
					{ iconName: 'calendar', time: '2月25日(今天' },
					{ iconName: 'clock', time: '14:00 - 15:00 1小时' }
				]
			}
		}
	}
</script>

<style lang="scss" scoped>
	.ballNav{
		padding: 0 24rpx;
		min-height: 452rpx;
		background: #FFFFFF;
		margin: 62rpx 0 28rpx 0;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		.headerNav{
			position: relative;
			.classify{
				position: absolute;
				width: 50rpx;
				height: 50rpx;
				right: 0;
				top: 50%;
				transform: translateY(-50%);
			}
			.select_ball{
				position: absolute;
				top: 76rpx;
				left: 64%;
				padding: 22rpx;
				width: 220rpx;
				min-height: 196rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 12rpx 32rpx 0rpx rgba(0,0,0,0.1);
				border-radius: 12rpx;
				z-index: 99;
				box-sizing: border-box;
				opacity: 0;
				transition: all .5s ease;
				&.show{
					opacity: 1;
				}
				.ball_item{
					text-align: center;
					font-size: 28rpx;
					color: #333;
				}
				.line{
					height: 2rpx;
					background-color: #E1E1E1;
					margin: 34rpx 0 ;
				}
			}
		}
	
		.date_show{
			.date_item{
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 100rpx;
				box-sizing: border-box;
				border-bottom: 2rpx solid #E1E1E1;
				.left {
					display: flex;
					align-items: center;
					font-size: 28rpx;
					line-height: 32rpx;
					color: #111;
				}
			}
		}
		
		.btn_list{
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 30rpx;
			margin: 40rpx 0 54rpx 0;
			.boking, .ball {
				flex: 1;
				height: 72rpx;
				line-height: 72rpx;
				text-align: center;
				font-size: 28rpx;
				color: #FFA100;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
			}
			.boking{
				border: 2rpx solid #FFA100;
			}
			.ball {
				background: linear-gradient( 270deg, #FFA100 0%, #FCD723 100%);
				color: #fff;
			}
		}
	}
</style>