Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
xysBooking
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2026-01-22 10:58:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
637271df0538a55f3fb8fa6499452fa789c47fe8
637271df
1 parent
fee4b4cb
feat(预约页面): 添加无限预约状态下的提示文本显示
在无限预约状态下显示自定义提示文本,当没有设置提示时显示默认文本
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
src/views/booking.vue
src/views/booking.vue
View file @
637271d
<!--
* @Date: 2024-01-15 13:35:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
4-02-05 16:57:15
* @FilePath: /xysBooking/src/views/booking.vue
* @LastEditTime: 202
6-01-22 10:56:01
* @FilePath: /
git/
xysBooking/src/views/booking.vue
* @Description: 预约页面
-->
<template>
...
...
@@ -67,7 +67,7 @@
<div class="text">选择参访时间段</div>
</div>
<div style="padding: 1.5rem 0.75rem; color: #A67939; text-align: center;">
暂未开启预约
{{ infinity_tips_text }}
</div>
</div>
</div>
...
...
@@ -142,13 +142,16 @@ onMounted(async () => {
* @return {object} {text: 日期, date: 日期, reserve_full: 是否可约 1=可约,0=约满,-1=无需预约 overdue=过期日期 }
*/
const findDatesInfo = (date) => {
if (!date) return { text: '', date: '', reserve_full: '', tips: '', lunar_date: {} };
const result = dates_list.value.find((item) => item.month_date === date);
const currentDate = new Date(date);
const lunarDate = calendar.solar2lunar(dayjs(date).format('YYYY-MM-DD'));
const d = dayjs(date);
const lunarDate = calendar.solar2lunar(d.year(), d.month() + 1, d.date());
return {
text: currentDate.getDate().toString().padStart(2, '0'),
date: result?.month_date,
reserve_full: result?.reserve_full,
tips: result?.tips || '',
lunar_date: lunarDate
};
};
...
...
@@ -212,6 +215,16 @@ const checked_day_reserve_full = ref(null);
const checked_time = ref(-1);
const timePeriod = ref([]); // 当前时间段信息
const infinity_tips_text = computed(() => {
if (!checked_day.value || checked_day_reserve_full.value !== ReserveStatus.INFINITY) return '';
const info = findDatesInfo(checked_day.value);
if (dayjs(checked_day.value).isAfter(dayjs(), 'day')) {
const tips = (info.tips || '').trim();
if (tips) return tips;
}
return '暂未开启预约';
});
const chooseTime = (item, index) => { // 选择时间段回调
if (item.rest_qty || item.rest_qty === QtyStatus.INFINITY) { // 余量等于-1为不限制数量
checked_time.value = index;
...
...
Please
register
or
login
to post a comment