<template>
	<!-- 完善信息最大盒子 -->
	<view class="modify_revise">
		<view class="top">
			<u-steps :list="numList" mode="number" :current="currentindex"></u-steps>
		</view>

		<view class="upidcard" v-if="currentindex==0">
			<!-- <view class="tip">
				<image src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/63a86cfe9b50410bbecd92bfa4e6c4ff4fd91n2wyx.png" mode=""></image>
				拍摄或上传身份证原件照片，请确保照片的真实性！
			</view> -->
			<view class="uploadbox">
				<view class="box_tip">
					拍摄身份证要求：
				</view>
				<view class="uptip">
					<view class="uptipli">大陆公民持有的本人有效二代身份证；</view>
					<view class="uptipli">拍摄时确保身份证<span style="color:#E83535 ;"> 边框完整，字迹清晰，亮度均匀</span></view>
				</view>
				<view class="upimg">
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/13bcc3bd8a1b420eac50db5b904859bdut3t4t62rx.png"
							alt="" />
						标准
					</view>
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/b15f084867574107b4c42091f1a7cb002y24kps8d3.png"
							alt="" />
						边框缺失
					</view>
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/dfb63655943e4e0b9da52352ab3bf551hrluul9s38.png"
							alt="" />
						照片模糊
					</view>
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/080f4efbd487455ea11d556c882dfef5az9v29iml4.png"
							alt="" />
						闪光强烈
					</view>
				</view>
			</view>
			<view class="uploadbox">
				<view class="box_tip">
					请拍摄身份证正面与反面照片
				</view>
				<view class="img_boxs">
					<view class="img_box">
						<image :src="upLoadPositiveImg" @click.stop='uploadpic'>
						</image>
						<view class="text">
							上传身份证人像面
						</view>
					</view>
					<view class="img_box">
						<image :src="upLoadReverseImg" @click.stop='uploadpics'>
						</image>
						<view class="text">
							上传身份证国徽面
						</view>
					</view>
				</view>
			</view>
			<view class="uploadbox" style="box-shadow: 0rpx 0rpx 0rpx 0rpx rgba(0,0,0,0.08);">
				<view class="box_tip">
					请确认你的身份信息
				</view>
				<view class="iptbox">
					<view class="iptli">
						<view class="left">
							姓名
						</view>
						<view class="right " v-if="realName==''">
							待自动录入
						</view>
						<view class="right act1" v-if="realName!=''">
							{{realName}}
						</view>
					</view>
					<view class="iptli">
						<view class="left">
							身份证号
						</view>
						<view class="right " v-if="idcard==''">
							待自动录入
						</view>
						<view class="right act1" v-if="idcard!=''">
							{{idcard}}
						</view>
					</view>
					<view class="iptli">
						<view class="left">
							有效期至
						</view>
						<view class="right " v-if="timelimit==''">
							待自动录入
						</view>
						<view class=" right act1" v-if="timelimit!=''">
							{{timelimit}}
						</view>
					</view>
				</view>
			</view>
			<view class="btnbox" @click="testIdcard()">
				<view class="btn">
					下一步
				</view>
			</view>
		</view>
		<view class="upidcard" v-if="currentindex==1">
			<view class="tip">
				<image
					src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/63a86cfe9b50410bbecd92bfa4e6c4ff4fd91n2wyx.png"
					mode=""></image>
				拍摄或上传身份证原件照片，请确保照片的真实性！
			</view>
			<view class="uploadbox" style="box-shadow: 0rpx 0rpx 0rpx 0rpx rgba(0,0,0,0.08);">
				<view class="upself">
					<view class="box_tip">
						请拍摄手持身份证照片
					</view>
					<image :src="handIdCard " @click.stop='uploadpicss'>
					</image>
				</view>
				<view class="box_tip">
					拍摄手持身份证要求：
				</view>

				<view class="uptip">
					<view class="uptipli">拍摄时，手持本人身份证，将持证的手臂和上半身整个拍进照片，头部和肩部要端正，头发不得遮挡脸部或造成阴影，<span
							style="color:#E83535 ;"> 要露出五官；</span></view>
					<view class="uptipli">确保身份证上的<span style="color:#E83535 ;"> 所有信息清晰可见、完整</span>（没有被遮挡或者被手指捏住）</view>
				</view>
				<view class="box_tip" style="margin-top: 26rpx;">
					如下方例图所示
				</view>

				<view class="showimg">
					<image
						src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/9d910a1450134aba9b613efc570f654eldlose0vf0.png"
						mode=""></image>
				</view>

			</view>

			<view class="btnbox" @click="testhandid()">
				<view class="btn">
					下一步
				</view>
			</view>
		</view>
		<view class="infopage" v-if="currentindex==2">
			<view class="info_box">
				<view class="info_li">
					<view class="text">
						收货邮箱
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="emitext"
							 placeholder="请输入常用邮箱(必填)" />
					</view>
				</view>
				<view class="info_li">
					<view class="text">
						手机号
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="tel"
							 placeholder="请输入本人手机号(必填)" />
					</view>
				</view>
				<view class="info_li" style="border: none;">
					<view class="tips">
						为保障您的权益，订单与物流信息将发送至您的邮箱
					</view>
				</view>
			</view>
			<view class="info_box">
				<view class="info_li">
					<view class="text">
						工作单位
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="company"
							 placeholder="请输入您的工作公司" />
					</view>
				</view>
				<view class="info_li">
					<view class="text">
						工资
					</view>
					<view class="input" style="width: 60%;">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="salary"
							 placeholder="请输入您的月收入（必填，可填无）" />
					</view>
				</view>
				<view class="info_li" style="border: none;">
					<view class="text">
						五险一金
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="insurance"
							 placeholder="请输入有 无（选填）" />
					</view>
				</view>

			</view>
			<view class="info_box">
				<view class="info_li">
					<view class="text">
						紧急联系人
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="lxrmoren"
							@click="openPopup('bottom')" placeholder="请选择您与联系人1的关系" />
					</view>
				</view>
				<view class="info_li">
					<view class="text">
						联系人姓名
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="realNameone"
							placeholder="请输入联系人1姓名" />
					</view>
				</view>
				<view class="info_li" style="border: none;">
					<view class="text">
						联系人手机号
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="telone"
							 placeholder="请输入联系人1手机号" />
					</view>
				</view>

			</view>
			<view class="info_box">
				<view class="info_li">
					<view class="text">
						紧急联系人
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="lxrmorens"
							@click="openPopups('bottoms')" placeholder="请选择您与联系人2的关系" />
					</view>
				</view>
				<view class="info_li">
					<view class="text">
						联系人姓名
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="realNametwo"
							 placeholder="请输入联系人2姓名" />
					</view>
				</view>
				<view class="info_li" style="border: none;">
					<view class="text">
						联系人手机号
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="teltwo"
							placeholder="请输入联系人2手机号" />
					</view>
				</view>

			</view>

			<view class="info_box">
				<view class="info_li">
					<view class="text">
						紧急联系人
					</view>
					<view class="input" @click.stop="openPopupadd('bottomadd')">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="lxrmorenss" 
							 placeholder="请选择您与联系人3的关系" />
					</view>
				</view>
				<view class="info_li">
					<view class="text">
						联系人姓名
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="realNametre"
							 placeholder="请输入联系人3姓名" />
					</view>
				</view>
				<view class="info_li" style="border: none;">
					<view class="text">
						联系人手机号
					</view>
					<view class="input">
						<input type="text" placeholder-style='color: #A6A6A6;font-size: 26rpx;' v-model="telthre"
							 placeholder="请输入联系人3手机号" />
					</view>
				</view>

			</view>
			<view class="btnbox" @click="btnclick()">
				<view class="btn">
					提交
				</view>
			</view>
		</view>
		<view class="rzpage" v-if="currentindex==3">
			<view class="topbox">
				<view class="text" style="font-weight: 500;font-size: 40rpx;">
					为保障账户安全
				</view>
				<view class="text">
					需采集你的人脸信息已核实身份
				</view>
				<image
					src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/545ad1f3f9e94c288167a4a5a78b125fyfrxub448y.png"
					mode=""></image>
				<view class="text">
					请保持正脸
				</view>
				<view class="text">
					根据指示完成人脸认证
				</view>

			</view>
			<view class="uploadbox">
				<view class="box_tip">
					拍摄须知：
				</view>

				<view class="upimg">
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/3d2e864c64d943ac98f2a44b526511ed9zge43hq14.png"
							alt="" />
						<view class="botimg">
							<image
								src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/183431357c3e4cd49c7ddc63cdc2e7d7y67xajv85d.png"
								mode=""></image>
							标准
						</view>

					</view>
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/cea2e31224bf4940b058a4ccfedb64875yp2sw7541.png"
							alt="" />
						<view class="botimg">
							<image
								src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/64ebffbb0e514be7887531285f8e4e31cc3qfx6hbq.png"
								mode=""></image>
							标准
						</view>

					</view>
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/802ec15387fe445582eb63875c5eca90hwo9deupr4.png"
							alt="" />
						<view class="botimg">
							<image
								src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/64ebffbb0e514be7887531285f8e4e31cc3qfx6hbq.png"
								mode=""></image>
							标准
						</view>
					</view>
					<view class="imgcont">
						<image
							src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/9f81e185c8364beeb40e84f59e69af071k8dsd7km8.png"
							alt="" />
						<view class="botimg">
							<image
								src="https://api.yruibao.com/crmebimage/public/content/2024/03/12/64ebffbb0e514be7887531285f8e4e31cc3qfx6hbq.png"
								mode=""></image>
							标准
						</view>
					</view>
				</view>
				<view class="btnbox">
					<view class="btn">
						下一步
					</view>
				</view>
			</view>
		</view>
		<liu-popup type="bottom" ref="bottom" class="boxlist" v-show="personflag">
			<view class="lxrlist">
				<view @click="btnlxr(item,index)" v-for="(item,index) in lxrarr" :key="index">{{item}}</view>
			</view>
		</liu-popup>
		<!-- 多个联系人弹出框 -->
		<liu-popup type="bottom" ref="bottoms" class="boxlist" v-show="personflaga">
			<view class="lxrlist">
				<view @click="btnlxrs(item,index)" v-for="(item,index) in lxrarr" :key="index">{{item}}</view>
			</view>
		</liu-popup>
		<!-- 多次添加 -->
		<liu-popup type="bottom" ref="bottomadd" class="boxlist" v-show="personflagb">
			<view class="lxrlist">
				<view @click="btnlxradd(item,index)" v-for="(item,index) in lxrarr" :key="index">{{item}}</view>
			</view>
		</liu-popup>
	</view>
