From ae767adbdff04d430a849755520e53f713b41b45 Mon Sep 17 00:00:00 2001 From: ozh Date: Wed, 19 Aug 2026 15:27:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(event):=20=E4=BA=8B=E4=BB=B6=E9=A1=B5?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=8A=BD=E5=B1=89=E4=B8=8E=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=97=A5=E5=8E=86=E9=87=8D=E6=9E=84=EF=BC=8Ctabbar=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 components/patched-calendar 本地补丁版日历组件,pages.json easycom 优先匹配 up-calendar,修复弹层嵌套下高度/滚动/底部按钮问题 - 时间筛选改为自绘钉底确定按钮 + pendingRange 临时选择,支持 31 天范围限制 与过去一年动态 monthNum;场所列表改走 /scene/list 接口 - 筛选项选中态高亮、抽屉样式优化,增加空列表提示文案 - pages.json 为三个 tab 配置图标(static/tabbar),mine 页裁剪未开放入口 - manifest 应用名改为 SEC_Warehouse --- components/patched-calendar/header.vue | 109 ++++ components/patched-calendar/month.vue | 632 +++++++++++++++++++++ components/patched-calendar/props.js | 169 ++++++ components/patched-calendar/u-calendar.vue | 421 ++++++++++++++ components/patched-calendar/util.js | 86 +++ manifest.json | 2 +- pages.json | 13 +- pages/event/index.vue | 533 ++++++++++++++++- pages/mine/index.vue | 3 - static/tabbar/event-active.png | Bin 0 -> 361 bytes static/tabbar/event.png | Bin 0 -> 351 bytes static/tabbar/home-active.png | Bin 0 -> 559 bytes static/tabbar/home.png | Bin 0 -> 590 bytes static/tabbar/mine-active.png | Bin 0 -> 1071 bytes static/tabbar/mine.png | Bin 0 -> 1295 bytes 15 files changed, 1951 insertions(+), 17 deletions(-) create mode 100644 components/patched-calendar/header.vue create mode 100644 components/patched-calendar/month.vue create mode 100644 components/patched-calendar/props.js create mode 100644 components/patched-calendar/u-calendar.vue create mode 100644 components/patched-calendar/util.js create mode 100644 static/tabbar/event-active.png create mode 100644 static/tabbar/event.png create mode 100644 static/tabbar/home-active.png create mode 100644 static/tabbar/home.png create mode 100644 static/tabbar/mine-active.png create mode 100644 static/tabbar/mine.png diff --git a/components/patched-calendar/header.vue b/components/patched-calendar/header.vue new file mode 100644 index 0000000..afb9f76 --- /dev/null +++ b/components/patched-calendar/header.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/components/patched-calendar/month.vue b/components/patched-calendar/month.vue new file mode 100644 index 0000000..aafaaba --- /dev/null +++ b/components/patched-calendar/month.vue @@ -0,0 +1,632 @@ + + + + + diff --git a/components/patched-calendar/props.js b/components/patched-calendar/props.js new file mode 100644 index 0000000..87f019b --- /dev/null +++ b/components/patched-calendar/props.js @@ -0,0 +1,169 @@ +import { defineMixin } from 'uview-plus/libs/vue' +import defProps from 'uview-plus/libs/config/props.js' + +export const props = defineMixin({ + props: { + // 日历顶部标题 + title: { + type: String, + default: () => defProps.calendar.title + }, + // 是否显示标题 + showTitle: { + type: Boolean, + default: () => defProps.calendar.showTitle + }, + // 是否显示副标题 + showSubtitle: { + type: Boolean, + default: () => defProps.calendar.showSubtitle + }, + // 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围 + mode: { + type: String, + default: () => defProps.calendar.mode + }, + // mode=range时,第一个日期底部的提示文字 + startText: { + type: String, + default: () => defProps.calendar.startText + }, + // mode=range时,最后一个日期底部的提示文字 + endText: { + type: String, + default: () => defProps.calendar.endText + }, + // 自定义列表 + customList: { + type: Array, + default: () => defProps.calendar.customList + }, + // 主题色,对底部按钮和选中日期有效 + color: { + type: String, + default: () => defProps.calendar.color + }, + // 最小的可选日期 + minDate: { + type: [String, Number], + default: () => defProps.calendar.minDate + }, + // 最大可选日期 + maxDate: { + type: [String, Number], + default: () => defProps.calendar.maxDate + }, + // 默认选中的日期,mode为multiple或range是必须为数组格式 + defaultDate: { + type: [Array, String, Date, null], + default: () => defProps.calendar.defaultDate + }, + // mode=multiple时,最多可选多少个日期 + maxCount: { + type: [String, Number], + default: () => defProps.calendar.maxCount + }, + // 日期行高 + rowHeight: { + type: [String, Number], + default: () => defProps.calendar.rowHeight + }, + // 日期格式化函数 + formatter: { + type: [Function, null], + default: () => defProps.calendar.formatter + }, + // 是否显示农历 + showLunar: { + type: Boolean, + default: () => defProps.calendar.showLunar + }, + // 是否显示月份背景色 + showMark: { + type: Boolean, + default: () => defProps.calendar.showMark + }, + // 确定按钮的文字 + confirmText: { + type: String, + default: () => defProps.calendar.confirmText + }, + // 确认按钮处于禁用状态时的文字 + confirmDisabledText: { + type: String, + default: () => defProps.calendar.confirmDisabledText + }, + // 是否显示日历弹窗 + show: { + type: Boolean, + default: () => defProps.calendar.show + }, + // 是否允许点击遮罩关闭日历 + closeOnClickOverlay: { + type: Boolean, + default: () => defProps.calendar.closeOnClickOverlay + }, + // 是否为只读状态,只读状态下禁止选择日期 + readonly: { + type: Boolean, + default: () => defProps.calendar.readonly + }, + // 是否展示确认按钮 + showConfirm: { + type: Boolean, + default: () => defProps.calendar.showConfirm + }, + // 日期区间最多可选天数,默认无限制,mode = range时有效 + maxRange: { + type: [Number, String], + default: () => defProps.calendar.maxRange + }, + // 范围选择超过最多可选天数时的提示文案,mode = range时有效 + rangePrompt: { + type: String, + default: () => defProps.calendar.rangePrompt + }, + // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效 + showRangePrompt: { + type: Boolean, + default: () => defProps.calendar.showRangePrompt + }, + // 是否允许日期范围的起止时间为同一天,mode = range时有效 + allowSameDay: { + type: Boolean, + default: () => defProps.calendar.allowSameDay + }, + // 圆角值 + round: { + type: [Boolean, String, Number], + default: () => defProps.calendar.round + }, + // 最多展示月份数量 + monthNum: { + type: [Number, String], + default: 3 + }, + // 星期文案 + weekText: { + type: Array, + default: defProps.calendar.weekText + }, + forbidDays: { + type: Array, + default: defProps.calendar.forbidDays + }, + forbidDaysToast:{ + type: String, + default: defProps.calendar.forbidDaysToast + }, + monthFormat:{ + type: String, + default: defProps.calendar.monthFormat + }, + // 是否页面内展示 + pageInline:{ + type: Boolean, + default: defProps.calendar.pageInline + } + } +}) diff --git a/components/patched-calendar/u-calendar.vue b/components/patched-calendar/u-calendar.vue new file mode 100644 index 0000000..5a88a9c --- /dev/null +++ b/components/patched-calendar/u-calendar.vue @@ -0,0 +1,421 @@ + + + + + diff --git a/components/patched-calendar/util.js b/components/patched-calendar/util.js new file mode 100644 index 0000000..6303319 --- /dev/null +++ b/components/patched-calendar/util.js @@ -0,0 +1,86 @@ +import dayjs from 'uview-plus/components/u-datetime-picker/dayjs.esm.min.js'; +export default { + methods: { + // 设置月份数据 + setMonth() { + // 月初是周几 + const day = dayjs(this.date).date(1).day() + const start = day == 0 ? 6 : day - 1 + + // 本月天数 + const days = dayjs(this.date).endOf('month').format('D') + + // 上个月天数 + const prevDays = dayjs(this.date).endOf('month').subtract(1, 'month').format('D') + + // 日期数据 + const arr = [] + // 清空表格 + this.month = [] + + // 添加上月数据 + arr.push( + ...new Array(start).fill(1).map((e, i) => { + const day = prevDays - start + i + 1 + + return { + value: day, + disabled: true, + date: dayjs(this.date).subtract(1, 'month').date(day).format('YYYY-MM-DD') + } + }) + ) + + // 添加本月数据 + arr.push( + ...new Array(days - 0).fill(1).map((e, i) => { + const day = i + 1 + + return { + value: day, + date: dayjs(this.date).date(day).format('YYYY-MM-DD') + } + }) + ) + + // 添加下个月 + arr.push( + ...new Array(42 - days - start).fill(1).map((e, i) => { + const day = i + 1 + + return { + value: day, + disabled: true, + date: dayjs(this.date).add(1, 'month').date(day).format('YYYY-MM-DD') + } + }) + ) + + // 分割数组 + for (let n = 0; n < arr.length; n += 7) { + this.month.push( + arr.slice(n, n + 7).map((e, i) => { + e.index = i + n + + // 自定义信息 + const custom = this.customList.find((c) => c.date == e.date) + + // 农历 + if (this.lunar) { + const { + IDayCn, + IMonthCn + } = this.getLunar(e.date) + e.lunar = IDayCn == '初一' ? IMonthCn : IDayCn + } + + return { + ...e, + ...custom + } + }) + ) + } + } + } +} diff --git a/manifest.json b/manifest.json index 7cbd19c..a9d70ab 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "smarthome", + "name" : "SEC_Warehouse", "appid" : "", "description" : "", "versionName" : "1.0.0", diff --git a/pages.json b/pages.json index 445e240..a1c2ab3 100644 --- a/pages.json +++ b/pages.json @@ -57,15 +57,21 @@ "list": [ { "pagePath": "pages/index/index", - "text": "首页" + "text": "首页", + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home-active.png" }, { "pagePath": "pages/event/index", - "text": "事件" + "text": "事件", + "iconPath": "static/tabbar/event.png", + "selectedIconPath": "static/tabbar/event-active.png" }, { "pagePath": "pages/mine/index", - "text": "我的" + "text": "我的", + "iconPath": "static/tabbar/mine.png", + "selectedIconPath": "static/tabbar/mine-active.png" } ] }, @@ -73,6 +79,7 @@ "easycom": { "autoscan": true, "custom": { + "^up-calendar$": "@/components/patched-calendar/u-calendar.vue", "^u-(.*)": "uview-plus/components/u-$1/u-$1.vue", "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue" } diff --git a/pages/event/index.vue b/pages/event/index.vue index 0458dd1..b2df4bd 100644 --- a/pages/event/index.vue +++ b/pages/event/index.vue @@ -4,41 +4,554 @@ - - - + + + {{ sceneLabel }} + + + + + + {{ statusLabel }} + + + + + + {{ filters.timeText || '时间' }} + + + + + 调整筛选条件后的事件列表将在此展示 + + + + + + + 选择场所 + + + + + + + {{ opt.name }} + + + + + + + + + + + 选择状态 + + + + + + + {{ opt.name }} + + + + + + + + + + + + 选择时间范围 + + + + + + + + + + + + - diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 805e80d..2625ae9 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -14,11 +14,8 @@ - - - diff --git a/static/tabbar/event-active.png b/static/tabbar/event-active.png new file mode 100644 index 0000000000000000000000000000000000000000..7fff556b4c25cd974d089c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