|
|
@ -66,14 +66,14 @@ |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<u-picker :show="showVaccine" :showToolbar='false' :columns="vaccineActions" @cancel="showVaccine = false" |
|
|
|
:immediateChange="true" @change="vaccineSelect"></u-picker> |
|
|
|
<u-picker :show="showExpelling" :showToolbar='false' :columns="expellingActions" @cancel="showExpelling = false" |
|
|
|
:immediateChange="true" @change="expellingSelect"></u-picker> |
|
|
|
<u-picker :show="showSterilization" :showToolbar='false' :columns="sterilizationActions" |
|
|
|
@cancel="showSterilization = false" :immediateChange="true" @change="sterilizationSelect"></u-picker> |
|
|
|
<u-picker :show="showDog" :showToolbar='false' :columns="dogActions" @cancel="showDog = false" |
|
|
|
:immediateChange="true" @change="dogSelect"></u-picker> |
|
|
|
<u-picker :show="showVaccine" :columns="vaccineActions" @cancel="showVaccine = false" |
|
|
|
:immediateChange="true" @confirm="vaccineSelect"></u-picker> |
|
|
|
<u-picker :show="showExpelling" :columns="expellingActions" @cancel="showExpelling = false" |
|
|
|
:immediateChange="true" @confirm="expellingSelect"></u-picker> |
|
|
|
<u-picker :show="showSterilization" :columns="sterilizationActions" |
|
|
|
@cancel="showSterilization = false" :immediateChange="true" @confirm="sterilizationSelect"></u-picker> |
|
|
|
<u-picker :show="showDog" :columns="dogActions" @cancel="showDog = false" |
|
|
|
:immediateChange="true" @confirm="dogSelect"></u-picker> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -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 @@ |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.personal-pet-health-info { |
|
|
|
background-color: #fff; |
|
|
|
padding: 10px 20px 0 20px; |
|
|
|