Compare commits

...

2 Commits

Author SHA1 Message Date
bb33726459 feat:工单 2025-08-10 23:19:20 +08:00
79f33497c7 feat: 快速预定的日历调整 2025-08-10 23:14:24 +08:00
3 changed files with 49 additions and 29 deletions

View File

@ -112,8 +112,7 @@
outline: none;
width: 100%;
font-size: 14px;
color: #999;
border-bottom: 1px solid #ddd;
color: #333;
}
.order-button {

View File

@ -2,10 +2,50 @@
<view class="container">
<ChatMainList />
</view>
<!-- 日历组件 -->
<Calender
:visible="calendarVisible"
mode="single"
:default-value="selectedDate"
@close="handleCalendarClose"
@select="handleDateSelect"
/>
</template>
<script setup>
import { ref, onMounted, onUnmounted } from "vue";
import ChatMainList from "../chat/ChatMainList.vue";
import Calender from "@/components/Calender/index.vue";
const calendarVisible = ref(false);
const selectedDate = ref("");
//
const handleCalendarClose = () => {
calendarVisible.value = false;
};
//
const handleDateSelect = (data) => {
selectedDate.value = data.date;
calendarVisible.value = false;
console.log("选择的日期:", data.date);
uni.$emit("selectCalendarDate", selectedDate.value); //
};
uni.$on("openCalendar", () => {
calendarVisible.value = true;
});
onUnmounted(() => {
// uni.$off('openCalendar')
})
</script>
<style lang="scss" scoped>
@ -14,4 +54,4 @@ import ChatMainList from "../chat/ChatMainList.vue";
height: 100vh;
background-color: #ffffff;
}
</style>
</style>

View File

@ -22,41 +22,17 @@
<text class="calendar-text">日历</text>
</view>
</view>
<!-- 日历组件 -->
<Calender
:visible="calendarVisible"
mode="single"
:default-value="selectedDate"
@close="handleCalendarClose"
@select="handleDateSelect"
/>
</view>
</template>
<script setup>
import { ref, onMounted } from "vue";
const emit = defineEmits(["update:date"]); //
import Calender from "@/components/Calender/index.vue";
const activeIndex = ref(2); //
const dates = ref([]);
const calendarVisible = ref(false);
const selectedDate = ref("");
//
const handleCalendarClose = () => {
calendarVisible.value = false;
};
//
const handleDateSelect = (data) => {
selectedDate.value = data.date;
calendarVisible.value = false;
console.log("选择的日期:", data.date);
emit("update:date", { fullDate: selectedDate.value }); //
};
//
const initDates = () => {
const today = new Date();
@ -82,7 +58,12 @@ const selectDate = (index) => {
};
const openCalendar = () => {
calendarVisible.value = true;
uni.$emit("openCalendar");
uni.$on("selectCalendarDate", (date) => {
emit("update:date", { fullDate: date });
uni.$off("selectCalendarDate");
});
};
onMounted(() => {