<template>
	<view class="course-card">
		<view class="course-tips">
			<view class="">!</view>
			<view class="">全平台每种类型的运动课程只可免费试听一次</view>
		</view>
		<view class="select-btn">
			<view :class="sel_btn===index?'distance':'score'" v-for="(item,index) in selectList" :key="index"
				@click="select_btn(index)">{{item}}</view>
		</view>
		<view class="venue-card" v-for="item in 2" @click="toCOurseDetail">
			<image src="https://img.keaitupian.cn/newupload/08/1629449018344288.jpg" mode=""></image>
			<view class="venue-info">
				<view class="info-title">
					<view class="title textHidden">小班体适能+篮球衔接小班体适能+篮球衔接...</view>
					<view class="sales">年售20</view>
				</view>
				<view class="type">
					篮球、足球、羽毛球
				</view>
				<view class="price">
					<view class="">￥58.9</view>
					<view class="">￥80.9</view>
				</view>
				<view class="price-info">
					<view class="sale">
						已售33 98%好评
					</view>
					<view class="price-btn">免费试听</view>
				</view>
			</view>
		</view>
		<!-- <loading/> -->
		<view class="more">查看更多</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from 'vue';
	import loading from '@/components/zzx-loading/zzx-loading.vue';
	const selectList = ref(['篮球', '羽毛球','乒乓球','网球']);
	const sel_btn=ref(0);
	const select_btn=(i)=>{
		sel_btn.value=i
	}
	
	const toCOurseDetail=()=>{
		uni.navigateTo({
			url:'/pages/index/courseDetail/index'
		})
	}
</script>

<style lang="less" scoped>
	.course-card {
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 32rpx;
		margin-top: 20rpx;
		.course-tips {
			display: flex;
			align-items: center;
			gap: 10rpx;
			font-size: 24rpx;
			color: #999999;
		
			&>view:first-child {
				width: 32rpx;
				height: 32rpx;
				background:#FFA347;
				border-radius: 50%;
				display: flex;
				justify-content: center;
				align-items: center;
				color: #FFFFFF;
			}
		}
		.select-btn {
			display: flex;
			align-items: center;
			gap: 20rpx;
			margin-top: 20rpx;
		
			.distance {
				width: 92rpx;
				height: 36rpx;
				background:#C8FF0C;
				border-radius: 8rpx;
				font-size: 24rpx;
				color: #222222;
				line-height:34rpx;
				text-align: center;
			}
		
			.score {
				width: 92rpx;
				height: 36rpx;
				background:#F5F5F5;
				border-radius: 8rpx;
				font-size: 24rpx;
				color:#AAAAAA;
				line-height:34rpx;
				text-align: center;
			}
		}
		.venue-card{
			display: flex;
			align-items: center;
			gap: 20rpx;
			margin-top: 20rpx;
			&>image{
				width: 200rpx;
				height: 200rpx;
				border-radius: 32rpx;
			}
			.venue-info{
				width: 430rpx;
				height: 200rpx;
				border-bottom: 1rpx solid #F0F0F0;
				.info-title{
					display: flex;
					align-items: center;
					justify-content: space-between;
					.title{
						width: 340rpx;
						font-weight: 800;
						font-size: 32rpx;
						color: #222222;
					}
					.sales{
						font-size: 22rpx;
						color: #AAAAAA;
					}
				}
				.type{
					margin-top: 16rpx;
					font-size: 24rpx;
					color: #AAAAAA;
				}
				.price{
					display: flex;
					align-items: center;
					gap: 20rpx;
					margin-top: 16rpx;
					&>view:nth-child(1){
						font-weight: bold;
						font-size: 28rpx;
						color: #FB5B5B;
					}
					&>view:nth-child(2){
						font-size: 22rpx;
						color: #AAAAAA;
						text-decoration: line-through;
					}
				}
				.price-info{
					display: flex;
					align-items: center;
					justify-content: space-between;
					.sale{
						font-size: 24rpx;
						color: #AAAAAA;
					}
					.price-btn{
						width: 152rpx;
						height: 48rpx;
						background: #C8FF0C;
						border-radius: 8rpx;
						font-weight: bold;
						font-size: 28rpx;
						color: #222222;
						text-align: center;
						line-height: 48rpx;
					}
				}
			}
		}
		.more{
			margin: auto;
			width:100rpx;
			margin-top: 20rpx;
			text-align: center;
			font-size: 24rpx;
			color: #CCCCCC;
			position: relative;
		}
		.more::after{
			position: absolute;
			bottom: -10rpx;
			left:25rpx;
			content: '';
			width: 38rpx;
			height: 4rpx;
			border-radius: 2rpx;
			background-color: #CCCCCC;
		}
	}
</style>