<template>
	<view class="mine">
		<u-navbar :is-back="false" title="　" :border-bottom="false">
			<view class="u-flex u-row-right" style="width: 100%;">
				<!-- <view class="camera u-flex u-row-center">
					<u-icon name="camera-fill" color="#000000" size="48"></u-icon>
				</view> -->
			</view>
		</u-navbar>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
			<view class="u-m-r-10">
				<u-avatar :src="memberinfo.avatar||pic" size="140"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">{{memberinfo.name}}</view>
				<view class="u-font-14 u-tips-color">
				军人认证状态：
				{{memberinfo.auditStatus|verifyStatusFilter}}
				<text v-if="memberinfo.auditStatus==1||memberinfo.auditStatus==9" @click="openPage('pages/authentication/authentication')" style="margin-left: 24rpx;">去认证</text>
			</view>
			</view>
			<view class="u-m-l-10 u-p-10">
				<u-icon name="arrow-right" color="#969799" size="28" @click="openPage('pages/inbuild/inbuild','个人信息')"></u-icon>
			</view>
		</view>
		<view class="mine-todo u-flex u-row-between">
			<view class="mine-todo-item" @click="openPage('pages/inbuild/inbuild','我的投递')">
				<view class="num">25</view>
				<view class="text">我的投递</view>
			</view>
			<view class="mine-todo-item" @click="openPage('pages/inbuild/inbuild','我的面试')">
				<view class="num">18</view>
				<view class="text">我的面试</view>
			</view>
			<view class="mine-todo-item" @click="openPage('pages/inbuild/inbuild','关注企业')">
				<view class="num">6</view>
				<view class="text">关注企业</view>
			</view>
			<view class="mine-todo-item" @click="openPage('pages/inbuild/inbuild','消息通知')">
				<view class="num">8</view>
				<view class="text">消息通知</view>
			</view>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="order" title="电子简历" @click="openPage('pages/inbuild/inbuild','电子简历')" ></u-cell-item>
				<u-cell-item icon="heart" title="求职意向" @click="openPage('pages/inbuild/inbuild','求职意向')"></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="cut" title="我的技能培训" @click="openPage('pages/inbuild/inbuild','我的技能培训')"></u-cell-item>
				<u-cell-item icon="photo" title="我的学历提升" @click="openPage('pages/inbuild/inbuild','我的学历提升')"></u-cell-item>
				<u-cell-item icon="coupon" title="我的适应性培训" @click="openPage('pages/basicTraining/myBasicTraining/myBasicTraining')"></u-cell-item>
				<u-cell-item icon="edit-pen" title="我的考试考核" @click="openPage('pages/inbuild/inbuild','我的考试考核')"></u-cell-item>
				<u-cell-item icon="android-circle-fill" title="我的班级" @click="openPage('pages/inbuild/inbuild','我的班级')"></u-cell-item>
				<u-cell-item icon="file-text" title="行为积分" @click="openPage('pages/inbuild/inbuild','行为积分')"></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="setting" title="设置" @click="openPage('pages/inbuild/inbuild','设置')"></u-cell-item>
				<u-cell-item icon="level" title="注销登录" @click="loginOut"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pic:'/static/img/default-avatar.png',
				show:true,
				veteEducStatus:null,
				memberinfo:[],
			}
		},
		onLoad() {
			
			// this.veteEducCheck();
		},
		onShow() {
			this.getmemberinfo();
		},
		filters: {
		  verifyStatusFilter(value) {
			if (value === 0) {
			  return '审核中';
			}else if(value === 1){
				return '不通过';
			}else if(value === 2){
				return '通过';
			}else if(value === 9){
				return '未认证';
			} else {
			  return '未知';
			}
		  },
		},
		methods: {
			openPage(path,msg) {
			  this.$u.route({
			    url: path,
				params:{
					msg:msg
				}
			  })
			},
			veteEducCheck(){
				this.$u.api.getVeteEducCheck().then(res=>{
					// console.log('res',res);
					this.veteEducStatus = res.data;
				})
			},
			getmemberinfo(){
				this.$u.api.getmemberinfo().then(res=>{
					this.memberinfo = res.data;
					console.log('this.memberinfo',JSON.parse(JSON.stringify(this.memberinfo)));
				})
			},
			loginOut(){
				let that = this;
				this.$u.vuex('vuex_hasLogin', false);
				this.$u.vuex('vuex_token', '');
				this.$u.vuex('vuex_user', '');
				this.$u.route('/pages/phoneLogin/phoneLogin');
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #ededed;	
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
}
.mine /deep/ .u-cell_title{font-size: 30rpx;}
.mine /deep/ .u-iconfont{font-size: 45rpx!important;}
.mine-todo{
	background-color: #fff;
	text-align: center;
	padding: 0 24rpx 24rpx;
}
</style>
