| <template> | |
| 	<view> | |
| 		<view class="se-bgc-orange se-pos se-pos-lt se-w-vw-100 se-h-vh-30" style="z-index: -1;border-bottom-left-radius: 120rpx;border-bottom-right-radius: 120rpx;"></view> | |
| 		<view class="se-flex se-flex-h-sb se-px-40 se-pb-30 se-pt-10 se-bgc-orange se-zi-s"> | |
| 			<view class="se-c-white se-fs-28" @click="getLocation()"> | |
| 				<view class="se-bgc-white se-py-5 se-px-10 se-fw-6 se-br-12 se-c-orange se-fs-24 se-display-ib"> | |
| 					工 | |
| 				</view> | |
| 				<text class="se-ml-10 se-fw-6 se-fs-28">智选猎头</text> | |
| 			</view> | |
| 			<!-- <view class="se-br-30 se-bgc-white se-fw-6 se-c-orange se-fs-28 se-px-20 se-py-10"> | |
| 				企业/个人端 | |
| 			</view> --> | |
| 		</view> | |
| 		<view class="se-px-20 se-pt-10 se-zi-s" @click="onCategory()"> | |
| 			<u-search height="40" :disabled="true" placeholder="搜索" :showAction="false" v-model="keyword"></u-search> | |
| 		</view> | |
| 		<view class="se-pb-20 se-pt-40 se-zi-s"> | |
| 			<view class="se-px-20"> | |
| 				<u-swiper height="300rpx" :indicator="true" style="background-color: #f5f5f5;height: 300rpx;" :list="swiperList" keyName="image" @change="change" @click="click"></u-swiper> | |
| 			</view> | |
| 			<view class="se-pt-10 se-px-0 se-py-10 se-ta-l se-flex se-flex-ai-c se-fs-26"> | |
| 				 <u-notice-bar direction="column" mode="link" @click="onNoticeDetail" :text="notice"></u-notice-bar> | |
| 			</view> | |
| 		</view> | |
| 		 | |
| 		<view class="se-my-20 se-bgc-white se-grid"> | |
| 			<navigator :url="`/pages_subpack/category/index?id=`+item.id+`&title=`+item.name" v-for="(item, index) in tabList" :key="index" class="se-flex-v-c se-pt-30 se-mb-20"> | |
| 				<image class="se-a-100" :src="item.image" mode=""></image> | |
| 				<text class="se-w-150 se-h-60 se-lh-30 se-c-black se-fs-22 se-ta-c se-mt-10 se-toe-2">{{item.name}}</text> | |
| 			</navigator> | |
| 		</view> | |
| 		<u-sticky> | |
| 		<view class="se-bgc-white se-p-20 se-flex"> | |
| 			<view @click="toNavigator(1)" class="se-flex-1 se-flex-h-c se-flex-ai-c se-c-white se-py-20 se-fw-6 enterprise"> | |
| 				<!-- 找工作 --> | |
| 				招聘 | |
| 			</view> | |
| 			<view @click="toNavigator(2)" class="se-flex-1 se-ml-20 se-flex-h-c se-flex-ai-c se-c-white se-py-20 se-fw-6 master"> | |
| 				<!-- 找师傅 --> | |
| 				求职 | |
| 			</view> | |
| 		</view> | |
| 		<u-tabs | |
| 			class="se-bgc-f5 se-pb-20" | |
| 			:current="current" | |
| 			lineWidth="30" | |
| 			lineColor="#FF7A31" | |
| 			:activeStyle="{ | |
| 				color: '#303133', | |
| 				fontWeight: 'bold', | |
| 				transform: 'scale(1.05)' | |
| 			}" | |
| 			:inactiveStyle="{ | |
| 				color: '#606266', | |
| 				transform: 'scale(1)' | |
| 			}" | |
| 			itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"  | |
| 			:list="navList"  | |
| 			@click="navClick($event)"> | |
| 		</u-tabs> | |
| 		</u-sticky> | |
| 		<!-- 企业端 求职大厅 --> | |
| 		<enterpriseBox :rolelist="rlist" v-if="current==0" /> | |
| 		<!-- 师傅端 招聘大厅 --> | |
| 		<masterBox :taskList="tList" v-if="current==1" /> | |
| 		<view class="se-h-80"></view> | |
| 	</view> | |
| </template> | |
| 
 | |
