<template>
	<view class="index-box">
		<view class="back-home-btn" @click="toUserIndex">
			<image src="../../static/backhome-icon.png" ></image>
			<text>回到首页</text>
		</view>
		<view class="userInfo-box acea-row row-column row-center-wrapper">
			<view class="headerimg-box">
				<image :src="userInfo.avatar" mode="aspectFill" v-if="userInfo.isPromoter == 0"></image>
				<image :src="userInfo.workPhoto" mode="aspectFill" v-else></image>
			</view>
			<view class="name">{{userInfo.realName || userInfo.nickname}}</view>
			<text class="iconfont icon-bianji1" @click.stop="eidtInfo()"></text>
		</view>
		<view class="btn-box acea-row row-center row-middle" @click="toSetSelfData" v-if="userInfo.isPromoter == 0">请先完善个人信息</view>
		<view class="btn-box acea-row row-center row-middle" @click="toCourseManagement" v-if="userInfo.isPromoter == 1">
			<image src="../../static/kecheng-icon.png" mode=""></image>
			<text>课程管理</text>
		</view>
		<view class="btn-box  acea-row row-center row-middle" @click="toMemberManagement" v-if="userInfo.isPromoter == 1">
			<image src="../../static/vipmanage-icon.png" mode=""></image>
			<text>会员管理</text>
		</view>
	</view>
</template>

<script>
	import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
	import { getUserInfo, getMenuUser, bindingPhone, wxappBindingPhone } from '@/api/user'
	export default{
		computed: mapGetters(['userInfo']),
		data(){
			return {
				
			}
		},
		onLoad(){
			console.log(this.userInfo)
		},
		
		methods:{
			toUserIndex () {
				this.$yrouter.switchTab({
				  path: '/pages/home/index',
				})
			},
			eidtInfo(){
				this.$yrouter.push({
					path: '/pages/serviceTeacher/setSelfData'
				})
			},
			toSetSelfData(){
				this.$yrouter.push({
					path: '/pages/serviceTeacher/setSelfData'
				})
			},
			toCourseManagement(){
				this.$yrouter.push({
					path: '/pages/serviceTeacher/courseManagement'
				})
			},
			toMemberManagement(){
				this.$yrouter.push({
					path: '/pages/serviceTeacher/memberManagement'
				})
			},
		}
	}
</script>

<style lang="less" scope>
	.index-box{
		width: 100%;
		height: 100vh;
		background: #F5F6F7;
		font-size: 32rpx;
		color: #222;
		position: relative;
		background: url(https://www.cyjyyjy.com:8081/static/teacher-index-bg.png);
		background-size: cover;
		.back-home-btn{
			position: absolute;
			left: 50%;
			margin-left: -40rpx;
			bottom: 56rpx;
			text-align: center;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			image{
				width: 80rpx;
				height: 80rpx;
			}
			text{
				color: #fff;
				font-size: 28rpx;
			}
		}
		.userInfo-box{
			.headerimg-box{
				width: 156rpx;
				height: 156rpx;
				border-radius: 50px;
				border: 8rpx solid #d9d9d9;
				overflow: hidden;
				margin: 100rpx 0 30rpx;
				image{
					width: 100%;
					height: 100%;
					border-radius: 50rpx;
				}
			}
			.name{
				margin-bottom: 12rpx;
			}
		}
		.btn-box{ 
			width: 590rpx;
			height: 264rpx;
			background-color: #fff;
			border-radius: 10rpx;
			font-size: 38rpx;
			margin: 40rpx auto;
			transform: scale(.8);
			box-shadow: 0px 6rpx 14rpx 8rpx rgba(0, 0, 0, 0.1);
			image{
				width: 104rpx;
				height: 104rpx;
				margin-right: 40rpx;
			}
		}
	}
</style>
