Jelajahi Sumber

搜索页面添加求职期望

wkw 7 bulan lalu
induk
melakukan
dd6a5337e1
3 mengubah file dengan 145 tambahan dan 53 penghapusan
  1. 9 0
      src/components/header/header.vue
  2. 1 1
      src/views/index/index.vue
  3. 135 52
      src/views/search/index.vue

+ 9 - 0
src/components/header/header.vue

@@ -263,6 +263,9 @@
 				<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>
@@ -1536,6 +1539,12 @@
 					name: 'enterpriseList'
 				})
 			},
+			// 去搜索页面
+			goPosition() {
+				this.$router.push({
+					name: 'search'
+				})
+			},
 		}
 	}
 </script>

+ 1 - 1
src/views/index/index.vue

@@ -17,7 +17,7 @@
 								width="calc(55vw - 100px)">
 								<template #reference>
 									<el-input @focus="Myfocus" @blur="visible = false" @keyup.enter="goSearch()"
-										v-model="keyWord" placeholder="搜索职位" />
+										v-model="keyWord" placeholder="搜索职位、公司" />
 								</template>
 								<div class="searchLabel flex algin-center flex-wrap">
 									<div class="searchLabel-item" @click="selectLabel(item.keyWord)"

+ 135 - 52
src/views/search/index.vue

@@ -31,10 +31,23 @@
 
 							<div class="condizione-box-c-search flex justify-between">
 								<div class="condizione-box-c-search-in flex align-center justify-center">
+									<el-dropdown style="flex-shrink: 0;margin-left: 10px;line-height: 0;">
+										<span class="el-dropdown-link">
+											{{ searchType }}
+											<el-icon class="el-icon--right">
+												<arrow-down />
+											</el-icon>
+										</span>
+										<template #dropdown>
+											<el-dropdown-menu>
+												<el-dropdown-item @click="changeType('职位')">职位</el-dropdown-item>
+												<el-dropdown-item @click="changeType('公司')">公司</el-dropdown-item>
+											</el-dropdown-menu>
+										</template>
+									</el-dropdown>
 									<div class="condizione-box-c-search-ins flex align-center justify-center">
-										<el-input @keyup.enter="startSearch()" v-model="keyWord" placeholder="搜索职位" />
+										<el-input @keyup.enter="startSearch()" v-model="keyWord" placeholder="搜索职位、公司" />
 									</div>
-
 								</div>
 								<div @click="startSearch()" class="condizione-box-c-search-btn flex justify-center">
 									<el-image style="width: 20px; height: 20px;margin-right: 8px;"
@@ -163,64 +176,86 @@
 		<div class="content flex align-center justify-center">
 			<div class="content-box flex justify-between">
 				<div v-show="isNoList == false" class="content-l" v-loading="loading">
-					<div class="content-l-item flex justify-between" @click="goDetails(item)"
+					<div @click="goDetails(item)"
 						v-for="(item, index) in jobDataList" :key="index">
-						<div class="content-l-item-l">
-							<div class="content-l-item-title">
-								{{ item.ruleClassifyName }}
-								<span>
-									【{{ item.city }} {{ item.county }}】
-								</span>
-							</div>
-							<div class="content-l-item-info flex align-center flex-wrap">
-								<div class="content-l-item-infomoney">
-									{{ item.salaryRange }}
-								</div>
-								<div class="content-l-item-infolabel">
-									{{ item.experience }}
-								</div>
-								<div class="content-l-item-infolabel">
-									{{ item.education }}
+						<div v-if="searchType == '职位'" class="content-l-item flex justify-between">
+							<div class="content-l-item-l">
+								<div class="content-l-item-title">
+									{{ item.ruleClassifyName }}
+									<span>
+										【{{ item.city }} {{ item.county }}】
+									</span>
 								</div>
-								<div class="content-l-item-infolabel" v-for="(ite, ind) in item.positionWelfare"
-									:key="ind">
-									{{ ite }}
+								<div class="content-l-item-info flex align-center flex-wrap">
+									<div class="content-l-item-infomoney">
+										{{ item.salaryRange }}
+									</div>
+									<div class="content-l-item-infolabel">
+										{{ item.experience }}
+									</div>
+									<div class="content-l-item-infolabel">
+										{{ item.education }}
+									</div>
+									<div class="content-l-item-infolabel" v-for="(ite, ind) in item.positionWelfare"
+										:key="ind">
+										{{ ite }}
+									</div>
 								</div>
-							</div>
-							<div class="content-l-item-btn flex align-center">
-								<div class="content-l-item-btn-item" v-for="(ite, ind) in item.industry.slice(0, 4)">
-									{{ ite }}<el-divider
-										v-if="ind < item.industry.slice(0, 4).length - 1 && item.industry.length > 1"
-										direction="vertical" />
+								<div class="content-l-item-btn flex align-center">
+									<div class="content-l-item-btn-item"
+										v-for="(ite, ind) in item.industry.slice(0, 4)">
+										{{ ite }}<el-divider
+											v-if="ind < item.industry.slice(0, 4).length - 1 && item.industry.length > 1"
+											direction="vertical" />
 
+									</div>
 								</div>
 							</div>
-						</div>
-						<div v-if="item.company" class="content-l-item-r">
-							<div class="content-l-item-r-title flex algin-center">
-								<img :src="item.company.companyLogo" alt="" />
-								<div class="content-l-item-r-title-r">
-									<div class="content-l-item-r-title-r-t">
-										{{ item.company?.companyName || item.company?.companyAllName }}
-									</div>
-									<div class="content-l-item-r-title-r-b flex align-center">
-										<div class="content-l-item-r-title-r-b-i">
-											{{ item.company.companyScope }}
+							<div v-if="item.company" class="content-l-item-r">
+								<div class="content-l-item-r-title flex algin-center">
+									<img :src="item.company.companyLogo" alt="" />
+									<div class="content-l-item-r-title-r">
+										<div class="content-l-item-r-title-r-t">
+											{{ item.company?.companyName || item.company?.companyAllName }}
 										</div>
