<template>
	<view class="admin-jiazheng-page">
		<view class="icon-title-navBar-box">
			<view @click="goUpPage" class="nav-bar-icon"></view>
			<text class="nav-bar-title">家政人员</text>
		</view>
		<v-tabs v-model="current" :tabs="tabs" :scroll="false" @change="changeTab" field="name"
			class="admin-tab-box"></v-tabs>
		<gerenZiliao ref="gerenZiliao" @goNext="gerenziliaoNext" v-show="current ==0"></gerenZiliao>
		<qiuzhiXinxi ref="qiuzhiXinxi" @goUp="goUpQiuzhixinxi" @goNext="goNextQiuzhixinxi" v-show="current ==1">
		</qiuzhiXinxi>
		<zhaopianZiliao ref="zhaopianZiliao" @goUp="goUpZhaopianZiliao" @goNext="goNextZhaopianZiliao"
			v-show="current ==2"></zhaopianZiliao>
		<banzhengXinxi ref="banzhengXinxi" @goUp="goUpBanzhengXinxi" v-show="current ==3"></banzhengXinxi>
	</view>
</template>

<script>
	import {
		ref
	} from "vue";
	import banzhengXinxi from './banzhengXinxi.vue';
	import qiuzhiXinxi from './qiuzhiXinxi.vue';
	import zhaopianZiliao from './zhaopianZiliao.vue';
	import gerenZiliao from './gerenZiliao.vue';
	export default {
		data() {
			return {
				current: 2,
				//	tabs: ['个人资料', '求职信息', '照片资料', '办证信息']
				tabs: [{
						id: 1,
						name: '个人资料',
						disabled: false
					},
					{
						id: 2,
						name: '求职信息',
						disabled: true
					},
					{
						id: 3,
						name: '照片资料',
						disabled: true
					},
					{
						id: 4,
						name: '办证信息',
						disabled: true
					},

				],
				allData: {
					"birthday": "string",
					"gender": 0,
					"hujiDizhi": "string",
					"hunyin": 0,
					"icon": "string",
					"idcard": "string",
					"idcardUrl1": "string",
					"idcardUrl2": "string",
					"idtype": 0,
					"jiankangDate": "string",
					"jibiexinzi": "string",
					"jiguanShengId": 0,
					"jiguanShiId": 0,
					"jineng": "string",
					"jingli": "string",
					"jingyan": "string",
					"juzhuDizhi": "string",
					"kaozhengList": [{
						"canxunshijian": "string",
						"jgId": 0,
						"needKaoshi": false,
						"needKecheng": false,
						"shicaochengji": "string",
						"zongkeshi": "string",
						"zyId": 0,
						"zyLevel": 0
					}],
					"leixing": "string",
					"minzu": 0,
					"qiwangxinzi": "string",
					"realName": "string",
					"shenghuoUrls": "string",
					"shuxiang": 0,
					"tijianDate": "string",
					"tijianUrl": "string",
					"userId": 0,
					"userName": "string",
					"xingzuo": 0,
					"xingzuoFlag": false,
					"xueli": 0,
					"zhengshuUrls": "string",
					"zhuangtai": 0
				},
				gerenziliaoObj: {},
				qiuzhixinxiObj: {},
				zhaopianziliaoObj: {},
				banzhengxinxiObj: {},
			}
		},
		components: {
			banzhengXinxi,
			qiuzhiXinxi,
			gerenZiliao,
			zhaopianZiliao,
		},
		methods: {
			changeTab(data) {
				console.log('data', data);
			},
			goUpPage() {
				uni.redirectTo({
					url: `/pages/admin/Jiazheng/jiazhengUserInfo`
				})
			},
			gerenziliaoNext(data, num) {
				console.log('data', data);
				console.log('num', num);
				this.gerenziliaoObj.userName = data.userName
				this.gerenziliaoObj.realName = data.realName
				this.gerenziliaoObj.idCard = data.idCard
				this.gerenziliaoObj.jiguanShengId = data.jiguanObj.jiguanShengId
				this.gerenziliaoObj.jiguanShiId = data.jiguanObj.jiguanShiId
				this.gerenziliaoObj.juzhuDizhi = data.juzhuDizhi
				this.gerenziliaoObj.minzu = data.minzu.id
				this.gerenziliaoObj.gender = data.gender
				this.gerenziliaoObj.xueli = data.xueli.id
				this.gerenziliaoObj.hunyin = data.hunyin.id
				this.gerenziliaoObj.hujiDizhi = data.hujiDizhi
				this.gerenziliaoObj.xingzuo = data.xingzuo.id
				this.gerenziliaoObj.shuxiang = data.shuxiang.id
				this.gerenziliaoObj.xingzuoFlag = data.xingzuoFlag
				this.current = num + 1
				this.tabs = this.tabs.map((item, i) => {
					if (i == this.current) item.disabled = false
					return item
				})
				console.log('this.gerenziliaoObj', this.gerenziliaoObj);
			},
			goUpQiuzhixinxi(data, num) {
				this.current = num - 1
			},
			goNextQiuzhixinxi(data, num) {
				this.qiuzhixinxiObj.leixing = data.leixing
				this.qiuzhixinxiObj.jingyan = data.jingyan
				this.qiuzhixinxiObj.jineng = data.jineng
				this.qiuzhixinxiObj.zhuangtai = data.zhuangtai
				this.qiuzhixinxiObj.jibiexinzi = data.jibiexinzi
				this.qiuzhixinxiObj.qiwangxinzi = data.qiwangxinzi
				this.qiuzhixinxiObj.jingli = data.jingli
				this.current = num + 1
				this.tabs = this.tabs.map((item, i) => {
					if (i == this.current) item.disabled = false
					return item
				})
				console.log('this.qiuzhixinxiObj', this.qiuzhixinxiObj);
			},
			goUpZhaopianZiliao(data, num) {
				this.current = num - 1
			},
			goNextZhaopianZiliao(data, num) {
				this.current = num + 1
				this.tabs = this.tabs.map((item, i) => {
					if (i == this.current) item.disabled = false
					return item
				})
			},
			goUpBanzhengXinxi(data, num) {
				this.current = num - 1
			}
		}
	}
</script>