From 4ddb75324a60a5a5753f98b055faf8e1020895d5 Mon Sep 17 00:00:00 2001 From: doublekou <951513186@qq.com> Date: Fri, 22 Sep 2023 14:51:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9C=81=E5=B8=82=E5=8C=BA?= =?UTF-8?q?=E5=92=8C=E8=90=A5=E4=B8=9A=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/geopoliticalCustomers/types.ts | 1 + .../geopoliticalCustomersModal copy.vue | 1318 +++++++++++++++++ .../geopoliticalCustomersModal.vue | 52 +- vite.config.ts | 4 +- 4 files changed, 1369 insertions(+), 6 deletions(-) create mode 100644 src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue diff --git a/src/api/geopoliticalCustomers/types.ts b/src/api/geopoliticalCustomers/types.ts index e6513c2..d675ebb 100644 --- a/src/api/geopoliticalCustomers/types.ts +++ b/src/api/geopoliticalCustomers/types.ts @@ -154,6 +154,7 @@ interface customStoreEntitiesItem { // customStoreId: number // storeId: number // customId: number + option?: any //门店id customStoreId?: number //预约id diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue new file mode 100644 index 0000000..a078cc3 --- /dev/null +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue @@ -0,0 +1,1318 @@ + + + + diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue index 94c21a9..7ed91bb 100644 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue @@ -322,7 +322,7 @@ ref="select" v-model:value="item.reservationTime" :allow-clear="title === '新建预约' || title === '编辑预约'" - :options="appointmentTimeOptions" + :options="item.option" :class="reservationTimeClass" :style="{ width: title === '详情' || title === '审核' ? '103%' : '100%' }" > @@ -457,7 +457,7 @@ const radiusChange = (value: SelectValue) => { const listData: any = ref([]) //预约时间下拉框列表数据 -const appointmentTimeOptions = ref([]) +const appointmentTimeOptions = ref([]) const time_array = [ '0:00~0:30', '0:30~1:00', @@ -509,6 +509,37 @@ const time_array = [ '23:30~0:00' ] +const generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => { + const startHour = Number(tradeStartTime.split(':')[0]) + const startMinute = Number(tradeStartTime.split(':')[1]) + const endHour = Number(tradeEndTime.split(':')[0]) + const endMinute = Number(tradeEndTime.split(':')[1]) + + const timeSlots = [] + for (let hour = startHour; hour < endHour; hour++) { + for (let minute = 0; minute < 60; minute += 30) { + if (hour === startHour && minute < startMinute) { + continue + } + + const startTime = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}` + const endTime = `${(hour + Math.floor(minute / 30)).toString().padStart(2, '0')}:${( + (minute + 30) % + 60 + ) + .toString() + .padStart(2, '0')}` + const timeSlot = { + label: `${startTime}~${endTime}`, + value: `${startTime}~${endTime}` + } + timeSlots.push(timeSlot) + } + } + + return timeSlots +} + //经纬度 const lng = ref() const lat = ref() @@ -550,6 +581,16 @@ const pagingQuery = () => { result.data && result.data.forEach((item: any) => { const disabled = ids.includes(Number(item.id)) + // console.log( + // generateTimeSlots(item.tradeStartTime, item.tradeEndTime), + // 'generateTimeSlots(item.tradeStartTime, item.tradeEndTime)' + // ) + // generateTimeSlots(item.tradeStartTime, item.tradeEndTime).forEach((i: string) => { + // generateTimeSlots(item.tradeStartTime, item.tradeEndTime).push({ + // value: i, + // label: i + // }) + // }) listData.value.push({ title: item.storeName, description: item.address, @@ -560,8 +601,10 @@ const pagingQuery = () => { id: item.id, index: item.index, tel: item.nid ? item.nid : '', - reservationDate: item.reservationDate + reservationDate: item.reservationDate, + option: generateTimeSlots(item.tradeStartTime, item.tradeEndTime) }) + console.log(listData.value, 'listData.value') }) pois.push(...listData.value) // 设置缩放级别,设置地图视图级别为 @@ -672,7 +715,8 @@ const addStore = (item: any) => { storeName: item.title, reservationTime: '', storeId: item.id, - reservationDate: '' + reservationDate: '', + option: item.option }) } //门店重置 diff --git a/vite.config.ts b/vite.config.ts index c42433a..52fd77b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -24,11 +24,11 @@ import { antdvStyleDeps } from './src/utils/resolvers' //xy // const serverAddress = 'http://172.18.0.225:8000' //jt -// const serverAddress = 'http://172.18.1.8:8000' +const serverAddress = 'http://172.18.1.8:8000' //ts // const serverAddress = 'http://172.18.0.228:8000' //测试 -const serverAddress = 'http://39.100.77.21:8000' +// const serverAddress = 'http://39.100.77.21:8000' //线上ip // const serverAddress = 'http://175.27.212.74:80'