From 6538dcce88ef6f14cc81ed518eaace5752c0a6d3 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Tue, 23 Aug 2022 14:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E6=97=A5=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityParty/calendar/cpts/calendar.vue | 39 ++- .../modules/communityParty/calendar/index.vue | 329 ++++++++++++++++-- 2 files changed, 323 insertions(+), 45 deletions(-) diff --git a/src/views/modules/communityParty/calendar/cpts/calendar.vue b/src/views/modules/communityParty/calendar/cpts/calendar.vue index bc0b1e4f3..89e97462e 100644 --- a/src/views/modules/communityParty/calendar/cpts/calendar.vue +++ b/src/views/modules/communityParty/calendar/cpts/calendar.vue @@ -26,7 +26,7 @@ @click="handleClickDate(item)" >
{{ item.date }}
- + @@ -75,7 +75,9 @@ export default { const dateObj = new Date(startDay + i * 24 * 3600 * 1000); const year = dateObj.getFullYear(); const month = dateObj.getMonth(); + const monthShow = ("0" + (month + 1)).substr(-2); const date = dateObj.getDate(); + const dateShow = ("0" + date).substr(-2); const day = dateObj.getDay(); calendarArr.push({ @@ -83,7 +85,17 @@ export default { year, month, day, - format: `${year}-${month + 1}-${date + 1}`, + dayFormat: [ + "星期日", + "星期一", + "星期二", + "星期三", + "星期四", + "星期五", + "星期六", + ][day], + format: `${year}-${monthShow}-${dateShow}`, + dateId: `${year}${monthShow}${dateShow}`, // 是否在当月 thisMonth: year == currentYear && month == currentMonth, // 是否是今天 @@ -95,23 +107,30 @@ export default { afterToday: dateObj.getTime() >= today.getTime(), }); } + + this.$emit("rangeChange", calendarArr); return calendarArr; }, }, watch: { - visibleCalendar(val) { - if (!this.currentDate) { - this.handleClickDate( - val.find((item) => item.isToday) || - val.filter((item) => item.thisMonth)[0] - ); - } + visibleCalendar() { + this.init(); }, }, mounted() { console.log("123", this.time); + this.init(); }, methods: { + init() { + if (!this.currentDate) { + this.handleClickDate( + this.visibleCalendar.find((item) => item.isToday) || + this.visibleCalendar.filter((item) => item.thisMonth)[0] + ); + } + }, + handleClickDate(item) { console.log("点击日历日期", item); this.currentDate = item.format; @@ -181,7 +200,7 @@ export default { padding: 8px 0; height: 90px; background-color: #ffffff; - opacity: 0.5; + opacity: 0.3; &::after { content: ""; diff --git a/src/views/modules/communityParty/calendar/index.vue b/src/views/modules/communityParty/calendar/index.vue index eb45bbd05..ecaf12d66 100644 --- a/src/views/modules/communityParty/calendar/index.vue +++ b/src/views/modules/communityParty/calendar/index.vue @@ -5,60 +5,126 @@
- 备选项 - 备选项 + 本人创建的活动 + 本组织所有活动
-
2222年2月22日
-
22
-
星期五
+
+ {{ currentDate.year }}年{{ currentDate.month + 1 }}月 +
+
{{ currentDate.date }}
+
{{ currentDate.dayFormat }}
-
-
今日活动
+
+
今日活动/日程
-
+
- 不忘初心牢记使命巴巴爸爸不不嘻嘻,分 额阿发文发文额 + {{ item.theme }}
活动类型: - 发发发发发发付付 + {{ item.type }}
- 活动类型: - 发发发发发发付付 + 开始时间: + {{ item.holdTime }}
- 活动类型: - 发发发发发发付付 + 活动地点: + {{ item.address }}
- 活动类型: - 发发发发发发付付 + 参加组织: + {{ item.joinOrgs.join("、") }} +
+
+ 发布 + 编辑 + 删除 +
+
+ +
+
+ {{ item.title }} +
+
+ 提醒时间: + {{ item.remindTime }} +
+
+ 备注说明: + {{ item.remark }}
- 发布 - 编辑 - 删除 + 编辑 + 删除
- 添加活动计划 - 添加日程 + 添加活动计划 + 添加日程
+
@@ -81,7 +147,11 @@ @click="currentMonth = m - 1" v-for="m in 12" > - +
{{ m }}月
@@ -97,15 +167,39 @@ :currentMonth="currentMonth" @clickDate="handleChangeDate" > -