{extend name="main"}
{block name="style"}
<style type="text/css">
{notempty name="Find.banner"}
.job-fair-header{
	min-height: 600px;
	background-image: url({$Find.banner});
	background-repeat: no-repeat;
	background-position-x:center;
	background-size: auto 600px;
	background-color: #F8F8F8;
	padding-top: 500px;
}
{/notempty}
.el-select .el-input,.w-80px{width: 100px; }
.job-fair-nav .el-tabs__header{margin:0;}
.job-fair-nav .el-tabs__nav-scroll{padding: 0 1rem;}
.job-fair-booth .el-tabs__item{height:60px;line-height:60px;padding: 0 2rem;}
.mx--5{margin-left: -0.5rem;margin-right: -0.5rem;}
.amap-info-content{padding: 10 !important;}
.amap-info-close{display: none !important;}
.is-lock.bg-danger .text-primary,
.is-lock.bg-danger .text-secondary{
color: #FFFFFF !important;
}
.is-lock.bg-success .text-primary,
.is-lock.bg-success .text-secondary{
color: #FFFFFF !important;
}
.block-title{background-color: #4B76EA;}
.block-title .el-divider__text{color:#4B76EA;background-color: #FFFFFF;white-space: nowrap;}
</style>
{/block}
{block name="header"}
{include file="module/top_nav" container="container-xl"/}
{include file="module/header_concise"/}
{/block}
{block name="body"}
<div class="job-fair-header pb-3">
	<div class="container-xl">
		<div class="flex bg-white py-5">
			<div class="flex-1"></div>
			<el-divider class="w-50 block-title">{$Find.title}</el-divider>
			<div class="flex-1"></div>
		</div>
		<div class="bg-white py-3 flex text-center flex-v-center text-dark">
			<div class="px-4">
				<div class="text-primary h4 mb-0 font-weight-bold px-1">{$Find.company_sum}</div>
				参会企业
			</div>
			<div class="py-3 border-left"></div>
			<div class="px-4">
				<div class="text-primary h4 mb-0 font-weight-bold px-1">{$Find.jobs_sum}</div>
				可投职位
			</div>
			<div class="py-3 border-left"></div>
			<div class="px-4">
				<div class="text-primary h4 mb-0 font-weight-bold px-1">{$Find.resume_sum}</div>
				求职者
			</div>
			<div class="py-3 border-left"></div>
			<div class="px-4">
				<div class="text-primary h4 mb-0 font-weight-bold px-1">{$Find.view_sum}</div>
				浏览量
			</div>
			<div class="py-3 border-left"></div>
			<div class="px-4">
				<div class="text-primary h4 mb-0 font-weight-bold px-1">{$Find.view_people_sum}</div>
				浏览人次
			</div>
		</div>
		<div class="p-4 bg-white text-grey">
	        为贯彻落实市委市政府、省人社厅关于做好新型冠状病毒感染的肺炎疫情防控工作要求，确保人民群众的生命安全、身体健康。为保障服务节后企业稳定用工和求职者应聘的需求，我们充分利用网络和新媒体平台，搭建线上交流渠道，求职人员可以通过宿迁人才网查询企业招聘信息与企业进行不见面沟通，亦可通过在线直接应聘相关岗位。
		</div>
		<el-tabs v-model="activeName" class="bg-white job-fair-nav">
		    <el-tab-pane label="展位" name="booth"></el-tab-pane>
		    <el-tab-pane label="企业" name="company"></el-tab-pane>
		    <el-tab-pane label="职位" name="jobs"></el-tab-pane>
		    <el-tab-pane label="人才" name="resume"></el-tab-pane>
		    <el-tab-pane label="交通路线" name="address"></el-tab-pane>
		    <el-tab-pane label="招聘会详情" name="content"></el-tab-pane>
		    <el-tab-pane label="联系我们" name="about"></el-tab-pane>
		</el-tabs>
		<div class="bg-white px-3 py-5"
		v-if="activeName=='content'">{$Find.content|raw}</div>
		<div class="bg-white p-3"
		v-if="activeName=='address'">
			<div class="flex flex-center py-3">
				<div class="text-secondary">举办地址</div>
				<div class="ml-3">{$Find.job_fair_province}{$Find.job_fair_city}{$Find.job_fair_area}{$Find.address}</div>
			</div>
			<div class="flex flex-center py-3">
				<div class="text-secondary">交通路线</div>
				<div class="ml-3">{$Find.transit}</div>
			</div>
			<div v-if="amapConfig.status && amapConfig.js_status && Find.lng && Find.lat">
				<div id="map_container" style="width: 100%;height: 500px;"></div>
			</div>
		</div>
		<div class="mt-3 row mx--1"
		v-if="activeName=='company'"
		v-loading="company_search.ajax">
			<div class="col-6 mb-3 px-2 text-secondary pt-2">
				已有<span class="px-1 text-primary">{{company_search.total}}</span>家企业参会，正在陆续增加中……
			</div>
			<div class="col-6 mb-3 px-2">
				<el-form @submit.native.prevent="sendComapnySearch">
					<el-input placeholder="企业名称检索" v-model="company_search.key" class="input-with-select"
					clearable>
					    <el-button native-type="submit" slot="append" icon="el-icon-search">搜索</el-button>
					</el-input>
				</el-form>
			</div>
			<div class="col-3" v-for="(v,index) in companyList">
				<div class="bg-white p-3">
					<a :href="'/company/'+v.id+'.html'" target="_blank" class="flex flex-center pb-2">
						<div class="border w-60px h-60px text-truncate rounded-lg">
							<img :src="v.logo" style="object-fit: contain;width: 100%;height: 100%;">
						</div>
						<div class="flex-1 pl-2">
							<div class="mb-1 text-primary">{{v.scompany_name?v.scompany_name:v.company_name}}</div>
							<div class="text-secondary">{{v.contacts_area}}丨{{v.nature}}</div>
						</div>
					</a>
					<div class="bg-white text-secondary border-top pt-2">
						在招职位：<span class="text-primary pointer" @click="clickJobsSum(v)">{{v.jobs_sum}}</span>
					</div>
				</div>
			</div>
			<div class="col-12 text-center">
				<el-pagination
				  background
				  layout="prev, pager, next"
      			  @current-change="handleCompanyCurrentChange"
			      :page-size="company_search.per_page"
				  :total="company_search.total">
				</el-pagination>
			</div>
		</div>
		<div class="mt-3 row mx--1"
		v-if="activeName=='jobs'"
		v-loading="jobs_search.ajax">
			<div class="col-6 mb-3 px-2 pt-2 text-secondary">
				已有<span class="px-1 text-primary">{{company_search.total}}</span>家企业参会，发布的<span class="px-1 text-primary">{{jobs_search.total}}</span>个职位
			</div>
			<div class="col-6 mb-3 px-2">
				<el-form @submit.native.prevent="sendJobsSearch">
					<el-input placeholder="会计/财务/人力/客服/设计…" v-model="jobs_search.key" class="input-with-select"
					clearable>
					    <el-button native-type="submit" slot="append" icon="el-icon-search">搜索</el-button>
					</el-input>
				</el-form>
			</div>
			<div class="col-6 mb-3 px-2" v-for="v in jobsList">
				<div class="bg-white flex p-4">
					<div class="flex-1 pr-3">
						<a :href="'/jobs/'+v.id+'.html'" target="_blank">
							<div class="h6 text-0143B1">{{v.title}}[{{v.jobs_city}}]</div>
						</a>
						<div class="h6 text-ec6334 flex">
							<div v-if="v.salary_min>0">
								<span v-if="v.jobs_salary_show_type">{{v.salary_min*1000}}-{{v.salary_max*1000}}元</span>
								<span v-else>{{v.salary_min}}-{{v.salary_max}}k</span>
								<span class="text-danger" v-if="v.salary_year>12">·{{v.salary_year}}薪</span>
							</div>
							<div v-else>面议</div>
							<div class="text-secondary ml-2 small">{{v.education}}丨{{v.exp_level}}</div>
						</div>
					</div>
					<div class="flex-1">
						<div>
							<a :href="'/company/'+v.company_id+'.html'" target="_blank" class="el-link el-link--primary">{{v.scompany_name?v.scompany_name:v.company_name}}</a>
						</div>
						<div class="text-secondary">{{v.industry}}丨{{v.size_type}}</div>
					</div>
					<div class="pl-3 w-80px text-right">
						<el-button type="info" size="small" v-if="v.is_delivery">已投递</el-button>
						<el-button type="primary" size="small" @click="deliveryResume(v,{job_fair_id:Find.id});" v-else="v.is_delivery">投递简历</el-button>
						<div class="pt-2 pointer" @click="toggleJobsCollection(v)" v-if="v.is_collection"><i class="el-icon-star-on mr-1"></i>取消收藏</div>
						<div class="pt-2 pointer" @click="toggleJobsCollection(v)" v-if="!v.is_collection"><i class="el-icon-star-off mr-1"></i>收藏</div>
					</div>
				</div>
				<!-- <div class="px-4 py-3 bg-light" v-if="v.welfare.length>0">
					<el-tag type="success" size="mini" v-for="welfare in v.welfare" class="mr-2">{{welfare}}</el-tag>
				</div> -->
			</div>
			<div class="col-12 text-center pt-3">
				<el-pagination
				  background
				  layout="prev, pager, next"
      			  @current-change="handleJobsCurrentChange"
			      :page-size="jobs_search.per_page"
				  :total="jobs_search.total">
				</el-pagination>
			</div>
		</div>
		<div
		v-if="activeName=='resume'"
		v-loading="resume_search.ajax">
			<div class="row mx--1 mt-3">
				<div class="mb-3 px-2 pt-2 text-secondary">
					已有<span class="px-1 text-primary">{{resume_search.total}}</span>位人才参会，正在陆续增加中……
				</div>
			</div>
			<div class="row home-resume-list">
				<a v-for="(v,index) in resumeList" :href="'/resume/'+v.id+'.html'" class="col-4" target="_blank">
					<div class="flex bg-white p-3 flex-center">
						<div class="p-3">
							<img :src="v.headimg" width="80" height="80" class="rounded-circle">
						</div>
						<div class="flex-1 h6 mb-0">
							<div class="flex flex-center">
								<div class="flex-1 text-dark">{{v.name}}</div>
								<div class="text-secondary small">信息完整度:<span class="text-primary h5 mb-0">{{v.progress}}%</span></div>
							</div>
							<ul class="resume-seniority flex mt-2 text-secondary small">
								<li>{{v.sex==1?'男':''}}{{v.sex==2?'女':''}}</li>
								<li>{{v.educational_background}}</li>
								<li>{{v.age}}岁</li>
								<li>{{v.work_experience_time?v.work_experience_time+'年':'无'}}工作经验</li>
							</ul>
							<div class="mt-2 text-secondary small">{{v.industry}}</div>
							<div class="text-secondary mt-2 small"><i class="el-icon-location-information mr-2"></i>{{v.job_area?v.job_area:'区域不限'}}</div>
						</div>
					</div>
				</a>
			</div>
			<div class="text-center pt-3">
				<el-pagination
				  background
				  layout="prev, pager, next"
      			  @current-change="handleResumeCurrentChange"
			      :page-size="resume_search.per_page"
				  :total="resume_search.total">
				</el-pagination>
			</div>
		</div>
		<div class="bg-white px-3 py-5"
		v-if="activeName=='booth'">
			{notempty name="Find.booth_img"}
			<div class="text-center">
				<el-image
				  	style="width: 100%; height: 300px"
				    src="{$Find.booth_img}" 
				    fit="contain"
				    :preview-src-list="['{$Find.booth_img}']">
			  	</el-image>
			</div>
			{/notempty}
			<div class="flex flex-center" v-if="userInfo.id && userInfo.role_type===1">
				<div class="text-secondary">预定状态</div>
				<div class="bg-light py-1 px-3 rounded ml-1 small">可预订</div>
				<div class="bg-danger py-1 px-3 rounded ml-1 text-white small">锁定</div>
				<div class="bg-success py-1 px-3 rounded ml-1 text-white small">已售</div>
				<div class="bg-light py-1 px-3 rounded ml-1 small text-secondary">每个账号可预定{$Find.booth_sum}个</div>
			</div>
			<el-tabs tab-position="left" v-model="booth" class="job-fair-booth mt-3">
			    <el-tab-pane :label="v.name" :name="v.identifier" v-for="(v,index) in Find.booth">
		  		<div class="row">
			  		<div v-for="(va,n) in v.boothCate" class="col-4 col-xl-3 py-3">
			  			<div class="rounded p-3 pointer"
			  			:class="getBoothClass(va)"
			  			@click="clickBooth(va,index,n)">
					    	<div class="flex mb-1 flex-center">
					    		<div class="flex-1 h1 mb-0 text-secondary">{{v.identifier}}{{va.index}}</div>
					    		<div>
							  		<div class="small" v-if="va.status===0&&userInfo.id && userInfo.role_type===1">可预订</div>
							  		<div class="small text-white" v-if="va.status===1&&userInfo.id && userInfo.role_type===1">锁定</div>
							  		<div class="small text-white" v-if="va.status===2&&userInfo.id && userInfo.role_type===1">已售<span v-if="userInfo.company_id===va.company_id">(我)</span></div>
							    	<div v-if="userInfo.id && userInfo.role_type===1">
								    	<div v-if="va.price>0" class="text-primary font-weight-bold">{{va.price}}元</div>
								    	<div v-else>免费</div>
							    	</div>
							    	<div v-else class="small">
							    		<div v-if="va.status===2 && va.company_id">
											{{va.stitle?va.stitle:va.title}}
							    		</div>
							    		<div v-else class="text-secondary">未入驻</div>
							    	</div>
					    		</div>
					    	</div>
				    	</div>
			  		</div>
		  		</div>
			    </el-tab-pane>
			</el-tabs>
		</div>
		<div class="bg-white px-3 py-5"
		v-if="activeName=='about'">
			{notempty name="Find.contacts"}
			{volist name="Find.contacts" id="v"}
			<div class="flex">
				<div class="text-secondary mr-3">{$v.contacts}</div>
				<div class="ml-1">
					{notempty name="v.contacts_mobile"}
					<div>手机号：{$v.contacts_mobile}</div>
					{/notempty}
					{notempty name="v.contacts_tel"}
					<div>座机：{$v.contacts_tel}</div>
					{/notempty}
					{notempty name="v.contacts_qq"}
					<div>QQ：{$v.contacts_qq}</div>
					{/notempty}
					{notempty name="v.contacts_wechat"}
					<div>微信号：{$v.contacts_wechat}</div>
					{/notempty}
					{notempty name="v.contacts_email"}
					<div>邮箱：{$v.contacts_email}</div>
					{/notempty}
				</div>
				<div class="ml-1">{$v.remarks}</div>
			</div>
			{/volist}
			{/notempty}
			{notempty name="Find.about"}
			<div class="mt-5">
				{$Find.about|raw}
			</div>
			{/notempty}
		</div>
	</div>
</div>
<div style="display: none;">
	<div ref="infoWindow">
		<div class="flex">
			{notempty name="Find.thumb"}
			<div class="pr-2">
				<img src="{$Find.thumb}" height="60" width="60">
			</div>
			{/notempty}
			<div>
				<div class="h6">{$Find.title}</div>
				<div class="text-secondary small">{$Find.transit}</div>
				<div class="text-secondary small">{$Find.job_fair_province}{$Find.job_fair_city}{$Find.job_fair_area}{$Find.address}</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="footer"}
{include file="module/footer"/}
{include file="module/login"/}
{include file="module/buy_win"/}
{/block}
{block name="script"}
<script type="text/javascript">
	var amapConfig={
		status:{xycms:mapconfig name="status"/},
		server_status:{xycms:mapconfig name="server_status"/},
		js_status:{xycms:mapconfig name="js_status"/},
		js_key:'{xycms:mapconfig name="js_key"/}',
	};
	{notempty name="Find"}
	var Find={:json_encode($Find,JSON_UNESCAPED_UNICODE)};
	var booth='';
	if(Find.booth&&Find.booth[0]&&Find.booth[0].identifier)
		booth=Find.booth[0].identifier;
	{/notempty}
</script>
<script type="text/javascript">
	var map=null;
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			loginTabs:XYBase.loginTabs,
			userInfo:UserInfo,
			feedback:XYBase.feedback,
			buy:XYBase.buy,
			activeName:'booth',
			boothCateIndex:null,
			boothIndex:null,
			booth:booth,
			Find:Find,
			confirm:0,
			amapConfig:amapConfig,
			companyList:[],
			jobsList:[],
			resumeList:[],
			company_search:{
				bid:'',
				id:{$Find.id},
				ajax:0,
				total:0,
				per_page:0,
				page:1,
				key:''
			},
			jobs_search:{
				id:{$Find.id},
				company_id:'',
				ajax:0,
				total:0,
				per_page:0,
				page:1,
				key:''
			},
			resume_search:{
				id:{$Find.id},
				ajax:0,
				total:0,
				per_page:0,
				page:1,
				key:''
			}
		},
		watch:{
		    view:XYBase.viewWatch,
		    loginTabs:XYBase.loginTabsWatch,
		    activeName(val,oldVal){
		    	switch(val){
		    		case 'address':
		    		setTimeout("initAmap();",300)
		    		break;
		    		case 'jobs':
		    		break;
		    		default:
		    		this.jobs_search.company_id='';
		    		break;
		    	}
		    },
			userInfo:{
				handler(val,oldVal){
					if (!val.id) {
						window.location.reload();
					}
				},
				deep:true
			},
		},
		created(){
			XYBase.created(this);
			this.initGetCompanyList();
			this.initGetJobsList();
			this.initGetResumeList();
		},
		methods:XYBase.methods({
			handleCompanyCurrentChange(val){
				this.company_search.page=val;
				this.initGetCompanyList();
			},
			handleJobsCurrentChange(val){
				this.jobs_search.page=val;
				this.initGetJobsList();
			},
			handleResumeCurrentChange(val){
				this.resume_search.page=val;
				this.initGetJobsList();
			},
			sendComapnySearch(){
				this.company_search.page=1;
				this.initGetCompanyList();
			},
			sendJobsSearch(){
				this.jobs_search.page=1;
				this.initGetJobsList();
			},
			sendResumeSearch(){
				this.resume_search.page=1;
				this.initGetJobsList();
			},
			initGetCompanyList(){
				if(this.company_search.ajax)return;
				this.company_search.ajax=1;
				var _this=this;
				this.sendGet({
					url:'/job-fair/getCompanyList',
					data:this.company_search
				},function(ret){
					_this.company_search.ajax=0;
					if(ret){
						if(ret.code===0){
							_this.companyList=ret.data.data;
							_this.company_search.total=ret.data.total;
							_this.company_search.per_page=ret.data.per_page;
						}
					}
				})
			},
			initGetJobsList(){
				if(this.jobs_search.ajax)return;
				this.jobs_search.ajax=1;
				var _this=this;
				this.sendGet({
					url:'/job-fair/getJobsList',
					data:this.jobs_search
				},function(ret){
					_this.jobs_search.ajax=0;
					if(ret){
						if(ret.code===0){
							_this.jobsList=ret.data.data;
							_this.jobs_search.total=ret.data.total;
							_this.jobs_search.per_page=ret.data.per_page;
						}
					}
				})
			},
			initGetResumeList(){
				if(this.resume_search.ajax)return;
				this.resume_search.ajax=1;
				var _this=this;
				this.sendGet({
					url:'/job-fair/getResumeList',
					data:this.resume_search
				},function(ret){
					_this.resume_search.ajax=0;
					if(ret){
						if(ret.code===0){
							_this.resumeList=ret.data.data;
							_this.resume_search.total=ret.data.total;
							_this.resume_search.per_page=ret.data.per_page;
						}
					}
				})
			},
			getBoothClass(val){
				switch(val.status){
					case 1:
					if(this.userInfo.id && this.userInfo.role_type===1)
					return 'bg-danger text-white is-lock';
					case 2:
					if(this.userInfo.id && this.userInfo.role_type===1)
					return 'bg-success text-white is-lock';
					default:
					return 'bg-light';
				}
			},
			clickJobsSum(val){
				this.activeName='jobs';
				this.jobs_search.company_id=val.id;
				this.sendJobsSearch();
			},
			clickBooth(val,cateIndex,index){
				if(this.userInfo.id && this.userInfo.role_type===1){
					if(val.status===2)return XYBase.msg('该展位不可预订');
					this.boothCateIndex=cateIndex;
					this.boothIndex=index;
					this.openNewBuy(val);
				}else{
					this.activeName='company';
					this.company_search.booth=val.identifier;
					if (val.status===2)
					this.company_search.key=val.title;
					this.sendComapnySearch();
				}
			},
			orderPaySuccess(val) {
				if (!this.hasOwnProperty('buy'))
					return ;
				if (val.otrade===this.buy.orderInfo.otrade)
					this.buy.pay_status='success';
				if (this.buy.orderTimeEr)
					clearInterval(this.buy.orderTimeEr);
				Find.booth[this.boothCateIndex].boothCate[this.boothIndex].status=2;
			},
			openNewBuy(val){
	    		document.body.style="overflow: hidden;padding-right:17px;";
	    		this.buy.title='招聘会';
	    		this.buy.stitle='预定展位';
				this.buy.pay_status='job_fair';
	    		this.buy.form.pay_type='';
	    		this.buy.form.type=12;
	    		this.buy.form.alias_id=val.id;
	    		this.buy.data=val;
	    		this.buy.data.title=this.Find.title+''+val.identifier+''+val.index+'展位';
	    		this.buy.data1=this.Find;
	    		this.buy.view=true;
			}
		})
	});
	if (amapConfig.status && amapConfig.js_status && amapConfig.js_key && Find.lng && Find.lat) {
		var url = '//webapi.amap.com/maps?v=2.0&key='+amapConfig.js_key;
		var jsapi = document.createElement('script');
		jsapi.charset = 'utf-8';
		jsapi.src = url;
		document.head.appendChild(jsapi);
	}
	function initAmap() {
		var param={
               resizeEnable: true,
               zoom:15
            };
        if (Find.lng && Find.lat)
        	param.center=[parseFloat(Find.lng),parseFloat(Find.lat)];
	    map = new AMap.Map('map_container',param);
	    if (Find.lng && Find.lat)
	    	setInfoWindow([parseFloat(Find.lng),parseFloat(Find.lat)]);
	}
	function setInfoWindow(lnglat) {
	    infoWindow = new AMap.InfoWindow({
	        content: vm.$refs.infoWindow  //使用默认信息窗体框样式，显示信息内容
	    });
	    infoWindow.open(map, lnglat);
	    var bounds = map.getBounds();
      	map.setLimitBounds(bounds);
	}
</script>
{/block}