<template>
	<view class="real-name">
		<u-form :model="form" ref="uForm" label-width='155'>
			<u-form-item label="入学时间">
				<picker mode="date" :value="form.admission_time" @change="bindDateChange">
					<view class="uni-input">{{form.admission_time}}</view>
				</picker>
				<!-- <u-input v-model="form.admission_time" placeholder="请输入联系电话" /> -->
			</u-form-item>
			<u-form-item label="专业">
				<u-input v-model="form.major" placeholder="请填写专业" />
			</u-form-item>
			<u-form-item label="硕士生导师">
				<u-input v-model="form.master_teacher_name" placeholder="请填写硕士生导师" />
			</u-form-item>
			<u-form-item label="硕士生单位">
				<u-input v-model="form.master_units" placeholder="请填写硕士生单位" />
			</u-form-item>
			<u-form-item label="博士生导师">
				<u-input v-model="form.doctor_teacher_name" placeholder="请填写博士生导师" />
			</u-form-item>
			<u-form-item label="博士生单位">
				<u-input v-model="form.doctor_units" placeholder="请填写博士生单位" />
			</u-form-item>

		</u-form>
		<button class="buttom" @click="save()">保存</button>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				form: {

				},
				politicsStatus: [{
						value: 0,
						label: "未知"
					},
					{
						value: 3,
						label: "积极分子"
					},
					{
						value: 4,
						label: "中共预备党员"
					},
					{
						value: 5,
						label: "中共党员"
					},
					{
						value: 6,
						label: "发展对象"
					}
				]
			}
		},
		onShow() {
			this.form = this.$store.state.vuex_user
			
		},
		methods: {
			
			bindDateChange(e){
				console.log(e.target.value)
				  this.form.admission_time= e.target.value
			},
			save() {
				this.$u.post('/page/update-people-info', this.form).then(res => {
					console.log(res, 'pppp')
					uni.showToast({
						title: res.message,
						icon: 'none'
					})
					this.$u.vuex('vuex_user',this.form);
					setTimeout(function() {
						uni.navigateBack()
					}, 1000)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.real-name {
		padding: 0 16px;
		padding-bottom: 40px;

		.buttom {
			width: 229px;
			height: 56px;
			line-height: 56px;
			background: #79573D;
			text-align: center;
			border-radius: 28px;
			margin: 0 auto;
			margin-top: 50px;
			font-size: 18px;
			font-family: PingFang SC;
			font-weight: bold;
			color: #fff;
			opacity: 1;
		}

	}
</style>
