lsw 9 månader sedan
förälder
incheckning
bd1256f676

+ 3 - 0
app/common/common.scss

@@ -224,6 +224,9 @@
 		padding-right: 3px;
 	}
 }
+.cen{
+	text-align: center;
+}
 .popup {
 	padding: 15px;
 	background-color: white;

+ 19 - 1
app/common/util.js

@@ -25,6 +25,23 @@ function formatLocation(longitude, latitude) {
 		latitude: latitude.toString().split('.')
 	}
 }
+
+function startCountdown(endTime, callback) {
+	const timer = setInterval(() => {
+		const now = new Date();
+		const distance = endTime - now;
+		if (distance < 0) {
+			clearInterval(timer);
+			callback('已超时');
+			return;
+		}
+		const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
+		const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
+		const seconds = Math.floor((distance % (1000 * 60)) / 1000);
+		callback(`${hours}小时 ${minutes}分钟 ${seconds}秒`);
+	}, 1000);
+	return timer;
+}
 //获取两日期之间日期列表函数
 function getdiffdate(stime, etime) {
 	//初始化日期列表,数组
@@ -259,5 +276,6 @@ module.exports = {
 	getdiffdate: getdiffdate,
 	getData: getData,
 	distance: distance,
-	days: days
+	days: days,
+	startCountdown: startCountdown
 }

+ 4 - 2
app/pages.json

@@ -255,7 +255,8 @@
 		{
 			"path": "pages/job/position/manage/part_time",
 			"style": {
-				"navigationBarTitleText": "兼职管理"
+				"navigationBarTitleText": "兼职管理",
+				"enablePullDownRefresh": true
 			}
 		},
 		{
@@ -285,7 +286,8 @@
 		{
 			"path": "pages/user/resume/application/receive/list",
 			"style": {
-				"navigationBarTitleText": "报名列表"
+				"navigationBarTitleText": "报名列表",
+				"enablePullDownRefresh": true
 			}
 		},
 		{

+ 3 - 2
app/pages/job/position/manage/part_time.vue

@@ -30,7 +30,8 @@
 					<text class="date">{{ item.createTime }}</text>
 				</view>
 				<view class="flex">
-					<view class="f danger" @click.stop="manageRemove(item)">删除</view>
+					<view class="f danger" @click.stop="manageRemove(item)" v-if="item.complete == 0 && item.audit == 0">删除</view>
+					<view class="f" @click.stop="manageRemove(item)" v-else>查看</view>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
@@ -94,7 +95,7 @@ export default {
 		manageRemove(item) {
 			uni.showModal({
 				title: '提示',
-				content: '确定删除该兼职?删除后金额会退回到你的账户下',
+				content: '确定删除该兼职?删除后兼职金额(不包含服务费)会退回到你的账户下',
 				success: (res) => {
 					if (res.confirm) {
 						this.http.request({

+ 7 - 6
app/pages/job/position/manage/part_time_push.vue

@@ -2,7 +2,7 @@
 	<view class="main">
 		<view class="form_group">
 			<view class="lable re">兼职名称</view>
-			<input placeholder="请输入" v-model="item.title" />
+			<input placeholder="请输入" v-model="item.title" :disabled="item.audit == 1" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">兼职类型</view>
@@ -13,12 +13,12 @@
 		</view>
 		<view class="form_group">
 			<view class="lable re">兼职描述(要求)</view>
-			<leditor ref="editor" v-model="item.contents" placeholder="请输入兼职描述"></leditor>
+			<leditor ref="editor" v-model="item.contents" placeholder="请输入兼职描述" :read="item.audit == 1"></leditor>
 		</view>
 		<view class="form_group">
 			<view class="lable re">兼职金额(元)</view>
 			<view class="bgm">
-				<input type="digit" placeholder="请输入" v-model="item.salary" class="input" />
+				<input type="digit" placeholder="请输入" v-model="item.salary" class="input" :disabled="item.audit == 1" />
 				<view class="msg">
 					<text>{{ money }}</text>
 					<text @click="go('/pages/user/money/index')">充值</text>
@@ -58,7 +58,8 @@
 			<input placeholder="请输入楼层/单元室/门牌号" v-model="item.mph" v-if="item.address" />
 			<view class="bz">如需应聘者去现场请选择兼职地点</view>
 		</view>
-		<button class="btn" @click="save()">{{ item.id ? '编辑' : '保存' }}</button>
+		<button class="btn" @click="ok()" v-if="item.id && item.audit == 0">编辑</button>
+		<button class="btn" @click="save()" v-if="!item.id">保存</button>
 		<u-popup :show="show" round="15" mode="center" :closeable="true" :closeOnClickOverlay="false" :customStyle="{ width: '85%' }" @close="show = false">
 			<view class="popup">
 				<view class="mtt">兼职金额</view>
@@ -70,7 +71,7 @@
 					</view>
 					<view class="item">
 						<text class="tt">费率</text>
-						<text class="la">{{ platform.cashOutService }}%</text>
+						<text class="la">{{ platform.partTimeService }}%</text>
 					</view>
 					<view class="item">
 						<text class="tt">实际扣除</text>
@@ -163,7 +164,7 @@ export default {
 				return false;
 			}
 			this.show = true;
-			this.item.serviceMoney = (this.item.salary * (this.platform.cashOutService / 100)).toFixed(2);
+			this.item.serviceMoney = (this.item.salary * (this.platform.partTimeService / 100)).toFixed(2);
 			this.item.realMoney = (parseFloat(this.item.salary) + parseFloat(this.item.serviceMoney)).toFixed(2);
 		},
 		ok() {

+ 2 - 2
app/pages/user/money/index.vue

@@ -43,8 +43,8 @@
 					<text>{{ item.createTime }}</text>
 				</view>
 				<view class="price">
-					<text v-if="item.type == 0 || item.type == 3" style="color: orangered">+{{ item.money }}元</text>
-					<text v-if="item.type == 1 || item.type == 4" style="color: darkgray">-{{ item.money }}元</text>
+					<text v-if="item.type == 0 || item.type == 3 || item.type == 4" style="color: orangered">+{{ item.money }}元</text>
+					<text v-if="item.type == 1" style="color: darkgray">-{{ item.money }}元</text>
 					<text v-if="item.type == 2 && item.state == 0" style="color: darkgray">-{{ item.money }}元</text>
 					<text v-if="item.type == 2 && item.state == 1" style="color: darkgray">-{{ item.money }}元</text>
 					<text v-if="item.type == 2 && item.state == 2" style="color: #f44336">+{{ item.money }}元</text>

+ 18 - 1
app/pages/user/resume/application/invite.vue

@@ -16,7 +16,7 @@
 				<view class="f br agree" v-if="item.isAccept == 1 && item.isExpire == 0">已同意</view>
 				<view class="f danger" v-if="item.isAccept == 0 && item.isExpire == 1">超时未操作(已过期)</view>
 			</view>
-			<view class="bz" v-if="item.isExpire == 0 && item.isAccept == 0">一个小时内未同意或操作即自动过期</view>
+			<view class="bz cen" v-if="item.isExpire == 0 && item.isAccept == 0 && item.countdown">剩余:{{ item.countdown }}</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>
@@ -43,6 +43,18 @@ export default {
 				success: (res) => {
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
 					res.data.rows.forEach((item) => {
+						if (item.isAccept == 0 && item.isExpire == 0) {
+							const endTime = new Date(item.auditTime);
+							endTime.setHours(endTime.getHours() + 1);
+							item.countdown = '';
+							item.timer = null;
+							item.timer = this.util.startCountdown(endTime, (countdown) => {
+								item.countdown = countdown;
+								if (countdown == '已超时') {
+									item.isExpire = 1;
+								}
+							});
+						}
 						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
 						this.list.push(item);
 					});
@@ -78,6 +90,7 @@ export default {
 							success: (res) => {
 								uni.showToast({ title: '操作成功' });
 								item.isAccept = isAccept;
+								clearInterval(item.timer);
 							}
 						});
 					}
@@ -88,6 +101,7 @@ export default {
 		refresh() {
 			this.loadMore = true;
 			this.param.pageNum = 1;
+			this.list.forEach((item) => clearInterval(item.timer));
 			this.list = [];
 			this.getData();
 		}
@@ -105,6 +119,9 @@ export default {
 			this.param.pageNum++;
 			this.getData();
 		}
+	},
+	destroyed() {
+		this.list.forEach((item) => clearInterval(item.timer));
 	}
 };
 </script>

+ 22 - 2
app/pages/user/resume/application/receive/list.vue

@@ -25,7 +25,7 @@
 			</view>
 			<view class="flex">
 				<view class="f" v-if="item.state == 0">待处理</view>
-				<view class="f" v-if="item.state == 1 && item.isAccept == 0 && item.isExpire == 0">等待对方同意接单</view>
+				<view class="f" v-if="item.state == 1 && item.isAccept == 0 && item.isExpire == 0">等待对方同意接单 {{ item.countdown }}</view>
 				<view class="f" v-if="item.state == 1 && item.isAccept == 0 && item.isExpire == 1">对方超时未操作(已过期)</view>
 				<view class="f br" v-if="item.state == 1 && item.isAccept == 1">对方同意接单</view>
 				<view class="f danger" v-if="item.state == 1 && item.isAccept == 2">对方已拒绝</view>
@@ -70,7 +70,23 @@ export default {
 				loading: 'false',
 				success: (res) => {
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
-					this.list.push(...res.data.rows);
+					res.data.rows.forEach((item) => {
+						if (item.isAccept == 0 && item.isExpire == 0 && item.state == 1) {
+							const endTime = new Date(item.auditTime);
+							endTime.setHours(endTime.getHours() + 1);
+							item.countdown = '';
+							item.timer = null;
+							item.timer = this.util.startCountdown(endTime, (countdown) => {
+								item.countdown = countdown;
+								if (countdown == '已超时') {
+									item.isExpire = 1;
+									clearInterval(item.timer);
+								}
+							});
+						}
+						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
+						this.list.push(item);
+					});
 				}
 			});
 		},
@@ -89,6 +105,7 @@ export default {
 		refresh() {
 			this.loadMore = true;
 			this.param.pageNum = 1;
+			this.list.forEach((item) => clearInterval(item.timer));
 			this.list = [];
 			this.getData();
 		}
@@ -106,6 +123,9 @@ export default {
 			this.param.pageNum++;
 			this.getData();
 		}
+	},
+	destroyed() {
+		this.list.forEach((item) => clearInterval(item.timer));
 	}
 };
 </script>

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/vo/ReceiveListVo.java

@@ -39,4 +39,7 @@ public class ReceiveListVo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+
 }

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

@@ -132,6 +132,8 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
             BigDecimal serviceMoney = platform.getPartTimeService().divide(new BigDecimal("100")).multiply(salary).setScale(2, RoundingMode.HALF_UP);
             //计算总费用
             BigDecimal totalMoney = serviceMoney.add(salary).setScale(2, RoundingMode.HALF_UP);
+            System.out.println("serviceMoney:" + serviceMoney);
+            System.out.println("totalMoney:" + totalMoney);
             if (totalMoney.compareTo(user.getMoney()) > 0) {
                 return AjaxResult.error(8080, "余额不足请先充值");
             }
@@ -193,6 +195,9 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
         if (position == null || !position.getUserId().equals(AppUtil.getUser().getId())) {
             return AjaxResult.error("职位不存在或非法操作");
         }
+        if (dto.getType() == 1 && !position.getSalary().equals(dto.getSalary())) {
+            return AjaxResult.error("兼职不允许编辑金额,如需修改金额请删除后重新发");
+        }
         if (position.getAudit() == 1) {
             return AjaxResult.error("该职位已审核通过不允许编辑");
         }
@@ -230,6 +235,9 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
         if (position == null || !position.getUserId().equals(AppUtil.getUser().getId())) {
             return AjaxResult.error("职位不存在或非法操作");
         }
+        if (position.getType() == 1 && (position.getAudit() == 1 || position.getComplete() != 0)) {
+            return AjaxResult.error("当前兼职不可删除");
+        }
         if (!removeById(id)) {
             throw new ServiceException("删除职位失败,请联系平台");
         }

+ 3 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/ResumeDeliverServiceImpl.java

@@ -108,11 +108,11 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
         //兼职接单成功,把兼职设置成进行中...
         if (dto.getIsAccept() == 1 && resumeDeliver.getType() == 1) {
             String key = CacheConstants.APP_DELIVER + resumeDeliver.getId() + "-" + AppUtil.getUser().getId();
-            if (redisCache.getCacheObject(key) == null) {
+   /*         if (redisCache.getCacheObject(key) == null) {
                 resumeDeliver.setIsExpire(1);
                 updateById(resumeDeliver);
                 return AjaxResult.error("抱歉你的兼职邀请已经超时无效了");
-            }
+            }*/
             Position position = new Position();
             position.setId(resumeDeliver.getPositionId());
             position.setComplete(1);
@@ -164,7 +164,7 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
         }
         List<ResumeDeliver> list = selectList(new ResumeDeliver().setPositionId(resumeDeliver.getPositionId()).setState(1).setIsExpire(0));
         if (!list.isEmpty() && list.size() > 0) {
-            return AjaxResult.error("你已发出兼职邀请,请等待对方答复后或者1小时无回应自动排除");
+            return AjaxResult.error("排队中...你已发出一份兼职邀请,请等待对方答复后或者1小时无回应再操作");
         }
         if (resumeDeliver.getIsAccept() == 2) {
             return AjaxResult.error("兼职者已拒绝,无法重复发送");