lsw 10 months ago
parent
commit
e74c26d98d

+ 3 - 0
app/common/common.scss

@@ -17,6 +17,7 @@
 	/* #ifdef H5 */
 	margin-top: -1px;
 	/* #endif */
+	overflow: hidden;
 }
 .omit {
 	white-space: nowrap;
@@ -479,6 +480,8 @@
 	float: right;
 	margin-top: -32px;
 	color: $font-c;
+	z-index:111;
+	position: relative;
 	.icon {
 		padding-right: 3px;
 	}

+ 39 - 15
app/components/filters/filters.vue

@@ -1,11 +1,22 @@
 <template>
-	<u-popup :show="value" @close="close()" round="15">
+	<u-popup :show="value" @close="close()" round="15" :closeable="true" :mask-close-able="true">
 		<view class="ppopup">
-			<u-divider text="条件筛选"></u-divider>
+			<u-divider text="条件筛选" style="margin-top: 25px; margin-bottom: -5px"></u-divider>
 			<scroll-view scroll-y="true" style="height: 450px">
 				<view class="item">
+					<view class="title" @click="go('/pages/job/position/classification')">
+						<text>职位分类</text>
+						<text class="icon">&#xe631;</text>
+					</view>
+					<view class="tags">
+						<view class="out">
+							<view class="int" :class="{ active: positionName != '不限' }">{{ positionName }}</view>
+						</view>
+					</view>
+				</view>
+				<view class="item">
 					<view class="title">薪资待遇</view>
-					<view class="tags" v-for="(item, index) in salary" :key="item.index" @click="select('salary', item, index)">
+					<view class="tags" v-for="(item, index) in salary" :key="item.name" @click="select('salary', item, index)">
 						<view class="out">
 							<view class="int" :class="{ active: item.check }">{{ item.name }}</view>
 						</view>
@@ -13,7 +24,7 @@
 				</view>
 				<view class="item">
 					<view class="title">经验要求</view>
-					<view class="tags" v-for="(item, index) in experience" :key="item.name" @click="select('experience', item, index)">
+					<view class="tags" v-for="(item, index) in experiences" :key="item.name" @click="select('experiences', item, index)">
 						<view class="out">
 							<view class="int" :class="{ active: item.check }">{{ item.name }}</view>
 						</view>
@@ -22,7 +33,7 @@
 			</scroll-view>
 			<view class="flex">
 				<view class="f">
-					<button class="btn ex" @click="clear()">清除</button>
+					<button class="btn ex" @click="clear()">重置</button>
 				</view>
 				<view class="f">
 					<button class="btn" @click="confirm()">确认</button>
@@ -47,15 +58,18 @@ export default {
 	data() {
 		return {
 			type: 0,
-			show: true,
-			experience: [{ name: '不限' }, { name: '1年以内' }, { name: '1-3年' }, { name: '3-5年' }, { name: '5-10年' }, { name: '10年以上' }],
+			positionName: '不限',
+			positionId: '',
+			experiences: [{ name: '不限' }, { name: '1年以内' }, { name: '1-3年' }, { name: '3-5年' }, { name: '5-10年' }, { name: '10年以上' }],
 			salary: [{ name: '不限' }, { name: '1-3k' }, { name: '3-5k' }, { name: '5-10k' }, { name: '10-20k' }, { name: '20-50k' }, { name: '50k以上' }]
 		};
 	},
-	watch: {
-		value(newValue) {
-			this.show = newValue;
-		}
+	mounted() {
+		uni.$on('select_position', (res) => {
+			this.positionName = res.title;
+			this.positionId = res.id;
+			this.$forceUpdate();
+		});
 	},
 	methods: {
 		select(tag, item, index) {
@@ -76,17 +90,24 @@ export default {
 		confirm(item) {
 			this.$emit('input', false);
 			this.$emit('confirm', {
-				experience: this.experience.filter((item) => item.check && item.name != '不限'),
-				salary: this.salary.filter((item) => item.check)
+				experiences: this.experiences.filter((item) => item.check && item.name != '不限'),
+				salary: this.salary.filter((item) => item.check),
+				positionId: this.positionId
 			});
 		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
 		clear() {
 			this.salary.forEach((i) => (i.check = false));
-			this.experience.forEach((i) => (i.check = false));
+			this.experiences.forEach((i) => (i.check = false));
+			this.positionName = '不限';
+			this.positionId = '';
 			this.$forceUpdate();
+			this.$emit('confirm', { experiences: [], salary: '', positionId: '' });
+			this.$emit('input', false);
 		},
 		close() {
-			this.show = false;
 			this.$emit('input', false);
 		}
 	}
@@ -102,6 +123,9 @@ export default {
 		margin-bottom: 12px;
 		font-weight: bold;
 		padding-left: 5px;
+		.icon {
+			float: right;
+		}
 	}
 	.item {
 		overflow: hidden;

+ 7 - 14
app/pages.json

@@ -66,20 +66,6 @@
 			}
 		},
 		{
-			"path": "pages/job/full_time",
-			"style": {
-				"navigationBarTitleText": "找工作",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/job/part_time",
-			"style": {
-				"navigationBarTitleText": "兼职零工",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
 			"path": "pages/serve/index",
 			"style": {
 				"navigationBarTitleText": "更多服务",
@@ -177,6 +163,13 @@
 				"navigationBarTitleText": "全职",
 				"enablePullDownRefresh": true
 			}
+		},
+		{
+			"path" : "pages/job/search",
+			"style" : 
+			{
+				"navigationBarTitleText" : "职位搜索"
+			}
 		}
 	],
 	"tabBar": {

+ 0 - 96
app/pages/job/full_time.vue

@@ -1,96 +0,0 @@
-<template>
-	<view class="main">
-		<!--搜索-->
-		<view class="search">
-			<u-search placeholder="请输入职位名称" bgColor="white" :showAction="false"></u-search>
-		</view>
-		<!--找工作-->
-		<view class="tab">
-			<u-tabs :list="tab" :current="current"></u-tabs>
-		</view>
-		<view class="jobs">
-			<view class="full_time" v-for="(item, index) in jobs" :key="index" @click="detail(item)">
-				<view class="out">
-					<view class="int">
-						<image :src="item.url" mode="aspectFill"></image>
-						<view class="title omit">{{ item.name }}</view>
-						<view class="desc">{{ item.job }}</view>
-						<view class="price">{{ item.price }}元/日</view>
-						<view class="address">
-							<text class="icon">&#xe62e;</text>
-							<text>南宁青秀山</text>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-<script>
-	export default {
-		data() {
-			return {
-				ip: this.http.ip,
-				current: 0,
-				tab: [{ name: '推荐职位' }, { name: '服务员' }, { name: '建筑泥工' }, { name: '网管' }],
-				jobs: [{
-						name: '广西龙坚贸易有限公司',
-						job: '装卸搬运工',
-						price: '4000',
-						url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401904451.jpg'
-					},
-					{
-						name: '韵达速递',
-						job: '快递装卸工',
-						price: '4700',
-						url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401871968.jpg'
-					},
-					{
-						name: '北京滴滴有限公司',
-						job: '滴滴快车专车司机',
-						price: '4200',
-						url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401886712.jpg'
-					},
-					{
-						name: '北京美团外卖有限公司',
-						job: '美团骑手送餐员',
-						price: '3700',
-						url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401895824.jpg'
-					},
-					{
-						name: '字节跳动有限公司',
-						job: '女主播',
-						price: '5500',
-						url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
-					},
-					{
-						name: '广西龙坚贸易有限公司',
-						job: '装卸搬运工',
-						price: '4000',
-						url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
-					}
-				]
-			};
-		},
-		onShow() {},
-		onLoad() {},
-		methods: {
-			detail() {
-				uni.navigateTo({
-					url: '/pages/clsd/job/detail'
-				})
-			},
-			go(url) {
-				if (this.hasLogin()) {} else {
-					uni.navigateTo({ url: '/pages/user/login' });
-				}
-			}
-		}
-	};
-</script>
-
-<style lang="scss">
-	.jobs {
-		margin-top: 0px;
-	}
-</style>

+ 21 - 8
app/pages/job/list.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="main">
 		<view class="search">
-			<u-search placeholder="职位名称" bgColor="white" :showAction="false"></u-search>
+			<u-search placeholder="搜索工作" :disabled="true" bgColor="white" :showAction="false" @click="go('/pages/job/search')"></u-search>
 		</view>
 		<view class="tab">
 			<u-tabs :list="tab" @click="tabClick"></u-tabs>
@@ -11,7 +11,7 @@
 			</view>
 		</view>
 		<view class="list">
-			<view class="item_job" v-for="(item, index) in list" :key="index" @click="detail()">
+			<view class="item_job" v-for="(item, index) in list" :key="index" @click="go('/pages/job/detail?id=' + item.id)">
 				<view class="top">
 					<view class="title omit">{{ item.title }}</view>
 					<view class="salary">{{ item.salary }}</view>
@@ -69,13 +69,26 @@ export default {
 			this.refresh();
 		},
 		confirm(e) {
-			this.param.educationList = e.education.map((item) => item.name);
-			this.param.salary = e.salary.map((item) => item.name).toString();
-			this.param.experienceList = e.experience.map((item) => item.name);
-			//this.refresh();
+			console.log('asd:' + JSON.stringify(e));
+			if (e.experiences.length > 0) {
+				this.param.experiences = e.experiences.map((item) => item.name);
+			} else {
+				delete this.param.experiences;
+			}
+			if (e.salary) {
+				this.param.salary = e.salary.map((item) => item.name).toString();
+			} else {
+				delete this.param.salary;
+			}
+			if (e.positionId) {
+				this.param.positionId = e.positionId;
+			} else {
+				delete this.param.positionId;
+			}
+			this.refresh();
 		},
-		detail(item) {
-			uni.navigateTo({ url: '/pages/job/position/manage/push?id=' + item.id });
+		go(url) {
+			uni.navigateTo({ url: url });
 		},
 		//刷新数据
 		refresh() {

+ 0 - 93
app/pages/job/part_time.vue

@@ -1,93 +0,0 @@
-<template>
-	<view class="main">
-		<!--搜索-->
-		<view class="search">
-			<u-search placeholder="企业名称" bgColor="white" :showAction="false"></u-search>
-		</view>
-		<!--找工作-->
-		<view class="tab">
-			<u-tabs :list="tab" :current="current"></u-tabs>
-		</view>
-		<view class="jobs">
-			<view class="part_time" v-for="(item, index) in jobs" :key="index" @click="detail()">
-				<view class="title omit">兼职{{ item.job }}</view>
-				<view class="price">{{ item.price }}元/天</view>
-				<text class="date">4.16-4.17</text>
-				<view class="address">
-					<text @click.stop="company()">{{ item.name }}</text>
-					<text class="add">申请</text>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-<script>
-export default {
-	data() {
-		return {
-			ip: this.http.ip,
-			current: 0,
-			tab: [{ name: '全部兼职' }, { name: '简单易做' }, { name: '体力达人' }, { name: '特色职位' }],
-			jobs: [
-				{
-					name: '广西龙坚贸易有限公司',
-					job: '装卸搬运工',
-					price: '100',
-					url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401904451.jpg'
-				},
-				{
-					name: '韵达速递',
-					job: '快递装卸工',
-					price: '100',
-					url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401871968.jpg'
-				},
-				{
-					name: '北京滴滴有限公司',
-					job: '滴滴快车专车司机',
-					price: '100',
-					url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401886712.jpg'
-				},
-				{
-					name: '北京美团外卖有限公司',
-					job: '美团骑手送餐员',
-					price: '50',
-					url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401895824.jpg'
-				},
-				{
-					name: '字节跳动有限公司',
-					job: '兼职女主播',
-					price: '500',
-					url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
-				},
-				{
-					name: '广西龙坚贸易有限公司',
-					job: '装卸搬运工',
-					price: '400',
-					url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
-				}
-			]
-		};
-	},
-	onShow() {},
-	onLoad() {},
-	methods: {
-		detail() {
-			uni.navigateTo({
-				url: '/pages/clsd/job/detail'
-			})
-		},
-		go(url) {
-			if (this.hasLogin()) {
-			} else {
-				uni.navigateTo({ url: '/pages/user/login' });
-			}
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-.jobs {
-	margin-top: 0px;
-}
-</style>

+ 0 - 1
app/pages/job/position/manage/push.vue

@@ -80,7 +80,6 @@ export default {
 			dict: {
 				positionName: this.util.getData('positionName'),
 				experience: this.util.getData('experience'),
-				education: ['不限'].concat(this.util.getData('education')),
 				salary: [['面议'], ['']],
 				location: this.util.getData('address'),
 				unit: this.util.getData('unit')

+ 19 - 0
app/pages/job/search.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 0 - 1
app/uni_modules/uview-ui/components/u-search/u-search.vue

@@ -33,7 +33,6 @@
 			    :value="value"
 			    @confirm="search"
 			    @input="inputChange"
-			    :disabled="disabled"
 			    @focus="getFocus"
 			    :focus="focus"
 			    :maxlength="maxlength"

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/PositionQueryDto.java

@@ -8,6 +8,7 @@ import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Pattern;
+import java.util.List;
 
 /**
  * @author lsw
@@ -25,12 +26,25 @@ public class PositionQueryDto {
     @ApiModelProperty(value = "职位名称")
     private String title;
 
+    @ApiModelProperty(value = "职位分类id")
+    private Long positionId;
+
     @ApiModelProperty(value = "经度")
     private String longitude;
 
     @ApiModelProperty(value = "维度")
     private String latitude;
 
+    @ApiModelProperty(value = "工作经验 [1年以内,5-10年]")
+    private List<String> experiences;
+
+    @ApiModelProperty(value = "薪资待遇")
+    private String salary;
+
+    private Integer min;
+
+    private Integer max;
+
     @NotNull(message = "参数错误")
     @Pattern(regexp = "^(id|distance)$", message = "orderBy 参数值只能是 id 或 distance")
     private String orderBy;

+ 25 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PositionServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.web.work.api.util.AppUtil;
 import com.ruoyi.web.work.domain.Column;
 import com.ruoyi.web.work.domain.Position;
@@ -46,6 +47,19 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
 
     @Override
     public List<PositionListVo> indexList(PositionQueryDto dto) {
+        if (StringUtils.isNotEmpty(dto.getSalary())) {
+            if (dto.getSalary().equals("50k以上")) {
+                dto.setMin(50);
+                dto.setMax(500);
+            } else if (dto.getSalary().equals("不限")) {
+                dto.setMin(0);
+                dto.setMax(50000);
+            } else {
+                String salary[] = dto.getSalary().replace("k", "").split("-");
+                dto.setMin(Integer.parseInt(salary[0]));
+                dto.setMax(Integer.parseInt(salary[1]));
+            }
+        }
         return positionMapper.indexList(dto);
     }
 
@@ -79,9 +93,19 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
             return AjaxResult.error("职位不存在或非法操作");
         }
         if (position.getAudit() == 1) {
-            return AjaxResult.error("该职位已审核通过不允许编辑");
+           // return AjaxResult.error("该职位已审核通过不允许编辑");
         }
         BeanUtils.copyProperties(dto, position);
+        Column region = columnService.selectRegion(new Column().setTitle(position.getRegionName()).setLevel(3));
+        if (region != null) {
+            position.setAncestors(region.getAncestors() + "," + region.getId());
+        }
+        //全职薪资
+        if (!position.getSalary().equals("面议") && position.getType() == 0) {
+            String salary[] = position.getSalary().replace("k", "").split("-");
+            position.setMin(Integer.parseInt(salary[0]));
+            position.setMax(Integer.parseInt(salary[1]));
+        }
         position.setUserId(AppUtil.getUser().getId());
         if (!updateById(position)) {
             throw new ServiceException("编辑职位失败");

+ 6 - 3
ruoyi-admin/src/main/resources/mapper/work/PositionMapper.xml

@@ -29,15 +29,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         salary,
         region_name,
         location
-        <if test="longitude != '' and latitude != '' ">,ROUND( ST_Distance_Sphere ( POINT ( #{longitude}, #{latitude} ), POINT ( longitude, latitude ))/ 1000, 2 ) AS distance</if>
+        <if test="longitude !=null and longitude !=null ">,ROUND( ST_Distance_Sphere ( POINT ( #{longitude}, #{latitude} ), POINT ( longitude, latitude ))/ 1000, 2 ) AS distance</if>
         FROM
         tb_position
         WHERE
         state = 0
         AND audit = 1
         AND type = #{type}
-        <if test="title != null  and title != ''"> AND title LIKE concat('%', #{name}, '%')</if>
-        <if test="orderBy=='distance'">ORDER BY distance ASC</if>
+        <if test="title != null and title != ''"> AND title LIKE concat('%', #{name}, '%')</if>
+        <if test="positionId != null"> AND position_id=#{positionId}</if>
+        <if test="experiences != null  and experiences.size() > 0">AND experience IN (<foreach collection="experiences" item="name" separator=",">#{name}</foreach>)</if>
+        <if test="min != null and max !=null">AND min <![CDATA[ >= ]]> #{min} AND max <![CDATA[ <= ]]> #{max}</if>
+        <if test="orderBy=='distance' and longitude !=null">ORDER BY distance ASC</if>
         <if test="orderBy=='id'">ORDER BY id DESC</if>
     </select>
 </mapper>