| | |
| | | import { useQuery, useQueryClient } from '@tanstack/vue-query'; |
| | | import * as standardServiceServices from '@12333/services/apiV2/standardService'; |
| | | import { MaybeRef, unref } from 'vue'; |
| | | import { computed, MaybeRef, unref } from 'vue'; |
| | | |
| | | type UseStandardServiceDetailOptions = { |
| | | id: MaybeRef<string>; |
| | |
| | | }, |
| | | }); |
| | | |
| | | const minPrice = computed(() => { |
| | | if (!data.value?.specs?.length) { |
| | | return 0; |
| | | } else { |
| | | return Math.min(...data.value.specs.map((x) => x.price)); |
| | | } |
| | | }); |
| | | |
| | | return { |
| | | detail: data, |
| | | refetch, |
| | | isLoading, |
| | | isError, |
| | | minPrice, |
| | | }; |
| | | } |