<template>
	<view class="com-teacher-section" v-if="info!=null">
		<view class="header" @click="onViewTeacher">
			<image :src="info.headerImg" class="image"></image>
		</view>
		<view class="intro" @click="onViewTeacher">
			<view class="name">{{info.name}}</view>
			<view class="tips">{{info.tips}}</view>
		</view>
		<view class="yy">
			<view class="btn">
				<button class="btn-yy"  @click="onViewReserve">预约</button>
			</view>
			<view class="text">
				共有<text class="txt"> {{info.reqTotal}}</text>人预约
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		name:"TeacherSection",
		emits:['onViewTeacher','onViewReserve'],
		props:{
			info:{
				type:Object,
				default:()=>{
					return null
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			onViewTeacher(e){ 
				this.$emit("onViewTeacher",this.info.id);
			},
			onViewReserve(e){
				this.$emit("onViewReserve",this.info.id);
			}
		}
	}
</script>

<style lang="scss">
@import './TeacherSection.scss'
</style>