</template>

<script>
	import {
		getInformation,getocr
	} from '@/api/api.js'
	// import config from '@/config/app.js'
	// const baseUrl = config.domain
	export default {
		data() {
			return {

				currentindex: 0,
				numList: [{
					name: '实名认证'
				}, {
					name: '手持拍摄'
				}, {
					name: '个人信息'
				}, {
					name: '人脸识别'
				}, ],
				positiveImg: '', //自己图片路径
				upLoadPositiveImg: 'https://api.yruibao.com/crmebimage/public/content/2024/03/12/dfca9b6e35e641b0be82dbddc7b244f18eixm72az5.png', // 反面身份证
				reverseImg: '', //自己图片路径
				upLoadReverseImg: 'https://api.yruibao.com/crmebimage/public/content/2024/03/12/81af97268d7c4687997f043ec46e038b3g6hzhanty.png',
				handIdCard: 'https://api.yruibao.com/crmebimage/public/content/2024/03/12/7367213efc6f4676be58a4f034fec6b50e8s80rddd.png',
				baidu_token: ' ', //百度token
				realName: '', //真实姓名,
				idcard: '', //身份证号,
				tel: '17795402553', //手机号
				timelimit:'',
				realNameone: '',
				realNametwo: '',

				realNametre: '',
				telone: '',
				teltwo: '',
				telthre: '',
				lxrarr: ['父母', '子女', '兄弟', '姐妹', '亲戚', '朋友', '配偶', '同事'],
				lxrmoren: '',
				lxrmorens: '',
				lxrmorenss: '',
				emitext: '2622874537@qq.com', //邮箱
				shenfenpic: '', //身份证正面的base64格式
				shenfenpics: '', //身份证反面的base64格式
				flaglxr: false,
				flaglxrs: false,
				flags: true,
				lxrmorenadd: '请选择您与联系人的关系   ',
				lxrmorenadds: '请选择您与联系人的关系',
				company :'穿特',//工作单位
				salary:'5000',//薪水
				teladd: '',
				insurance:'有',//五险一金
				teladds: '',
				teladdss: '',
				realNameadd: '',
				realNameadds: '',
				flaga: false,
				personflag: false,
				personflaga: false,
				personflagb: false,
				identification: {},
				lxindex: '', //紧急联系人关系
				lxindexs: '',
				lxindexss: '',
				isup:false,
				ocrData:{}
			}
		},
		onLoad(option) {


		},
		methods: {
			// ocr识别
			testIdcard(){
				if(this.upLoadPositiveImg=='https://api.yruibao.com/crmebimage/public/content/2024/03/12/dfca9b6e35e641b0be82dbddc7b244f18eixm72az5.png'||this.upLoadPositiveImg==''){
					return this.$util.Tips({
						title: '请上传身份证人像面'
					});
				}else if(this.upLoadReverseImg=='https://api.yruibao.com/crmebimage/public/content/2024/03/12/81af97268d7c4687997f043ec46e038b3g6hzhanty.png'||this.upLoadReverseImg==''){
					return this.$util.Tips({
						title: '请上传身份证国徽面'
					});
				}else if(this.isup==false){
					return this.$util.Tips({
						title: '识别未通过'
					});
				}else{
					this.currentindex=1
				}
			},
			testhandid(){
				if(this.handIdCard=='https://api.yruibao.com/crmebimage/public/content/2024/03/12/7367213efc6f4676be58a4f034fec6b50e8s80rddd.png'){
					return this.$util.Tips({
						title: '请上传手持身份证照片'
					});
				}else if(this.handIdCard==''){
					return this.$util.Tips({
						title: '请上传手持身份证照片'
					});
				}else{
					this.currentindex=2
					
				}
			},
			getocrinfo(){
				if(this.upLoadPositiveImg=='https://api.yruibao.com/crmebimage/public/content/2024/03/12/dfca9b6e35e641b0be82dbddc7b244f18eixm72az5.png'||this.upLoadPositiveImg==''){
					
				}else if(this.upLoadReverseImg=='https://api.yruibao.com/crmebimage/public/content/2024/03/12/81af97268d7c4687997f043ec46e038b3g6hzhanty.png'||this.upLoadReverseImg==''){
					
				}else{
					// getocr()
					let data = {
						positiveImg: this.upLoadPositiveImg,
						reverseImg:this.upLoadReverseImg
					}
					uni.showLoading({
						title: '识别中'
					});
					getocr(data).then(res=>{
						console.log(res);
						
						console.log(this.realName);
						if(res.data.result_msg=='识别结果错误'){
							return that.$util.Tips({
								title: '识别结果错误,请重新上传'
							});
							this.isup=false
						}else{
							this.realName=res.data.result.name
							this.idcard=res.data.result.number
							this.timelimit=res.data.result.timelimit
							this.ocrData=res.data.result
							this.isup=true
						}
						uni.hideLoading();
					})
				}
			},
			// 判断姓名
			realNameinp() {
				let that = this
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/
				if (this.realName == '') {
					return that.$util.Tips({
						title: '姓名不能为空'
					});
				} else if (namepatten.test(this.realName)) {

				} else {
					return that.$util.Tips({
						title: '请填写正确的姓名'
					});
				}
			},
			realNameinptwo() {
				let that = this
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/
				if (this.realNametwo == '') {
					return that.$util.Tips({
						title: '联系人姓名不能为空'
					});
				} else if (namepatten.test(this.realNametwo)) {

				} else {
					return that.$util.Tips({
						title: '请填写正确的联系人姓名'
					});
				}
			},
			realNameinptwos() {
				let that = this
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/
				if (this.realNametre == '') {
					return that.$util.Tips({
						title: '联系人姓名不能为空'
					});
				} else if (namepatten.test(this.realNametre)) {

				} else {
					return that.$util.Tips({
						title: '请填写正确的联系人姓名'
					});
				}
			},
			realNameinpone() {
				let that = this
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/
				if (this.realNameone == '') {
					return that.$util.Tips({
						title: '联系人姓名不能为空'
					});
				} else if (namepatten.test(this.realNameone)) {

				} else {
					return that.$util.Tips({
						title: '请填写正确的联系人姓名'
					});
				}
			},
			telinpadd() {
				let photopatten = /^1[3456789]\d{9}$/
				if (this.teladd == '') {
					return this.$util.Tips({
						title: '手机号不能为空'
					});
				} else if (photopatten.test(this.teladd)) {

				} else {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					});
				}
			},
			realNameinpadd() {
				let that = this
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/
				if (this.realNameadd == '') {
					return that.$util.Tips({
						title: '姓名不能为空'
					});
				} else if (namepatten.test(this.realNameadd)) {

				} else {
					return that.$util.Tips({
						title: '请填写正确的姓名'
					});
				}
			},
			// 4
			realNameinpadds() {
				let that = this
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/
				if (this.realNameadds == '') {
					return that.$util.Tips({
						title: '姓名不能为空'
					});
				} else if (namepatten.test(this.realNameadds)) {

				} else {
					return that.$util.Tips({
						title: '请填写正确的姓名'
					});
				}
			},
			telinpadds() {
				let photopatten = /^1[3456789]\d{9}$/
				if (this.teladds == '') {
					return this.$util.Tips({
						title: '手机号不能为空'
					});
				} else if (photopatten.test(this.teladds)) {

				} else {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					});
				}
			},

			// 判断手机号
			telinp() {
				let photopatten = /^1[3456789]\d{9}$/
				if (this.tel == '') {
					return this.$util.Tips({
						title: '手机号不能为空'
					});
				} else if (photopatten.test(this.tel)) {

				} else {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					});
				}
			},
			telinpone() {
				let photopatten = /^1[3456789]\d{9}$/
				if (this.telone == '') {
					return this.$util.Tips({
						title: '联系人手机号不能为空'
					});
				} else if (photopatten.test(this.telone)) {

				} else {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					});
				}
			},
			telinptwo() {
				let photopatten = /^1[3456789]\d{9}$/
				if (this.teltwo == '') {
					return this.$util.Tips({
						title: '联系人手机号不能为空'
					});
				} else if (photopatten.test(this.teltwo)) {

				} else {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					});
				}
			},
			telinptre() {
				let photopatten = /^1[3456789]\d{9}$/
				if (this.telthre == '') {
					return this.$util.Tips({
						title: '联系人手机号不能为空'
					});
				} else if (photopatten.test(this.telthre)) {

				} else {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					});
				}
			},

			// 点击显示联系人关系
			openPopup(e) {
				this.$refs[e].open();
				this.personflag = true
			},
			openPopups(e) {
				this.$refs[e].open();
				this.personflaga = true
			},
			openPopupadd(e) {
				this.$refs[e].open();
				this.personflagb = true
			},

			// 选择联系人关系
			btnlxr(val, index) {
				this.lxindex = index
				this.lxrmoren = val
				this.personflag = false
			},
			btnlxrs(val, index) {
				this.lxindexs = index
				this.lxrmorens = val
				this.personflaga = false
			},
			btnlxradd(val, index) {
				this.lxindexss = index
				this.lxrmorenss = val
				this.personflagb = false
			},

			// 点击确定调用判断
			btnclick() {
				let namepatten = /^[\u4e00-\u9fa5a-zA-Z\s\-]+$/ //姓名正则
				let result = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dX]$/ //身份证正则
				let photopatten = /^1[3456789]\d{9}$/ //手机号正则
				let aqq = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/ //邮箱正则
				// if (this.upLoadPositiveImg ==
				// 	'https://tse1-mm.cn.bing.net/th/id/OIP-C.zrlmSg7klHyl3uDBB-nG3wAAAA?w=280&h=170&c=7&r=0&o=5&pid=1.7' ||
				// 	this.upLoadReverseImg ==
				// 	'https://ha.hainanu.edu.cn/__local/2/05/F5/E22F199DEFB4C9D81BED08639F8_1DB89F92_17BD.jpg') {
				// 	return this.$util.Tips({
				// 		title: '身份证正反面不能为空'
				// 	});
				// } else if (this.handIdCard == null) {
				// 	return this.$util.Tips({
				// 		title: '手持身份证正面不能为空'
				// 	})
				// } else 	if (this.realName == '') {
				// 	return this.$util.Tips({
				// 		title: '姓名不能为空'
				// 	});
				// } else if (!namepatten.test(this.realName)) {
				// 	return this.$util.Tips({
				// 		title: '请填写正确的姓名'
				// 	});
				// }else if (this.idcard == '') {
				// 	return this.$util.Tips({
				// 		title: '身份证不能为空'
				// 	})
				// }else if (this.idcard == '') {
				// 	return this.$util.Tips({
				// 		title: '身份证不能为空'
				// 	});
				// } else if (!result.test(this.idcard)) {
				// 	return this.$util.Tips({
				// 		title: '请填写正确的身份证'
				// 	});
				// } 
				

				console.log(this.handIdCard, '1111')
				 if (this.emitext == '') {
					return this.$util.Tips({
						title: '常用邮箱不能为空'
					});
				} else if (!aqq.test(this.emitext)) {
					return this.$util.Tips({
						title: '请填写正确的邮箱'
					});
				} else if (this.tel == '') {
					return this.$util.Tips({
						title: '手机号不能为空'
					});
				} else if (!photopatten.test(this.tel)) {
					return this.$util.Tips({
						title: '请填写正确的手机号'
					})
				} else if (this.company == '') {
					return this.$util.Tips({
						title: '请填写您的工作单位'
					})
				} else if (this.salary == '') {
					return this.$util.Tips({
						title: '请填写您的薪水'
					})
				}  else if (this.insurance == '') {
					return this.$util.Tips({
						title: '请填写您的五险一金'
					})
				}else if (this.lxrmoren == '') {
					return this.$util.Tips({
						title: '请选择联系人1与您的关系'
					})
				}  else if (this.realNameone == '') {
					return this.$util.Tips({
						title: '联系人1姓名不能为空'
					});
				} else if (!namepatten.test(this.realNameone)) {
					return this.$util.Tips({
						title: '请填写正确的联系人1姓名'
					});
				} else if (this.telone == '') {
					return this.$util.Tips({
						title: '联系人1手机号不能为空'
					});
				} else if (!photopatten.test(this.telone)) {
					return this.$util.Tips({
						title: '请填写正确的联系人1手机号'
					})
				}else if (this.lxrmorens == '') {
					return this.$util.Tips({
						title: '请选择联系人2与您的关系'
					})
				} else if (this.realNametwo == '') {
					return this.$util.Tips({
						title: '联系人2姓名不能为空'
					});
				} else if (!namepatten.test(this.realNametwo)) {
					return this.$util.Tips({
						title: '请填写正确的联系人2姓名'
					});
				} else if (this.teltwo == '') {
					return this.$util.Tips({
						title: '联系人2手机号不能为空'
					});
				} else if (!photopatten.test(this.teltwo)) {
					return this.$util.Tips({
						title: '请填写正确的联系人2手机号'
					});
				} else if (this.lxrmorenss == '') {
					return this.$util.Tips({
						title: '请选择联系人3与您的关系'
					})
				} else if (this.realNametre == '') {
					return this.$util.Tips({
						title: '联系人3姓名不能为空'
					});
				} else if (!namepatten.test(this.realNametre)) {
					return this.$util.Tips({
						title: '请填写正确的联系人3姓名'
					});
				} else if (this.telthre == '') {
					return this.$util.Tips({
						title: '联系人3手机号不能为空'
					});
				} else if (!photopatten.test(this.telthre)) {
					return this.$util.Tips({
						title: '请填写正确的联系人3手机号'
					});
				} else if (this.flaglxr == true) {
				let data = {
					realName: this.realName,
					idCardNumber: this.idcard,
					phoneNumber: this.tel,
					idCardFrontPhoto: this.upLoadPositiveImg,
					idCardBackPhoto: this.upLoadReverseImg,
					email: this.emitext,
					commonPhoneNumber: this.tel,
					uid: this.$store.getters.uid,
					handIdCard: this.handIdCard,
					company:this.company ,
					salary:this.salary ,
					insurance:this.insurance,
					ocrData:this.ocrData,
					timelimit:this.timelimit,
					userEmergencyContactsList: [{
							relationship: this.lxindex, //与紧急联系人关系
							contactName: this.realNameone, //紧急联系人姓名
							phoneNumber: this.telone, //紧急联系人手机号
						},
						{
							relationship: this.lxindexs, //与紧急联系人关系
							contactName: this.realNametwo, //紧急联系人姓名
							phoneNumber: this.teltwo, //紧急联系人手机号
						},{
							relationship: this.lxindexss, //与紧急联系人关系
							contactName: this.realNametre, //紧急联系人姓名
							phoneNumber: this.telthre, //紧急联系人手机号
						}
					]
				}
					// getInformation(data).then(res => {
					// 	let data = res.data
					// 	console.log(res,'resres');
					// 	// uni.navigateBack()
					// })
					getInformation(data).then(res => {
						let data = res.data;
						console.log(res, 'rerererere');
						if (res.code == 500) {
							console.log('发生了500错误');
							this.$util.Tips({
								title: res.message
							});
							// 在这里进行处理，例如记录日志、展示错误信息等
						} else {
							// 处理其他情况
							uni.navigateBack()
						}
					}).catch(error => {
						this.$util.Tips({
							title: error
						});
					});
					// if (this.realNameadd == '') {
					// 	return this.$util.Tips({
					// 		title: '紧急联系人姓名不能为空'
					// 	});
					// } else if (!namepatten.test(this.realNameadd)) {
					// 	return this.$util.Tips({
					// 		title: '请输入紧急联系人正确姓名'
					// 	});
					// } else if (this.teladd == '') {
					// 	return this.$util.Tips({
					// 		title: '紧急联系人手机号不能为空'
					// 	});
					// } else if (!photopatten.test(this.teladd)) {
					// 	return this.$util.Tips({
					// 		title: '请输入正确紧急联系人手机号'
					// 	});
					// } else if (this.lxrmorenadd == '请选择您与联系人的关系   ') {
					// 	return this.$util.Tips({
					// 		title: '请选择紧急联系人与您的关系'
					// 	});
					// } else {
						
					// }
				} else {
					// 请求保存个人信息
					let data = {
						realName: this.realName,
						idCardNumber: this.idcard,
						phoneNumber: this.tel,
						idCardFrontPhoto: this.upLoadPositiveImg,
						idCardBackPhoto: this.upLoadReverseImg,
						email: this.emitext,
						commonPhoneNumber: this.tel,
						uid: this.$store.getters.uid,
						handIdCard: this.handIdCard,
						company:this.company ,
						salary:this.salary ,
						insurance:this.insurance,
						authority:this.ocrData.authority,
						day:this.ocrData.day,
						month:this.ocrData.month,
						nation:this.ocrData.nation,
						sex:this.ocrData.sex,
						sex:this.ocrData.sex,
						year:this.ocrData.year,
						timelimit:this.timelimit,
						userEmergencyContactsList: [{
								relationship: this.lxindex, //与紧急联系人关系
								contactName: this.realNameone, //紧急联系人姓名
								phoneNumber: this.telone, //紧急联系人手机号
							},
							{
								relationship: this.lxindexs, //与紧急联系人关系
								contactName: this.realNametwo, //紧急联系人姓名
								phoneNumber: this.teltwo, //紧急联系人手机号
							},{
								relationship: this.lxindexss, //与紧急联系人关系
								contactName: this.realNametre, //紧急联系人姓名
								phoneNumber: this.telthre, //紧急联系人手机号
							}
						]
					}
					console.log(data,'dadadadada');
					// getInformation(data).then(res => {
					// 	let data = res.data;
					// 	console.log(res, 'rerererere');
					// 	if (res.code == 500) {
					// 		console.log('发生了500错误');
					// 		this.$util.Tips({
					// 			title: '输入的身份证、手机号、姓名不匹配，请重新输入'
					// 		});
					// 		// 在这里进行处理，例如记录日志、展示错误信息等
					// 	} else {
					// 		// 处理其他情况
					// 		uni.navigateBack()
					// 	}
					// }).catch(error => {
					// 	this.$util.Tips({
					// 		title: '输入的身份证、手机号、姓名不匹配，请重新输入'
					// 	});
					// });
					// getInformation(data)
					// .then(res => {
					// 	let data = res.data
					// 	console.log(res,'resres');
					// })
					// .catch(res => {

					// 	this.$util.Tips({
					// 		title: res
					// 	});
					// });
				}
			},


			// 点击继续添加联系人
			btnadd() {
				this.flaglxr = true
				this.flags = false
				this.flaga = true
			},
			// 点击继续添加联系人
			btnadds() {
				this.flaga = false
				this.flaglxrs = true
			},



			uploadpic: function() {
				let that = this;
				that.$util.uploadImageOne({
					url: 'upload/image',
					name: 'multipart',
					model: 'user',
					pid: 7
				}, function(res) {
					that.upLoadPositiveImg = res.data.url;
					that.getocrinfo()
					// console.log(that.upLoadPositiveImg)
				});
			},

			uploadpics: function() {
				let that = this;
				that.$util.uploadImageOne({
					url: 'upload/image',
					name: 'multipart',
					model: 'user',
					pid: 7
				}, function(res) {
					that.upLoadReverseImg = res.data.url;
					that.getocrinfo()
				});
			},
			uploadpicss: function() {
				let that = this;
				that.$util.uploadImageOne({
					url: 'upload/image',
					name: 'multipart',
					model: 'user',
					pid: 7
				}, function(res) {
					that.handIdCard = res.data.url;
				});
			},

		}
	}
