diff --git a/components/MonthCalendar.vue b/components/MonthCalendar.vue
new file mode 100644
index 0000000..cb312e8
--- /dev/null
+++ b/components/MonthCalendar.vue
@@ -0,0 +1,663 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ day }}
+
+
+
+
+
+
+
+
+ {{ dayObj.day }}
+
+
+
+
+
+
+
+ {{ dayObj.day }}
+
+
+
+
+
+
+
+ {{ dayObj.day }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages.json b/pages.json
index 019d53a..7337e60 100644
--- a/pages.json
+++ b/pages.json
@@ -11,6 +11,7 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "办公管理"
+
}
},
{
diff --git a/pages/add-event/index.vue b/pages/add-event/index.vue
index e91b25e..e369ffb 100644
--- a/pages/add-event/index.vue
+++ b/pages/add-event/index.vue
@@ -253,7 +253,7 @@ const formData = ref({
allDay: false,
repeat: 'none',
description: '',
- color: '#0079FE',
+ color: '#B3D9FF',
reminder: 15 // 提前多少分钟提醒
});
@@ -284,8 +284,12 @@ const endDateCalendar = ref(null);
// 颜色选项
const colorOptions = [
- '#0079FE', '#FC902A', '#FF505D', '#18B48A',
- '#FCBF28', '#8883F0',
+ '#B3D9FF', // 更淡的蓝色
+ '#FFE8CC', // 更淡的橙色
+ '#FFD6D9', // 更淡的红色
+ '#D4F3E8', // 更淡的绿色
+ '#FFF4CC', // 更淡的黄色
+ '#E6E5FC', // 更淡的紫色
];
// 重复选项
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 73cf292..7e48e86 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -3,19 +3,20 @@
-
-
-
+
+
-
-
-
-
@@ -58,6 +59,7 @@ import { onShow } from '@dcloudio/uni-app';
import TimeTable from '@/components/TimeTable.vue';
import FabPlus from '@/components/FabPlus.vue';
import AddEventModal from '@/components/AddEventModal.vue';
+import MonthCalendar from '@/components/MonthCalendar.vue';
// 顶部tabs选项
const topTabs = [
@@ -132,65 +134,11 @@ watch(selectedDate, (newDate, oldDate) => {
console.log('eventsInDay 新值:', eventsInDay.value);
}, { immediate: true });
-const calendar = ref(null)
-
-// 格式化日期为 YYYY-MM-DD
-function formatDateToYYYYMMDD(dateInput) {
- if (!dateInput) return '';
-
- let dateStr = '';
-
- // 如果已经是字符串格式 YYYY-MM-DD,直接返回
- if (typeof dateInput === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(dateInput)) {
- return dateInput;
- }
-
- // 处理各种可能的输入格式
- if (typeof dateInput === 'string') {
- dateStr = dateInput;
- } else if (dateInput?.date) {
- dateStr = dateInput.date;
- } else if (dateInput?.value) {
- dateStr = dateInput.value;
- } else if (Array.isArray(dateInput) && dateInput.length > 0) {
- dateStr = typeof dateInput[0] === 'string' ? dateInput[0] : (dateInput[0]?.date || dateInput[0]?.value || '');
- }
-
- if (!dateStr) return '';
-
- // 尝试解析日期
- const date = new Date(dateStr);
- if (!isNaN(date.getTime())) {
- // 格式化为 YYYY-MM-DD
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- return `${year}-${month}-${day}`;
- }
-
- // 如果已经是 YYYY-MM-DD 格式但 new Date 解析失败(如时区问题),尝试直接使用
- if (/^\d{4}-\d{2}-\d{2}/.test(dateStr)) {
- return dateStr.slice(0, 10);
- }
- return '';
-}
-
-// 打开日历方法
-const openCalendar = () => {
- if (calendar.value) {
- calendar.value.open()
- }
-}
-
-// confirm 事件处理(可能在确认时触发)
-const handleConfirm = (e) => {
- console.log('日历 confirm 事件:', e, typeof e);
- const formattedDate = formatDateToYYYYMMDD(e);
- if (formattedDate) {
- selectedDate.value = formattedDate;
- console.log('通过 confirm 更新选择日期:', selectedDate.value);
- console.log('过滤后的事件数:', eventsInDay.value.length);
- }
+// 处理日期变化
+const handleDateChange = (dateStr) => {
+ selectedDate.value = dateStr;
+ console.log('通过日历组件更新选择日期:', selectedDate.value);
+ console.log('过滤后的事件数:', eventsInDay.value.length);
}
// 悬浮按钮/弹窗控制