From 094657ad33942dc57bdf025a8dc031a645231d5c Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Mon, 19 May 2025 20:47:43 +0800
Subject: [PATCH] =?UTF-8?q?feat(companionPetList):=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=9C=B0=E5=9B=BE=E7=BB=84=E4=BB=B6=E5=B9=B6?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=9B=E9=80=89=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
添加了新的地址地图组件 `addressMap.vue`,用于显示伴宠师的可接单地址,并优化了伴宠师列表的筛选逻辑,支持根据性别、宠物类型和等级进行筛选。同时,修复了伴宠师等级选择的bug,并调整了部分样式。
---
components/FilterPopup/FilterPopup.vue | 4 +-
components/addressMap.vue | 125 ++++++++++++++++++++++++++++
mixins/position.js | 1 +
pages/companionPetList/companionPetInfo.vue | 19 ++++-
pages/companionPetList/companionPetList.vue | 21 ++++-
pages/newOrder/serviceNew.vue | 6 +-
6 files changed, 167 insertions(+), 9 deletions(-)
create mode 100644 components/addressMap.vue
diff --git a/components/FilterPopup/FilterPopup.vue b/components/FilterPopup/FilterPopup.vue
index 600339c..1c92a0e 100644
--- a/components/FilterPopup/FilterPopup.vue
+++ b/components/FilterPopup/FilterPopup.vue
@@ -42,10 +42,10 @@
伴宠师等级
-
+
初级伴宠师
-
+
高级伴宠师
diff --git a/components/addressMap.vue b/components/addressMap.vue
new file mode 100644
index 0000000..ce1456b
--- /dev/null
+++ b/components/addressMap.vue
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mixins/position.js b/mixins/position.js
index 238a316..b3519f6 100644
--- a/mixins/position.js
+++ b/mixins/position.js
@@ -11,6 +11,7 @@ export default {
...mapState(['position']),
},
methods: {
+ calculateDistance,
calculateDistanceAddress(teacherAddress) {
if (!teacherAddress ||
teacherAddress.length == 0 ||
diff --git a/pages/companionPetList/companionPetInfo.vue b/pages/companionPetList/companionPetInfo.vue
index 2f5d5eb..1948206 100644
--- a/pages/companionPetList/companionPetInfo.vue
+++ b/pages/companionPetList/companionPetInfo.vue
@@ -222,7 +222,7 @@
style="margin: 10rpx 0;"
:key="index"
v-for="(address, index) in addressList">
-
+
可接单地址{{ index + 1 }}:
{{ address.area }} {{ address.address }} {{ address.rangeNo ? address.rangeNo + '公里内' : '' }}
@@ -234,15 +234,20 @@
style="font-size: 20rpx; color: #FFB13F; display: flex; align-items: center; padding: 2rpx 8rpx; background-color: #FFF9F0; border-radius: 20rpx;"
@click="selectDate = address.appletOutDate.map(n => n.date);$refs.calendarPopup.open('bottom')">
- 不接单{{address.appletOutDate.length}}天
+ 点击查看不接单{{address.appletOutDate.length}}天
+
+
+
+
+
@@ -352,8 +357,12 @@
} from "@/api/order/order"
import uniRate from '@/uni_modules/uni-rate/components/uni-rate/uni-rate.vue';
import positionMixin from '../../mixins/position';
+ import addressMap from '@/components/addressMap.vue'
export default {
mixins: [positionMixin],
+ components : {
+ addressMap
+ },
data() {
return {
currentCompanionPetId: '',
@@ -472,6 +481,12 @@
this.getCurrentCompanionPetInfo(this.currentCompanionPetId)
},
methods: {
+ clickAddress(address){
+ if(address.appletOutDate && address.appletOutDate.length > 0){
+ this.selectDate = address.appletOutDate.map(n => n.date);
+ this.$refs.calendarPopup.open('bottom')
+ }
+ },
toBuy(){
this.buyInfo.teacher = this.companionInfo
uni.navigateTo({
diff --git a/pages/companionPetList/companionPetList.vue b/pages/companionPetList/companionPetList.vue
index d9122ad..0b90ec3 100644
--- a/pages/companionPetList/companionPetList.vue
+++ b/pages/companionPetList/companionPetList.vue
@@ -253,6 +253,10 @@
},
getInfo(id) {
if (id) {
+
+ let info = encodeURIComponent(JSON
+ .stringify(this.allInfo))
+
uni.navigateTo({
// url: '/pages/companionPetList/companionPetInfo',
url: `/pages/companionPetList/companionPetInfo?id=${id}`
@@ -287,12 +291,23 @@
// address: this.locationAddress
// }
let data = {
- address: "上海市浦东新区浦东南路150弄",
+ // address: "上海市浦东新区浦东南路150弄",
latitude: 29.56471,
longitude: 106.55073,
- petTypes: ["1", "2"],
- staffName: "君"
+ // petTypes: ["1", "2"],
+ userName: this.value,
}
+
+ if(this.filterOptions.gender){
+ data.sex = this.filterOptions.gender == '男' ? 0 : 1
+ }
+ if(this.filterOptions.petTypes.length){
+ data.petTypes = this.filterOptions.petTypes.join(',')
+ }
+ if(this.filterOptions.level){
+ data.level = this.filterOptions.level
+ }
+
console.log('data', data);
// getCompanionList(data).then(response => {
// if (response.code == 200) {
diff --git a/pages/newOrder/serviceNew.vue b/pages/newOrder/serviceNew.vue
index e4f55e7..4850ad6 100644
--- a/pages/newOrder/serviceNew.vue
+++ b/pages/newOrder/serviceNew.vue
@@ -30,8 +30,10 @@
-
-
+
+
下单方式:指定喂养员 - {{buyInfo.teacher.userName}}