From 998c36cd9c41f6fb1806cc87097187198702b9a1 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Tue, 10 Jun 2025 12:20:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(calendar):=20=E6=B7=BB=E5=8A=A0=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=97=A5=E6=9C=9F=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=9C=B0=E5=9D=80=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在日历组件中添加disabledDay属性支持禁用特定日期 - 新增calculateDistanceAddressList方法计算并排序地址距离 - 优化companionPetInfo页面地址列表的显示样式 - 在petList页面集成禁用日期功能并获取技师不接单日期 --- mixins/position.js | 23 +++++++++++++- pages/companionPetList/companionPetInfo.vue | 5 +-- pages/companionPetList/companionPetList.vue | 3 ++ pages/newOrder/petList.vue | 37 ++++++++++++++++++++-- .../components/uni-calendar/uni-calendar-item.vue | 6 ++++ .../components/uni-calendar/uni-calendar.vue | 10 +++++- .../uni-calendar/components/uni-calendar/util.js | 16 ++++++++-- 7 files changed, 91 insertions(+), 9 deletions(-) diff --git a/mixins/position.js b/mixins/position.js index c8a1a41..964cfb1 100644 --- a/mixins/position.js +++ b/mixins/position.js @@ -37,6 +37,27 @@ export default { }) return minDistance - } + }, + calculateDistanceAddressList(teacherAddress){ + if (!teacherAddress || + teacherAddress.length == 0 || + !this.position || + !this.position.latitude || + !this.position.longitude) { + return 0 + } + + + teacherAddress.forEach((item, index) => { + item.distance = calculateDistance( + this.position.latitude, + this.position.longitude, + item.latitude, + item.longitude, + ) + }) + + return teacherAddress.sort((a, b) => a.distance - b.distance) + }, } } \ No newline at end of file diff --git a/pages/companionPetList/companionPetInfo.vue b/pages/companionPetList/companionPetInfo.vue index 1948206..8c58e55 100644 --- a/pages/companionPetList/companionPetInfo.vue +++ b/pages/companionPetList/companionPetInfo.vue @@ -222,14 +222,15 @@ style="margin: 10rpx 0;" :key="index" v-for="(address, index) in addressList"> - + 可接单地址{{ index + 1 }}: {{ address.area }} {{ address.address }} {{ address.rangeNo ? address.rangeNo + '公里内' : '' }} + style="display: flex; justify-content: center; + width: 100%;"> diff --git a/pages/companionPetList/companionPetList.vue b/pages/companionPetList/companionPetList.vue index 4dce9e5..5693a80 100644 --- a/pages/companionPetList/companionPetList.vue +++ b/pages/companionPetList/companionPetList.vue @@ -458,6 +458,9 @@ this.position.address = this.locationAddress this.position.longitude = this.locationLongitude this.position.latitude = this.locationLatitude + + + this.getCompanionList() }, fail: (err) => { diff --git a/pages/newOrder/petList.vue b/pages/newOrder/petList.vue index 4f82afe..7b8a364 100644 --- a/pages/newOrder/petList.vue +++ b/pages/newOrder/petList.vue @@ -107,7 +107,9 @@ - 确定 @@ -120,7 +122,12 @@