| <script> | |
| 	import { | |
| 		bannerList, | |
| 		taskList, | |
| 		rolelist, | |
| 		industryList, | |
| 		getSysText, | |
| 		querySeekList, | |
| 		getNotice, | |
| 		noticeList, | |
| 		queryConfigList | |
| 	} from "@/common/api.js" | |
| 	import enterpriseBox from "@/components/list/enterprise.vue" | |
| 	import masterBox from "@/components/list/master.vue" | |
| 	import QQMapWX from "@/util/qqmap-wx-jssdk.min.js" | |
| 	export default{ | |
| 		components:{ | |
| 			enterpriseBox, | |
| 			masterBox | |
| 		}, | |
| 		data(){ | |
| 			return { | |
| 				latitude:'', | |
| 				longitude:'', | |
| 				 | |
| 				notList:[], | |
| 				notice:[], | |
| 				tabList:[],//导航栏 | |
| 				swiperList:[],//轮播 | |
| 				current:0, | |
| 				navList:[ | |
| 					{ | |
| 						name: '求职大厅', | |
| 					},  | |
| 					{ | |
| 						name: '招聘大厅', | |
| 					} | |
| 				], | |
| 				rpageNo:1, | |
| 				rpageSize:20, | |
| 				rlist:[], | |
| 				 | |
| 				tpageNo:1, | |
| 				tpageSize:20, | |
| 				tList:[] | |
| 			} | |
| 		}, | |
| 		mounted() { | |
| 			 | |
| 		}, | |
| 		onShow() { | |
|             this.rpageNo =  1 | |
|             this.rlist = [] | |
|             this.tpageNo =  1 | |
|             this.tList = [] | |
| 			this.onBannerList() | |
| 			this.onTaskList() | |
| 			this.onRolelist() | |
| 			this.onIndustryList() | |
| 			this.getLocation() | |
| 			this.onSysText() | |
| 			this.onNotice() | |
| 		}, | |
| 		onPullDownRefresh() { | |
| 			let that = this | |
| 			if(that.current==0){ | |
| 				that.rpageNo =  1 | |
| 				that.rlist = [] | |
| 				that.onRolelist() | |
| 			}else if(that.current==1){ | |
| 				that.tpageNo =  1 | |
| 				that.tList = [] | |
| 				that.onTaskList() | |
| 			} | |
| 		}, | |
| 		onReachBottom() { | |
| 			let that = this | |
| 			if(that.current==0){ | |
| 				that.rpageNo = that.rpageNo + 1 | |
| 				that.onRolelist() | |
| 			}else if(that.current==1){ | |
| 				that.tpageNo = that.tpageNo + 1 | |
| 				that.onTaskList() | |
| 			} | |
| 			 | |
| 		}, | |
| 		methods:{ | |
| 			onNoticeDetail(index){ | |
| 				console.info(index) | |
| 				uni.navigateTo({ | |
| 					url:"/pages_subpack/notice/index?id="+this.notList[index].id | |
| 				}) | |
| 			}, | |
| 			onNotice(){ | |
| 				let that = this | |
| 				let params={} | |
| 				let arr=[] | |
| 				noticeList(params).then(response=>{ | |
| 					console.info('noticeList',response) | |
| 					response.result.records.forEach(items=>{ | |
| 						arr.push(items.title) | |
| 					}) | |
| 					that.notice = arr | |
| 					that.notList = response.result.records | |
| 				}).catch(error=>{ | |
| 					 | |
| 				}) | |
| 			}, | |
| 			onSysText(){ | |
| 				let that = this | |
| 				let params={} | |
| 				getSysText(params).then(response=>{ | |
| 					console.info("onSysText",response.result) | |
| 					uni.setStorageSync('sysList', result.result) | |
| 				}).catch(error=>{ | |
| 					 | |
| 				}) | |
| 			}, | |
| 			getLocation(){ | |
| 				const that = this; | |
| 				wx.getLocation({ | |
| 				    type: 'wgs84', | |
| 					success: function (res) { | |
| 						that.latitude=res.latitude | |
| 						that.longitude=res.longitude | |
| 						uni.setStorageSync("longitude",res.longitude) | |
| 						uni.setStorageSync("latitude",res.latitude) | |
| 						const qqmapsdk = new QQMapWX({ | |
| 						    key: 'BJKBZ-W46K3-6S43C-OFLJB-FW6FQ-RMBYP' // 必填 | |
| 						}); | |
| 						qqmapsdk.reverseGeocoder({ | |
| 						    location: { | |
| 						        latitude: res.latitude, | |
| 						        longitude: res.longitude | |
| 						    }, | |
| 						    success: function(response) { | |
| 								// that.city = response.result.ad_info.city | |
| 						        console.log('逆地理编码结果:', response); | |
| 						    }, | |
| 						    fail: function(error) { | |
| 						        console.error('逆地理编码失败:', error); | |
| 						    } | |
| 						}); | |
| 					} | |
| 				}) | |
| 			}, | |
| 			onIndustryList(){ | |
| 				industryList({}).then(response=>{ | |
| 					console.info("industryList",response); | |
| 					this.tabList = response.result | |
| 				}).catch(error=>{ | |
| 					 | |
| 				}) | |
| 			}, | |
| 			onBannerList(){ | |
| 				bannerList({type:0}).then(response=>{ | |
| 					this.swiperList = response.result.records | |
| 				}).catch(error=>{ | |
| 					 | |
| 				}) | |
| 			}, | |
| 			onTaskList(){ | |
| 				let that = this | |
| 				taskList({ | |
| 					latitude:that.latitude, | |
| 					longitude:that.longitude, | |
| 					pageNo:that.tpageNo, | |
| 					pageSize:that.tpageSize | |
| 				}).then(response=>{ | |
| 					console.info("response",response.result.records) | |
| 					if(that.tpageNo==1){ | |
| 						that.tList = response.result.records | |
| 					}else{ | |
| 						that.tList = that.tList.concat(response.result.records) | |
| 					} | |
| 					console.info("taskList",response) | |
| 				}).catch(error=>{ | |
| 					 | |
| 				}) | |
| 			}, | |
| 			onRolelist(){ | |
| 				let that = this | |
| 				querySeekList({ | |
| 					pageNo:that.rpageNo, | |
| 					pageSize:that.rpageSize | |
| 				}).then(response=>{ | |
| 					console.info("querySeekList",response) | |
| 					if(that.rpageNo==1){ | |
| 						that.rlist = response.result.records | |
| 					}else{ | |
| 						that.rlist = that.rlist.concat(response.result.records) | |
| 					} | |
| 				}).catch(error=>{ | |
| 					 | |
| 				}) | |
| 			}, | |
| 			navClick(event){ | |
| 				this.current=event.index | |
| 			}, | |
| 			change(event){ | |
| 				console.info(event) | |
| 			}, | |
| 			click(event){ | |
| 				console.info(event) | |
| 			}, | |
| 			toNavigator(event){ | |
| 				console.info(event) | |
| 				 | |
| 				if (event === 1) { | |
| 					// 招聘按钮 - 需要企业认证 | |
| 					this.$store.dispatch('onEnterpriseAuth', { | |
| 						success: (company) => { | |
| 							// 企业认证通过,跳转到发布页面 | |
| 							uni.navigateTo({ | |
| 								url: "/pages_subpack/release/index?status=" + event | |
| 							}) | |
| 						}, | |
| 						fail: (company) => { | |
| 							// 企业认证未通过,跳转到企业认证页面,带上回调参数 | |
| 							uni.showToast({ | |
| 								title: '请先完成企业认证', | |
| 								icon: 'none' | |
| 							}) | |
| 							setTimeout(() => { | |
| 								uni.navigateTo({ | |
| 									url: "/pages_subpack/enterprise/index?callback=release&status=" + event | |
| 								}) | |
| 							}, 1000) | |
| 						} | |
| 					}) | |
| 				} else if (event === 2) { | |
| 					// 求职按钮 - 需要个人认证和简历完成 | |
| 					this.$store.dispatch('onPersonalAuth', { | |
| 						success: (person) => { | |
| 							// 个人认证通过,检查简历是否完成 | |
| 							this.$store.dispatch('onResumeComplete', { | |
| 								success: (resume) => { | |
| 									// 简历已完成,跳转到发布页面 | |
| 									uni.navigateTo({ | |
| 										url: "/pages_subpack/release/index?status=" + event | |
| 									}) | |
| 								}, | |
| 								fail: (resume) => { | |
| 									// 简历未完成,跳转到简历页面,带上回调参数 | |
| 									uni.showToast({ | |
| 										title: '请先完善个人简历', | |
| 										icon: 'none' | |
| 									}) | |
| 									setTimeout(() => { | |
| 										uni.navigateTo({ | |
| 											url: "/pages_subpack/resume/index?callback=release&status=" + event | |
| 										}) | |
| 									}, 1000) | |
| 								} | |
| 							}) | |
| 						}, | |
| 						fail: (person) => { | |
| 							// 个人认证未通过,跳转到个人认证页面,带上回调参数 | |
| 							uni.showToast({ | |
| 								title: '请先完成个人认证', | |
| 								icon: 'none' | |
| 							}) | |
| 							setTimeout(() => { | |
| 								uni.navigateTo({ | |
| 									url: "/pages_subpack/person/index?callback=release&status=" + event | |
| 								}) | |
| 							}, 1000) | |
| 						} | |
| 					}) | |
| 				} | |
| 			}, | |
| 			onCategory(){ | |
| 				uni.navigateTo({ | |
| 					url:"/pages_subpack/category/index" | |
| 				}) | |
| 			} | |
| 		} | |
| 	} | |
| </script> | |
| <style> | |
| 	page{ | |
| 		background-color: #f5f5f5; | |
| 	} | |
| 	.enterprise{ | |
| 		background: #ff7a31; | |
| 		border: 4rpx solid rgba(255,255,255,0.50); | |
| 		border-radius: 14rpx; | |
| 	} | |
| 	.master{ | |
| 		background: #f0b744; | |
| 		border: 4rpx solid rgba(255,255,255,0.50); | |
| 		border-radius: 14rpx; | |
| 	} | |
| </style> |