<template>
	<div>
		<template v-if="!showDetail">
			<div class="teacherstyle-right">
				<div class="teacherstyle-item-box" @click="goDetail(index)" v-for="(item,index) in teatherArr" :key="index">
					<img :src="item.PictureUrls" alt="">
					<span class="clips1">{{item.Title}}</span>
				</div>
			</div>
		</template>
		<teacherStyleDetail v-if="showDetail" :teacherInfo="teacherInfo" @backstyle="backstyle"></teacherStyleDetail>
	</div>
</template>

<script>
	import teacherStyleDetail from '@/components/teacherStyleDetail.vue';
	export default {
		components:{
			teacherStyleDetail
		},
		name: 'teacherStyle',
		data() {
			return {
				teatherArr:[],
				teacherInfo:{},
				showDetail:false
			}
		},
		methods: {
			goDetail(e){
				this.teacherInfo = this.teatherArr[e];
				this.showDetail = true;
				this.getteachers_demeanor_detailEv(this.teacherInfo.Guid);
			},
			// 继承详情返回事件
			backstyle(e){
				this.showDetail = e;
			},
			async checkTeacherStyle() {
				let data = await this.$axios({
					// 调用 serviceAPI
					url: this.$https.getteachers_demeanor,
					methods: "get",
					params: {
						EquipmentID: "yaohaotest001",
					},
				});
				this.teatherArr = data.data.data;
			},
			async getteachers_demeanor_detailEv(guid) {
				let data = await this.$axios({
					// 调用 serviceAPI
					url: this.$https.getteachers_demeanor_detail,
					methods: "get",
					params: {
						// EquipmentID: "yaohaotest001",
						Guid:guid,
						OrgGuid:'6a6d885c-45d2-0b5b-ef1f-b0e1964df0fe'
					},
				});
				this.teacherInfo = data.data.data;
			},
		},
		mounted() {
			this.checkTeacherStyle();
		}
	}
</script>

<style>
</style>
