@shopbite-de/storefront 1.31.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yaml +54 -0
- package/.nuxtrc +1 -1
- package/CLAUDE.md +23 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +100 -61
- package/app/components/AddToWishlist.vue +15 -25
- package/app/components/Address/Card.vue +6 -11
- package/app/components/Address/Detail.vue +23 -23
- package/app/components/Address/Fields.vue +175 -73
- package/app/components/Address/Form.vue +107 -106
- package/app/components/Cart/Bar.vue +6 -9
- package/app/components/Cart/Item.vue +48 -63
- package/app/components/Cart/QuickView.vue +38 -25
- package/app/components/Cart/Upsell.vue +24 -62
- package/app/components/Category/Breadcrumb.vue +29 -3
- package/app/components/Category/FilterGroup.vue +20 -41
- package/app/components/Category/Listing.vue +100 -130
- package/app/components/Category/SearchInput.vue +22 -19
- package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
- package/app/components/Checkout/LoginOrRegister.vue +28 -29
- package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
- package/app/components/Checkout/Summary.vue +90 -60
- package/app/components/Checkout/VoucherInput.vue +40 -27
- package/app/components/Contact/Form.vue +164 -192
- package/app/components/DemoBanner.vue +5 -5
- package/app/components/Footer/StoreStatus.vue +2 -2
- package/app/components/Footer.vue +125 -57
- package/app/components/Header.vue +283 -18
- package/app/components/Home/Categories.vue +116 -0
- package/app/components/Home/Facts.vue +71 -0
- package/app/components/Home/Faq.vue +34 -16
- package/app/components/Home/Hero.vue +172 -0
- package/app/components/Home/Highlights.vue +29 -37
- package/app/components/Home/Restaurant.vue +102 -0
- package/app/components/Menu/BonCard.vue +180 -0
- package/app/components/Menu/CartPanel.vue +24 -0
- package/app/components/Menu/CategoryIndex.vue +54 -0
- package/app/components/Menu/OrderMode.vue +20 -0
- package/app/components/Menu/SectionHeader.vue +38 -0
- package/app/components/Navigation/MobileTop.vue +23 -15
- package/app/components/Order/Confirmation.vue +119 -0
- package/app/components/Order/Detail.vue +80 -88
- package/app/components/Product/CardSkeleton.vue +8 -12
- package/app/components/Product/Configurator.vue +8 -16
- package/app/components/Product/CrossSelling.vue +75 -83
- package/app/components/Product/DeselectIngredient.vue +17 -22
- package/app/components/Product/Detail.vue +35 -27
- package/app/components/Product/QuickView.vue +80 -51
- package/app/components/SalesChannelSwitch.vue +14 -28
- package/app/components/Sb/Button.vue +70 -0
- package/app/components/Sb/Checkbox.vue +73 -0
- package/app/components/Sb/Chip.vue +51 -0
- package/app/components/Sb/ChoiceGroup.vue +82 -0
- package/app/components/Sb/ConfirmDialog.vue +60 -0
- package/app/components/Sb/Field.vue +77 -0
- package/app/components/Sb/Icon.vue +66 -0
- package/app/components/Sb/IconButton.vue +55 -0
- package/app/components/Sb/Input.vue +23 -0
- package/app/components/Sb/SegmentedControl.vue +34 -0
- package/app/components/Sb/Select.vue +49 -0
- package/app/components/Sb/Sheet.vue +83 -0
- package/app/components/Sb/Stars.vue +60 -0
- package/app/components/Sb/StatusPill.vue +38 -0
- package/app/components/Sb/Stepper.vue +72 -0
- package/app/components/User/AccountHeader.vue +16 -0
- package/app/components/User/AuthPanel.vue +41 -0
- package/app/components/User/Detail.vue +32 -29
- package/app/components/User/LoginForm.vue +92 -98
- package/app/components/User/RegistrationForm.vue +285 -249
- package/app/components/Wishlist.vue +55 -155
- package/app/composables/useCartMutations.ts +9 -27
- package/app/composables/useCheckoutMethodGuard.ts +2 -24
- package/app/composables/useContactForm.ts +66 -0
- package/app/composables/useHomeMenuCategories.ts +41 -0
- package/app/composables/useNavigation.ts +10 -2
- package/app/composables/useOrderMode.ts +65 -0
- package/app/composables/useRegistrationForm.ts +161 -0
- package/app/composables/useRestaurantSchema.ts +1 -1
- package/app/composables/useShareLink.ts +3 -13
- package/app/composables/useSortingSelection.ts +13 -0
- package/app/composables/useThemePreset.ts +15 -0
- package/app/composables/useVoucherCode.ts +7 -16
- package/app/composables/useWishlistActions.ts +0 -51
- package/app/error.vue +31 -9
- package/app/layouts/account.vue +45 -50
- package/app/layouts/default.vue +2 -3
- package/app/layouts/listing.vue +3 -5
- package/app/pages/[...all].vue +8 -4
- package/app/pages/account/recover/password/index.vue +113 -80
- package/app/pages/anmelden.vue +11 -10
- package/app/pages/bestellung/[id]/erfolg.vue +1 -15
- package/app/pages/bestellung/[id]/fehler.vue +63 -51
- package/app/pages/bestellung/[id]/index.vue +3 -85
- package/app/pages/bestellung/kasse.vue +29 -0
- package/app/pages/bestellung.vue +8 -60
- package/app/pages/index.vue +12 -52
- package/app/pages/kontakt.vue +27 -7
- package/app/pages/konto/adressen.vue +106 -102
- package/app/pages/konto/bestellung/[id].vue +9 -43
- package/app/pages/konto/bestellungen.vue +55 -33
- package/app/pages/konto/index.vue +47 -62
- package/app/pages/konto/profil.vue +162 -100
- package/app/pages/maintenance.vue +8 -6
- package/app/pages/merkliste.vue +7 -8
- package/app/pages/passwort-vergessen.vue +92 -75
- package/app/pages/registrierung/bestaetigen.vue +20 -48
- package/app/pages/registrierung/index.vue +16 -7
- package/app/pages/suche.vue +94 -95
- package/app/plugins/theme-preset.ts +9 -0
- package/app/utils/highlight.ts +25 -0
- package/app/utils/product.ts +9 -0
- package/app/validation/registrationSchema.ts +1 -1
- package/docs/notes/2026-10-07-issue-434-property-group-projection.md +27 -0
- package/docs/notes/2026-10-07-listing-payload.md +38 -0
- package/docs/notes/2026-10-07-nuxt-4.6-inline-error-rendering.md +31 -0
- package/modules/theme.ts +115 -0
- package/nuxt.config.ts +27 -15
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +10 -11
- package/server/api/product/[productId].get.ts +4 -2
- package/server/api/product/variant.get.ts +1 -2
- package/server/api/search.get.ts +7 -12
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -0
- package/test/nuxt/AccountPagesPreset.test.ts +191 -0
- package/test/nuxt/AuthPagesPreset.test.ts +87 -0
- package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
- package/test/nuxt/CartItem.test.ts +18 -3
- package/test/nuxt/CartUpsell.test.ts +1 -2
- package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
- package/test/nuxt/CheckoutOnePage.test.ts +115 -0
- package/test/nuxt/CheckoutSummary.test.ts +6 -6
- package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
- package/test/nuxt/ContactFormPreset.test.ts +115 -0
- package/test/nuxt/FooterStoreStatus.test.ts +2 -2
- package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
- package/test/nuxt/HomeFaq.test.ts +3 -2
- package/test/nuxt/MenuBonCard.test.ts +122 -0
- package/test/nuxt/OrderPagesPreset.test.ts +132 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
- package/test/nuxt/ProductCrossSelling.test.ts +2 -1
- package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
- package/test/nuxt/ProductSheetPreset.test.ts +105 -0
- package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
- package/test/nuxt/RegistrationForm.test.ts +89 -270
- package/test/nuxt/SbBaseComponents.test.ts +170 -0
- package/test/nuxt/SbStars.test.ts +25 -0
- package/test/nuxt/useCartMutations.test.ts +3 -17
- package/test/nuxt/useCartUpsell.test.ts +1 -1
- package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
- package/test/nuxt/useShareLink.test.ts +1 -9
- package/test/nuxt/useWishlistActions.test.ts +3 -26
- package/test/unit/highlight.spec.ts +31 -0
- package/test/unit/product.spec.ts +12 -0
- package/test/unit/themePresets.spec.ts +61 -0
- package/app/app.config.ts +0 -19
- package/app/components/AnimatedSection.vue +0 -74
- package/app/components/BottomNavi.vue +0 -70
- package/app/components/Category/Header.vue +0 -48
- package/app/components/Checkout/PaymentMethod.vue +0 -30
- package/app/components/Checkout/ShippingMethod.vue +0 -30
- package/app/components/Cta.vue +0 -30
- package/app/components/Feature/Card.vue +0 -121
- package/app/components/Features.vue +0 -42
- package/app/components/Footer/Contact.vue +0 -82
- package/app/components/Header/Body.vue +0 -82
- package/app/components/Header/Right.vue +0 -187
- package/app/components/Header/Title.vue +0 -10
- package/app/components/Hero.vue +0 -233
- package/app/components/Home/MenuCategories.vue +0 -148
- package/app/components/ImageGallery.vue +0 -63
- package/app/components/Loading.vue +0 -29
- package/app/components/Navigation/DesktopLeft.vue +0 -39
- package/app/components/Product/Card.vue +0 -177
- package/app/components/Product/CardCompact.vue +0 -72
- package/app/components/Product/CardDietBadges.vue +0 -43
- package/app/components/Product/CardIngredients.vue +0 -35
- package/app/components/Product/CardKitchen.vue +0 -34
- package/app/components/Product/Category.vue +0 -160
- package/app/components/Product/SearchBar.vue +0 -95
- package/app/components/PublicAnnouncement.vue +0 -17
- package/app/pages/bestellung/bestaetigen.vue +0 -16
- package/app/pages/bestellung/warenkorb.vue +0 -49
- package/app/pages/bestellung/zahlung-versand.vue +0 -25
- package/test/nuxt/AddressFields.test.ts +0 -222
- package/test/nuxt/AnimatedSection.test.ts +0 -67
- package/test/nuxt/ContactForm.test.ts +0 -207
- package/test/nuxt/FooterContact.test.ts +0 -102
- package/test/nuxt/HeaderRight.test.ts +0 -142
- package/test/nuxt/Hero.test.ts +0 -126
- package/test/nuxt/HomeMenuCategories.test.ts +0 -94
- package/test/nuxt/LoginForm.test.ts +0 -159
package/app/pages/index.vue
CHANGED
|
@@ -31,65 +31,31 @@ usePageSeo({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
useRestaurantSchema();
|
|
34
|
+
|
|
35
|
+
// Shops with a style preset get the home page of #444.
|
|
34
36
|
</script>
|
|
35
37
|
<template>
|
|
36
|
-
<div v-if="page"
|
|
37
|
-
<
|
|
38
|
+
<div v-if="page">
|
|
39
|
+
<HomeHero
|
|
38
40
|
:title="page.hero.title || page.title"
|
|
39
|
-
:background-video="page.hero.backgroundVideo"
|
|
40
|
-
:poster="page.hero.poster"
|
|
41
41
|
:description="page.description"
|
|
42
42
|
:headline="page.hero.headline"
|
|
43
|
+
:poster="page.hero.poster"
|
|
43
44
|
:links="page.hero.links"
|
|
44
45
|
:usps="page.hero.usps"
|
|
45
46
|
/>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
:title="page.menu?.title"
|
|
49
|
-
:description="page.menu?.description"
|
|
50
|
-
:headline="page.menu?.headline"
|
|
51
|
-
/>
|
|
52
|
-
|
|
53
|
-
<HomeHighlights
|
|
54
|
-
:title="page.highlights?.title"
|
|
55
|
-
:description="page.highlights?.description"
|
|
56
|
-
:headline="page.highlights?.headline"
|
|
57
|
-
/>
|
|
58
|
-
|
|
59
|
-
<USeparator :ui="{ border: 'border-primary/30' }" />
|
|
60
|
-
|
|
61
|
-
<Features
|
|
62
|
-
:title="page.features.title"
|
|
63
|
-
:description="page.features.description"
|
|
64
|
-
:headline="page.features.headline"
|
|
47
|
+
<HomeFacts
|
|
48
|
+
v-if="page.features?.features?.length"
|
|
65
49
|
:features="page.features.features"
|
|
66
50
|
/>
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
:headline="page.mittagstisch.headline"
|
|
72
|
-
:title="page.mittagstisch.title"
|
|
73
|
-
:description="page.mittagstisch.description"
|
|
74
|
-
:orientation="page.mittagstisch.orientation"
|
|
75
|
-
:features="page.mittagstisch.features"
|
|
76
|
-
:links="page.mittagstisch.links"
|
|
77
|
-
>
|
|
78
|
-
<img
|
|
79
|
-
:src="page.mittagstisch.image"
|
|
80
|
-
width="352"
|
|
81
|
-
height="647"
|
|
82
|
-
:alt="page.mittagstisch.imageAlt"
|
|
83
|
-
class="w-full rounded-lg"
|
|
84
|
-
/>
|
|
85
|
-
</UPageSection>
|
|
86
|
-
|
|
87
|
-
<ImageGallery
|
|
88
|
-
v-if="page.gallery?.images?.length"
|
|
51
|
+
<HomeCategories :title="page.menu?.title" />
|
|
52
|
+
<HomeHighlights :title="page.highlights?.title" />
|
|
53
|
+
<HomeRestaurant
|
|
54
|
+
v-if="page.gallery"
|
|
89
55
|
:title="page.gallery.title"
|
|
90
56
|
:description="page.gallery.description"
|
|
91
57
|
:headline="page.gallery.headline"
|
|
92
|
-
:
|
|
58
|
+
:image="page.gallery.images?.[0]?.image"
|
|
93
59
|
:links="page.gallery.links"
|
|
94
60
|
/>
|
|
95
61
|
<HomeFaq
|
|
@@ -99,11 +65,5 @@ useRestaurantSchema();
|
|
|
99
65
|
:headline="page.faq.headline"
|
|
100
66
|
:items="page.faq.items"
|
|
101
67
|
/>
|
|
102
|
-
<Cta
|
|
103
|
-
:title="page.cta.title"
|
|
104
|
-
:description="page.cta.description"
|
|
105
|
-
:background-image="page.cta.backgroundImage"
|
|
106
|
-
:links="page.cta.links"
|
|
107
|
-
/>
|
|
108
68
|
</div>
|
|
109
69
|
</template>
|
package/app/pages/kontakt.vue
CHANGED
|
@@ -9,15 +9,35 @@ if (config.public.shopBite.feature.contactForm !== true) {
|
|
|
9
9
|
useSeoMeta({
|
|
10
10
|
title: "Kontakt",
|
|
11
11
|
});
|
|
12
|
+
|
|
13
|
+
const { site } = config.public;
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
16
|
<template>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
description="Bitte beachten Sie, dass wir Tischreservierung oder Tischstornierung nur telefonisch entgegennehmen können."
|
|
18
|
-
icon="i-lucide-mail"
|
|
19
|
-
orientation="horizontal"
|
|
17
|
+
<div
|
|
18
|
+
class="mx-auto grid w-full max-w-(--sb-container) gap-8 px-4 pt-8 pb-16 font-body text-sb-ink sm:px-6 sm:pt-12 lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] lg:gap-16 lg:px-8"
|
|
20
19
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
20
|
+
<header class="flex flex-col gap-4">
|
|
21
|
+
<h1 class="font-display text-4xl leading-tight sm:text-5xl">Kontakt</h1>
|
|
22
|
+
<p class="text-lg">
|
|
23
|
+
Sie haben eine Frage oder Anregung? Wir freuen uns auf Ihre Nachricht.
|
|
24
|
+
</p>
|
|
25
|
+
<p class="text-sb-ink-muted">
|
|
26
|
+
Tische reservieren oder stornieren Sie bitte telefonisch.
|
|
27
|
+
</p>
|
|
28
|
+
<SbButton
|
|
29
|
+
v-if="site.telephone"
|
|
30
|
+
variant="secondary"
|
|
31
|
+
:to="toTelHref(site.telephone)"
|
|
32
|
+
class="self-start"
|
|
33
|
+
>
|
|
34
|
+
<SbIcon name="phone" />
|
|
35
|
+
<span class="sr-only">Anrufen:</span>
|
|
36
|
+
{{ site.telephone }}
|
|
37
|
+
</SbButton>
|
|
38
|
+
</header>
|
|
39
|
+
<div class="rounded-sb-card border border-sb-line bg-sb-surface p-6">
|
|
40
|
+
<ContactForm />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
23
43
|
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useAddress, useUser } from "@shopware/composables";
|
|
3
|
+
import type { Schemas } from "#shopware";
|
|
3
4
|
|
|
4
5
|
definePageMeta({
|
|
5
6
|
layout: "account",
|
|
@@ -9,7 +10,6 @@ useSeoMeta({
|
|
|
9
10
|
title: "Adressen",
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
const toast = useToast();
|
|
13
13
|
const { userDefaultShippingAddress, userDefaultBillingAddress, refreshUser } =
|
|
14
14
|
useUser();
|
|
15
15
|
const {
|
|
@@ -24,8 +24,6 @@ onMounted(() => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const reloadCustomerData = async () => {
|
|
27
|
-
openEditModal.value = false;
|
|
28
|
-
openNewModal.value = false;
|
|
29
27
|
await loadCustomerAddresses();
|
|
30
28
|
await refreshUser({
|
|
31
29
|
associations: {
|
|
@@ -37,113 +35,119 @@ const reloadCustomerData = async () => {
|
|
|
37
35
|
});
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
// One sheet for editing and adding; results are announced in the page
|
|
39
|
+
// (#445).
|
|
40
|
+
const sheetOpen = ref(false);
|
|
41
|
+
const editedAddress = ref<Schemas["CustomerAddress"] | undefined>();
|
|
42
|
+
const notice = ref("");
|
|
43
|
+
|
|
44
|
+
function openSheet(address?: Schemas["CustomerAddress"]) {
|
|
45
|
+
editedAddress.value = address;
|
|
46
|
+
sheetOpen.value = true;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
async function
|
|
50
|
-
|
|
49
|
+
async function onSaved() {
|
|
50
|
+
sheetOpen.value = false;
|
|
51
|
+
notice.value = editedAddress.value
|
|
52
|
+
? "Die Adresse ist gespeichert."
|
|
53
|
+
: "Die Adresse ist angelegt.";
|
|
51
54
|
await reloadCustomerData();
|
|
52
|
-
toast.add({
|
|
53
|
-
title: "Standard Rechnungsadresse wurde geändert!",
|
|
54
|
-
color: "success",
|
|
55
|
-
});
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
async function setDefault(kind: "shipping" | "billing", addressId: string) {
|
|
58
|
+
if (kind === "shipping") await setDefaultCustomerShippingAddress(addressId);
|
|
59
|
+
else await setDefaultCustomerBillingAddress(addressId);
|
|
60
|
+
await reloadCustomerData();
|
|
61
|
+
notice.value =
|
|
62
|
+
kind === "shipping"
|
|
63
|
+
? "Die Lieferadresse ist geändert."
|
|
64
|
+
: "Die Rechnungsadresse ist geändert.";
|
|
65
|
+
}
|
|
60
66
|
</script>
|
|
61
67
|
|
|
62
68
|
<template>
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
<div class="font-body text-sb-ink">
|
|
70
|
+
<UserAccountHeader title="Adressen" />
|
|
71
|
+
<p
|
|
72
|
+
role="status"
|
|
73
|
+
:class="
|
|
74
|
+
notice
|
|
75
|
+
? 'mb-4 rounded-sb-control bg-sb-primary-tint p-4 text-sm text-sb-primary-ink'
|
|
76
|
+
: ''
|
|
77
|
+
"
|
|
78
|
+
>
|
|
79
|
+
{{ notice }}
|
|
80
|
+
</p>
|
|
81
|
+
<SbButton class="mb-6" @click="openSheet()">
|
|
82
|
+
<SbIcon name="plus" />
|
|
83
|
+
Neue Adresse
|
|
84
|
+
</SbButton>
|
|
85
|
+
<ul class="grid gap-4 md:grid-cols-2">
|
|
86
|
+
<li
|
|
87
|
+
v-for="address in customerAddresses ?? []"
|
|
88
|
+
:key="address.id"
|
|
89
|
+
class="flex flex-col gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-5"
|
|
90
|
+
>
|
|
91
|
+
<ul
|
|
92
|
+
v-if="
|
|
93
|
+
address.id === userDefaultShippingAddress?.id ||
|
|
94
|
+
address.id === userDefaultBillingAddress?.id
|
|
95
|
+
"
|
|
96
|
+
class="flex flex-wrap gap-2"
|
|
97
|
+
aria-label="Verwendung"
|
|
90
98
|
>
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
</UTooltip>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
99
|
+
<li
|
|
100
|
+
v-if="address.id === userDefaultShippingAddress?.id"
|
|
101
|
+
class="rounded-sb-control bg-sb-primary-tint px-3 py-1 text-sm font-bold text-sb-primary-ink"
|
|
102
|
+
>
|
|
103
|
+
Lieferadresse
|
|
104
|
+
</li>
|
|
105
|
+
<li
|
|
106
|
+
v-if="address.id === userDefaultBillingAddress?.id"
|
|
107
|
+
class="rounded-sb-control bg-sb-muted px-3 py-1 text-sm font-bold"
|
|
108
|
+
>
|
|
109
|
+
Rechnungsadresse
|
|
110
|
+
</li>
|
|
111
|
+
</ul>
|
|
112
|
+
<AddressDetail :address="address" />
|
|
113
|
+
<div class="mt-auto flex flex-wrap gap-2">
|
|
114
|
+
<SbButton variant="secondary" @click="openSheet(address)">
|
|
115
|
+
Bearbeiten
|
|
116
|
+
<span class="sr-only"
|
|
117
|
+
>: {{ address.street }}, {{ address.city }}</span
|
|
118
|
+
>
|
|
119
|
+
</SbButton>
|
|
120
|
+
<SbButton
|
|
121
|
+
v-if="address.id !== userDefaultShippingAddress?.id"
|
|
122
|
+
variant="ghost"
|
|
123
|
+
@click="setDefault('shipping', address.id)"
|
|
124
|
+
>Als Lieferadresse
|
|
125
|
+
<span class="sr-only"
|
|
126
|
+
>: {{ address.street }}, {{ address.city }}</span
|
|
127
|
+
></SbButton
|
|
128
|
+
>
|
|
129
|
+
<SbButton
|
|
130
|
+
v-if="address.id !== userDefaultBillingAddress?.id"
|
|
131
|
+
variant="ghost"
|
|
132
|
+
@click="setDefault('billing', address.id)"
|
|
133
|
+
>Als Rechnungsadresse
|
|
134
|
+
<span class="sr-only"
|
|
135
|
+
>: {{ address.street }}, {{ address.city }}</span
|
|
136
|
+
></SbButton
|
|
137
|
+
>
|
|
133
138
|
</div>
|
|
134
|
-
</
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
</UContainer>
|
|
139
|
+
</li>
|
|
140
|
+
</ul>
|
|
141
|
+
<SbSheet
|
|
142
|
+
v-if="sheetOpen"
|
|
143
|
+
v-model:open="sheetOpen"
|
|
144
|
+
:title="editedAddress ? 'Adresse bearbeiten' : 'Neue Adresse'"
|
|
145
|
+
>
|
|
146
|
+
<AddressForm
|
|
147
|
+
:key="editedAddress?.id ?? 'neu'"
|
|
148
|
+
:address="editedAddress"
|
|
149
|
+
@submit-success="onSaved"
|
|
150
|
+
/>
|
|
151
|
+
</SbSheet>
|
|
152
|
+
</div>
|
|
149
153
|
</template>
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useOrderDetails } from "@shopware/composables";
|
|
3
|
-
import { formatDate } from "~/utils/formatDate";
|
|
4
|
-
import type { Schemas } from "#shopware";
|
|
5
|
-
|
|
6
|
-
import type { RouteParams } from "vue-router";
|
|
7
|
-
|
|
8
2
|
definePageMeta({
|
|
9
3
|
layout: "account",
|
|
10
4
|
});
|
|
@@ -13,45 +7,17 @@ useSeoMeta({
|
|
|
13
7
|
title: "Bestellung",
|
|
14
8
|
});
|
|
15
9
|
|
|
16
|
-
interface OrderRouteParams extends RouteParams {
|
|
17
|
-
id: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
10
|
const route = useRoute();
|
|
21
|
-
const
|
|
22
|
-
const {
|
|
23
|
-
order: orderRaw,
|
|
24
|
-
loadOrderDetails,
|
|
25
|
-
status,
|
|
26
|
-
} = useOrderDetails(id as string);
|
|
27
|
-
const order = computed(
|
|
28
|
-
() => orderRaw.value as Schemas["Order"] | undefined | null,
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const isLoadingData = ref(true);
|
|
32
|
-
|
|
33
|
-
onMounted(async () => {
|
|
34
|
-
isLoadingData.value = true;
|
|
35
|
-
|
|
36
|
-
await loadOrderDetails();
|
|
37
|
-
|
|
38
|
-
isLoadingData.value = false;
|
|
39
|
-
});
|
|
11
|
+
const orderId = route.params.id as string;
|
|
40
12
|
</script>
|
|
41
13
|
|
|
42
14
|
<template>
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
v-if="order"
|
|
52
|
-
:order="order as Schemas['Order']"
|
|
53
|
-
:status="status ?? 'laden...'"
|
|
54
|
-
/>
|
|
55
|
-
</UPageBody>
|
|
56
|
-
</UContainer>
|
|
15
|
+
<div class="flex flex-col gap-4">
|
|
16
|
+
<NuxtLink
|
|
17
|
+
to="/konto/bestellungen"
|
|
18
|
+
class="inline-flex min-h-11 items-center self-start font-body font-semibold text-sb-primary-ink underline underline-offset-4"
|
|
19
|
+
>Alle Bestellungen</NuxtLink
|
|
20
|
+
>
|
|
21
|
+
<OrderConfirmation :order-id="orderId" />
|
|
22
|
+
</div>
|
|
57
23
|
</template>
|
|
@@ -10,45 +10,67 @@ useSeoMeta({
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
const { orders, loadOrders } = useCustomerOrders();
|
|
13
|
+
const loaded = ref(false);
|
|
13
14
|
|
|
14
|
-
onMounted(() => {
|
|
15
|
-
|
|
15
|
+
onMounted(async () => {
|
|
16
|
+
try {
|
|
17
|
+
await loadOrders();
|
|
18
|
+
} finally {
|
|
19
|
+
loaded.value = true;
|
|
20
|
+
}
|
|
16
21
|
});
|
|
17
22
|
|
|
18
23
|
const { getFormattedPrice } = useCommercePrice();
|
|
19
24
|
</script>
|
|
20
25
|
|
|
21
26
|
<template>
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
<div class="font-body text-sb-ink">
|
|
28
|
+
<UserAccountHeader title="Bestellungen" />
|
|
29
|
+
<p v-if="!loaded" role="status" class="text-sb-ink-muted">
|
|
30
|
+
Bestellungen werden geladen …
|
|
31
|
+
</p>
|
|
32
|
+
<div
|
|
33
|
+
v-else-if="!orders?.length"
|
|
34
|
+
class="flex flex-col items-start gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6"
|
|
35
|
+
>
|
|
36
|
+
<p>Sie haben noch nichts bestellt.</p>
|
|
37
|
+
<SbButton to="/">Zur Startseite</SbButton>
|
|
38
|
+
</div>
|
|
39
|
+
<ul
|
|
40
|
+
v-else
|
|
41
|
+
class="flex flex-col overflow-hidden rounded-sb-card border border-sb-line bg-sb-surface"
|
|
42
|
+
>
|
|
43
|
+
<li
|
|
44
|
+
v-for="order in orders"
|
|
45
|
+
:key="order.id"
|
|
46
|
+
class="border-b border-sb-line last:border-b-0"
|
|
47
|
+
>
|
|
48
|
+
<NuxtLink
|
|
49
|
+
:to="`/konto/bestellung/${order.id}`"
|
|
50
|
+
class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1 p-4 hover:bg-sb-muted focus-visible:outline-3 focus-visible:-outline-offset-3 focus-visible:outline-sb-focus sm:p-5"
|
|
39
51
|
>
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
<span class="font-bold">
|
|
53
|
+
Bestellung <span class="tabular-nums">{{ order.orderNumber }}</span>
|
|
54
|
+
</span>
|
|
55
|
+
<span class="font-bold tabular-nums">{{
|
|
56
|
+
getFormattedPrice(order.amountTotal)
|
|
57
|
+
}}</span>
|
|
58
|
+
<span class="text-sm text-sb-ink-muted">
|
|
59
|
+
{{ formatDate(order.createdAt) }}
|
|
60
|
+
<template v-if="order.stateMachineState">
|
|
61
|
+
·
|
|
62
|
+
{{
|
|
63
|
+
order.stateMachineState.translated?.name ??
|
|
64
|
+
order.stateMachineState.name
|
|
65
|
+
}}
|
|
66
|
+
</template>
|
|
67
|
+
</span>
|
|
68
|
+
<span
|
|
69
|
+
class="flex items-center gap-1 text-sm font-semibold text-sb-primary-ink"
|
|
70
|
+
>Details <SbIcon name="chevron-right" :size="16"
|
|
71
|
+
/></span>
|
|
72
|
+
</NuxtLink>
|
|
73
|
+
</li>
|
|
74
|
+
</ul>
|
|
75
|
+
</div>
|
|
54
76
|
</template>
|
|
@@ -9,70 +9,55 @@ useSeoMeta({
|
|
|
9
9
|
|
|
10
10
|
const { user, userDefaultShippingAddress, userDefaultBillingAddress } =
|
|
11
11
|
useUser();
|
|
12
|
+
const sameAddress = computed(
|
|
13
|
+
() =>
|
|
14
|
+
userDefaultShippingAddress.value?.id ===
|
|
15
|
+
userDefaultBillingAddress.value?.id,
|
|
16
|
+
);
|
|
12
17
|
</script>
|
|
13
18
|
|
|
14
19
|
<template>
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
description="Verwalte deine Nutzerdaten und Bestellungen."
|
|
20
|
+
<div class="font-body text-sb-ink">
|
|
21
|
+
<UserAccountHeader
|
|
22
|
+
:title="user?.firstName ? `Hallo ${user.firstName}` : 'Mein Konto'"
|
|
23
|
+
description="Ihre Daten, Adressen und Bestellungen."
|
|
20
24
|
/>
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</div>
|
|
60
|
-
<div class="flex flex-col gap-2 w-full">
|
|
61
|
-
<AddressCard
|
|
62
|
-
:address="userDefaultBillingAddress"
|
|
63
|
-
title="Standard Rechnungsadresse"
|
|
64
|
-
icon="i-lucide-receipt-text"
|
|
65
|
-
:with-edit-button="false"
|
|
66
|
-
/>
|
|
67
|
-
<UButton
|
|
68
|
-
variant="outline"
|
|
69
|
-
label="Bearbeiten"
|
|
70
|
-
icon="i-lucide-pen"
|
|
71
|
-
block
|
|
72
|
-
to="/konto/adressen"
|
|
73
|
-
/>
|
|
74
|
-
</div>
|
|
75
|
-
</UPageGrid>
|
|
76
|
-
</UPageBody>
|
|
77
|
-
</UContainer>
|
|
25
|
+
<div class="grid gap-4 md:grid-cols-2">
|
|
26
|
+
<section
|
|
27
|
+
class="flex flex-col items-start gap-3 rounded-sb-card border border-sb-line bg-sb-surface p-5"
|
|
28
|
+
>
|
|
29
|
+
<h2 class="font-display text-xl">Profil</h2>
|
|
30
|
+
<p>
|
|
31
|
+
<span class="block">{{ user?.firstName }} {{ user?.lastName }}</span>
|
|
32
|
+
<span class="text-sb-ink-muted">{{ user?.email }}</span>
|
|
33
|
+
</p>
|
|
34
|
+
<SbButton variant="secondary" to="/konto/profil"
|
|
35
|
+
>Profil bearbeiten</SbButton
|
|
36
|
+
>
|
|
37
|
+
</section>
|
|
38
|
+
<section
|
|
39
|
+
class="flex flex-col items-start gap-3 rounded-sb-card border border-sb-line bg-sb-surface p-5"
|
|
40
|
+
>
|
|
41
|
+
<h2 class="font-display text-xl">Bestellungen</h2>
|
|
42
|
+
<p class="text-sb-ink-muted">Alle Bestellungen mit Status und Beleg.</p>
|
|
43
|
+
<SbButton variant="secondary" to="/konto/bestellungen"
|
|
44
|
+
>Bestellungen ansehen</SbButton
|
|
45
|
+
>
|
|
46
|
+
</section>
|
|
47
|
+
<AddressCard
|
|
48
|
+
v-if="userDefaultShippingAddress"
|
|
49
|
+
:address="userDefaultShippingAddress"
|
|
50
|
+
:title="sameAddress ? 'Liefer- und Rechnungsadresse' : 'Lieferadresse'"
|
|
51
|
+
>
|
|
52
|
+
<SbButton variant="secondary" to="/konto/adressen" class="self-start"
|
|
53
|
+
>Adressen verwalten</SbButton
|
|
54
|
+
>
|
|
55
|
+
</AddressCard>
|
|
56
|
+
<AddressCard
|
|
57
|
+
v-if="userDefaultBillingAddress && !sameAddress"
|
|
58
|
+
:address="userDefaultBillingAddress"
|
|
59
|
+
title="Rechnungsadresse"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
78
63
|
</template>
|