<template>
	<div class="headers flex align-center justify-center">
		<div class="headers-box flex align-center justify-between">
			<div class="headers-box-logo flex align-center" @click="goHome()">
				<el-image style="height: 30px;margin-right: 20px;" src="/login.png" fit="cover" />
			</div>
			<div class="headers-box-right flex align-center">
				<Notice v-if="gongao.length>0" :lists="gongao" />
				<el-popover ref="popoverRef" trigger="click" :show-arrow="false" :popper-style="popperStyle"
					placement="bottom" :width="340">
					<template #reference>
						<!-- <div class="flex align-center myVip" v-if="userType==1">
							<el-image style="width: 22px; height: 22px;margin-right: 10px;"
								src="/images/index/vipIcon.png" fit="cover" />
							{{isVip?'会员用户':'开通会员'}}
						</div> -->
						<div class="flex align-center myVip" v-if="userType == 2">
							<el-image style="width: 22px; height: 22px;margin-right: 10px;"
								src="/images/index/vipIcon.png"/>
							{{isUserVip?'会员用户':'开通会员'}}
						</div>
					</template>
					 <div class="myVipCon">
						<div class="myVipCon-bg flex align-center justify-between">
							<div class="myVipCon-bg-l">
								<!-- <div class="myVipCon-bg-l-title" v-if="userType==1">
									{{isVip==true?'已开通会员':'开通会员'}}
								</div> -->
								<div class="myVipCon-bg-l-title">
									{{isUserVip==true?'已开通会员':'开通会员'}}
								</div>
								<div class="myVipCon-bg-l-title">
									{{userType==1?'提升简历曝光':'提升岗位曝光'}}
								</div>
								<!-- <div class="myVipCon-bg-l-time" v-if="userType==1">
									{{isVip==true?'到期时间：'+vipTime:'开通会员更多招聘方联系你'}}
								</div> -->
								<div class="myVipCon-bg-l-time">
									{{ isUserVip ? (vipName + ' 剩余 ' + remainingDays + ' 天到期') : '开通会员更多求职者联系你' }}
								</div>

							</div>
							<img src="/images/hader/vip5.png" alt="" srcset="" />
						</div>
						<div class="myVipCon-icon flex align-center justify-between">
							<div class="myVipCon-icon-item flex align-center justify-center flex-wrap">
								<div>{{ myViewTimes }}/{{ vipViewTimes }}</div>
								<div class="myVipCon-icon-item-txt">
									查看权益
								</div>
							</div>
							<div class="myVipCon-icon-item flex align-center justify-center flex-wrap">
								<div>{{ myConTimes }}/{{ vipConTimes }}</div>
								<div class="myVipCon-icon-item-txt">
									沟通权益
								</div>
							</div>
							<div class="myVipCon-icon-item flex align-center justify-center flex-wrap">
								<div>{{ myPostTimes }}/{{ vipPostTimes }}</div>
								<div class="myVipCon-icon-item-txt">
									普通职位
								</div>
							</div>
							<div class="myVipCon-icon-item flex align-center justify-center flex-wrap">
								<div>{{ myDueTimes }}/{{ vipDueTimes }}</div>
								<div class="myVipCon-icon-item-txt">
									急聘职位
								</div>
							</div>
						</div>
						<!-- <div class="myVipCon-li" v-if="userType==1">
							<div class="myVipCon-li-sj"></div>
							<div class="myVipCon-li-con">
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">
										在线普通职位
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1"
										style="font-weight: 500;">
										基础权益
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
										style="font-weight: 500;">
										试用版
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
										style="font-weight: 500;">
										月付版
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
										style="font-weight: 500;">
										年度版
									</div>
								</div>
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">
										简历刷新
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
										{{noVipNum}}次/天
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										{{vipNum}}次/天
									</div>
								</div>
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">
										优先提醒
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
										<el-icon :size="iconSize">
											<Close />
										</el-icon>
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										<el-icon :size="iconSize">
											<Check />
										</el-icon>
									</div>
								</div>
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">
										专属客服
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
										<el-icon :size="iconSize">
											<Close />
										</el-icon>
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										<el-icon :size="iconSize">
											<Check />
										</el-icon>
									</div>
								</div>
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">
										简历置顶
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
										<el-icon :size="iconSize">
											<Close />
										</el-icon>
									</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										<el-icon :size="iconSize">
											<Check />
										</el-icon>
									</div>
								</div>
							</div>
						</div> -->
						<div class="myVipCon-li" v-if="userType == 2">
							<div class="myVipCon-li-sj"></div>
							<div class="myVipCon-li-con">
								<!-- 顶部标题行 -->
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">权益类型</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1"
										style="font-weight: 500;">基础权益</div>

									<div v-for="(vip, index) in viplist" :key="index"
										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
										style="font-weight: 500;">
										<div v-if="vip.vipName === vipName" class="plan-tag-left">生效中</div>
										<div>{{ vip.vipName }}</div>
										<div v-if="vip.vipName === vipName" style="font-size: 8px;">{{ endTimeStr ?
											endTimeStr.split(' ')[0] : '' }}到期</div>
									</div>
								</div>

								<!-- 在线普通职位 -->
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">在线普通职位</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">{{ nonVipInfo.postTimes }}个</div>
									<div v-for="(vip, index) in viplist" :key="index"
										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										{{ vip.vipPostTimes }}个
									</div>
								</div>

								<!-- 在线急聘职位 -->
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">在线急聘职位</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">{{ nonVipInfo.dueTimes }}个</div>
									<div v-for="(vip, index) in viplist" :key="index"
										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										{{ vip.vipDueTimes }}个
									</div>
								</div>

								<!-- 每日查看总数 -->
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">每日查看总数</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">{{ nonVipInfo.viewTimes }}个</div>
									<div v-for="(vip, index) in viplist" :key="index"
										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										{{ vip.vipViewTimes }}个
									</div>
								</div>

								<!-- 每日沟通总数 -->
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">每日沟通总数</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">{{ nonVipInfo.conTimes }}个</div>
									<div v-for="(vip, index) in viplist" :key="index"
										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										{{ vip.vipConTimes }}个
									</div>
								</div>

								<!-- 价格 -->
								<div class="myVipCon-li-con-item flex align-center justify-between">
									<div class="myVipCon-li-con-items" style="font-weight: 500;">价格</div>
									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">免费</div>
									<div v-for="(vip, index) in viplist" :key="index"
										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
										{{ vip.money }}/{{ vipNameTypeText(vip.vipNameType) }}
									</div>
								</div>
							</div>
						</div>
						<!-- <div v-if="userType==1 && isVip==false" class="myVipCon-xy flex align-center">
							<el-checkbox v-model="checkVipXy" style="margin-right: 10px;" size="large" />
							阅读并同意<span @click="openAgree()">《会员开通协议》</span>
						</div> -->
						<div v-if="userType==2 && isUserVip==false" class="myVipCon-xy flex align-center">
							<el-checkbox v-model="checkVipXy" style="margin-right: 10px;" size="large" />
							阅读并同意<span @click="openAgree()">《会员开通协议》</span>
						</div>
						<!-- <div v-if="userType==1 && isVip==false" class="myVipCon-btn flex align-center justify-between">
							<div class="myVipCon-btn-l flex align-center">
								<span>{{vipPrice}}</span>元/月
							</div>
							<div @click="openVipMenber()" class="myVipCon-btn-r flex align-center justify-center">
								立即开通
							</div>
						</div> -->
						<div v-if="userType==2 && isUserVip==false"
							class="myVipCon-btn flex align-center justify-between">
							<div class="myVipCon-btn-l flex align-center">
								<el-dropdown style="width: 100%;" :hide-after-click="false" @click.stop>
									<span class="el-dropdown-link flex align-center justify-between" style="width: 100%; padding: 0 20px;">
										<span style="color: #fff">{{ selectedPlan || '选择套餐' }}{{ vipPrice }}</span>
										<el-icon class="el-icon--right">
											<arrow-down />
										</el-icon>
									</span>
									<template #dropdown>
										<el-dropdown-menu>
											<el-dropdown-item 
												v-for="(plan, index) in viplist" 
												:key="plan.id"
												@click.stop="selectPlan(plan)">
												{{ plan.vipName }}
												<span style="margin-left: 10px;">
													{{ plan.money }}元
												</span>
											</el-dropdown-item>
										</el-dropdown-menu>
									</template>
								</el-dropdown>
							</div>
							<div @click.stop="openVipMenber()" class="myVipCon-btn-r flex align-center justify-center">
								立即开通
							</div>
						</div>
					</div> 
				</el-popover>
				<!-- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&7 -->
				<div class="headers-box-right-item flex" @click="goHome()">
					首页
				</div>
				<div v-if="userType == 1" class="headers-box-right-item flex" @click="goPosition()">
					职位
				</div>
				<div v-if="userType==1" class="headers-box-right-item flex" @click="goComp()">
					企业
				</div>
				<el-badge :value="chatCount" :hidden="chatCount==0?true:false" :max="99">
					<div class="headers-box-right-item flex" @click="goMessage()">
						消息
					</div>
				</el-badge>
				<div v-if="userType==2" class="headers-box-right-item flex" @click="fabuPostPush()">
					发布招聘
				</div>
				<div v-if="userType==2" class="headers-box-right-item flex" @click="goMyCompanyCenter()">
					企业中心
				</div>
				<div v-if="userType==1" @click="goInfo()" class="headers-box-right-item">
					简历
				</div>
				<div v-if="visible && token">
					<el-popover :visible="visible" placement="bottom" :width="340">
						<template #reference>
							<div class="headers-box-right-item flex align-center">
								{{nickName}}
								<el-image style="width: 32px; height: 32px;margin-left: 10px;border-radius: 50%;"
									:src="avatar" fit="cover" />
							</div>
						</template>
						<div class="myInfo">
							<div class="myInfo-title">
								个人信息
							</div>
							<div class="myInfo-item flex align-center justify-between">
								<div class="myInfo-item-l">
									头像
								</div>
								<div class="myInfo-item-r">
									<el-upload class="flex align-center justify-center" :action="action"
										:show-file-list="false" :on-success="handleAvatarSuccess">
										<el-image
											style="width: 40px; height: 40px;margin-left: 10px;border-radius: 50%;"
											:src="avatars" fit="cover" />
									</el-upload>

								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between">
								<div class="myInfo-item-l">
									用户名
								</div>
								<div class="myInfo-item-r removeInputStyle">
									<el-input :input-style="inputStyles" v-model="nickNames" placeholder="请输入用户名" />
								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between">
								<div class="myInfo-item-l">
									年龄
								</div>
								<div class="myInfo-item-r">
									<el-input-number v-model="age" :min="1" :max="150" />

								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between">
								<div class="myInfo-item-l">
									手机号
								</div>
								<div class="myInfo-item-r removeInputStyle">
									<el-input :input-style="inputStyles" readonly v-model="phone"
										placeholder="请输入手机号" />

								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between">
								<div class="myInfo-item-l">
									微信号
								</div>
								<div class="myInfo-item-r removeInputStyle">
									<el-input :input-style="inputStyles" v-model="weChatNum" placeholder="请输入微信号" />

								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between" v-if="userType == 2">
								<div class="myInfo-item-l">
									邮箱
								</div>
								<div class="myInfo-item-r removeInputStyle">
									<el-input :input-style="inputStyles" v-model="hrEmail" placeholder="请输入邮箱" />

								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between" v-if="userType == 2">
								<div class="myInfo-item-l">
									我的职务
								</div>
								<div class="myInfo-item-r removeInputStyle">
									<el-input :input-style="inputStyles" v-model="hrPosition" placeholder="请输入职务" />

								</div>
							</div>
							<div class="myInfo-item flex align-center justify-between" style="border: none;">
								<div class="myInfo-item-l">
									性别
								</div>
								<div class="myInfo-item-r ">
									<el-radio-group v-model="sex" class="ml-4">
										<el-radio :label="1" size="large">男</el-radio>
										<el-radio :label="2" size="large">女</el-radio>
									</el-radio-group>
								</div>
							</div>
							<div class="myInfo-btn flex align-center justify-center">
								<el-button style="width: 40%;" @click="visible = false" type="default">取消</el-button>
								<el-button style="width: 40%;" @click="messagebtn()" type="primary">保存</el-button>
							</div>
						</div>
					</el-popover>
				</div>
				<div v-else="!visible && token">
					<el-popover v-if="token" placement="bottom" trigger="hover">
						<template #reference>
							<div class="headers-box-right-item flex align-center">
								{{nickName}}
								<el-image style="width: 32px; height: 32px;margin-left: 10px;border-radius: 50%;"
									:src="avatar" fit="cover" />
							</div>
						</template>
						<div class="seeting">
							<div @click="visible = true" class="seeting-item flex align-center justify-center">
								<el-icon :size="18" style="margin-right: 5px;">
									<User />
								</el-icon>个人信息
							</div>
							<div v-if="userType==1" @click="selectUserType()"
								class="seeting-item flex align-center justify-center">
								<el-icon :size="18" style="margin-right: 5px;">
									<User />
								</el-icon>切换招聘
							</div>
							<div v-if="userType==2" @click="selectUserTypes()"
								class="seeting-item flex align-center justify-center">
								<el-icon :size="18" style="margin-right: 5px;">
									<User />
								</el-icon>切换求职
							</div>
							<div @click="goSetting()" class="seeting-item flex align-center justify-center">
								<el-icon :size="18" style="margin-right: 5px;">
									<Setting />
								</el-icon>设置中心
							</div>
							<div @click="outLogin()" class="seeting-item flex align-center justify-center">
								<el-icon :size="18" style="margin-right: 5px;">
									<SwitchButton />
								</el-icon>退出登录
							</div>
						</div>
					</el-popover>
				</div>

				<div v-if="!token" @click="goLogin()" class="myLogin flex align-center">
					登录/注册
				</div>
			</div>
		</div>
		<el-dialog v-model="dialogCompay" title="企业认证" width="60%">
			<!-- <div style="width: 100%;color: red;" v-if="form.auditContent&&form.status==3">
				拒绝理由：{{form.auditContent}}
			</div> -->
			<el-form v-loading="loadingCompany" ref="formCompany" size="large" style="margin-top: 20px;"
				class="flex align-center justify-between" label-position="top" :inline="true" :model="form"
				label-width="120px">
				<el-form-item prop="companyName" :rules="[{required: true,message: '请输入企业名称',trigger: 'blur',},]"
					class="row45" label="企业名称">
					<el-input placeholder="请输入企业名称" class="inputClass" v-model="form.companyName" />
				</el-form-item>
				<el-form-item prop="companyPeople" :rules="[{required: true,message: '请选择公司规模',trigger: 'blur',},]"
					class="row45" label="公司规模">
					<el-select v-model="form.companyPeople" style="width: 100%;" class="inputClass"
						placeholder="请选择公司规模" size="large">
						<el-option v-for="item in comList" :key="item.value" :label="item.value" :value="item.value" />
					</el-select>
				</el-form-item>
				<!-- <el-form-item prop="companyAddress1" :rules="[{required: true,message: '请选择公司所在地',trigger: 'blur',},]"
					class="row45" label="公司所在地">
					<el-cascader style="width: 100%;" :props="{ value: 'label',label: 'label',children: 'children'}"
						v-model="form.companyAddress1" :options="citysList" placeholder="请选择省市区" />
				</el-form-item> -->
				<!-- <el-form-item prop="companyAddress" :rules="[{required: true,message: '请输入详细地址',trigger: 'blur',},]"
					class="row45" label="详细地址">
					<el-autocomplete style="width: 100%;" @input="workInput" v-model="form.companyAddress"
						:fetch-suggestions="querySearchAsync" placeholder="请输入工作地址" @select="handleSelect" />
				</el-form-item>
				<el-form-item prop="companyScope" :rules="[{required: true,message: '请选择公司所属行业',trigger: 'blur',},]"
					class="row45" label="所属行业">
					<el-input @click="openIndustry()" :readonly="true" placeholder="请选择公司所属行业" suffix-icon="ArrowRight"
						class="inputClass" v-model="form.companyScope">
					</el-input>
				</el-form-item>
				<el-form-item prop="companyLegalPerson" :rules="[{required: true,message: '请输入公司法人',trigger: 'blur',},]"
					class="row45" label="公司法人">
					<el-input placeholder="请输入公司法人" class="inputClass" v-model="form.companyLegalPerson" />
				</el-form-item>
				<el-form-item prop="email" :rules="[{required: true,message: '请输入企业邮箱',trigger: 'blur',},]"
					class="row45" label="企业邮箱">
					<el-input placeholder="请输入企业邮箱" class="inputClass" v-model="form.email" />
				</el-form-item>
				<el-form-item prop="companyRegisteredFund" :rules="[{required: true,message: '请输入注册资金(万)',trigger: 'blur',}, {
					type: 'number',
					message: '请输入数字',
					trigger: ['blur', 'change'],
					},]" class="row45" label="注册资金(万)">
					<el-input placeholder="请输入注册资金(万)" class="inputClass" v-model.number="form.companyRegisteredFund" />
				</el-form-item>
				<el-form-item prop="companyCreateTime" :rules="[{required: true,message: '请选择注册时间',trigger: 'blur',},]"
					class="row45" label="注册时间">
					<el-date-picker style="width: 100%;" v-model="form.companyCreateTime" type="date"
						placeholder="请选择注册时间" />
				</el-form-item>
				<el-form-item prop="companyDetails" :rules="[{required: true,message: '请输入公司介绍',trigger: 'blur',},]"
					class="row45" label="公司介绍">
					<el-input v-model="form.companyDetails" :rows="4" type="textarea" placeholder="请输入公司介绍" />
				</el-form-item> -->
				<el-form-item prop="companyCertification"
					:rules="[{required: true,message: '请上传营业执照照片',trigger: 'blur',},]" class="row45" label="营业执照">
					<el-upload class="flex align-center justify-center" :action="action"
						:show-file-list="false" :on-success="handleAvatarSuccessC">
						<img style="width: 100px;height: 100px;border-radius: 6px;" v-if="form.companyCertification"
							:src="form.companyCertification" />
						<el-icon v-else class="avatar-uploader-icon">
							<Plus />
						</el-icon>
					</el-upload>
				</el-form-item>

				<!-- 公司证明（最多4张图片） -->
				<el-form-item prop="companyVerification"
					:rules="[{ required: true, message: '请上传公司证明图片', trigger: 'change' }]" class="row45" label="公司证明(最多上传 4 张公司证明图片)">
					<el-upload list-type="picture-card" :action="action" :limit="4"
						:file-list="proofFileList" :on-success="handleProofSuccess" :on-remove="handleProofRemove">
						<el-icon v-if="proofFileList.length < 4" class="avatar-uploader-icon">
							<Plus />
						</el-icon>
					</el-upload>
					<!-- 预览弹窗 -->
					<!-- <el-dialog v-model="dialogVisible" width="50%" height="300px">
						<img :src="dialogImageUrl" alt="Preview" style="width: 100%" />
					</el-dialog> -->
				</el-form-item>

				<!-- 在职证明（PDF 上传） -->
				<el-form-item prop="employmentVerification"
					:rules="[{ required: true, message: '请上传在职证明 PDF 文件', trigger: 'change' }]" class="row45"
					label="在职证明（PDF）">
					<el-upload :action="action" :limit="1" accept=".pdf" :file-list="pdfFileList"
						:on-success="handlePdfSuccess" :on-remove="handlePdfRemove" :show-file-list="true">
						<el-button v-if="pdfFileList.length === 0" type="primary">上传 PDF 文件</el-button>
						<a @click.stop :href="templateUrl" download="在职证明模板.docx" style="color: #016bf6; cursor: pointer;margin-left: 16px;">
							点击下载模板
						</a>
					</el-upload>
				</el-form-item>

				<div style="width: 100%;margin-top: 20px;" class="flex align-center justify-center">
					<el-button @click="dialogCompay = false" style="width: 100px;" type="Info">取消</el-button>
					<el-button @click="saveCompany()" style="width: 100px;margin-left: 30px;"
						type="primary">保存</el-button>
				</div> 
			</el-form>
		</el-dialog>
		<!-- 行业选择 -->
		<el-dialog class="workDialog" @close="type=false" :draggable="true" destroy-on-close align-center center
			v-model="industryDialog" title="选择行业">
			<template #header>
				<div class="my-header flex align-center">
					<div class="my-header-title" style="font-weight: bold;">
						选择行业
					</div>
					<div class="my-header-title flex align-center" style="margin-left: 40px;width: 500px;">
						<el-select style="width: 300px;" @remove-tag="removeTag" :collapse-tags=" true"
							:max-collapse-tags="2" class="my-header-title-se" multiple-limit="3" v-model="industryArr"
							multiple placeholder="请选择行业">
							<el-option v-for="item in industryArrList" :key="item.industryName"
								:label="item.industryName" :value="item.industryName" />
						</el-select>
						<span style="margin-left: 10px;font-size: 13px;color: #999999;">{{industryArr.length}}/3</span>
						<el-button @click="addHangye()" style="margin-left: 10px;" type="primary">确定</el-button>
					</div>
				</div>
			</template>
			<div class="myHy flex align-center justify-center">
				<div class="myHy-box">
					<div class="myHy-box-item flex justify-between" v-for="(item,index) in industryList" :key="index">
						<div class="myHy-box-item-l">
							{{item.industryName}}
						</div>
						<div class="myHy-box-item-r flex align-center justify-between flex-wrap">
							<div class="myHy-box-item-r-item" :style="ite.select?'color:#00DD9A':''"
								@click="addIndustry(ite)" v-for="(ite,ind) in item.childrenList" :key="ind">
								{{ite.industryName}}
							</div>
							<div class="myHy-box-item-r-item"></div>
							<div class="myHy-box-item-r-item"></div>
						</div>
					</div>
					<el-empty v-if="industryList.length==0" description="暂无行业" />
				</div>
			</div>

		</el-dialog>
		<postPush @closePostPush="closePostPush" v-if="dialogPostPush" :dialogPostPushs="dialogPostPush" />
		<!-- 开通会员 -->
		<!-- @close="closevip()" -->
		<el-dialog z-index="3000" @close="closeVip()" :destroy-on-close="true" v-model="dialogVisiblevip" title="开通会员"
			width="40%">
			<template #header>
				<div class="my-header flex align-center">
					<div class="my-header-title" style="font-weight: bold;">
						开通会员
					</div>
				</div>
			</template>
			<div class="wallet">
				<div class="wallet-title">
					支付价格：{{vipPrice}}
				</div>
				<div class="wallet-pay">
					<div class="wallet-pay-se">
						<el-radio-group @change="changeRadio" v-model="radio" class="ml-4">
							<el-radio :label="1" size="large" class="flex align-center">
								<img style="width: 30px;height: 30px;border-radius: 50%;margin-right: 10px;"
									src="/images/money/weixin.png" alt="" />
								微信支付
							</el-radio>
							<el-radio :label="2" size="large">
								<img style="width: 30px;height: 30px;border-radius: 50%;margin-right: 10px;"
									src="/images/money/zhifubao.png" alt="" />
								支付宝支付</el-radio>
						</el-radio-group>
					</div>
					<div class="wallet-pay-qr flex align-center justify-center" v-if="radio ==1 && codeUrl">
						<div class="wallet-pay-qrs">
							<VueQrcode type="image/png" :color="qrColor" :value="codeUrl" :margin="0"
								errorCorrectionLevel="quartile" :width="size" />
						</div>
					</div>
					<div v-if="radio == 2 && alPay" style="margin-top: 20px;margin-bottom: 10px;width: 100%;"
						class="flex align-center justify-center">
						<iframe :srcdoc="alPay" frameborder="no" border="0" marginwidth="0" marginheight="0"
							scrolling="no" width="100%" height="200px" style="overflow:hidden;"> </iframe>
					</div>
					<div v-if="codeUrl || alPay" style="width: 100%;text-align: center;color: #999999;">
						{{radio==1?'请使用微信扫码支付':'请使用支付宝扫码支付'}}
					</div>
				</div>
				<div class="flex justify-end" style="padding: 10px;margin-bottom: 10px;">
					<el-button @click="dialogVisiblevip = false">取消</el-button>
					<el-button type="primary" @click="payMoney()">
						立即支付
					</el-button>
				</div>
			</div>
			<!-- <template #footer>
				
			</template> -->
		</el-dialog>
		<!-- 协议弹窗 -->
		<agreement title="会员开通协议" v-if="dialogAgreements" :dialogAgreements="dialogAgreements" typeid="315"
			@closeAgree="closeAgree" />
	</div>
