From e1c1edffb386a634959f50840be95e7bb36f8e12 Mon Sep 17 00:00:00 2001 From: qiuyuan Date: Tue, 16 Sep 2025 16:08:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E4=B9=A0=E5=AE=A4=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/meetingList/index.vue | 152 ++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/pages/meetingList/index.vue b/pages/meetingList/index.vue index 9a1385c..b1cb190 100644 --- a/pages/meetingList/index.vue +++ b/pages/meetingList/index.vue @@ -106,8 +106,8 @@ --> - - + + @@ -284,67 +284,67 @@ } }, - goDetail(item) { - console.log("====item",item) - // 安全获取ID(兼容各种可能的字段名) - const id = item.id; - const isSelfStudy = item.title === '自习室'; - - if (!id) { - uni.showToast({ - title: '会议室信息异常', - icon: 'none' - }); - return; - } - - // 如果是自习室,先弹出提示确认框 - if (item.roomType == 2&&item.num!==4 ) { - uni.showModal({ - title: '温馨提示', - content: '自习室预约时间按月为单位,单次预约最长两个月,请确认是否继续?', - confirmColor: '#007AFF', // 可根据uView主题色调整 - success: (res) => { - if (res.confirm) { - // 用户点击确定,执行跳转 - this.navigateToDetail(id, true); - } else if (res.cancel) { - // 用户点击取消,可选操作(如提示取消) - uni.showToast({ - title: '已取消', - icon: 'none' - }); - } - }, - fail: (err) => { - console.error('弹窗失败:', err); - uni.showToast({ - title: '操作失败', - icon: 'none' - }); - } - }); - } else { - // 非自习室,直接跳转 - this.navigateToDetail(id, false); - } - }, - - // 封装跳转逻辑,避免重复代码 - navigateToDetail(id, isSelfStudy) { - uni.navigateTo({ - url: `/pages/meetingDetail/index?Id=${encodeURIComponent(id)}&isSelfStudy=${isSelfStudy}`, - success: () => { - console.log('导航成功,ID:', id); - }, - fail: (err) => { - console.error('导航失败:', err); - uni.showToast({ - title: '打开详情页失败', - icon: 'none' - }); - } - }); + goDetail(item) { + console.log("====item",item) + // 安全获取ID(兼容各种可能的字段名) + const id = item.id; + const isSelfStudy = item.title === '自习室'; + + if (!id) { + uni.showToast({ + title: '会议室信息异常', + icon: 'none' + }); + return; + } + + // 如果是自习室,先弹出提示确认框 + if (item.roomType == 2&&item.num!==4 ) { + uni.showModal({ + title: '温馨提示', + content: '自习室预约时间按月为单位,单次预约最长一个月,请确认是否继续?', + confirmColor: '#007AFF', // 可根据uView主题色调整 + success: (res) => { + if (res.confirm) { + // 用户点击确定,执行跳转 + this.navigateToDetail(id, true); + } else if (res.cancel) { + // 用户点击取消,可选操作(如提示取消) + uni.showToast({ + title: '已取消', + icon: 'none' + }); + } + }, + fail: (err) => { + console.error('弹窗失败:', err); + uni.showToast({ + title: '操作失败', + icon: 'none' + }); + } + }); + } else { + // 非自习室,直接跳转 + this.navigateToDetail(id, false); + } + }, + + // 封装跳转逻辑,避免重复代码 + navigateToDetail(id, isSelfStudy) { + uni.navigateTo({ + url: `/pages/meetingDetail/index?Id=${encodeURIComponent(id)}&isSelfStudy=${isSelfStudy}`, + success: () => { + console.log('导航成功,ID:', id); + }, + fail: (err) => { + console.error('导航失败:', err); + uni.showToast({ + title: '打开详情页失败', + icon: 'none' + }); + } + }); }, // 获取会议室列表 async getList() { @@ -412,21 +412,21 @@ $card-radius: 24rpx; $tag-radius: 8rpx; - .container { - background-color: $bg-color; - padding: 20rpx; - min-height: 100vh; - box-sizing: border-box; - display: flex; /* 新增 */ - flex-direction: column; /* 新增 */ + .container { + background-color: $bg-color; + padding: 20rpx; + min-height: 100vh; + box-sizing: border-box; + display: flex; /* 新增 */ + flex-direction: column; /* 新增 */ padding-bottom: calc(100rpx + 80rpx); /* 调整为footer高度 + copyright高度 */ - // .copyright-fixed { - // position: fixed; - // bottom: 0; - // left: 0; - // right: 0; - // z-index: 10; /* 防止被其他元素遮挡 */ + // .copyright-fixed { + // position: fixed; + // bottom: 0; + // left: 0; + // right: 0; + // z-index: 10; /* 防止被其他元素遮挡 */ // } .nav-bar {