<template>
	<view style="padding: 30rpx;" >
		<view style="position: relative;">
			<view class="tip">
				请填写真实信息，以便我们后续为您提供完善的 <br>
				个人职业成长定制服务！
			</view>
			<view class="btn" style="position: absolute;right: 20rpx;top: 0;">
				编辑
			</view>
		</view>
		<view class="form">
			<u-form :model="form" ref="uForm">
				<u-form-item label="学校名称" :label-width="auto"><u-input v-model="form.name" /></u-form-item>
				<u-form-item label="全日制" :label-width="auto">
					<picker @change="bindPickerChangeSex" :value="index_sex" :range="array_sex">
					              <view class="picker">
					                {{array_sex[index_sex]}}
					              </view>
					    </picker>
				</u-form-item>
				<u-form-item  label="入学时间" prop="birth" :label-width="auto">
					<picker mode="date" :value="form.date"   @change="bindDateChange">
						<view class="picker">
						  {{form.date}}
						</view>
					  </picker>
				</u-form-item>
				<u-form-item  label="毕业时间" prop="birth" :label-width="auto">
					<picker mode="date" :value="form.date"   @change="bindDateChange">
						<view class="picker">
						  {{form.date}}
						</view>
					  </picker>
				</u-form-item>
				<u-form-item label="学历">
					<picker @change="bindPickerChangeSex" :value="index_sex" :range="array_sex">
					              <view class="picker">
					                {{array_sex[index_sex]}}
					              </view>
					    </picker>
				</u-form-item>
				<u-form-item label="学位">
					<picker @change="bindPickerChangeSex" :value="index_sex" :range="array_sex">
					              <view class="picker">
					                {{array_sex[index_sex]}}
					              </view>
					    </picker>
				</u-form-item>
				<u-form-item label="学制">
					<picker @change="bindPickerChangeSex" :value="index_sex" :range="array_sex">
					              <view class="picker">
					                {{array_sex[index_sex]}}
					              </view>
					    </picker>
				</u-form-item>
				<u-form-item label="院系">
					<picker @change="bindPickerChangeSex" :value="index_sex" :range="array_sex">
					              <view class="picker">
					                {{array_sex[index_sex]}}
					              </view>
					    </picker>
				</u-form-item>
				<u-form-item label="专业" :label-width="auto"><u-input v-model="form.name" /></u-form-item>
				<u-form-item label="班级">
					<picker @change="bindPickerChangeSex" :value="index_sex" :range="array_sex">
					              <view class="picker">
					                {{array_sex[index_sex]}}
					              </view>
					    </picker>
				</u-form-item>
				<u-form-item label="学信网学籍（PDF）" :label-width="auto" label-position="top">
					<u-upload :auto-upload="false" custom-btn="true" :action="action" :file-list="fileList" width="120" height ="120" size-type="['compressed']" max-count="1">
						<template v-slot:addBtn >
							<image src="/static/info_4.png" style="width: 120rpx; height: 120rpx;"></image>
						</template>
					</u-upload>
				</u-form-item>
				
			</u-form>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				action: '33',
				fileList: [],
				fileList1: [],
				fileList2: [],
				defaultRegionCode:'440112',
				form:{
					date:'1990-01-01',
					region1: ['广东省', '广州市', '天河区'],
					region2: ['广东省', '广州市', '天河区'],
				},
				index_sex: 0,
				array_sex: ['男', '女'],	
				index_marry: 0,
				array_marry: ['未婚', '已婚'],	
				index_politic: 0,
				array_politic: ['群众', '团员', '党员'],	
			}
		},
		onLoad(option) {
			
		},
		onShow(){
		},
		methods: {	
			bindPickerChangeSex(e){
				this.index_sex= e.detail.value
			},
			bindPickerChangePolitic(e){
				this.index_politic= e.detail.value
			},
			bindPickerChangeMarry(e){
				this.index_marry= e.detail.value
			},
			handleGetRegion2(region){
				let array = []
			    array.push(region[0].name) 
				array.push(region[1].name) 
				array.push(region[2].name) 
				this.form.region2 = array
				
			},
			// 获取选择的地区
			handleGetRegion(region){
				let array = []
			    array.push(region[0].name) 
				array.push(region[1].name) 
				array.push(region[2].name) 
				this.form.region1 = array
				
			},
			bindDateChange(e){
				this.form.date=e.detail.value
				var year=this.date.substr(0,4);
				var month=this.date.substr(5,2);
				var day=this.date.substr(8,2);
			//	this.index = (parseInt(year)-1948)%12;
			//	console.log(this.getAstro(month,day))
			//	this.index_s = this.getAstro(month,day)
			},
			actionSheetCallback(index) {
				uni.hideKeyboard();
				this.form.sex_text = this.actionSheetList[index].text;
			},
		},
		
	}
</script>

<style scope>
	.picker{
		text-align: right;
	}
	input{
		text-align: right;
	}
	.form{
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
		border-radius: 32rpx;
		margin: 20rpx 0;
		padding: 15rpx;
	}
	.btn{
		width: 96rpx;
		height: 48rpx;
		background: #32467B;
		border-radius: 16rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 48rpx;
		text-align: center;
	}
	
page {
		background: #FDFDFD;
	}
	.tip{
		width: 70%;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #32467B;
	}
</style>
