From c71cf10c55058b8e404b2bc59e4c013e05982ff1 Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Tue, 8 Apr 2025 20:19:32 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=92=8C=E5=AE=A0=E7=89=A9=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8F=8A=E9=80=89=E6=8B=A9=E5=99=A8=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复了用户信息获取时未检查userId的问题,优化了宠物信息显示逻辑,确保仅在有效数据时显示。调整了宠物健康信息选择器的触发事件为@confirm,确保选择后正确更新数据。
---
.../userManage/pet/components/petHealthInfo.vue | 30 +++++++++++-----------
otherPages/userManage/pet/index.vue | 2 +-
otherPages/userManage/pet/petInfo.vue | 13 ++++++++--
pages/userManage/index.vue | 6 ++---
store/modules/user.js | 2 +-
5 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/otherPages/userManage/pet/components/petHealthInfo.vue b/otherPages/userManage/pet/components/petHealthInfo.vue
index e9af5bb..a0a4b4c 100644
--- a/otherPages/userManage/pet/components/petHealthInfo.vue
+++ b/otherPages/userManage/pet/components/petHealthInfo.vue
@@ -66,14 +66,14 @@
-->
-
-
-
-
+
+
+
+
@@ -105,7 +105,7 @@
});
// 定义 emits
- const emits = defineEmits(['update:petHealthInfo']);
+ const emits = defineEmits(['update:petHealthInfo', 'updatePetHealthInfo']);
// 定义响应式数据
const showVaccine = ref(false);
@@ -176,25 +176,25 @@
};
const vaccineSelect = (e) => {
- props.petHealthInfo.vaccine = e.index;
+ props.petHealthInfo.vaccine = e.indexs[0];
showVaccine.value = false;
updatePetHealthInfo();
};
const expellingSelect = (e) => {
- props.petHealthInfo.deworm = e.index;
+ props.petHealthInfo.deworm = e.indexs[0];
showExpelling.value = false;
updatePetHealthInfo();
};
const sterilizationSelect = (e) => {
- props.petHealthInfo.neutered = e.index;
+ props.petHealthInfo.neutered = e.indexs[0];
showSterilization.value = false;
updatePetHealthInfo();
};
const dogSelect = (e) => {
- props.petHealthInfo.petCard = e.index;
+ props.petHealthInfo.petCard = e.indexs[0];
showDog.value = false;
updatePetHealthInfo();
};
@@ -216,7 +216,7 @@
updatePetHealthInfo();
};
- const updatePetHealthInfo = () => {
+ const updatePetHealthInfo = (map) => {
// 触发 update 事件,将修改后的 petHealthInfo 对象发送给父组件
emits('update:petHealthInfo', props.petHealthInfo);
};
@@ -231,7 +231,7 @@
});
-