<template>
	<view>
		<!--pages/myCollectTeacher/myCollectTeacher.wxml-->
		
		<view class="teachWrapper">
			<view v-for="(Info,index) in collectCourseInfo" :key="index">
				<view class="teachDetail" @click="courseDetail">
				    <image class="teachImg" mode="widthFix" src="../../images/zly.jpeg"></image>
				    <view class="teachIntro">
				        <view class="teachIntroTop">
				            <view>
				                <view>
				                    <text>{{Info.teacherName}}教员</text>
				                </view>
				                <view class="course">
				                    <text>科目:</text>
				                    <text class="teachCourse">{{Info.teacherCourses.subject}}</text>
				                </view>
				                <view>
				                    <text>{{Info.school}}</text>
				                </view>
				            </view>
				            <view class="teachIntroRight">
				                <view class="teachEduAndAge">
				                    <view class="collect">
				                        <text>{{Info.education}}</text>
				                    </view>
				                    <view>
				                        <text class="teachAgeIcon">教龄</text>
				                        <text class="teachAge">{{Info.teacherCourses.teachAge}}</text>
				                    </view>
				                </view>                    
				            </view>
				        </view>
				        <view class="experience">
				            <text>成功经验:</text>
				            <text class="teachExperience">{{Info.teacherCourses.experience}}</text>
				        </view>
				    </view>
				</view>
			</view>
		    
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				collectCourseInfo:[]
			};
		},
		created(){
			this.collectCourse()
		},
		methods:{
			async collectCourse(){
				const { data: result } = await uni.$http.get('/education/my-favorite-courses/getFavoriteCourse')
				console.log(result)
				this.collectCourseInfo = result.data.FavoriteCourseVo
				
			},
			async courseDetail(Info){
				console.log(JSON.stringify(Info))
				uni.navigateTo({
					url: '/subpkg/my_invite_detail/my_invite_detail?Info='+ encodeURIComponent(JSON.stringify(Info))
				})
				
			}
		}
	}
</script>

<style lang="scss" scoped>

/* 设置页面背景 */
.teachWrapper{
    background-color: #aaaaff;
	
    height: 100%;
    padding: 20rpx;
}

/* 设置单个教员背景 */
.teachDetail{
    display: flex;
    position: relative;
    /* border: 1rpx solid gray; */
    padding: 10rpx 0;
    border-radius: 20rpx;
    background-color: #FFF2CC;
    margin-bottom: 20rpx;
    font-weight: bold;
    font-size: 28rpx;
}

.teachIntroTop{
    display: flex;
}
/* 教员头像 */
.teachImg{
    width: 22%;
    margin: 10rpx;
    border-radius: 20rpx;
}

.teachIntro{
    margin-left: 10rpx;
}

/* 科目 */
.course{
    display: flex;
}
.teachCourse{
    margin-left: 10rpx;
    width: 160rpx;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧部分定位 */
.teachIntroRight{
    position: absolute;
    /* right: 30rpx; */
    left: 65%;
}

/* 教员学历和教龄 */
.teachEduAndAge{
    display: flex;
}

/* 教龄图标 */
.teachAgeIcon {
    margin-left: 20rpx;
    padding: 2rpx;
    border: 1rpx solid;
    border-radius: 10rpx;
    font-size: 26rpx;
    color: white;
    background-color: #FF6666;
}

/* 教龄 */
.teachAge{
    margin-left: 10rpx;
    font-weight: bold;
    color: red;
}

/* 成功经验 */
.experience{
    display: flex;
}
.teachExperience{
    width: 300rpx;
    margin-left: 10rpx;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.collect{
	color:greenyellow;
}
</style>
