lsw 11 月之前
父節點
當前提交
63a91720d3

+ 14 - 0
app/pages.json

@@ -267,6 +267,20 @@
 			{
 				"navigationBarTitleText" : "金额充值"
 			}
+		},
+		{
+			"path" : "pages/job/position/manage/part_time",
+			"style" : 
+			{
+				"navigationBarTitleText" : "兼职管理"
+			}
+		},
+		{
+			"path" : "pages/job/position/manage/part_time_push",
+			"style" : 
+			{
+				"navigationBarTitleText" : "发布兼职"
+			}
 		}
 	],
 	"tabBar": {

+ 161 - 0
app/pages/job/position/manage/part_time.vue

@@ -0,0 +1,161 @@
+<template>
+	<view>
+		<view class="position">
+			<view class="audits">
+				<view class="audit" :class="{ active: current == index }" v-for="(item, index) in audit" :key="index" @click="click({ index: index }, 'audit')">{{ item.name }}</view>
+			</view>
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+				<view class="top">
+					<view class="title omit">
+						<text class="icon" :style="{ color: item.state == 0 ? '#4CAF50' : '#545555' }">&#xe614;</text>
+						<text>{{ item.title }}</text>
+					</view>
+					<view class="audit" v-if="item.audit == 0">
+						<text class="icon">&#xe642;</text>
+						<text>审核中</text>
+					</view>
+					<view class="audit" style="color: #4caf50" v-if="item.audit == 1">
+						<text class="icon">&#xe612;</text>
+						<text>审核通过</text>
+					</view>
+					<view class="audit" v-if="item.audit == 2">
+						<text class="icon">&#xec72;</text>
+						<text>审核不通过</text>
+					</view>
+				</view>
+				<view class="desc">
+					<text class="tag">{{ item.experience }}</text>
+					<text class="tag">{{ item.salary }}</text>
+					<text class="tag">{{ item.regionName }}</text>
+					<text class="date">{{ item.createTime }}</text>
+				</view>
+				<view class="flex">
+					<view class="f br" @click.stop="manageState(item)">{{ item.state == 0 ? '关闭' : '启用' }}</view>
+					<view class="f danger" @click.stop="manageRemove(item)">删除</view>
+				</view>
+			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+		</view>
+		<view class="mfooter">
+			<button class="btn" @click="go('/pages/job/position/manage/part_time_push')">
+				<text class="icon">&#xe7c4;</text>
+				<text>发布兼职</text>
+			</button>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			audit: [
+				{ name: '全部', value: '' },
+				{ name: '待审核', value: 0 },
+				{ name: '审核通过', value: 1 },
+				{ name: '未通过', value: 2 }
+			],
+			current: 0,
+			list: [],
+			param: { pageNum: 1, pageSize: 10, type: 1 },
+			loadMore: true,
+			show: false
+		};
+	},
+	onLoad(e) {
+		this.getData();
+		uni.$on('position', (res) => {
+			this.refresh();
+		});
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/app/position/manage/list',
+				data: this.param,
+				loading: 'false',
+				success: (res) => {
+					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+					res.data.rows.forEach((item) => {
+						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
+						this.list.push(item);
+					});
+				}
+			});
+		},
+		click(e, tag) {
+			this.param[tag] = this[tag][e.index].value;
+			if (tag == 'audit') {
+				this.current = e.index;
+			}
+			this.refresh();
+		},
+		selectClick(e) {
+			uni.navigateTo({ url: '/pages/job/position/manage/push?type=' + e.value });
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		manageState(item) {
+			uni.showModal({
+				title: '提示',
+				content: item.state == 0 ? '确定关闭该职位' : '确定启用该职位',
+				success: (res) => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/app/position/manage/state',
+							data: { id: item.id, state: item.state == 0 ? 1 : 0 },
+							method: 'POST',
+							success: (res) => {
+								uni.showToast({ title: '操作成功' });
+								item.state = item.state == 0 ? 1 : 0;
+							}
+						});
+					}
+				}
+			});
+		},
+		manageRemove(item) {
+			uni.showModal({
+				title: '提示',
+				content: '确定删除该职位?删除后包括已投递简历也全部清除',
+				success: (res) => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/app/position/manage/remove/' + item.id,
+							success: (res) => {
+								uni.showToast({ title: '删除成功' });
+								this.list.splice(this.list.indexOf(item), 1);
+							}
+						});
+					}
+				}
+			});
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNum = 1;
+			this.list = [];
+			this.getData();
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNum++;
+			this.getData();
+		}
+	}
+};
+</script>
+
+<style lang="scss"></style>

