
<template>
	 <view class="vac-form">
		 <view v-if="edidflag" class="boxa">
			 <uni-forms :modelValue="formData" label-width="110" class="boxflex1">
			 		 <!-- 基本信息 -->
			 		 <uni-group title="基本信息" top="0">
			 			<uni-forms-item required label="身份证号" >
							<view class="form_zhan" :class="formData.idCard?'':'nodata'">{{formData.idCard||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			<uni-forms-item required label="姓名">
							<view class="form_zhan" :class="formData.name?'':'nodata'">{{formData.name||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			<!-- <uni-forms-item required label="出生日期">
			 				<uni-easyinput :clearable="false" @focus="showDatePicker" type="text" :inputBorder="false" v-model="formData.birthday" placeholder="请选择出生日期"></uni-easyinput>
			 			</uni-forms-item> -->
			 			<uni-forms-item  label="年龄">
							<view class="form_zhan" :class="formData.age?'':'nodata'">{{formData.age||'暂无信息'}}</view>
			 			<!-- 	<uni-easyinput type="number" :inputBorder="false" v-model="formData.age" placeholder="请输入年龄"></uni-easyinput> -->
			 			</uni-forms-item>
			 			<uni-forms-item label="性别">
							<view class="form_zhan" :class="formData.sex?'':'nodata'">{{formData.sex||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			<uni-forms-item label="联系号码">
							<view class="form_zhan" :class="formData.telephone?'':'nodata'">{{formData.telephone||'暂无信息'}}</view>
			 			</uni-forms-item>
			 		</uni-group>
			 		<!-- 地址信息 -->
			 		<uni-group title="地址信息">
			 			<uni-forms-item required label="乡镇">
							<view class="form_zhan" :class="formData.villageTowns?'':'nodata'">{{formData.villageTowns||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			<uni-forms-item required label="村（居）">
							<view class="form_zhan" :class="formData.village?'':'nodata'">{{formData.village||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			
			 			<uni-forms-item  label="省外工作地址">
							<view class="form_zhan" :class="formData.addrOutsideProvince?'':'nodata'">{{formData.addrOutsideProvince||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			<uni-forms-item label="详细地址" label-position="top">
							<view class="form_zhan form_right" :class="formData.detailAddr?'':'nodata'">{{formData.detailAddr||'暂无信息'}}</view>
			 			</uni-forms-item>
			 			<uni-forms-item label="备注" label-position="top">
							<view class="form_zhan form_right" :class="formData.remark?'':'nodata'">{{formData.remark||'暂无信息'}}</view>
			 			</uni-forms-item>
			 		</uni-group>
			 		<!-- 返乡时间 -->
			 		<uni-group title="返乡时间">
			 			<uni-forms-item required label="拟返回时间">
							<view class="form_zhan" :class="formData.intendedReturnTime?'':'nodata'">{{formData.intendedReturnTime||'暂无信息'}}</view>
			 				</uni-forms-item>
			 			</uni-forms-item>
			 		</uni-group>
			 	<view style="height: 260rpx;"></view>	
			 	
			 	</uni-forms>
			<view class="addbox" style="background: #F2F2F2;padding-top:20rpx">
				<button class="margin0-auto submit_btn"  type="primary" @click="getUpdateFn">修改</button>
				<button class="margin0-auto submit_btns" v-if="formData.id"  type="primary" @click="getDeletFn">变更</button>
					
				</view>
		 </view>
		 <view v-else class="boxa">
			 
		
		 <uni-forms :modelValue="formData" label-width="110" class="boxflex1">
			 <!-- 基本信息 -->
			 <uni-group title="基本信息" top="0">
				<uni-forms-item required label="身份证号" >
					<image src="@/static/image/icon_xz_pz.png" @click="takePhoto" style="z-index: 100; width: 26px; height: 22px; position: absolute; right: 5px; top: 5px; "></image>
					<uni-easyinput @blur="getIdcardInfo" :inputBorder="false" style="width: 80%; z-index: 80;" v-model="formData.idCard" placeholder="请输入身份证号码"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item required label="姓名">
					<uni-easyinput type="text" :inputBorder="false" v-model="formData.name" placeholder="请输入姓名"></uni-easyinput>
				</uni-forms-item>
				<!-- <uni-forms-item required label="出生日期">
					<uni-easyinput :clearable="false" @focus="showDatePicker" type="text" :inputBorder="false" v-model="formData.birthday" placeholder="请选择出生日期"></uni-easyinput>
				</uni-forms-item> -->
				<uni-forms-item  label="年龄">
					<uni-easyinput type="number" :inputBorder="false" v-model="formData.age" placeholder="请输入年龄"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="性别">
					<uni-data-checkbox v-model="formData.genderIndex" :localdata="sexRange" ></uni-data-checkbox>
				</uni-forms-item>
				<uni-forms-item label="联系号码">
					<uni-easyinput type="text" :inputBorder="false" v-model="formData.telephone" placeholder="请输入联系号码"></uni-easyinput>
				</uni-forms-item>
			</uni-group>
			<!-- 地址信息 -->
			<uni-group title="地址信息">
				<uni-forms-item required label="乡镇">
					<view @click="showTownsSelect" class="pick-line">
						<text v-if='formData.villageTowns'>{{formData.villageTowns}}</text>
						<text v-else style="color: grey;">请选择乡镇</text>
					</view>
				</uni-forms-item>
				<uni-forms-item required label="村（居）">
					<view @click="showVillageSelect" class="pick-line">
						<text v-if='formData.village'>{{formData.village}}</text>
						<text v-else style="color: grey;">请选择村（居）</text>
					</view>
				</uni-forms-item>
				
				<uni-forms-item  label="省外工作地址">
					<uni-easyinput type="text" :inputBorder="false" v-model="formData.addrOutsideProvince" placeholder="请输入省外工作地址"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="详细地址" label-position="top">
					 <textarea 
					 placeholder="请输入详细地址...." v-model="formData.detailAddr"
					 style="width: 100%;background: #F2F2F2;height: 112rpx;border-radius: 10rpx; "/>
				</uni-forms-item>
				<uni-forms-item label="备注" label-position="top">
					 <textarea 
					 placeholder="请输入备注信息...." 
					 v-model="formData.remark"
					 style="width: 100%;background: #F2F2F2;height: 160rpx;border-radius: 10rpx;"/>
				</uni-forms-item>
			</uni-group>
			<!-- 返乡时间 -->
			<uni-group title="返乡时间">
				<uni-forms-item required label="拟返回时间">
					<uni-easyinput :clearable="false" @focus="showDatePicker" type="text" :inputBorder="false" v-model="formData.intendedReturnTime" placeholder="请选择拟返回时间"></uni-easyinput>
					
					</uni-forms-item>
				</uni-forms-item>
			</uni-group>
			<!-- <view style="height:196rpx;"></view> -->
		
		</uni-forms>
		<view class="addbox" style="background: #F2F2F2;padding-top:20rpx">
			<button class="margin0-auto submit_btn"  type="primary" @click="$noMultipleClicks(submit)">提交</button>
			<view class="addbox_txt" @click="checkSelect">
								 <image :src="selectimg" class="addbox_txta" v-if="selectfalg"></image>
								 <image :src="noselectimg" class="addbox_txta" v-else></image>
								 <view class="addbox_txta1">勾选即表示同意<text class="addbox_txt2">《用户服务协议》</text>及<text class="addbox_txt2">《隐私政策》</text></view>
			</view>
		
			</view>
		 </view>
		<!-- 删除弹窗 -->
		<view class="bgbox" v-if="delfalg"></view>
		<view class="delbox" v-if="delfalg">
			<view class="deltit">变更原因</view>
			<image :src="delimg" class="del_img" @click="getClose"></image>
			<view class="del_list">
				<view class="del_lista" :class="delvalue==ite.value?'act':''" @click="getDeltab(ite.value)" v-for="(ite,idx) in deletelist" :key="idx">{{ite.label}}</view>
				<!-- <view class="del_lista">失踪</view>
				<view class="del_lista">死亡</view> -->
			</view>
			<view class="del_btn" @click="deletSure">确认</view>
		</view>
		
		<!-- 时间选择器-->
		<dataTimePicke ref="setpicker" type="date" toolBarTitle="请选择拟返回时间" @change="timeChange"></dataTimePicke>
		

		<!-- 户籍地选择 -->
		<selectMuPicker ref="birselet"  model="muitl-column-auto" :list="birthplace"  title="选择户籍地" @vacChange="birRegion"></selectMuPicker>
		<!-- 模态框 -->
		<hModal ref="h_modal" :content="modalContent"></hModal>
		
		<!-- 乡镇 -->
		<selectPicker ref="townsselet" :list="townslist" title="请选择乡镇" @vacChange="vacTownsChange"></selectPicker>
		<!-- 村 -->
		<selectPicker ref="villageselet" :list="villagelist" title="请选择村(居)" @vacChange="vacVillageChange"></selectPicker>
		
		<areaP ref="area" ></areaP>

	 </view>
</template>
	
<script>
	import senSetPicker from '@/_components/picker/dateTimePicker.vue'
	import hUploadImage from '@/_components/hUploadImage.vue'
	import selectMuPicker from '@/_components/picker/selectMutilPicker.vue'
	import selectPicker from '@/_components/picker/selectPicker.vue'
	import hModal from '@/_components/hModal.vue'
	import dataTimePicke from '@/_components/picker/dataTimePicke.vue'
	import areaP from '@/_components/picker/areaP.vue'
	import pickRegions from '@/components/pick-regions/pick-regions.vue'
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
	import hostUrl from "@/util/url";
	let {host, imgDomain} = hostUrl
	
	export default {
		components:{uniPopup, uniPopupDialog,pickRegions,senSetPicker,hUploadImage,selectPicker,hModal,selectMuPicker,dataTimePicke,areaP},
		data() {
			return {
				delimg:require("@/static/image/del.png"),
				selectimg:require("@/static/image/select.png"),
				noselectimg:require("@/static/image/noselect.png"),
				selectfalg:true,
				delfalg:false,
				birAddress: '',
				jiciOption: [],// 剂次选项
				curItem: {},
				curIndex: 0,
				noClick: true,// $noMultipleClicks变量
				defaultRegion: ['安徽省', '安庆市', '潜山市'], // 初始值必须为空，否则更换默认值时不能生效
				searchRegion: [],
				formData: {
					"id": '',//
					"name": '',//姓名
					"sex": '',//男|女
					"idCard": '',//：身份证
					"villageTownsId": '',//乡镇id
					"villageTowns": '',//乡镇名字
					"villageId": '',//村id
					"village": '',//村
					"groupId": '',//组id
					"group": '',//组
					"addrOutsideProvince": '',//省外工作地址
					"intendedReturnTime": '',//拟返回时间
					"telephone": '',//身份证
					"remark": '',//备注
					"detailAddr": '',//详细地址
					"wzhjdz": '',//完整户籍地址
					'genderIndex': 0,
				},
				areaList: [],
				inputValue : '',
				shixian : false,
				imageValue:{},
				sexRange: [{"value": 0,"text": "男"    },{"value": 1,"text": "女"}],// 性别
				isUPN: [{"value": 0,"text": "是"    },{"value": 1,"text": "否"}], // 是否户主
				vaccination: [{"value": 0,"text": "是"    },{"value": 1,"text": "否"}] ,// 是否接种
				vacPro:[{"value": 0,"text": "已完成"    },{"value": 1,"text": "未完成"}], // 接种进度
				vacTitle: [], // 疫苗名称
				birthplace:[], // 户籍地
				trades:[], // 重点行业
				contraindication:[], // 禁忌症
				othersOption: [],// 其他原因
				moratorium:[], // 暂缓接种
				vacTimes:[], // 接种疫苗剂次
				vacArea:[],// 疫苗接种地点
				modalContent:'',
				
				
				
				peopleclass:[],//人员分类，
				keyIndustries:'',
				selectidx:[0],
				edidflag:true,
				deletelist:[],//删除字典
				delvalue:'',//删除原因
				townslist:[],//乡镇
				villagelist:[],//村
			}
		},
		methods:{
			getClose(){
				this.delfalg=false
			},
			// 修改
			getUpdateFn(){
				this.edidflag=false
			},
			//删除
			getDeletFn(){
				this.delfalg=true;
			},
			getDeltab(e){
				this.delvalue=e;
			},
			deletSure(){
				var that=this;
				var params={
					id:this.formData.id,
					deleteReason:this.delvalue
				}
				this.$http.get('boman-web-core/core/fxry/delete/'+this.formData.id, params).then(res=>{
					if(res.code == 200 ) {
						uni.showToast({
							title: '变更成功',
							icon: "none"
						})
						setTimeout(function() {
							uni.$emit('refreshData');
							uni.navigateBack()
						}, 1000)
					}else{
						this.delfalg=false;
						uni.showToast({
							title: res.msg,
							icon: "none"
						})
					}
				})
			}, 
			showTownsSelect(){
				this.$refs.townsselet.show()
			},
			showVillageSelect(){
				if(!this.formData.villageTownsId){
					uni.showToast({
						title:"请先选择乡镇",
						icon:"none"
					})
					return
				}
				this.$refs.villageselet.show()

			},
			// vacTownsChange  vacVillageChange  
			vacTownsChange(e){
				var id = e[0].value;
				if(this.formData.villageTownsId==id){
					
				}else{
					this.formData.villageId='';
					this.formData.village='';
					this.formData.villageTowns=e[0].label;
					this.formData.villageTownsId=e[0].value;
					this.getVillageFn();
				}
			},
			vacVillageChange(e){
				var id = e[0].value;
				if(this.formData.villageTownsId==id){
					
				}else{
					this.formData.village=e[0].label;
					this.formData.villageId=e[0].value;
				}
				// var label = e[0].label;
				// this.keyIndustries=e[0].label;
				// this.formData.keyIndustries=e[0].value;
			},
			
			takePhoto() {
				console.log('---------')
				var that = this
				uni.chooseImage({
					count: 1,
					sourceType: 'camera',
					success(res){
						var file = res.tempFilePaths[0]
						that.ocrParse(file)
					}
				})
			},
			ocrParse(filePath) {
				var url = host + '/boman-file/ocrIdCard'
				var token = uni.getStorageSync('token')
				// var token = "df057579-73c8-4bdd-8312-f64db8efd699"
				uni.showLoading()
				uni.uploadFile({
					url: url,
					filePath: filePath,
					name: 'file',
					header: {
						// 'Content-type': 'multipart/form-data',
						'Authorization': token
					},
					success: res => {
						uni.hideLoading()
						// console.log(JSON.stringify(res))
						var data = JSON.parse(res.data)
						this.formData.idCard = data.data.id
						this.formData.name = data.data.name
						this.formData.age = this.getAge(data.data.birth)
						this.formData.sex = data.data.gender
						if (this.formData.sex == '男') {
							this.formData.genderIndex = 0
						} else {
							this.formData.genderIndex = 1
						}
					},
					fail: err => {
						uni.hideLoading();
						// console.log(JSON.stringify(err))
						uni.showToast({
							title: err.errMsg,
							icon: "none"
						})
					}
				})
			},
			getTownsFn(){
				var that=this;
				that.$http.get('boman-system/dept/list/towns').then(res=>{
					if(res.code&&res.code != 200) {
					}else{
						this.townslist = res.map(v=>{
							return {label: v.deptName,value:v.id}
						})
					}
				})
			},
			getVillageFn(){
				var that=this;
				var params={
					deptId:this.formData.villageTownsId
				}
				that.$http.get('boman-system/dept/list/towns',params).then(res=>{
					if(res.code&&res.code != 200) {
					}else{
						this.villagelist = res.map(v=>{
							return {label: v.deptName,value:v.id}
						})
					}
					// console.log(this.villagelist)
				})
			},
			checkSelect(){
				this.selectfalg=!this.selectfalg
			},
			submit() {
				if(!this.formData.idCard){
					uni.showToast({
						title: '请输入身份证号码',
						icon: "none"
					})
					return
				}
				let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
				if (reg.test(this.formData.idCard)) {
					// 获取身份证信息
				} else {
					uni.showToast({
						title: '请输入正确的身份证号',
						icon: 'none'
					})
					return
				}
				if(!this.formData.name){
					uni.showToast({
						title: '请输入姓名',
						icon: "none"
					})
					return
				}
				//户籍地址
				if(!this.formData.villageTownsId){
					uni.showToast({
						title: '请选择乡镇',
						icon: "none"
					})
					return
				}
				if(!this.formData.villageId){
					uni.showToast({
						title: '请选择村(居)',
						icon: "none"
					})
					return
				}
				
				// if (this.formData.houseTypeValue == 0) {
				// 	this.formData.houseType = '是'
				// 	//户主
				// } else {
				// 	this.formData.houseType = '否'
				// }
				if (this.formData.genderIndex == 0) {
					this.formData.sex = '男'
				} else {
					this.formData.sex = '女'
				}
				if(!this.selectfalg){
					uni.showToast({
						title: '请勾选同意下方协议',
						icon: "none"
					})
					return
				}
				var tempArr = []

				// console.log(JSON.stringify(this.formData))
				if (this.formData.id) {
					this.$http.post('boman-web-core/core/fxry/edit', this.formData).then(res=>{
						if(res.code == 200 ) {
							uni.navigateTo({
								url:'/add/pages/addvacfrom/submit'
							})
						}else{
							uni.showToast({
								title: res.msg,
								icon: "none"
							})
						}
					})
				} else {
					this.$http.post('boman-web-core/core/fxry/add', this.formData).then(res=>{
						if(res.code == 200 ) {
							uni.navigateTo({
								url:'/add/pages/addvacfrom/submit'
							})
						}else{
							uni.showToast({
								title: res.msg,
								icon: "none"
							})
						}
					})
				}
			},
			//删除
			delete(){
				this.$http.get('boman-web-core/core/fxry/delete/' + this.formData.id).then(res=>{
					if(res.code == 200 ) {
						uni.showToast({
							title: '提交成功',
							icon: "none"
						})
						setTimeout(function() {
							uni.$emit('refreshData');
							uni.navigateBack()
						}, 1000)
					}
				})
			},
			regionPickerChange(region) {
				this.searchRegion = region
				// console.log(this.searchRegion,'searchRegion')
				var codeArray = this.searchRegion.map(item=>item?item.code:undefined)
				var nameArray = this.searchRegion.map(item=>item?item.name:undefined)
				this.formData.province = nameArray[0]
				this.formData.city = nameArray[1]
				this.formData.region = nameArray[2]
			},
			/* 获取户籍地 */
			getBirthplace () {
				this.$http.get('boman-web-core/administrativeInfo/treeSelect').then(res=>{
					if(res.code == 200) {
						this.birthplace = res.data
					}
				})
			},
			/* 初始化 */
			init() {
				// this.getBirthplace()
				this.getDelectList();
				// 获取乡镇
				this.getTownsFn()
				
				
				// this.getPeopleClass();
				// this.getVacTitle()
			},
			getDelectList(){
				// 删除显示
				var tthat=this;
				this.$http.get('system/dict/data/type/people_status').then(res=>{
					if(res.code == 200) {
						this.delvalue=res.data[0].dictValue
						this.deletelist = res.data.map(v=>{
							return {label: v.dictLabel,value:v.dictValue}
						})
					}
				})
			},
			getDetail() {
				this.$http.get('boman-web-core/core/fxry/getById/' + this.formData.id).then(res=>{
					if(res.code == 200 ) {
						this.init()
						
						this.formData = res.data
						// if (this.formData.houseType == '是') {
						// 	this.formData.houseTypeValue = 0
						// } else {
						// 	this.formData.houseTypeValue = 1
						// }
						if (this.formData.sex == '男') {
							this.formData.genderIndex = 0
						} else {
							this.formData.genderIndex = 1
						}
						// if (this.formData.isVaccination == '是') {
						// 	this.formData.isVaccinationValue = 0
						// } else {
						// 	this.formData.isVaccinationValue = 1
						// }
						this.birAddress = ''
						// 户籍地址
						if (this.formData.villageTowns) {
							this.birAddress += this.formData.villageTowns
						}
						if (this.formData.village) {
							this.birAddress += this.formData.village
						}
						if (this.formData.group) {
							this.birAddress += this.formData.group
						}
					}
				})
			},
			// 人员分类
			getPeopleClass(){
				this.$http.get('system/dict/data/type/renyuanfenlei').then(res=>{
					if(res.code == 200) {
						this.peopleclass = res.data.map(v=>{
							return {label: v.dictLabel,value:v.dictValue}
						})
					}
				})
			},
			timeChange(e){
				var time=e;
				this.$set(this.formData,'intendedReturnTime',time);
				// console.log(e,11,this.formData.intendedReturnTime)
			},
			// 显示人员分类
			showPropleSelect() {
				if (this.formData.id != undefined && this.formData.id != "") {
					return
				}
				// this.curIndex = index
				this.$refs.peopleselet.show()
			},
			peopleChange(e){
				// console.log(e[0],8)
				var label = e[0].label;
				// this.selectidx
				this.keyIndustries=e[0].label;
				this.formData.keyIndustries=e[0].value;
			},
			/* 上传后端获取身份证信息 */
			getIdcardInfo (val) {
				if (this.formData == undefined) {
					return
				}
				if (this.formData.idCard == undefined || this.formData.idCard == '') {
					return
				}
				let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
				if (reg.test(this.formData.idCard)) {
					this.$http.post('boman-web-core/core/info/findHjInfo',{
						idCard: this.formData.idCard
					}).then(res=>{
						if(res.code == 200 ) {
							this.$set(this.formData,"name",res.data.userName)
							this.$set(this.formData,"age",res.data.age)
							this.$set(this.formData,"sex",res.data.gender)
					
							if (this.formData.sex == '男') {
								this.$set(this.formData,"genderIndex",0)
							} else {
								this.$set(this.formData,"genderIndex",1)
							}
						}
					})
				}else{
					uni.showToast({
						title:'请输入正确的身份证号',
						icon:'none'
					})
				}
				
			},
			/* 户籍地选择组件 */
			showbirPicker () {
				this.$refs.birselet.show()
			},
			/* 成功选择户籍 */
			birRegion (e) {
				console.log('---------' + JSON.stringify(e))
				this.formData.villageTowns = e[0].label
				this.formData.village = e[1].label
				this.formData.group = e[2].label
				this.birAddress = this.formData.villageTowns + this.formData.village + this.formData.group
			},
			/* 出生日期组件 */
			showDatePicker () {
				this.$refs.setpicker.show();					
			},
			getAge(strAge) {
				var birArr = strAge.split("-");
				var birYear = birArr[0];
				var birMonth = birArr[1];
				var birDay = birArr[2];

				d = new Date();
				var nowYear = d.getFullYear();
				var nowMonth = d.getMonth() + 1; //记得加1
				var nowDay = d.getDate();
				var returnAge;

				if (birArr == null) {
					return false
				};
				var d = new Date(birYear, birMonth - 1, birDay);
				if (d.getFullYear() == birYear && (d.getMonth() + 1) == birMonth && d.getDate() == birDay) {
					if (nowYear == birYear) {
						returnAge = 0; // 
					} else {
						var ageDiff = nowYear - birYear; // 
						if (ageDiff > 0) {
							if (nowMonth == birMonth) {
								var dayDiff = nowDay - birDay; // 
								if (dayDiff < 0) {
									returnAge = ageDiff - 1;
								} else {
									returnAge = ageDiff;
								}
							} else {
								var monthDiff = nowMonth - birMonth; // 
								if (monthDiff < 0) {
									returnAge = ageDiff - 1;
								} else {
									returnAge = ageDiff;
								}
							}
						} else {
							return  "出生日期晚于今天，数据有误"; //返回-1 表示出生日期输入错误 晚于今天
						}
					}
					return returnAge;
				} else {
					return ("输入的日期格式错误！");
				}
			}
		},
		onLoad(option) {
			// console.log('onLoad')
			if (option.id) {
				this.formData.id = option.id
				uni.setNavigationBarTitle({
					title: '修改'
				})
			} else {
				this.edidflag=false
				uni.setNavigationBarTitle({
					title: '新增'
				})
			}
		},
		mounted () {
			if (this.formData.id) {// “编辑”模式下，先获取详情，再获取选项列表
				this.getDetail()
			} else {// “新增”模式下，获取选项列表
				this.init()
			}
		}
	}
</script>

<style>
	.vac-form textarea {
		display: block;
		padding:16rpx 36rpx;
		font-size: 28rpx;
		box-sizing: border-box;
	}
</style>

<style scoped lang="scss">
	// 新修改的
	.boxa{display: flex;flex-direction: column;height: 100vh;}
	.boxflex1{flex: 1;overflow-y: auto;}
.addbox{padding: 20rpx 34rpx;z-index: 1;background: #ffffff;box-shadow: 0 14rpx 40rpx 12rpx rgba(218, 218, 218, 1);flex:0 0 auto;}
	.submit_btn {width: 100%;height: 96rpx;background: #00B034;border-radius: 6rpx;font-size: 34rpx;
	}

	.submit_btns {background: #EA2929;width: 684rpx;height: 98rpx;border-radius: 6rpx;font-size: 34rpx;margin-top: 20rpx;
	}

	
	.bgbox{position: fixed;left: 0;right: 0;top: 0;bottom: 0;background: rgba(0,0,0,0.2);z-index: 3;}
	.delbox{width: 580rpx;background: #FFFFFF;border-radius: 14px;position: fixed;top: 50%;left: 80rpx;right: 80rpx;padding: 48rpx 34rpx 72rpx;box-sizing: border-box;z-index: 5;margin-top: -210rpx;
		.deltit{font-size: 28rpx;font-weight: bold;color: #343434;text-align: center;line-height: 40rpx;}
		.del_img{width: 34rpx;height: 34rpx;position: absolute;right: 34rpx;top: 44rpx;}
		.del_btn{width: 100%;height:76rpx;background: #00B034;border-radius: 6rpx;font-size: 28rpx;font-weight: bold;color: #FFFFFF;text-align: center;line-height: 76rpx;}
		.del_list{display: flex;padding: 60rpx 0 40rpx;flex-wrap: wrap;
			.del_lista{width:116rpx;height: 64rpx;background: #CACACA;border-radius: 32rpx;font-size: 26rpx;font-weight: 500;
color: #FFFFFF;text-align: center;line-height: 64rpx;margin: 0 10rpx 20rpx 0;
			&.act{background-color: #019FE8;}
			}
		}
	}
	.form_zhan{flex: 1;width: 100%;display: flex;box-sizing: border-box;min-height: 72rpx;flex-direction: row;align-items: center;font-size: 28rpx;color: #343434;
	&.nodata{color: #999999;}
	&.form_right{background-color: rgb(242, 242, 242);height: 120rpx;padding: 10rpx;align-items: flex-start;}
	}
	
	
	
	
	
	.pick-line {
		width: 100%; 
		height: 100%; 
		display: flex; 
		flex-direction: row; 
		align-items: center; 
		padding-left: 20rpx;
	}
	.from_image{
		width: 30rpx;
		height: 30rpx;
	}
	.delPop {
		z-index: 2;
		top: -10rpx;
		right: -10rpx;
	
		.circleRed {
			width: 40rpx;
			height: 40rpx;
			background-color: red;
			border-radius: 50%;
	
			&::after,
			&::before {
				content: '';
				width: 25rpx;
				height: 5rpx;
				position: absolute;
				background-color: white;
				top: 50%;
				left: 50%;
				// transform-origin:center;
			}
	
			&::after {
				transform: translate(-50%, -50%) rotate(45deg);
			}
	
			&::before {
				transform: translate(-50%, -50%) rotate(-45deg);
			}
		}
	}
	
	.img-add {
		width: 120rpx;
		height: 120rpx;
		margin: 10rpx 3% 10rpx 0;
		border-radius: 10rpx;
		overflow: hidden;
		background-color: #f7f7f7;
		display: flex;
		flex-direction: column;
		justify-content: center;
	
		.add {
			padding-top: 0rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
	
			image {}
	
			.font {
				color: #8a8a8a;
				font-size: 26rpx;
			}
		}
	
	}
	.addbox_txt{display: flex;align-items: center;justify-content: center;margin-top: 24rpx;
		.addbox_txta{width: 28rpx;height: 28rpx;margin-right: 14rpx;}
		.addbox_txta1{font-size: 24rpx;color: #666666;
			.addbox_txt2{color: #009FE8;}
		}
	}
</style>