</script>

<style lang="less">
	page {
		background: #FFFFFF !important;
	}

	.lxrlist {
		width: 100%;
		padding: 20rpx 30rpx !important;
		box-sizing: border-box;
		color: gray;

		view:hover {
			background-color: aqua;
			color: #000;
			font-size: 14px;
			font-weight: 700;
		}

		view {
			height: 60rpx;
			line-height: 60rpx;
			text-align: center;
			border-bottom: 1px solid #ccc;
		}
	}

	.modify_revise {
		width: 100%;
		height: 100%;
		background: #FFFFFF;
		// padding: 20rpx;
		box-sizing: border-box;
		font-size: 12px !important;

		.rzpage {
			.btnbox {
				margin-top: 100rpx;
				width: 100%;
				display: flex;
				justify-content: center;

				.btn {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 500rpx;
					height: 82rpx;
					background: #409EFF;
					border-radius: 10rpx 10rpx 10rpx 10rpx;

					font-weight: 500;
					font-size: 32rpx;
					color: #FFFFFF;
					line-height: 44rpx;
				}
			}

			.topbox {
				padding-bottom: 20rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: center;
				width: 750rpx;

				background: #FFFFFF;
				box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(0, 0, 0, 0.16);
				border-radius: 0rpx 0rpx 0rpx 0rpx;

				.text {
					margin-top: 24rpx;
					width: 100%;
					text-align: center;
					font-weight: 400;
					font-size: 28rpx;
					color: #333333;
					line-height: 38rpx;
				}

				image {
					width: 374rpx;
					height: 376rpx;
				}
			}

			.uploadbox {
				padding: 0 46rpx;
				margin-top: 66rpx;
				width: 750rpx;
				padding-bottom: 20rpx;
				background: #FFFFFF;

				// box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
				.box_tip {
					width: 100%;
					font-weight: 600;
					font-size: 32rpx;
					color: #333333;
				}

				border-radius: 0rpx 0rpx 0rpx 0rpx;

				.upimg {
					margin-top: 30rpx;
					display: flex;
					flex-wrap: nowrap;
					justify-content: space-between;

					.imgcont {
						width: 132rpx;
						display: flex;
						flex-wrap: wrap;
						justify-content: center;


						image {
							width: 132rpx;
							height: 78rpx;
						}

						.botimg {
							margin-top: 28rpx;
							display: flex;
							flex-wrap: nowrap;
							align-items: center;
							font-weight: 400;
							font-size: 20rpx;
							color: #A19C9C;
							line-height: 28rpx;

							image {
								margin-right: 8rpx;
								width: 25.14rpx;
								height: 25.25rpx;
							}
						}
					}

				}
			}
		}

		.infopage {
			.btnbox {
				margin-top: 50rpx;
				width: 100%;
				display: flex;
				justify-content: center;

				.btn {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 500rpx;
					height: 82rpx;
					background: #409EFF;
					border-radius: 10rpx 10rpx 10rpx 10rpx;

					font-weight: 500;
					font-size: 32rpx;
					color: #FFFFFF;
					line-height: 44rpx;
				}
			}

			.info_box {
				margin-bottom: 24rpx;
				display: flex;
				flex-wrap: wrap;
				width: 748rpx;
				padding: 0 52rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(0, 0, 0, 0.16);

				.info_li {
					width: 100%;
					height: 80rpx;

					display: flex;
					align-items: center;
					flex-wrap: nowrap;
					border-bottom: 2rpx solid #F0F0F0;

					.text {
						margin-right: 56rpx;
						width: 154rpx;
						font-weight: 400;
						font-size: 26rpx;
						color: #212529;
						line-height: 36rpx;
					}

					.tips {
						font-weight: 400;
						font-size: 22rpx;
						color: #808080;
					}

					.input {}
				}
			}
		}

		.top {
			padding: 20rpx;
		}

		.upidcard {

			.btnbox {
				margin-top: 50rpx;
				width: 100%;
				display: flex;
				justify-content: center;

				.btn {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 500rpx;
					height: 82rpx;
					background: #409EFF;
					border-radius: 10rpx 10rpx 10rpx 10rpx;

					font-weight: 500;
					font-size: 32rpx;
					color: #FFFFFF;
					line-height: 44rpx;
				}
			}

			.tip {
				display: flex;
				padding-left: 40rpx;
				align-items: center;
				width: 750rpx;
				height: 64rpx;
				background: #FFEBEB;
				border-radius: 0rpx 0rpx 0rpx 0rpx;

				font-weight: 400;
				font-size: 28rpx;
				color: #EB8989;

				image {
					margin-right: 6rpx;
					width: 40rpx;
					height: 40rpx;
				}
			}

			.uploadbox {
				padding: 0 46rpx;
				margin-top: 66rpx;
				width: 750rpx;
				padding-bottom: 20rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
				border-radius: 0rpx 0rpx 0rpx 0rpx;

				.showimg {
					margin-top: 40rpx;
					width: 100%;
					display: flex;
					justify-content: center;

					image {
						width: 572rpx;
						height: 314rpx;
					}
				}

				.uptip {
					display: flex;
					flex-wrap: wrap;

					.uptipli {
						margin-top: 24rpx;
						width: 100%;
						font-weight: 400;
						font-size: 24rpx;
						color: #A19C9C;
						line-height: 32rpx;
					}

				}

				.upself {
					margin-bottom: 60rpx;
					padding: 36rpx 44rpx;
					width: 678rpx;
					height: 478rpx;
					background: #FFFFFF;
					box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(0, 0, 0, 0.16);
					border-radius: 30rpx 30rpx 30rpx 30rpx;

					.box_tip {
						width: 100%;
						font-weight: 600;
						font-size: 32rpx;
						color: #333333;
					}

					image {
						margin-top: 24rpx;
						width: 578rpx;
						height: 330rpx;
						border-radius: 14rpx;
					}
				}

				.upimg {
					margin-top: 30rpx;
					display: flex;
					flex-wrap: nowrap;
					justify-content: space-between;

					.imgcont {
						width: 132rpx;
						display: flex;
						flex-wrap: wrap;
						justify-content: center;
						font-weight: 400;
						font-size: 20rpx;
						color: #A19C9C;
						line-height: 28rpx;

						image {
							width: 132rpx;
							height: 91.25rpx;
						}
					}
				}

				.iptbox {
					display: flex;
					flex-wrap: wrap;

					.iptli {
						width: 100%;
						margin-top: 34rpx;
						display: flex;
						flex-wrap: nowrap;

						.left {
							margin-right: 78rpx;
							width: 112rpx;
							font-weight: 400;
							font-size: 28rpx;
							color: #A19C9C;
						}

						.right {
							font-weight: 400;
							font-size: 28rpx;
							color: #C8C7C7;
						}

						.act1 {
							color: #212529;
						}
					}
				}

				.box_tip {
					font-weight: 600;
					font-size: 32rpx;
					color: #333333;
				}

				.img_boxs {
					margin-top: 38rpx;
					margin-left: 24rpx;
					display: flex;
					flex-wrap: nowrap;
					align-items: center;

					.img_box {
						font-weight: 400;
						font-size: 24rpx;
						color: #C8C7C7;
						line-height: 32rpx;
						margin-right: 60rpx;
						width: 278rpx;
						display: flex;
						flex-wrap: wrap;
						justify-content: center;

						image {
							width: 278rpx;
							height: 188rpx;
						}
					}
				}
			}
		}
	}
</style>