</template>

<script>
	import {
		ElMessageBox,
		ElMessage,
	} from 'element-plus'
	import {
		ROOTPATH,
		ROOTPATH4,
	} from '../../../comment/httpUrl.js'
	import citys from './citys.json'
	import axios from 'axios';
	import jsonp from 'axios-jsonp'
	import postPush from '../postPush/postPush.vue'
	import VueQrcode from 'vue-qrcode'
	import agreement from '../agreement/agreement.vue'
	import Notice from '../Notice/Notice.vue'
	export default {
		components: {
			postPush,
			VueQrcode,
			agreement,
			Notice
		},
		data() {
			return {
				templateUrl: 'https://h5.bosszan.com/员工在职证明-亿职赞模板.docx',
				codeUrl: '', //微信二维码支付URL;
				alPay: '',
				orderId: '', //支付订单号
				timer: null, //查询状态定时器
				radio: 1, //1:微信支付 2:支付宝支付
				size: 160, //二维码大小
				qrColor: {
					'background': '#ffffff'
				},
				dialogVisiblevip: false,
				dialogPostPush: false,
				action: ROOTPATH + '/alioss/upload', //上传图片地址
				industryDialog: false,
				industryList: [], //行业列表
				formLoading: false,
				form: {
					companyName: '', //企业名称
					companyLegalPerson: '', //公司规模
					companyAddress1: '', //省市区
					companyAddress: '', //营业地址
					companyScope: '', //经营范围
					companyPeople: '', //公司法人
					companyRegisteredFund: '', //注册资金
					companyCreateTime: '', //注册时间
					// companyContent: [], //招聘信息
					companyDetails: '', //简介
					companyLogo: '',
					companyCertification: '', //营业执照
					employmentVerification:'',//在职证明
					companyVerification:[],//公司证明
					email: '', //企业邮箱
					province: '',
					city: '',
					district: '',
					companyLng: '',
					companyLat: '',
				},
				dialogCompay: false,
				noVipNumCom: 0,
				vipNumCom: 0,
				vipTimeC: '', //企业会员到期时间
				vipTime: '', //用户会员到期时间
				vipPrice: '', //会员价格
				vipId:'',
				checkVipXy: false,
				vipNum: 0,
				noVipNum: 0,
				iconSize: 18,
				popperStyle: {
					backgroundColor: '#1F1F27',
					borderRadius: '12px'
				},
				action: ROOTPATH + '/alioss/upload', //上传图片地址
				visible: false,
				inputStyles: {
					textAlign: 'right',
				},
				avatars: '', //头像
				nickNames: '', //用户名
				age: '', //年龄
				phone: '', //手机号
				weChatNum: '', //微信号
				sex: 1, //性别
				token: '',
				isVip: false, //用户是否是vip
				isUserVip: false, //企业是否是vip
				screenHeight: 0, //屏幕高度
				inter: null,
				chatCount: 0,
				CompanyList: {}, //企业信息
				comList: [], //公司规模列表
				citysList: citys,
				industryArrList: [], //可选择的行业列表
				industryArr: [], //选择的行业数组
				loadingCompany: false,
				dialogAgreements: false,
				gongao: [], //公告
				msgNum: 0, //非会员每天免费联系次数
				vipMsgNum: 0, //会员每天免费联系次数
				msgPrice: 0, //非会员每次联系价格
				vipMsgPrice: 0, //会员每次联系价格
				// 会员权益
				myPostTimes: 0,
				vipDueTimes: 0,
				vipConTimes: 0,
				myViewTimes: 0,
				vipViewTimes: 0,
				myConTimes: 0,
				vipPostTimes: 0,
				myDueTimes: 0,
				viplist: [],
				selectedPlan: '',
				remainingDays: 0, // 剩余天数
				vipName: "",
				hrEmail:'',
				hrPosition:'',
				pdfFileList: [],
				proofFileList: [],
				dialogImageUrl: '', // 预览图片URL
				dialogVisible: false, // 预览图片是否可见
				nonVipInfo: {},
				endTimeStr:''
			}
		},
		created() {
			this.getgonggaoList()
		},
		mounted() {
			this.getNumOrPrive()
			this.getgonggaoList()
			this.screenHeight = window.innerHeight
			this.token = localStorage.getItem('token')
			if (this.token) {
				this.getUserInfo();
				
				this.selectVipDetails();
				this.getNonVipDetails();
				this.getVipdetile();
				this.$Request.get('/app/chat/selectChatCount').then(res => {
					if (res.code === 0) {

						let messageCount = res.data.messageCount
						this.chatCount = Number(res.data.chatCount) + Number(messageCount)

						this.$store.commit('SET_MESSAGE_COUNT', messageCount);
					}
				});
			}

			this.inter = setInterval(d => { //定时器，定时去调取聊天未读消息
				if (localStorage.getItem('token')) {
					this.$Request.get('/app/chat/selectChatCount').then(res => {
						if (res.code === 0) {

							let messageCount = res.data.messageCount
							this.chatCount = Number(res.data.chatCount) + Number(messageCount)

							this.$store.commit('SET_MESSAGE_COUNT', messageCount);
						}
					});
				} else {
					clearInterval(this.inter)
					this.inter = null
				}
			}, 6000);
			this.getVipPeople()
			this.getNoVipPeople()
			// this.getVipPrice()
			this.getVipCom()
			this.getNoVipCom()
		},
		computed: {
			userType() {
				return this.$store.state.userType;
			},
			avatar() {
				return this.$store.state.avatar;
			},
			nickName() {
				return this.$store.state.nickName;
			}
		},
		watch: {
			//监听一下用户类型重新去获取开通会员的价格
			userType() {
				// this.getVipPrice()
				this.getgonggaoList()
			},
		},
		methods: {
			// 点击预览
			handlePreview(file) {
				this.dialogImageUrl = file.url
				this.dialogVisible = true
			},
			vipNameTypeText(value) {
				const map = {
					0: '月',
					1: '季',
					2: '年'
				};
				return map[value] || '月';
			},
			// 获取HR信息
			getUserHrInfo() {
				this.$Request.get("/app/HrFirst/getUserHr").then((res) => {
					if (res.code == 0) {
						this.hrInfo = res.data.HrEntity
						this.hrPosition = res.data.HrEntity.hrPosition
						this.hrEmail = res.data?.HrEntity?.hrEmail
					}
				});
			},
			//获取vip个人信息
			getUserInfoVipList() {
				this.$Request.get("/app/user/vipData").then((res) => {
					if (res.code == 0) {
						this.myPostTimes = res.data.myPostTimes || 0
						this.vipDueTimes = res.data.vipDueTimes || 0
						this.vipConTimes = res.data.vipConTimes || 0
						this.myViewTimes = res.data.myViewTimes || 0
						this.vipViewTimes = res.data.vipViewTimes || 0
						this.myConTimes = res.data.myConTimes || 0
						this.vipPostTimes = res.data.vipPostTimes || 0
						this.myDueTimes = res.data.myDueTimes || 0
					}
				});
			},
			//vip 套餐
			selectVipDetails() {
				this.$Request.get("/app/VipDetails/selectVipDetails").then((res) => {
					if (res.code == 0) {
						this.viplist = res.data || [];
					}
				});
			},
			// 基础套餐
			getNonVipDetails() {
				this.$Request.get("/app/VipDetails/getNonVipDetails").then((res) => {
					if (res.code == 0) {
						this.nonVipInfo = res.data;
					}
				});
			},
			// 获取会员到期天数
			getVipdetile() {
				this.$Request.get("/app/UserVip/selectUserVip").then((res) => {
					if (res.code == 0) {
						if (res.data) {
							this.endTimeStr = res.data.endTime; // 到期时间（格式：yyyy-MM-dd HH:mm:ss 或 yyyy-MM-dd）
							const createTimeStr = res.data.createTime; // 创建时间（格式同上）

							// 1. 时间字符串转时间戳（兼容不同格式）
							const endTime = this.formatTimeToTimestamp(this.endTimeStr);
							const createTime = this.formatTimeToTimestamp(createTimeStr);
							const currentTime = new Date().getTime(); // 当前时间戳

							// 2. 验证时间有效性
							if (!endTime || !createTime) {
								console.error("时间格式错误", { endTimeStr:this.endTimeStr, createTimeStr });
								this.remainingDays = 0;
								// this.vipStatus = "已过期";

								return;
							}
							if (res.data.vipDetails) {
								this.vipName = res.data.vipDetails.vipName
							}
							// 3. 计算剩余时间（毫秒）：到期时间 - 当前时间
							const remainingTime = endTime - currentTime;

							// 4. 处理不同情况
							if (remainingTime <= 0) {
								// 已过期
								this.remainingDays = 0;
								// this.vipStatus = "已过期";
							} else {
								// 计算剩余天数（向上取整，不足1天按1天算）
								const days = Math.ceil(remainingTime / (1000 * 60 * 60 * 24));
								this.remainingDays = days;
								// this.vipStatus = `剩余${days}天到期`;
								// // 可选：如果需要显示总有效期（创建到到期的总天数）
								// this.totalValidDays = Math.ceil((endTime - createTime) / (1000 * 60 * 60 * 24));
							}
							
						}
					} else {
						this.remainingDays = 0;
						this.vipStatus = "未开通VIP";
					}
				}).catch((err) => {
					console.error("获取VIP详情失败", err);
					this.remainingDays = 0;
					this.vipStatus = "未开通VIP";
				});
			},
			formatTimeToTimestamp(timeStr) {
				if (!timeStr) return null;
				const formattedTime = timeStr.replace(/-/g, "/");
				const timestamp = new Date(formattedTime).getTime();
				return isNaN(timestamp) ? null : timestamp;
			},
			//选择地址
			handleSelect(item) {
				this.form.province = item.province
				this.form.city = item.city
				this.form.district = item.district
				this.form.companyLng = item.location.lng
				this.form.companyLat = item.location.lat
			},
			//地址搜索
			querySearchAsync(queryString, cd) {
				if (!queryString) {
					cd([])
					return
				}
				let data = {
					key: "ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75", //申请的密钥
					keyword: queryString, //搜索内容
					output: 'jsonp',
				};
				let url =
					"https://apis.map.qq.com/ws/place/v1/suggestion"
				axios.get(url, {
					params: data,
					adapter: jsonp
				}).then(res => {
					if (res.data.status == 0) {
						let arr = res.data.data
						arr.map(item => {
							item.value = item.title
						})
						cd(arr)
					}
				}).catch(err => {
					console.log(err)
				})
			},
			//获取免费联系次数与价格
			getNumOrPrive() {
				// 企业会员每天免费联系次数
				this.$Request.get('/app/common/type/421').then(res => {
					if (res.code == 0) {
						this.vipMsgNum = res.data.value ? res.data.value : 0
					}
				})
				// 企业非会员每天免费联系次数
				this.$Request.get('/app/common/type/422').then(res => {
					if (res.code == 0) {
						this.msgNum = res.data.value ? res.data.value : 0
					}
				})
				// 企业会员每次联系价格
				this.$Request.get('/app/common/type/419').then(res => {
					if (res.code == 0) {
						this.vipMsgPrice = res.data.value ? res.data.value : 0
					}
				})
				// 企业非会员每次联系价格
				this.$Request.get('/app/common/type/420').then(res => {
					if (res.code == 0) {
						this.msgPrice = res.data.value ? res.data.value : 0
					}
				})
			},
			//获取公告
			getgonggaoList() {
				this.$Request.get('/app/message/page/1/1/100').then(res => {
					if (res.code == 0) {
						let arr = []
						if (this.userType == 1) { //用户公告
							res.data.list.map(item => {
								if (item.type == 1) {
									arr.push(item.title)
								}
							})
						} else { //企业公告
							res.data.list.map(item => {
								if (item.type == 2) {
									arr.push(item.title)
								}
							})
						}
						this.gongao = arr
					} else {
						this.gongao = []
					}
				})
			},
			openAgree() {
				this.dialogAgreements = true
			},
			closeAgree(data) {
				this.dialogAgreements = data
			},
			//清除定时器
			cleanTimer() {
				clearInterval(this.timer)
				this.timer = null
				this.orderId = ''
			},
			closeVip() {
				this.radio = 2
				this.cleanTimer()
				this.codeUrl = ''
				this.alPay = ''
				//关闭的时候再去查询一下会员的支付状态
				this.getPayStatus()
			},
			changeRadio() {
				this.codeUrl = ''
				this.alPay = ''
			},
			//查询支付状态
			getPayStatus() {
				let data = {
					orderId: this.orderId
				}
				this.$Request.get('/app/payDetails/checkOrderStatus', {
					params: data
				}).then(res => {
					if (res.code == 0) {
						// isPay
						if (res.data) {
							ElMessage({
								message: '支付成功',
								type: 'success',
								duration: 1500,
								offset: this.screenHeight / 2
							})
							this.cleanTimer()
							this.dialogVisiblevip = false
							this.getUserInfo()

						}
					}
				})
			},
			//打开会员支付
			openVipMenber() {
				if (this.checkVipXy == false) {
					ElMessage({
						message: '请阅读并同意《会员开通协议》',
						type: 'info',
						duration: 1500,
						offset: this.screenHeight / 2
					})
					return
				}
				if (localStorage.getItem('token')) {
					this.dialogVisiblevip = true
				} else {
					this.$router.push({
						name: 'login'
					})
				}

			},
			//会员支付
			payMoney() {
				if (this.radio == 1) { //微信支付
					// 微信支付
					let data = {
						classify: 6,
						// money: this.vipPrice,
						type: this.vipId,
					}
					this.$Request.post('/app/wxPay/wxPayOrder', data).then(res => {
						if (res.code == 0) {
							if (res.data) {
								this.cleanTimer()
								this.codeUrl = res.data.param.code_url
								this.orderId = res.data.orderId
								this.timer = setInterval(() => {
									this.getPayStatus()
								}, 1000)

							}
						} else {
							this.cleanTimer()
							ElMessage({
								message: res.msg,
								type: 'error',
								duration: 1500,
								offset: this.screenHeight / 2
							})
						}
					})
				} else {
					let data = {
						classify: 7,
						// money: 0.1,
						type: this.vipId,
					}
					this.$Request.post('/app/aliPay/payMoneyOrder', data).then(
						res => {
							if (res.code === 0) {
								if (res.data) {
									this.cleanTimer()
									this.alPay = res.data.form
									this.orderId = res.data.orderId
									this.timer = setInterval(() => {
										this.getPayStatus()
									}, 1000)
								}
							} else {
								this.cleanTimer()
								ElMessage({
									message: res.msg,
									type: 'error',
									duration: 1500,
									offset: this.screenHeight / 2
								})
							}
						});
				}

			},
			//去企业中心
			goMyCompanyCenter() {
				this.$router.push({
					name: 'enterprise'
				})
			},
			//关闭发布弹窗
			closePostPush(data) {
				this.dialogPostPush = data
			},
			//发布岗位
			fabuPostPush() {

				this.dialogPostPush = true
			},
			//时间对象转：2023-11-21格式
			getFormDate(formData) {
				let time = new Date(formData)
				return time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate();
			},
			//企业认证
			saveCompany() {
				let formRef = this.$refs.formCompany
				formRef.validate((valid) => {
					if (valid) {
						let form = JSON.parse(JSON.stringify(this.form));
						
						const data = {
							companyAllName: form.companyName,
							companyPeople: form.companyPeople,
							companyCertification: form.companyCertification,
							employmentVerification: form.employmentVerification,
							companyVerification: form.companyVerification.join(',')
						};
						this.loadingCompany = true
						this.$Request.post("/app/company/insertCompany", data,{type:'json'}).then(res=>{
							if (res.code == 0) {
								this.loadingCompany = false
								this.dialogCompay = false;
								this.dialogPostPush = true
							} else {
								this.loading = false
								ElMessageBox.alert(res.msg, '提示', {
									confirmButtonText: '确认'
								})
							}
						})
						// if (this.form.companyId) { //修改
						// 	this.$Request.post("/app/company/updateCompany", form, {
						// 		type: 'json'
						// 	}).then(res => {
						// 		if (res.code == 0) {
						// 			ElMessage({
						// 				message: '认证修改成功!',
						// 				type: 'success',
						// 				duration: 1500,
						// 				offset: this.screenHeight / 2
						// 			})
						// 			this.loadingCompany = false
						// 			this.dialogCompay = false
						// 		} else {
						// 			this.loadingCompany = false
						// 			ElMessageBox.alert(res.msg, '提示', {
						// 				confirmButtonText: '确认'
						// 			})
						// 		}
						// 	});
						// } else { //保存
						// 	this.$Request.post("/app/company/insertCompany", form, {
						// 		type: 'json'
						// 	}).then(res => {
						// 		if (res.code == 0) {
						// 			ElMessage({
						// 				message: '认证提交成功!',
						// 				type: 'success',
						// 				duration: 1500,
						// 				offset: this.screenHeight / 2
						// 			})
						// 			this.loadingCompany = false
						// 			this.dialogCompay = false
						// 		} else {
						// 			this.loading = false
						// 			ElMessageBox.alert(res.msg, '提示', {
						// 				confirmButtonText: '确认'
						// 			})
						// 		}
						// 	});
						// }

					} else {
						console.log('error submit!')
						return false
					}
				})
			},
			//上传营业执照
			handleAvatarSuccessC(res) {
				this.form.companyCertification = res.data
			},
			// PDF 上传成功
			handlePdfSuccess(res, file) {
				this.form.employmentVerification = res.data
				this.pdfFileList = [{ name: file.name, url: res.data }]
			},
			handlePdfRemove() {
				this.form.employmentVerification = ''
				this.pdfFileList = []
			},
			// 公司证明上传成功
			handleProofSuccess(res, file, fileList) {
				this.form.companyVerification = fileList.map(
					item => item.response ? item.response.data : item.url
				)
				this.proofFileList = fileList
			},
			handleProofRemove(file, fileList) {
				this.form.companyVerification = fileList.map(
					item => item.response ? item.response.data : item.url
				)
				this.proofFileList = fileList
			},
			//上传公司logo
			handleAvatarSuccessL(res) {
				this.form.companyLogo = res.data
			},
			//确认行业
			addHangye() {
				this.form.companyScope = this.industryArr.join(',')
				this.industryDialog = false
			},
			// 添加行业
			addIndustry(ite) {
				if (ite.select == false) {
					if (this.industryArr.length == 3) {
						ElMessage({
							message: '最多添加三条',
							type: 'info',
							duration: 1500,
							offset: this.screenHeight / 2
						})
						return
					}
					this.industryArr.push(ite.industryName)
				} else {
					this.industryArr.splice(this.industryArr.indexOf(ite.industryName), 1)
				}
				ite.select = !ite.select
			},
			//打开行业选择弹框
			openIndustry(type) {
				this.industryArr = []
				this.getIndustryList()
			},
			/**
			 * 获取行业数据
			 */
			getIndustryList() {
				this.$Request.get('/app/industry/getIndustryList').then(res => {
					if (res.code == 0) {
						let arr = JSON.parse(JSON.stringify(res.data))
						arr.map(item => {
							item.childrenList.map((ite, ind) => {
								ite.select = false
								if (ind < 6) {
									this.industryArrList.push(ite)
								}
							})
						})
						this.industryList = arr
						this.industryDialog = true
					} else {
						ElMessage({
							message: res.msg,
							type: 'error',
							duration: 1500,
							offset: this.screenHeight / 2
						})
					}
				})
			},
			cityChange() {
				console.log(this.form.companyScope, 'ccccccccccccc')
			},
			//获取公司规模
			getComList() {
				let data = {
					type: '公司规模 '
				}
				this.$Request.get("/app/dict/list", {
					params: data
				}).then(res => {
					if (res.code == 0) {
						this.comList = res.data
					}
				})
			},
			//切换为招聘者
			selectUserType() {
				ElMessageBox.confirm(
					'确认切换到招聘者身份吗？',
					'温馨提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning',
					}
				).then(() => {
					this.getCompany()
				}).catch(() => {

				})
			},
			//切换为求职者
			selectUserTypes() {
				ElMessageBox.confirm(
					'确认切换到求职者身份吗？',
					'温馨提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning',
					}
				).then(() => {
					this.$Request.post("/app/user/updateUserEntity", {
						userType: 1
					}).then(async res => {
						if (res.code == 0) {
							await this.getUserInfo()
							this.$router.push({
								name: 'index'
							})
						}
					})
				}).catch(() => {

				})
			},
			/**
			 * 获取用户企业实名数据
			 */
			getCompany() {
				this.$Request.get("/app/company/selectCompanyByUserId").then(res => {
					if (res.code == 0 && res.data) {
						this.CompanyList = res.data
						if (this.CompanyList.status == 1) {
							ElMessageBox.confirm(
								'您提交的企业认证正在审核，请审核通过后操作!',
								'温馨提示', {
									confirmButtonText: '确定',
									cancelButtonText: '取消',
									type: 'warning',
								}
							).then(() => {
								return;
								this.form = res.data
								this.form.companyRegisteredFund = Number(this.form.companyRegisteredFund)
								if (res.data.province && res.data.city && res.data.district) {
									this.form.companyAddress1 = [res.data.province, res.data.city, res.data
										.district
									]
								}
								this.getComList()
								this.dialogCompay = true
							}).catch(() => {

							})

						} else if (this.CompanyList.status == 2) { //切换为招聘者
							this.$Request.post("/app/user/updateUserEntity", {
								userType: 2
							}).then(async res => {
								if (res.code == 0) {
									this.$store.commit('SET_COMPANY_ID', this.CompanyList.companyId)
									localStorage.setItem('companyId', this.CompanyList.companyId)
									await this.getUserInfo()

									this.$router.push({
										name: 'indexCompany'
									})
								}
							})
						} else if (this.CompanyList.status == 3) {
							ElMessageBox.confirm(
								'您提交的企业认证已被拒绝，请重新认证!',
								'温馨提示', {
									confirmButtonText: '确定',
									cancelButtonText: '取消',
									type: 'warning',
								}
							).then(() => {
								this.form = res.data;
								this.form.companyLegalPerson = this.form.companyPeople;//公司规模
								// this.form.companyRegisteredFund = Number(this.form.companyRegisteredFund)
								// let address = this.form.companyAddress
								// let reg = /.+?(省|市|自治区|自治州|县|区)/g
								// let cityarr = address.match(reg)
								// if (cityarr.length >= 3) {
								// 	this.form.companyAddress1 = [cityarr[0], cityarr[1], cityarr[2]]
								// } else {
								// 	this.form.companyAddress1 = cityarr[0] + '' + cityarr[1]
								// }
								// this.form.companyAddress = this.form.companyAddress.replace(this.form
								// 	.companyAddress1, '')
								this.getComList()
								this.dialogCompay = true
							}).catch(() => {

							})
						}
					} else {
						ElMessageBox.confirm(
							'您还未企业认证,请进行认证',
							'温馨提示', {
								confirmButtonText: '确定',
								cancelButtonText: '取消',
								type: 'warning',
							}
						).then(() => {
							this.getComList()
							this.dialogCompay = true
						}).catch(() => {

						})
					}
				})
			},
			//会员岗位刷新次数
			getVipCom() {
				this.$Request.get('/app/common/type/330').then(res => {
					if (res.code == 0) {
						this.vipNumCom = res.data.value
					}
				})
			},
			//非会员岗位刷新次数
			getNoVipCom() {
				this.$Request.get('/app/common/type/329').then(res => {
					if (res.code == 0) {
						this.noVipNumCom = res.data.value
					}
				})
			},
			// 选择套餐
			selectPlan(plan) {
				this.vipId = plan.id;
				this.selectedPlan = plan.vipName;
				// 更新会员价格
				this.vipPrice = plan.money;
			},
			//会员简历刷新次数
			getVipPeople() {
				this.$Request.get('/app/common/type/328').then(res => {
					if (res.code == 0) {
						this.vipNum = res.data.value
					}
				})
			},
			//非会员简历刷新次数
			getNoVipPeople() {
				this.$Request.get('/app/common/type/327').then(res => {
					if (res.code == 0) {
						this.noVipNum = res.data.value
					}
				})
			},
			//去设置中心
			goSetting() {
				if (localStorage.getItem('token')) {
					this.$router.push({
						name: 'setting'
					})
				} else {
					this.goLogin()
				}
			},
			//去消息页面
			goMessage() {
				if (localStorage.getItem('token')) {
					this.$router.push({
						name: 'message'
					})
				} else {
					this.goLogin()
				}
			},
			//退出登录
			outLogin() {
				localStorage.removeItem('token');
				localStorage.removeItem('userId');
				localStorage.removeItem('userType');
				localStorage.removeItem('companyId');
				// 调用重置状态的函数  
				this.$store.dispatch('SET_DATA');
				this.$router.push({
					name: 'login'
				})
			},
			//上传头像成功后的回调
			handleAvatarSuccess(res) {
				this.avatars = res.data
			},
			// 保存
			messagebtn() {
				if (!this.nickNames) {
					ElMessage({
						message: '用户名不能为空',
						type: 'info',
						duration: 1500,
						offset: this.screenHeight / 2
					})
				} else if (!this.phone) {
					ElMessage({
						message: '联系电话不能为空',
						type: 'info',
						duration: 1500,
						offset: this.screenHeight / 2
					})
				} else {
					ElMessageBox.confirm(
							'确定保存信息？',
							'温馨提示', {
								confirmButtonText: '确定',
								cancelButtonText: '取消',
								type: 'warning',
							}
						)
						.then(() => {
							let data = {
								userName: this.nickNames,
								avatar: this.avatars,
								phone: this.phone,
								sex: this.sex,
								age: this.age,
								weChatNum: this.weChatNum
							}
							this.$Request.post("/app/user/updateUser", data, {
								type: 'json'
							}).then(res => {
								if (res.code == 0) {
									if(this.userType == 1){
										ElMessage({
											message: '保存成功',
											type: 'success',
											duration: 1500,
											offset: this.screenHeight / 2
										})
										this.getUserInfo()
										this.visible = false
									}else{
										this.saveHrInfo();
									}
								}
							})
						}).catch(() => {

						})
				}
			},
			// 保存hr的信息
			saveHrInfo() {
				this.$Request.post("/app/HrFirst/addHr", {
					hrPosition: this.hrPosition,
					hrEmail: this.hrEmail,
					avatar: this.avatars
				},{type: 'json'}).then(res => {
					if (res.code === 0) {
						ElMessage({
							message: '保存成功',
							type: 'success',
							duration: 1500,
							offset: this.screenHeight / 2
						})
						this.getUserInfo()
						this.visible = false
					}
				})
			},
			//去个人中心
			goInfo() {
				if (localStorage.getItem('token')) {
					this.$router.push({
						name: 'addResume'
					})
				} else {
					this.goLogin()
				}
			},
			//获取个人信息
			async getUserInfo() {
				await this.$Request.get('/app/user/selectUserById').then(res => {
					if (res.code == 0) {
						this.avatars = res.data.avatar
						this.nickNames = res.data.userName
						this.age = res.data.age
						this.phone = res.data.phone
						this.weChatNum = res.data.weChatNum
						this.sex = res.data.sex
						// this.avatar = res.data.avatar
						//记录直属佣金比例
						this.$store.commit('SET_ZHI_RATE', res.data.zhiRate)
						//设置手机号
						this.$store.commit('SET_PHONE', res.data.phone)
						//设置企业id
						// this.$store.commit('SET_COMPANY_ID', res.data.companyId)
						// localStorage.setItem('companyId', res.data.companyId)
						//设置邀请码
						this.$store.commit('SET_INVITATION_CODE', res.data.invitationCode)
						//设置头像
						this.$store.commit('SET_AVATAR', res.data.avatar);
						//设置昵称
						this.$store.commit('SET_NICK_NAME', res.data.userName);
						//设置微信号
						if (res.data.weChatNum) {
							this.$store.commit('SET_WE_CHAT_NUM', res.data.weChatNum);
						} else {
							this.$store.commit('SET_WE_CHAT_NUM', '');
						}

						if (res.data.userType == 1 || res.data.userType == null) {
							this.$store.commit('SET_USER_TYPE', 1);
							localStorage.setItem('userType', 1)
							if (res.data.isUserVip == 1) { //判断用户是否是vip
								this.isVip = true
								this.vipTime = res.data.userMonthTime
								this.$store.commit('SET_IS_VIP', true);
							} else {
								this.isVip = false
								this.$store.commit('SET_IS_VIP', false);
							}

						} else {
							this.$store.commit('SET_USER_TYPE', 2);
							localStorage.setItem('userType', 2)
							// 获取当前用户的vip数据
							this.getUserInfoVipList();
							// 获取HR信息
							this.getUserHrInfo()
							if (res.data.isUserVip + "" == "1") { //判断企业用户是否是vip
								this.isUserVip = true
								this.vipTimeC = res.data.companyMonthTime
								this.$store.commit('SET_IS_COMPANY_VIP', true);
							} else {
								this.isUserVip = false
								this.$store.commit('SET_IS_COMPANY_VIP', false);
							}
						}
					}
				})
			},
			//去登录
			goLogin() {
				this.$router.push({
					name: 'login'
				})
			},
			//返回首页
			goHome() {
				//判断是求职者 还是招聘者
				if (this.userType == 1) {
					this.$router.push({
						name: 'index',
					})
				} else {
					this.$router.push({
						name: 'indexCompany'
					})
				}

			},
			//去企业页面
			goComp() {
				this.$router.push({
					name: 'enterpriseList'
				})
			},
			// 去搜索页面
			goPosition() {
				this.$router.push({
					name: 'search'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	$margin-60: 120px;
	:deep(.el-upload--picture-card){
		width: 100px;
		height: 100px;
	}
	:deep(.el-upload-list--picture-card .el-upload-list__item) {
		width: 100px;
		height: 100px;
		border: none;
	}

	.avatar-uploader-icon {
		color: var(--el-border-color);
		font-size: 25px;
		width: 100px;
		height: 100px;
		border-radius: 6px;
		background: #f5f7fa;
	}

	:deep(.el-upload--picture-card) {
		border: none !important;
		width: initial !important;
	}
	:deep(.el-radio__label) {
		display: flex;
		align-items: center;
	}

	.my-header {
		padding: 10px 10px 0 10px;
	}

	.wallet {
		width: calc(100% - 20px);
		padding: 0 10px;

		.wallet-title {
			margin-top: 10px;
			font-weight: 500;
		}

		.wallet-pay {
			width: 100%;
			margin-top: 20px;

			.wallet-pay-qr {
				width: 100%;
				margin-top: 20px;
			}

		}
	}

	.zhiwei {
		width: 400px;
		max-height: 400px;
		overflow: hidden;
		overflow-y: scroll;

		.zhiwei-item {
			width: 100%;
		}

		.zhiwei-item-l {
			width: 40%;
			font-weight: 500;
		}

		.zhiwei-item-r {
			width: 60%;
		}

		.zhiwei-item-r-txt {
			width: 100%;
			font-weight: 500;
			color: #999999;
		}

		.zhiwei-item-r-i {

			margin-bottom: 10px;
		}

		.zhiwei-item-r-i-i {
			margin-top: 10px;
			margin-right: 10px;
			cursor: pointer;
			font-size: 14px;
		}

		.zhiwei-item-r-i-i:hover {
			color: #00DD9A;
		}
	}

	::-webkit-scrollbar {
		/* Chrome, Safari, Opera */
		width: 4px;
	}

	::-webkit-scrollbar-thumb {
		background-color: #cccccc;
		/* 滚动条颜色 */
	}

	::-webkit-scrollbar-track {
		background-color: #ffffff;
		/* 轨道颜色 */
	}

	.avatar-uploader {
		width: 100px;
		height: 100px;
		border: 1px solid var(--el-border-color);
		border-radius: 6px;

		img {
			width: 100%;
			height: 100%;
			border-radius: 6px;
		}
	}

	.avatar-uploader-icon {
		color: var(--el-border-color);
		font-size: 25px;
	}

	.myHy {
		width: 100%;
		height: 500px;

		.myHy-box {
			width: calc(100% - 40px);
			height: calc(100% - 40px);
			overflow: hidden;
			overflow-y: scroll;
		}

		.myHy-box-item {
			width: 100%;
		}

		.myHy-box-item-l {
			width: 200px;
			line-height: 36px;
			text-align: center;
			color: #333;
			font-size: 14px;
			font-weight: bold;
		}

		.myHy-box-item-r {
			width: calc(100% - 220px);

			.myHy-box-item-r-item {
				width: calc((100% - 24px) / 4);
				line-height: 36px;
				margin-bottom: 8px;
				cursor: pointer;
				// background-color: red;
			}
		}
	}

	.myInfo {
		:deep(.el-input__wrapper) {
			box-shadow: none;
			border: none;
		}
	}


	:deep(.el-dialog) {
		border-radius: 14px !important;
		// padding: 0 !important;
		// padding: 0 !important;
	}

	:deep(.el-dialog__body) {
		padding-top: 10px !important;


	}

	:deep(.el-dialog__header) {
		// background: linear-gradient(45deg, #f2fffa, #FFFFFF);
		border-radius: 14px 14px 0 0;
	}

	.row45 {
		width: 45%;
	}

	.info-box-l-edit-btn {
		width: 100%;
		height: 100%;
		margin-top: 30px;
	}

	.myVipCon {
		width: 100%;
		height: auto;
		background-color: #1F1F27;
		border-radius: 12px;

		.myVipCon-bg {
			margin-top: 20px;
			width: 100%;
			height: 100px;
			background: linear-gradient(90deg, #E8B99F 0%, #F8D3B9 46%, #DD9E7D 100%);
			border-radius: 19px;

			.myVipCon-bg-l {
				margin-left: 20px;
				color: #73411C;

				.myVipCon-bg-l-title {
					font-weight: 500;
				}

				.myVipCon-bg-l-time {
					font-weight: 400;
					font-size: 13px;
					margin-top: 10px;
				}
			}

			img {
				width: 80px;
				height: 80px;
				margin-right: 20px;
			}
		}

		.myVipCon-icon {
			margin-top: 10px;

			.myVipCon-icon-item {
				img {
					width: 50px;
					height: 50px;
					border-radius: 50%;
				}
			}

			.myVipCon-icon-item-txt {
				width: 100%;
				text-align: center;
				color: #E3C9BB;
				margin-top: 5px;
			}
		}

		.myVipCon-li {
			margin-top: 20px;
			width: 100%;
			height: auto;
			background-color: #FFFFFF;
			border-radius: 13px;
			position: relative;

			.myVipCon-li-sj {
				position: absolute;
				width: 0;
				height: 0;
				border-left: 10px solid transparent;
				border-right: 10px solid transparent;
				border-bottom: 10px solid #FFFFFF;
				top: -8px;
				left: 50%;
				transform: translate(-50%, 0);
			}

			.myVipCon-li-con {
				padding: 20px 0;

				.myVipCon-li-con-item {
					width: 100%;
				}

				.myVipCon-li-con-itemscolor1 {
					color: #999999 !important;
				}

				.myVipCon-li-con-itemscolor2 {
					color: #DE8D5C !important;
				}

				.myVipCon-li-con-items {
					width: 70px;
					text-align: center;
					padding: 10px 0;
					color: #333333;
					font-weight: 400;
					font-size: 13px;
					position: relative;
				}
			}
		}

		.myVipCon-xy {
			margin-top: 5px;
			padding-left: 20px;
			color: #FFFFFF;

			span {
				cursor: pointer;
				color: #00DD9A;
			}
		}

		.myVipCon-btn {
			width: 100%;
			height: 44px;
			margin-top: 5px;

			.myVipCon-btn-l {
				width: 65%;
				height: 100%;
				background: linear-gradient(90deg, #056D70 0%, #023842 100%);
				border-radius: 36px 0px 0px 36px;
				color: #FEBB90;
				font-weight: 500;

				span {
					margin-left: 20px;
					font-size: 18px;
				}
			}

			.myVipCon-btn-r {
				width: 35%;
				height: 100%;
				background: linear-gradient(90deg, #FFE2DA 0%, #FFB584 100%);
				border-radius: 0 36px 36px 0;
				color: #58372D;
				cursor: pointer;
				font-weight: 500;
			}
		}
	}

	.seeting {
		width: 100%;
		height: auto;

		.seeting-item {
			width: 100%;
			text-align: center;
			line-height: 40px;
			cursor: pointer;
		}

		.seeting-item:hover {
			color: #FFFFFF;
			background-color: #00DD9A;
			border-radius: 8px;
		}
	}

	.myInfo {
		width: calc(100% - 20px);
		height: auto;
		padding: 10px;

		.myInfo-title {
			width: 100%;
			text-align: center;
			font-weight: bold;
		}

		.myInfo-item {
			border-bottom: 1px solid #f5f5f5;
			padding: 10px 0;
		}

		.removeInputStyle {
			.el-input__wrapper {
				box-shadow: none;
			}
		}

		.myInfo-btn {
			width: 100%;
		}
	}


	.headers {
		width: 100%;
		height: 60px;
		background-color: #FFFFFF;

		.headers-box {
			width: calc(1600px - $margin-60 * 2);
			height: 30px;
		}

		.headers-box-logo {
			cursor: pointer;
		}

		.headers-box-right {
			width: auto;
			height: 100%;
		}

		.headers-box-right-item:hover {
			color: #00DD9A;
		}

		.headers-box-right-item {
			color: #333333;
			font-size: 14px;
			font-weight: 400;
			margin-left: 40px;
			cursor: pointer;
			position: relative;
		}

		.myVip {
			font-size: 14px;
			font-weight: 400;
			margin-left: 40px;
			cursor: pointer;
			background: linear-gradient(32deg, #FCEEDB 0%, #FFE7C4 98%);
			border-radius: 4px;
			height: 100%;
			padding: 0 16px;
			color: #7A330D;
		}

		.myLogin {
			font-size: 14px;
			font-weight: 400;
			margin-left: 40px;
			cursor: pointer;
			border: 1px solid #00DD9A;
			border-radius: 4px;
			height: 100%;
			padding: 0 16px;
		}
	}
	.plan-tag-left {
		position: absolute;
		top: 0px;
		left: 0px;
		background: linear-gradient(90.00deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
		color: rgba(255, 255, 255, 1);
		font-family: DM Sans;
		font-size: 6px;
		font-weight: 400;
		line-height: 7px;
		letter-spacing: 0px;
		text-align: left;
		padding: 2px 6px;
		border-radius: 8px 0 8px 0;
		transform-origin: center;
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;

		&::before {
			content: '';
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: inherit;
			transform: rotate(-45deg);
			z-index: -1;
		}
	}
</style>