<template>
	<view class="content">
		<view class="container">
			<view class="top-box">
				<image src="../../static/imgs/myback.png" mode=""></image>
				<view class="top-ds">
					<view class="touxiang"></view>
					<view class="">
						<view v-if="selfInfo.phone" class="usernam">{{selfInfo.phone}}</view>
						<view v-else @click="toLogin()" class="usernam">登录/注册</view>
						<view v-if="!selfInfo.phone" class="usersize">登录开启全部服务</view>
					</view>
				</view>

			</view>
			<view class="t-box">
				<view class="title-">我的教练</view>
				<view class="box-ds">
					<view class="box-touxiang">
						<image :src=" baseUrl + selfInfo.driveSchoolCoach.image" mode=""></image>
					</view>
					<view class="">
						<view v-if="selfInfo.driveSchoolCoach.instructorName" class="jname">
							{{selfInfo.driveSchoolCoach.instructorName}}
						</view>
						<view class="jziliao">驾龄：{{selfInfo.driveSchoolCoach.experienceYear||""}}年
							学员数：{{selfInfo.driveSchoolCoach.student||""}}</view>
					</view>
				</view>
			</view>
			<view class="title-">我的订单</view>
			<view class="wrap-box">
				<view @click="goAllOrders()" class="er-box">
					<image src="../../static/imgs/ybm.png" mode=""></image>
					<view class="">已报名</view>
				</view>
				<view @click="goAllOrders()" class="er-box">
					<image src="../../static/imgs/yfk.png" mode=""></image>
					<view class="">已付款</view>
				</view>
				<view @click="goAllOrders()" class="er-box">
					<image src="../../static/imgs/ymq.png" mode=""></image>
					<view class="">已面签</view>
				</view>
				<view @click="goAllOrders()" class="er-box">
					<image src="../../static/imgs/qbdd.png" mode=""></image>
					<view class="">全部订单</view>
				</view>
			</view>
			<view class="hui-hang"></view>
			<view @click="goSeifInfo()" class="my-box">
				<view class="di-s">
					<image src="../../static/imgs/my1.png" mode=""></image>
					<view class="">个人信息</view>
				</view>
				<u-icon name="arrow-right" size="18"></u-icon>
			</view>

			<!-- <view @click="goGchoolFeedback()" class="my-box">
				<view class="di-s">
					<image src="../../static/imgs/my3.png" mode=""></image>
					<view class="">建议反馈</view>
				</view>
				<u-icon name="arrow-right" size="18"></u-icon>
			</view> -->
			<view @click="gopassThrough()" class="my-box">
				<view class="di-s">
					<image src="../../static/imgs/scc.png" style="width: 28px; height: 28px; margin-right: 0px; ">
					</image>
					<view class="">上传成绩</view>
				</view>
				<u-icon name="arrow-right" size="18"></u-icon>
			</view>
		</view>
		<tabbar :msg='msg'></tabbar>
	</view>
</template>

<script>
	import headers from '../../components/header/headers.vue'
	import tabbar from '../../components/tabbar/tabbar.vue'
	import request from '@/utils/request.js'
	import {
		getToken
	} from '@/utils/auth'
	export default {
		data() {
			return {
				baseUrl: this.$imagesUrl,
				titles: "我的",
				msg: "3",
				List: [],
				show: false,
				status: 'loading',
				selfInfo: {}
			}
		},
		onShow() {
			if (getToken()) {
				this.findSelfInfo()
			}

		},
		onPullDownRefresh() {
			console.log("刷新");
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			// this.show = true
			setTimeout(() => {
				console.log("加载执行");
			}, 2000)
		},
		components: {
			headers,
			tabbar
		},
		methods: {
			goback() {
				uni.navigateBack()
			},
			goAllOrders() {
				uni.navigateTo({
					url: "/pages/index/allOrders"
				})
			},
			goSeifInfo() {
				uni.navigateTo({
					url: "/pages/index/selfInfo"
				})
			},
			playClick() {
				uni.showToast({
					title: "客服电话 123132322134",
					icon: "none",
					duration: 3000
				})
			},
			toLogin() {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			},
			async findSelfInfo() {
				let res = await request({
					url: `/driving/findSelfInfo`,
					method: 'get',
				})
				console.log(res, 138);
				this.selfInfo = res
			},
			gopassThrough() {
				uni.navigateTo({
					url: '/pages/my/passThrough'
				})
			},
			goGchoolFeedback() {
				uni.navigateTo({
					url: "/pages/index/schoolFeedback"
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		background: #fff;

		height: 100vh;
	}

	.container {
		width: 100%;
		background: #fff;
		box-sizing: border-box;

	}

	.top-box {
		width: 100%;
		height: 250px;
		overflow: hidden;
		position: relative;
		z-index: 1;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.top-ds {
		position: absolute;
		left: 25px;
		top: 130px;
		display: flex;
		align-items: center;
		color: white;
	}

	.touxiang {
		width: 56px;
		height: 56px;
		border-radius: 50%;
		overflow: hidden;
		margin-right: 10px;
		background: #fff;

		image {
			width: 100%;
			height: 100%;

		}
	}

	.usernam {
		font-weight: bold;
		font-size: 18px;
		color: #FFFFFF;
		margin-bottom: 5px;
	}

	.usersize {
		font-weight: 400;
		font-size: 12px;
	}

	.t-box {
		width: 95%;
		height: 105px;
		background: #FFFFFF;
		box-shadow: 0px 4px 6px 0px rgba(48, 142, 85, 0.1);
		border-radius: 8px 8px 8px 8px;
		margin: 0 auto;

		z-index: 99;

	}

	.title- {
		width: 100%;
		font-weight: bold;
		font-size: 14px;
		color: #333333;
		box-sizing: border-box;
		padding: 15px;
	}

	.box-ds {
		width: 100%;
		box-sizing: border-box;
		padding: 0px 15px;
		display: flex;
		align-items: center;

	}

	.box-touxiang {
		width: 46px;
		height: 46px;
		border-radius: 50%;
		overflow: hidden;
		background: #dcf0ff;
		margin-right: 10px;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.jname {
		font-weight: bold;
		font-size: 14px;
		color: #333333;
	}

	.jziliao {
		font-weight: 400;
		font-size: 12px;
		color: #999999;
	}

	.wrap-box {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.er-box {
		width: 25%;
		text-align: center;
		font-size: 12px;
		color: #000000;

		image {
			width: 22px;
			height: 22px;
		}
	}

	.hui-hang {
		width: 100%;
		height: 10px;
		background: #f4f4f4;
		margin: 15px auto;
	}

	.my-box {
		width: 95%;
		box-sizing: border-box;
		padding: 15px 0px;
		margin: 15px auto;
		border-bottom: 1px solid #DDDDDD;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.di-s {
		display: flex;
		align-items: center;
		font-size: 14px;
		color: #333333;

		image {
			width: 22px;
			height: 22px;
			margin-right: 10px;
		}
	}
</style>