<template>
	<view class="container">
		<view class="title">
		   <view>
				<text class="line"></text>学历信息
			</view>
		   <text class="page_mark">4/8</text>
		 </view>
		 <view class="content">
		     <view class="contentDetail employ">
		       <view class="contentItem">
		         <text>最高学历：如本科、专科、硕士</text>
				 <picker @change="changeEducation" :value="name" :range="educationLevelList"
				 range-key="name">
					 <view class="uni-input">{{educationLevelList[educationIdx]['name']}}
						 <text class="iconfont icon-youjiantou"></text>
					 </view>
				 </picker>
		       </view>
		       <view class="contentItem">
		         <text>毕业学校</text>
		         <input class="form-control" />
		       </view>
		       <view class="contentItem" style="border:none;">
		         <text>毕业证</text>
		         <view></view>
		       </view>
		     </view>
		     <view class="photo_wrapper">
		       <text class="iconfont icon-weibiaoti553"></text>
		       <view style="margin-top: 10px;" >点击添加毕业证照片</view>
		     </view>
		     <!-- <image alt="毕业证照片"></image> -->
		     <view class="tips">
		       <view>（jpg,png 文件大小不大于1mb）</view>
		     </view>
		   </view>
		 <navigator class="fixed" url="bank-card" @click="saveInfo()">
		   保存并下一步
		 </navigator>
	</view>
</template>

<script>
	import api from '../../api/api';
	export default{
		data(){
			return {
				educationLevelList:[{id:null,name:'请选择'}],
				educationIdx:0,
				applyParam:{
					lastGraduateGrade:'',
					lastGraduateSchool:'',
					lastGraduateCertificationOssPath:'',
				}
			}
		},
		components:{},
		onLoad(){
			this.educationLevelQuery()
		},
		methods:{
			educationLevelQuery(){
				api.educationLevelQuery().then((res)=>{
					console.log(res)
					if(res['success']){
						this.educationLevelList = this.educationLevelList.concat(res['data']['educationLevelList']);
					}
				})
			},
			changeEducation:function(e){
				this.educationIdx = e.detail.value;
				this.applyParam.lastGraduateGrade = this.educationLevelList[this.educationIdx]['name'];
			},
			saveInfo(){
				uni.setStorageSync('applyParam',JSON.stringify(this.applyParam))
			}
		}
	}
</script>

<style lang="scss">
	@import 'applyCommon.scss';
</style>