+ 167 - 0
app/pages/job/position/manage/part_time_push.vue

@@ -0,0 +1,167 @@
+<template>
+	<view class="main">
+		<view class="form_group">
+			<view class="lable re">兼职名称</view>
+			<input placeholder="请输入" v-model="item.title" />
+		</view>
+		<view class="form_group">
+			<view class="lable re">兼职类型</view>
+			<picker :disabled="true" @click="go('/pages/job/position/classification')">
+				<input placeholder="请选择" v-model="item.positionName" :disabled="true" />
+				<view class="icon more">&#xe8f2;</view>
+			</picker>
+		</view>
+		<view class="form_group">
+			<view class="lable re">兼职描述(要求)</view>
+			<leditor ref="editor" v-model="item.contents" placeholder="请输入兼职描述"></leditor>
+		</view>
+		<view class="form_group">
+			<view class="lable re">兼职金额(元)</view>
+			<view class="bgm">
+				<input type="number" placeholder="请输入" v-model="item.salary" class="input" />
+				<view class="msg">
+					<text>{{ money }}</text>
+					<text @click="go('/pages/user/money/index')">充值</text>
+				</view>
+			</view>
+			<view class="bz">
+				<text class="icon">&#xe634;</text>
+				<text>兼职金额从账户余额扣除,请保留充足的余额</text>
+			</view>
+		</view>
+		<view class="form_group">
+			<view class="lable re">兼职时间</view>
+		</view>
+		<view class="form_group" style="display: flex">
+			<view class="start">
+				<picker mode="date" :start="end" @change="picker($event, 'startDate')">
+					<input placeholder="开始时间" v-model="item.startDate" :disabled="true" />
+				</picker>
+			</view>
+			<view class="hor">至</view>
+			<view class="start">
+				<picker mode="date" :start="end" @change="picker($event, 'endDate')">
+					<input placeholder="结束时间" v-model="item.endDate" :disabled="true" />
+				</picker>
+			</view>
+		</view>
+		<view class="form_group">
+			<view class="lable">兼职地点</view>
+			<picker :disabled="true" @click="chooseLocation()">
+				<input :placeholder="item.type == 0 ? '请选择' : '留空不限工作地点'" v-model="item.location" :disabled="true" />
+				<view class="icon more">&#xe8f2;</view>
+			</picker>
+			<input placeholder="请输入楼层/单元室/门牌号" v-model="item.mph" v-if="item.address" />
+			<view class="bz">如需应聘者去现场请选择兼职地点</view>
+		</view>
+		<button class="btn" @click="save()">{{ item.id ? '编辑' : '保存' }}</button>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			money: 0,
+			item: { type: 1 },
+			end: this.util.getDate('day'),
+			dict: {
+				positionName: this.util.getData('positionName'),
+				experience: this.util.getData('experience'),
+				salary: [['面议'], ['']],
+				location: this.util.getData('address'),
+				unit: this.util.getData('unit')
+			}
+		};
+	},
+	onLoad(e) {
+		if (e.id) {
+			this.http.request({
+				url: '/app/position/manage/detail/' + e.id,
+				success: (res) => {
+					this.item = res.data.data;
+					this.$refs.editor.setContents();
+					uni.setNavigationBarTitle({ title: '编辑兼职' });
+				}
+			});
+		}
+		uni.$on('select_position', (res) => {
+			this.item.positionName = res.title;
+			this.item.positionId = res.id;
+			this.$forceUpdate();
+		});
+	},
+	onShow() {
+		this.money = uni.getStorageSync('money');
+	},
+	methods: {
+		picker(e, tag) {
+			if (tag == 'startDate' || tag == 'endDate') {
+				this.item[tag] = e.detail.value;
+			} else {
+				this.item[tag] = this.dict[tag][e.detail.value];
+			}
+			this.$forceUpdate();
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		chooseLocation() {
+			uni.chooseLocation({
+				success: (res) => {
+					let reg = /.+?(省|市|自治区|自治州|县|区)/g;
+					let addressList = res.address.match(reg).toString().split(',');
+					//注意区分直辖市;
+					let city = addressList.length >= 3 ? addressList[1] : addressList[0];
+					let region = addressList.length >= 3 ? addressList[2] : addressList[1];
+					this.item.location = res.name;
+					this.item.address = res.address;
+					this.item.longitude = res.longitude;
+					this.item.latitude = res.latitude;
+					this.item.regionName = region;
+					this.item.cityName = city;
+					this.$forceUpdate();
+				}
+			});
+		},
+		save() {
+			this.http.request({
+				url: this.item.id ? '/app/position/manage/edit' : '/app/position/manage/add',
+				data: this.item,
+				method: 'POST',
+				success: (res) => {
+					//实名认证跳转
+					if (res.data.code == 7878) {
+						uni.showModal({
+							title: '提示',
+							content: res.data.msg,
+							showCancel: false,
+							success: (res) => {
+								uni.navigateTo({ url: '/pages/user/auth' });
+							}
+						});
+						return;
+					}
+					uni.showToast({ title: '操作成功' });
+					setTimeout(() => {
+						uni.$emit('position');
+						uni.navigateBack();
+					}, 1500);
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.bgm {
+	.input {
+		width: 50%;
+	}
+	.msg {
+		text {
+			padding-left: 17px;
+		}
+	}
+}
+</style>

+ 15 - 1
app/pages/user/index.vue

@@ -70,6 +70,7 @@
 				</view>
 			</view>
 		</view>
+		<!--企业服务-->
 		<view v-if="user.type == 1">
 			<view class="mtt">企业服务</view>
 			<view class="menu">
@@ -101,6 +102,7 @@
 				</view>
 			</view>
 		</view>
+		<!--求职服务-->
 		<view v-else>
 			<view class="mtt">求职服务</view>
 			<view class="menu">
@@ -140,6 +142,17 @@
 				</view>
 			</view>
 		</view>
+		<view class="mtt">兼职服务</view>
+		<view class="menu">
+			<view class="cd" @click="go('/pages/job/position/manage/part_time')">
+				<view class="out">
+					<view class="int">
+						<view class="icon" style="background-color: #03a9f4">&#xe63c;</view>
+						<view class="title">兼职管理</view>
+					</view>
+				</view>
+			</view>
+		</view>
 		<view class="mtt">更多功能</view>
 		<view class="menu">
 			<view class="cd" @click="go('/pages/statement/index/index')">
@@ -216,7 +229,7 @@ export default {
 		};
 	},
 	onShow() {
-/* 		 	this.user = {
+		/* 		 	this.user = {
 				token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImIwNzE0MjFkLTg1NTAtNDk4Yy1iOTAzLTQ1NTBkMmJhYThkZSJ9.y6PAxUng74T4gq1apPRqTowMGVPqdx0fiNrBmeiP3l7mqgKibRrlOrZUYdaNWE3GxhiGklZ1wHEmzuiq9Tez7Q'
 			};
 			uni.setStorageSync('user', this.user); */
@@ -233,6 +246,7 @@ export default {
 				url: '/app/user/info',
 				success: (res) => {
 					this.user = res.data.data;
+					uni.setStorageSync('money', res.data.data.money || 0);
 					if (res.data.data.type == null) {
 						uni.navigateTo({ url: '/pages/user/switch' });
 						return;

+ 1 - 0
app/pages/user/money/index.vue

@@ -72,6 +72,7 @@ export default {
 				url: '/app/user/info',
 				success: (res) => {
 					this.item = res.data.data;
+					uni.setStorageSync('money', res.data.data.money || 0);
 				}
 			});
 		},

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PositionServiceImpl.java

@@ -103,6 +103,11 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
                 return AjaxResult.error(7979, "请先完成企业认证");
             }
         }
+        if (dto.getType() == 1) {
+            User user=userService.getById(AppUtil.getUser().getId());
+            if(user.getMoney())
+        }
+
         Position position = new Position();
         BeanUtils.copyProperties(dto, position);
         Column region = columnService.selectRegion(new Column().setTitle(position.getRegionName()).setLevel(3));