Show supplier/origin in offer cards
Some checks failed
Build Docker Image / build (push) Failing after 7m43s
Some checks failed
Build Docker Image / build (push) Failing after 7m43s
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
<OfferResultCard
|
||||
v-for="(offer, index) in offersWithPrice"
|
||||
:key="offer.uuid ?? index"
|
||||
:supplier-name="offer.supplierName"
|
||||
:location-name="offer.locationName"
|
||||
:product-name="offer.productName || offer.title || undefined"
|
||||
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
|
||||
@@ -86,6 +87,7 @@ interface Offer {
|
||||
title?: string | null
|
||||
productName?: string | null
|
||||
locationName?: string | null
|
||||
supplierName?: string | null
|
||||
status?: string | null
|
||||
latitude?: number | null
|
||||
longitude?: number | null
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<OfferResultCard
|
||||
v-for="(offer, index) in offersWithPrice"
|
||||
:key="offer.uuid ?? index"
|
||||
:supplier-name="offer.supplierName"
|
||||
:location-name="offer.locationName"
|
||||
:product-name="offer.title || undefined"
|
||||
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
|
||||
@@ -51,6 +52,7 @@ interface Offer {
|
||||
uuid?: string | null
|
||||
title?: string | null
|
||||
locationName?: string | null
|
||||
supplierName?: string | null
|
||||
status?: string | null
|
||||
validUntil?: string | null
|
||||
lines?: (OfferLine | null)[] | null
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
<OfferResultCard
|
||||
v-for="(offer, index) in offersWithPrice"
|
||||
:key="offer.uuid ?? index"
|
||||
:supplier-name="offer.supplierName"
|
||||
:location-name="offer.locationName || offer.locationCountry || offer.locationName"
|
||||
:product-name="offer.productName"
|
||||
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
<!-- Header: Location + Price -->
|
||||
<div class="flex items-start justify-between mb-3">
|
||||
<div>
|
||||
<Text weight="semibold">{{ locationName || 'Локация' }}</Text>
|
||||
<Text weight="semibold">{{ supplierDisplay }}</Text>
|
||||
<Text tone="muted" size="sm">
|
||||
{{ t('catalogOfferCard.labels.origin_label') }}: {{ originDisplay }}
|
||||
</Text>
|
||||
<Text v-if="productName" tone="muted" size="sm">{{ productName }}</Text>
|
||||
</div>
|
||||
<Text v-if="priceDisplay" weight="semibold" class="text-primary text-lg">
|
||||
@@ -29,6 +32,7 @@ import type { RouteStage } from './RouteStepper.vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
locationName?: string
|
||||
supplierName?: string
|
||||
productName?: string
|
||||
pricePerUnit?: number | null
|
||||
currency?: string | null
|
||||
@@ -45,6 +49,16 @@ defineEmits<{
|
||||
select: []
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const supplierDisplay = computed(() => {
|
||||
return props.supplierName || t('catalogOfferCard.labels.supplier_unknown')
|
||||
})
|
||||
|
||||
const originDisplay = computed(() => {
|
||||
return props.locationName || t('catalogOfferCard.labels.origin_unknown')
|
||||
})
|
||||
|
||||
const priceDisplay = computed(() => {
|
||||
if (!props.pricePerUnit) return null
|
||||
const currSymbol = getCurrencySymbol(props.currency)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
@click="emit('select-offer', offer)"
|
||||
>
|
||||
<OfferResultCard
|
||||
:supplier-name="offer.supplierName"
|
||||
:location-name="offer.locationName || offer.locationCountry"
|
||||
:product-name="offer.productName"
|
||||
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
|
||||
@@ -45,6 +46,7 @@ interface Offer {
|
||||
uuid: string
|
||||
productName?: string | null
|
||||
productUuid?: string | null
|
||||
supplierName?: string | null
|
||||
quantity?: number | string | null
|
||||
unit?: string | null
|
||||
pricePerUnit?: number | string | null
|
||||
|
||||
Reference in New Issue
Block a user