wkw 6 місяців тому
батько
коміт
600f7edd69

+ 7 - 1
common/queue.js

@@ -681,13 +681,19 @@ module.exports = {
 		  }
 		})
 	},
-	sendImMessage(userId,content,messageType,chatConversationId){
+	sendImMessage(userId,content,messageType,chatConversationId,recordId){
 		let data = {
 			userId,
 			content,
 			messageType,
 			chatConversationId
 		}
+		if(recordId){
+			data = {
+				...data,
+				recordId
+			}
+		}
 		data = JSON.stringify(data);
 		return new Promise(async (resolve,reject) => {
 			uni.sendSocketMessage({

+ 4 - 4
my/jilu/bossMianshiDetail.vue

@@ -394,21 +394,21 @@ export default {
 			interviewResultType:that.resultType,
 			interviewResultMsg:that.text,
 			interviewProcesses:4
-		}).then(res => {
+		}).then(ret => {
 			that.isWork=false
 			that.showResult=false
-			if (res.code === 0) {
+			if (ret.code === 0) {
 				that.info.interviewResultMsg=that.text
 				that.info.interviewResultType=that.resultType
 				that.info.interviewProcesses=4
 				that.currentStep=4
 				this.$Request.getT("/app/chat/selectByTwoIds", {userId:this.info.userEntity.userId,'focusedUserId':this.$queue.getData('userId')}).then((res) => {
 				  if (res.code == 0) 
-					this.$queue.sendImMessage(this.info.userEntity.userId,'面试结果:'+(that.resultType==0?'恭喜您通过面试啦':(that.resultType==1?'我们需要再考虑一下':'非常抱歉,您与我们招聘的岗位不太匹配!')),98,res.data)
+					this.$queue.sendImMessage(this.info.userEntity.userId,'面试结果:'+(that.resultType==0?'恭喜您通过面试啦':(that.resultType==1?'我们需要再考虑一下':'非常抱歉,您与我们招聘的岗位不太匹配!')),98,res.data,ret.data)
 				})
 			} else {
 				uni.showToast({
-					title: res.msg,
+					title: ret.msg,
 					icon: "none"
 				})
 			}

+ 73 - 51
pages/msg/im.vue

@@ -259,7 +259,7 @@
 						</view>
 						<view class="time-favorite flex justify-between align-center">
 							<view class="time-text">
-								{{conversationInfo.createTime&&conversationInfo.createTime.substring(0,10)}} 沟通的职位-亚马逊{{resumesInfo.intentionRuleClassifyName}}
+								{{conversationInfo.createTime&&conversationInfo.createTime.substring(0,10)}} 沟通的职位-{{resumesInfo.intentionRuleClassifyName}}
 							</view>
 						</view>
 					</view>
@@ -411,8 +411,8 @@
 							{{item.content}}已拒绝
 						</view>
 						<view class="chat-listitem-text bg-style" style="margin-left: 20rpx;"
-						v-if="item.content && (item.messageType === 96 || item.messageType === 97)">{{item.content}}</view>
-						<view v-if="item.content && item.messageType === 99"
+						v-if="item.content && (item.messageType === 96 || item.messageType === 97)" @click="goToInterviewDetail(item)">{{item.content}}</view>
+						<view v-if="item.content && item.messageType === 99" @click="goToInterviewDetail(item)"
 							class="chat-listitem-text"
 							style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-left: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
 							<view class="flex align-center">
@@ -421,7 +421,7 @@
 								您收到了{{item.content}}
 							</view>
 						</view>
-						<view v-if="item.content && item.messageType === 98"
+						<view v-if="item.content && item.messageType === 98" @click="goToInterviewDetail(item)"
 							class="chat-listitem-text"
 							style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-left: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
 							<view class="flex align-center">
@@ -532,8 +532,8 @@
 							{{item.content}}已拒绝
 						</view>
 						<view class="chat-listitem-text bg-style" style="margin-right: 20rpx;"
-						v-if="item.content && (item.messageType === 96 || item.messageType === 97)">{{item.content}}</view>
-						<view v-if="item.content && item.messageType === 99"
+						v-if="item.content && (item.messageType === 96 || item.messageType === 97)" @click="goToInterviewDetail(item)">{{item.content}}</view>
+						<view v-if="item.content && item.messageType === 99" @click="goToInterviewDetail(item)"
 							class="chat-listitem-text textColor"
 							style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-right: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
 							<view class="flex align-center">
@@ -542,7 +542,7 @@
 								您发送了{{item.content}}
 							</view>
 						</view>
-						<view v-if="item.content && item.messageType === 98"
+						<view v-if="item.content && item.messageType === 98" @click="goToInterviewDetail(item)"
 							class="chat-listitem-text textColor"
 							style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-right: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
 							<view class="flex align-center">
@@ -738,7 +738,7 @@
 		</u-select>
 
 		<u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
-
+		<!-- ——————————————————————————-废弃  开始——————————————————————---- -->
 		<u-popup v-model="mianshiShow" mode="bottom" z-index="998" :mask-close-able="false" border-radius="14"
 			@close="cleanMs" :closeable="true">
 			<view class="mianshiTitle">面试邀请</view>
@@ -791,6 +791,7 @@
 				</view>
 			</view>
 		</u-popup>
+		<!-- ——————————————————————————-废弃  结束——————————————————————---- -->
 		<u-toast ref="uToast" />
 		<u-picker v-model="msTime" mode="time" :params="params" @confirm="mianshiConfirm" confirm-color="#016BF6">
 		</u-picker>
@@ -1246,6 +1247,13 @@
 			// this.recordsInter = null
 		},
 		methods: {
+			goToInterviewDetail(item){
+				if(item.recordId){
+					uni.navigateTo({
+						url: `/my/jilu/bossMianshiDetail?recordId=${item.recordId}`
+					})
+				}
+			},
 			// 返回上一页
 			goBack() {
 				uni.navigateBack();
@@ -1520,7 +1528,7 @@
 										title: '已接受面试邀请'
 									})
 									that.msshow = false;
-									that.setChatSave(97)
+									that.setChatSave(97,res.data)
 								} else {
 									uni.showToast({
 										title: res.msg,
@@ -1563,7 +1571,7 @@
 										title: '已拒绝来自' + item.company.companyName + '的面试邀请'
 									})
 									that.msshow = false;
-									that.setChatSave(96)
+									that.setChatSave(96,res.data)
 								} else {
 									uni.showToast({
 										title: res.msg,
@@ -2456,42 +2464,46 @@
 				return result
 			},
 			getDateDiff(data) {
-				// 传进来的data必须是日期格式,不能是时间戳
-				//var str = data;
-				//将字符串转换成时间格式
-				var timePublish = new Date(data);
-				var timeNow = new Date();
-				var minute = 1000 * 60;
-				var hour = minute * 60;
-				var day = hour * 24;
-				var month = day * 30;
-				var result = "2";
-
-				var diffValue = timeNow - timePublish;
-				var diffMonth = diffValue / month;
-				var diffWeek = diffValue / (7 * day);
-				var diffDay = diffValue / day;
-				var diffHour = diffValue / hour;
-				var diffMinute = diffValue / minute;
-
-
-				if (diffMonth > 3) {
-					result = timePublish.getFullYear() + "-";
-					result += timePublish.getMonth() + "-";
-					result += timePublish.getDate();
-				} else if (diffMonth > 1) { //月
-					result = data.substring(0, 10);
-				} else if (diffWeek > 1) { //周
-					result = data.substring(0, 10);
-				} else if (diffDay > 1) { //天
-					result = data.substring(0, 10);
-				} else if (diffHour > 1) { //小时
-					result = parseInt(diffHour) + "小时前";
-				} else if (diffMinute > 1) { //分钟
-					result = parseInt(diffMinute) + "分钟前";
+				// 1️⃣ 手动解析字符串,避免 iOS 时区问题
+				let timePublish;
+				if (typeof data === 'string') {
+					// 格式:2026-01-05 18:46:39
+					const parts = data.split(/[- :]/);
+					// 注意:月份从 0 开始
+					timePublish = new Date(parts[0], parts[1] - 1, parts[2], parts[3] || 0, parts[4] || 0, parts[5] || 0);
+				} else {
+					timePublish = new Date(data);
+				}
+			
+				const timeNow = new Date();
+				const publishYear = timePublish.getFullYear();
+				const publishMonth = timePublish.getMonth() + 1;
+				const publishDate = timePublish.getDate();
+				const publishHour = timePublish.getHours().toString().padStart(2, '0');
+				const publishMinute = timePublish.getMinutes().toString().padStart(2, '0');
+			
+				const oneDay = 1000 * 60 * 60 * 24;
+				// 用本地时间差计算天数
+				const diffDays = Math.floor((timeNow.setHours(0, 0, 0, 0) - timePublish.setHours(0, 0, 0, 0)) / oneDay);
+			
+				const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
+				const weekStr = weekDays[timePublish.getDay()];
+				const sameYear = publishYear === timeNow.getFullYear();
+			
+				let result = '';
+			
+				if (diffDays === 0) {
+					result = `${publishHour}:${publishMinute}`;
+				} else if (diffDays === 1) {
+					result = `昨天 ${publishHour}:${publishMinute}`;
+				} else if (diffDays < 7) {
+					result = `${weekStr} ${publishHour}:${publishMinute}`;
+				} else if (sameYear) {
+					result = `${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
 				} else {
-					result = "刚刚";
+					result = `${publishYear}年${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
 				}
+			
 				return result;
 			},
 			// 发送心跳包
@@ -2701,12 +2713,6 @@
 				// 	});
 				// 	return;
 				// }
-				if(type == 96){
-					this.content = '已拒绝面试邀请'
-				}
-				if(type == 97){
-					this.content = '已接受面试邀请'
-				}
 				let userId = this.$queue.getData('userId');
 				if (type === 4) {
 					this.content = url;
@@ -2751,7 +2757,23 @@
 						messageType: type,
 						chatConversationId: this.chatConversationId
 					}
-				} else {
+				} else if (type == 96){
+					data = {
+						userId: this.byUserId,
+						content: '已拒绝面试邀请',
+						messageType: type,
+						chatConversationId: this.chatConversationId,
+						recordId:url
+					}
+				}else if(type == 97){
+					data = {
+						userId: this.byUserId,
+						content: '已接受面试邀请',
+						messageType: type,
+						chatConversationId: this.chatConversationId,
+						recordId:url
+					}
+				}else {
 					data = {
 						userId: this.byUserId,
 						content: this.content,

+ 68 - 7
pages/msg/index.vue

@@ -59,7 +59,7 @@
 		</view> -->
 
 		<view v-if="chatList.length" class="margin-top-sm  content ">
-			<view class="radius padding-lr-sm bg" style="margin-top: 4rpx;" @click="goIM(item)"
+			<view class="radius padding-lr-sm bg" style="margin-top: 4rpx;" @click="goIM(item)" @longpress="confirmDelete(item)"
 				v-for="(item,index) in chatList" :key='index'>
 				<view class="flex padding-tb ">
 					<view class="avatar-container">
@@ -279,13 +279,74 @@
 			clearInterval(this.time)
 		},
 		methods: {
+			confirmDelete(item){
+				uni.showModal({
+					title: '提示',
+					content: '是否删除这条消息?',
+					cancelText: '取消',
+					confirmText: '删除',
+					success: (res) => {
+					  if (res.confirm) {
+						this.$Request.get(`/app/chat/deleteConversation?chatConversationId=${item.chatConversationId}`).then(res => {
+							if(res.code == 0){
+								uni.showToast({
+									title: res.msg,
+									icon: 'none'
+								})
+							}else{
+								uni.showToast({
+									title: res.msg || '删除失败',
+									icon: 'none'
+								})
+							}
+						});
+					  }
+					}
+				});
+			},
 			//把时间转换为月日
-			getMonthOrDay(time) {
-				let date = new Date(time) // 获取时间
-				// var year = date.getFullYear() // 获取年
-				let month = date.getMonth() + 1 // 获取月
-				let strDate = date.getDate() // 获取日
-				return month + '月' + strDate + '日'
+			getMonthOrDay(data) {
+				// 1️⃣ 手动解析字符串,避免 iOS 时区问题
+				let timePublish;
+				if (typeof data === 'string') {
+					// 格式:2026-01-05 18:46:39
+					const parts = data.split(/[- :]/);
+					// 注意:月份从 0 开始
+					timePublish = new Date(parts[0], parts[1] - 1, parts[2], parts[3] || 0, parts[4] || 0, parts[5] || 0);
+				} else {
+					timePublish = new Date(data);
+				}
+							
+				const timeNow = new Date();
+				const publishYear = timePublish.getFullYear();
+				const publishMonth = timePublish.getMonth() + 1;
+				const publishDate = timePublish.getDate();
+				const publishHour = timePublish.getHours().toString().padStart(2, '0');
+				const publishMinute = timePublish.getMinutes().toString().padStart(2, '0');
+							
+				const oneDay = 1000 * 60 * 60 * 24;
+				// 用本地时间差计算天数
+				const diffDays = Math.floor((timeNow.setHours(0, 0, 0, 0) - timePublish.setHours(0, 0, 0, 0)) / oneDay);
+							
+				const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
+				const weekStr = weekDays[timePublish.getDay()];
+				const sameYear = publishYear === timeNow.getFullYear();
+							
+				let result = '';
+							
+				if (diffDays === 0) {
+					result = `${publishHour}:${publishMinute}`;
+				} else if (diffDays === 1) {
+					result = `昨天 ${publishHour}:${publishMinute}`;
+				} else if (diffDays < 7) {
+					result = `${weekStr} ${publishHour}:${publishMinute}`;
+				} else if (sameYear) {
+					result = `${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
+				} else {
+					result = `${publishYear}年${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
+				}
+							
+				return result;
 			},
 			// 开启订阅消息
 			openMsg() {

+ 1 - 1
pages/msg/interviewInvitation.vue

@@ -546,7 +546,7 @@
 						     // 回传上一页
 							 this.$Request.getT("/app/chat/selectByTwoIds", {userId:this.interviewerId,'focusedUserId':this.$queue.getData('userId')}).then((res) => {
 							   if (res.code == 0) 
-								this.$queue.sendImMessage(this.interviewerId,'一份面试邀约',99,res.data)
+								this.$queue.sendImMessage(this.interviewerId,'一份面试邀约',99,res.data,ret.data)
 							 })
 						      uni.$emit('saveInterviewResult', "success");
 						      uni.navigateBack();