<!--课程详情页面-->
<template>
	<view class="main_box">
		<!-- 课程基本信息 -->
		<view class="course_info_card" v-if="courseInfo">
			<view class="course_header">
				<view class="course_name">{{ courseInfo.course_name }}</view>
				<view class="course_status" :class="courseInfo.status">
					{{ courseInfo.status === 'active' ? '进行中' : '已结束' }}
				</view>
			</view>
			
			<view class="course_details">
				<view class="detail_item">
					<view class="detail_label">授课教师</view>
					<view class="detail_value">{{ courseInfo.teacher_name }}</view>
				</view>
				<view class="detail_item">
					<view class="detail_label">上课校区</view>
					<view class="detail_value">{{ courseInfo.campus_name }}</view>
				</view>
				<view class="detail_item">
					<view class="detail_label">上课时间</view>
					<view class="detail_value">{{ courseInfo.schedule_time }}</view>
				</view>
				<view class="detail_item">
					<view class="detail_label">课程进度</view>
					<view class="detail_value">{{ courseInfo.progress }}</view>
				</view>
				<view class="detail_item" v-if="courseInfo.next_class">
					<view class="detail_label">下节课时间</view>
					<view class="detail_value next_class">{{ courseInfo.next_class }}</view>
				</view>
			</view>
		</view>
		
		<!-- 空状态 -->
		<view class="empty_state" v-if="!loading && !courseInfo">
			<image src="/static/icon-img/empty.png" class="empty_icon"></image>
			<view class="empty_text">暂无课程信息</view>
		</view>
		
		<!-- 加载状态 -->
		<view class="loading_state" v-if="loading">
			<view class="loading_text">加载中...</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			courseInfo: null,
			loading: false,
			courseId: null,
			childId: null
		}
	},
	onLoad(options) {
		this.courseId = options.courseId
		this.childId = options.childId
		this.loadCourseInfo()
	},
	methods: {
		async loadCourseInfo() {
			// 这里可以添加具体的课程详情获取逻辑
			// 暂时使用模拟数据
			this.courseInfo = {
				course_name: '少儿篮球训练',
				teacher_name: '王教练',
				campus_name: '总部校区',
				schedule_time: '周六 09:00-10:30',
				progress: '8/12节',
				status: 'active',
				next_class: '2024-01-20 09:00'
			}
		}
	}
}
</script>

<style lang="less" scoped>
.main_box {
	background: #f8f9fa;
	min-height: 100vh;
	padding: 20rpx;
}

.course_info_card {
	background: #fff;
	border-radius: 16rpx;
	padding: 32rpx;
	box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
	
	.course_header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 32rpx;
		padding-bottom: 24rpx;
		border-bottom: 1px solid #f0f0f0;
		
		.course_name {
			font-size: 36rpx;
			font-weight: 600;
			color: #333;
		}
		
		.course_status {
			font-size: 24rpx;
			padding: 8rpx 16rpx;
			border-radius: 12rpx;
			
			&.active {
				background: rgba(41, 211, 180, 0.1);
				color: #29d3b4;
			}
			
			&.inactive {
				background: #f0f0f0;
				color: #999;
			}
		}
	}
	
	.course_details {
		.detail_item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20rpx 0;
			border-bottom: 1px solid #f8f9fa;
			
			.detail_label {
				font-size: 28rpx;
				color: #666;
				min-width: 160rpx;
			}
			
			.detail_value {
				font-size: 28rpx;
				color: #333;
				flex: 1;
				text-align: right;
				
				&.next_class {
					color: #29d3b4;
					font-weight: 600;
				}
			}
		}
	}
}

.empty_state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 120rpx 0;
	
	.empty_icon {
		width: 160rpx;
		height: 160rpx;
		margin-bottom: 32rpx;
		opacity: 0.3;
	}
	
	.empty_text {
		font-size: 28rpx;
		color: #999;
	}
}

.loading_state {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 60rpx 0;
	
	.loading_text {
		font-size: 28rpx;
		color: #666;
	}
}
</style>