From 3829c1671e98bc8d5202d1b07294dafb94a1e134 Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Thu, 9 Oct 2025 18:36:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 8 +- .../integrated/meeting/my-reservations.vue | 98 +++++++++++++++++-- src/sheep/api/meetingRoom.ts | 18 ++++ 3 files changed, 114 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 8f8874b..f789095 100644 --- a/.env +++ b/.env @@ -20,15 +20,15 @@ VITE_OAUTH2_APP_CLIENT='mini:mini' # VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上 #VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上 # VITE_APP_DEV_SERVICE = http://192.168.101.174:9999 # 邓-本地 -# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地 -VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上 +VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地 +; VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上 # --------------------------- 开发环境 图片访问基础地址 --------------------------- # VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上 #VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上 # VITE_IMAGE_DEV_PATH = http://192.168.101.174:9999 # 邓-本地 - #VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999 -VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上 +VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999 +; VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上 # --------------------------- 生产环境 api地址 ---------------------------------- VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api # 域名线上 diff --git a/src/pages/integrated/meeting/my-reservations.vue b/src/pages/integrated/meeting/my-reservations.vue index 5d4df5e..f95289b 100644 --- a/src/pages/integrated/meeting/my-reservations.vue +++ b/src/pages/integrated/meeting/my-reservations.vue @@ -14,11 +14,13 @@ - + {{ item.title }} - {{ statusMap[item.checkStatus]?.text }} + {{ statusMap[item.checkStatus]?.text }} + 已结束 + 已过期 预约日期:{{ item.bookingDate }} @@ -28,7 +30,8 @@ 查看详情 - 取消预约 + 取消预约 + 结束会议 @@ -96,10 +99,75 @@ function cancelBooking(item: any) { uni.showModal({ title: "提示", content: "确定要取消该预约吗?", - success: (res) => { + success: async (res) => { if (res.confirm) { - // TODO: 调用取消预约接口 - uni.showToast({ title: "已取消(待接入接口)", icon: "none" }) + try { + uni.showLoading({ title: "处理中..." }) + const response: any = await meetingRoomApi.cancelBooking(item.id) + uni.hideLoading() + + if (response.code === 0) { + uni.showToast({ title: "预约已取消", icon: "success" }) + // 刷新列表 + fetchReservations() + } else { + uni.showToast({ + title: response.msg || "操作失败", + icon: "none" + }) + } + } catch (error) { + uni.hideLoading() + uni.showToast({ title: "操作失败,请重试", icon: "none" }) + console.error("取消预约失败:", error) + } + } + }, + }) +} + +// 是否已结束 +function isEnded(item: any) { + return Number(item.isConfirmEnd) === 1 +} + +// 是否已过期(当前日期大于预约日期,且未结束) +function isExpired(item: any) { + try { + if (!item.bookingDate) return false + const todayStr = new Date().toISOString().split('T')[0] + return todayStr > item.bookingDate && !isEnded(item) + } catch (e) { + return false + } +} + +function endMeeting(item: any) { + uni.showModal({ + title: "提示", + content: "确定要结束该会议吗?", + success: async (res) => { + if (res.confirm) { + try { + uni.showLoading({ title: "处理中..." }) + const response: any = await meetingRoomApi.confirmEndMeeting(item.id) + uni.hideLoading() + + if (response.code === 0) { + uni.showToast({ title: "会议已结束", icon: "success" }) + // 刷新列表 + fetchReservations() + } else { + uni.showToast({ + title: response.msg || "操作失败", + icon: "none" + }) + } + } catch (error) { + uni.hideLoading() + uni.showToast({ title: "操作失败,请重试", icon: "none" }) + console.error("结束会议失败:", error) + } } }, }) @@ -194,6 +262,20 @@ function viewDetail(item: any) { .card-status.cancel { color: #ff4d4f; } +.tag { + margin-left: 8rpx; + font-size: 22rpx; + padding: 2rpx 10rpx; + border-radius: 6rpx; +} +.tag.ended { + background: #f5f5f5; + color: #999; +} +.tag.expired { + background: #fff1f0; + color: #ff4d4f; +} .card-info { font-size: 26rpx; color: #666; @@ -215,6 +297,10 @@ function viewDetail(item: any) { background: #ffeaea; color: #ff4d4f; } +.card-btn.end { + background: #e6f7ff; + color: #1890ff; +} .empty { display: flex; flex-direction: column; diff --git a/src/sheep/api/meetingRoom.ts b/src/sheep/api/meetingRoom.ts index 055d4f4..75b3a0b 100644 --- a/src/sheep/api/meetingRoom.ts +++ b/src/sheep/api/meetingRoom.ts @@ -69,6 +69,24 @@ export default { method: 'GET', }), + /** + * 确认结束会议 + */ + confirmEndMeeting: (bookingId: string) => + request({ + url: `/integrated/meetingBooking/app/confirm-end-meeting/${bookingId}`, + method: 'POST', + }), + + /** + * 取消预约 + */ + cancelBooking: (bookingId: string) => + request({ + url: `/integrated/meetingRoom/app/cancel-booking/${bookingId}`, + method: 'POST', + }), + }