自习室预约提示
This commit is contained in:
parent
036be9b27b
commit
e1c1edffb3
@ -106,8 +106,8 @@
|
||||
<u-button type="primary" text="我已知晓" :disabled="hasReaded" @click="show=false"></u-button>
|
||||
</u-popup> -->
|
||||
<!-- 保持原有结构不变 -->
|
||||
<view class="copyright-fixed">
|
||||
<Copyright :footerHeight="'0'" />
|
||||
<view class="copyright-fixed">
|
||||
<Copyright :footerHeight="'0'" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user