-										<div class="content-l-item-r-title-r-b-i">
-											{{ item.company.companyPeople }}
+										<div class="content-l-item-r-title-r-b flex align-center">
+											<div class="content-l-item-r-title-r-b-i">
+												{{ item.company.companyScope }}
+											</div>
+											<div class="content-l-item-r-title-r-b-i">
+												{{ item.company.companyPeople }}
+											</div>
 										</div>
 									</div>
 								</div>
+								<div class="content-l-item-r-bom flex align-center">
+									<el-icon size="13" style="margin-right: 10px;" name="MapLocation" />
+									<div class="content-l-item-r-bomtxt">
+										{{ item.address }}
+									</div>
+								</div>
 							</div>
-							<div class="content-l-item-r-bom flex align-center">
-								<el-icon size="13" style="margin-right: 10px;" name="MapLocation" />
-								<div class="content-l-item-r-bomtxt">
-									{{ item.address }}
+						</div>
+						<div v-if="searchType == '公司'" class="content-l-item flex" style="padding: 20px;width: initial;">
+							<el-image style="width: 56px; height: 56px;border-radius: 10px;margin-right: 10px;" loading="lazy"
+								:src="item.companyLogo" fit="cover" />
+							<div>
+								<div class="list-box-item-top-r-name">
+									{{ item.companyName || item.companyAllName }}
+								</div>
+								<div class="list-box-item-top-r-label flex flex-wrap align-center">
+									<div style="color: #666666;font-size: 13px;">{{ item.companyPeople }} ·</div>
+									<div v-if="item.companyScope">
+										<span v-for="item in item.companyScope" :key="index"
+											class="list-box-item-top-r-label-i">
+											{{ item }}
+										</span>
+									</div>
 								</div>
+								<div style="color: #9ca4ab;font-size: 12px;margin-top: 5px;">{{ item.workTime }} · {{
+									item.welfare }}</div>
 							</div>
 						</div>
-
 					</div>
 					<!-- 分页 -->
 					<div class="content-l-item-pag flex align-center justify-center">
@@ -239,6 +274,7 @@
 			</div>
 
 		</div>
+		<!-- 企业列表主体 -->
 		<!-- 暂无简历提示框 -->
 		<resumeTipsComp v-if="shoModal" :show="shoModal" @close="shoModal = false" @addResume="addResume" />
 		<!-- 切换城市 -->
@@ -384,6 +420,7 @@ export default {
 			county: '', //区域
 			allCitys: false, //是否显示全部城市弹框
 			citys: '', //定位城市
+			searchType: '职位', //搜索类型,默认职位
 		}
 	},
 	computed: {
@@ -429,6 +466,11 @@ export default {
 
 	},
 	methods: {
+		changeType(type){
+			this.searchType = type;
+			this.page = 1
+			this.getUserList()
+		},
 		goToPage() {
 			this.$router.push({
 				path: '/addResume',
@@ -629,16 +671,26 @@ export default {
 		 */
 		goDetails(item) {
 			if (localStorage.getItem('token')) {
-				if (this.isResume) { //有简历
+				if(this.searchType == '职位'){
+					if (this.isResume) { //有简历
+						this.$router.push({
+							name: 'postInfo',
+							query: {
+								postPushId: item.postPushId
+							}
+						})
+					} else { //无简历
+						this.shoModal = true
+					}
+				}else{
 					this.$router.push({
-						name: 'postInfo',
+						name: 'enterpriseInfo',
 						query: {
-							postPushId: item.postPushId
+							companyId: item.companyId
 						}
 					})
-				} else { //无简历
-					this.shoModal = true
 				}
+				
 			} else {
 				this.$router.push({
 					name: 'login'
@@ -730,7 +782,17 @@ export default {
 				// lat: this.latitude,
 				userId: localStorage.getItem('userId') ? localStorage.getItem('userId') : ''
 			}
-			this.$Request.get('/app/postPush/userGetPostPushList', {
+			let url = '';
+			if(this.searchType == '职位'){
+				url = '/app/postPush/userGetPostPushList'
+			}else{
+				url = '/app/company/getCompanyPostPush'
+				data = {
+					...data,
+					key: this.keyWord
+				}
+			}
+			this.$Request.get(url, {
 				params: data
 			}).then(res => {
 				this.loading = false
@@ -747,6 +809,11 @@ export default {
 						} else {
 							item.industry = []
 						}
+						if (item.companyScope) {
+							item.companyScope = item.companyScope.split(',')
+						} else {
+							item.companyScope = []
+						}
 					})
 					this.jobDataList = res.data.records
 					if (this.jobDataList.length > 0) {
@@ -1491,4 +1558,20 @@ $marginTop-60: 120px;
 	margin-left: 10px;
 	cursor: pointer;
 }
+.list-box-item-top-r-name {
+	// width: 100%;
+	font-size: 16px;
+	font-weight: 500;
+}
+
+.list-box-item-top-r-label-i {
+	background-color: #f8f8f8;
+	color: #666666;
+	padding: 0 8px;
+	line-height: 22px;
+	border-radius: 4px;
+	font-size: 13px;
+	margin-right: 10px;
+	margin-top: 10px;
+}
 </style>