@shopbite-de/storefront 1.31.3 → 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/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/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 +3 -0
- 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/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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import type { FormSubmitEvent } from "@nuxt/ui";
|
|
4
3
|
|
|
5
4
|
useHead({
|
|
6
5
|
title: "Passwort zurücksetzen",
|
|
@@ -12,26 +11,11 @@ useHead({
|
|
|
12
11
|
|
|
13
12
|
// Constants
|
|
14
13
|
const MIN_PASSWORD_LENGTH = 8;
|
|
15
|
-
const PASSWORD_MIN_LENGTH_ERROR = "
|
|
16
|
-
const PASSWORD_MISMATCH_ERROR = "Passwörter stimmen nicht überein";
|
|
17
|
-
const SUCCESS_TOAST_CONFIG = {
|
|
18
|
-
title: "Erfolgreich zurückgesetzt!",
|
|
19
|
-
description: "Melden Sie sich nun mit Ihrem neuen Passwort an.",
|
|
20
|
-
icon: "i-lucide-check",
|
|
21
|
-
color: "success" as const,
|
|
22
|
-
duration: 0,
|
|
23
|
-
close: true,
|
|
24
|
-
};
|
|
25
|
-
const ERROR_TOAST_CONFIG = {
|
|
26
|
-
title: "Fehler beim Senden",
|
|
27
|
-
icon: "i-lucide-x",
|
|
28
|
-
description: "Bitte versuchen Sie es später erneut.",
|
|
29
|
-
color: "error" as const,
|
|
30
|
-
};
|
|
14
|
+
const PASSWORD_MIN_LENGTH_ERROR = "Das Passwort braucht mindestens 8 Zeichen.";
|
|
15
|
+
const PASSWORD_MISMATCH_ERROR = "Die Passwörter stimmen nicht überein.";
|
|
31
16
|
|
|
32
17
|
const { apiClient } = useShopwareContext();
|
|
33
18
|
const route = useRoute();
|
|
34
|
-
const toast = useToast();
|
|
35
19
|
|
|
36
20
|
// Schemas
|
|
37
21
|
const routeValidationSchema = z.object({
|
|
@@ -66,79 +50,128 @@ function validateRouteParameters(): string {
|
|
|
66
50
|
}
|
|
67
51
|
}
|
|
68
52
|
|
|
69
|
-
// Extract toast creation functions
|
|
70
|
-
function showSuccessToast(): void {
|
|
71
|
-
toast.add(SUCCESS_TOAST_CONFIG);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function showErrorToast(): void {
|
|
75
|
-
toast.add(ERROR_TOAST_CONFIG);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
53
|
const recoveryHash = ref<string>("");
|
|
79
54
|
recoveryHash.value = validateRouteParameters();
|
|
80
55
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
placeholder: "Neues Passwort wiederholen",
|
|
94
|
-
required: true,
|
|
95
|
-
},
|
|
96
|
-
];
|
|
56
|
+
async function resetPassword(data: PasswordResetSchema) {
|
|
57
|
+
await apiClient.invoke(
|
|
58
|
+
"recoveryPassword post /account/recovery-password-confirm",
|
|
59
|
+
{
|
|
60
|
+
body: {
|
|
61
|
+
newPassword: data.newPassword,
|
|
62
|
+
newPasswordConfirm: data.newPasswordConfirm,
|
|
63
|
+
hash: recoveryHash.value,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
}
|
|
97
68
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
69
|
+
// Errors and the result show in the form (#445).
|
|
70
|
+
const passwords = reactive({ newPassword: "", newPasswordConfirm: "" });
|
|
71
|
+
const errors = ref<Partial<Record<keyof PasswordResetSchema, string>>>({});
|
|
72
|
+
const result = ref<"done" | "failed" | null>(null);
|
|
73
|
+
const saving = ref(false);
|
|
74
|
+
const resultBox = ref<HTMLElement | null>(null);
|
|
75
|
+
|
|
76
|
+
async function onSubmit() {
|
|
77
|
+
result.value = null;
|
|
78
|
+
const parsed = passwordResetSchema.safeParse(passwords);
|
|
79
|
+
if (!parsed.success) {
|
|
80
|
+
const next: typeof errors.value = {};
|
|
81
|
+
for (const issue of parsed.error.issues) {
|
|
82
|
+
const key = issue.path[0] as keyof PasswordResetSchema;
|
|
83
|
+
next[key] ??= issue.message;
|
|
84
|
+
}
|
|
85
|
+
errors.value = next;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
errors.value = {};
|
|
89
|
+
saving.value = true;
|
|
101
90
|
try {
|
|
102
|
-
await
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
body: {
|
|
106
|
-
newPassword: payload.data.newPassword,
|
|
107
|
-
newPasswordConfirm: payload.data.newPasswordConfirm,
|
|
108
|
-
hash: recoveryHash.value,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
);
|
|
112
|
-
showSuccessToast();
|
|
113
|
-
navigateTo("/anmelden");
|
|
91
|
+
await resetPassword(parsed.data);
|
|
92
|
+
result.value = "done";
|
|
114
93
|
} catch (error) {
|
|
115
|
-
showErrorToast();
|
|
116
94
|
console.error("Password recovery error:", error);
|
|
95
|
+
result.value = "failed";
|
|
96
|
+
} finally {
|
|
97
|
+
saving.value = false;
|
|
117
98
|
}
|
|
99
|
+
await nextTick();
|
|
100
|
+
resultBox.value?.focus();
|
|
118
101
|
}
|
|
119
102
|
</script>
|
|
120
103
|
<template>
|
|
121
|
-
<
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
label: 'Senden',
|
|
129
|
-
}"
|
|
130
|
-
@submit="handlePasswordReset"
|
|
104
|
+
<UserAuthPanel title="Neues Passwort">
|
|
105
|
+
<div
|
|
106
|
+
v-if="result === 'done'"
|
|
107
|
+
ref="resultBox"
|
|
108
|
+
role="status"
|
|
109
|
+
tabindex="-1"
|
|
110
|
+
class="flex flex-col items-start gap-4"
|
|
131
111
|
>
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
112
|
+
<p>
|
|
113
|
+
<strong class="block">Ihr Passwort ist geändert.</strong>
|
|
114
|
+
Sie können sich jetzt mit dem neuen Passwort anmelden.
|
|
115
|
+
</p>
|
|
116
|
+
<SbButton to="/anmelden">Zur Anmeldung</SbButton>
|
|
117
|
+
</div>
|
|
118
|
+
<form
|
|
119
|
+
v-else
|
|
120
|
+
novalidate
|
|
121
|
+
class="flex flex-col gap-4"
|
|
122
|
+
@submit.prevent="onSubmit"
|
|
123
|
+
>
|
|
124
|
+
<div
|
|
125
|
+
v-if="result === 'failed'"
|
|
126
|
+
ref="resultBox"
|
|
127
|
+
role="alert"
|
|
128
|
+
tabindex="-1"
|
|
129
|
+
class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
|
|
130
|
+
>
|
|
131
|
+
<strong class="block"
|
|
132
|
+
>Das Passwort konnte nicht geändert werden.</strong
|
|
133
|
+
>
|
|
134
|
+
Der Link ist vielleicht abgelaufen.
|
|
135
|
+
<NuxtLink
|
|
136
|
+
to="/passwort-vergessen"
|
|
137
|
+
class="font-semibold text-sb-primary-ink underline underline-offset-4"
|
|
138
|
+
>Neuen Link anfordern</NuxtLink
|
|
139
139
|
>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
</div>
|
|
141
|
+
<SbField
|
|
142
|
+
v-slot="{ id, describedBy, invalid }"
|
|
143
|
+
label="Neues Passwort"
|
|
144
|
+
hint="Mindestens 8 Zeichen"
|
|
145
|
+
:error="errors.newPassword"
|
|
146
|
+
>
|
|
147
|
+
<SbInput
|
|
148
|
+
:id="id"
|
|
149
|
+
v-model="passwords.newPassword"
|
|
150
|
+
name="newPassword"
|
|
151
|
+
type="password"
|
|
152
|
+
autocomplete="new-password"
|
|
153
|
+
:aria-describedby="describedBy"
|
|
154
|
+
:invalid="invalid"
|
|
155
|
+
/>
|
|
156
|
+
</SbField>
|
|
157
|
+
<SbField
|
|
158
|
+
v-slot="{ id, describedBy, invalid }"
|
|
159
|
+
label="Neues Passwort wiederholen"
|
|
160
|
+
:error="errors.newPasswordConfirm"
|
|
161
|
+
>
|
|
162
|
+
<SbInput
|
|
163
|
+
:id="id"
|
|
164
|
+
v-model="passwords.newPasswordConfirm"
|
|
165
|
+
name="newPasswordConfirm"
|
|
166
|
+
type="password"
|
|
167
|
+
autocomplete="new-password"
|
|
168
|
+
:aria-describedby="describedBy"
|
|
169
|
+
:invalid="invalid"
|
|
170
|
+
/>
|
|
171
|
+
</SbField>
|
|
172
|
+
<SbButton type="submit" size="lg" block :loading="saving"
|
|
173
|
+
>Passwort speichern</SbButton
|
|
174
|
+
>
|
|
175
|
+
</form>
|
|
176
|
+
</UserAuthPanel>
|
|
144
177
|
</template>
|
package/app/pages/anmelden.vue
CHANGED
|
@@ -27,14 +27,15 @@ function handleLoginSuccess() {
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
<UserAuthPanel title="Anmelden">
|
|
31
|
+
<UserLoginForm @login-success="handleLoginSuccess" />
|
|
32
|
+
<template #footer>
|
|
33
|
+
Noch kein Kundenkonto?
|
|
34
|
+
<NuxtLink
|
|
35
|
+
to="/registrierung"
|
|
36
|
+
class="font-semibold text-sb-primary-ink underline underline-offset-4"
|
|
37
|
+
>Jetzt registrieren</NuxtLink
|
|
38
|
+
>
|
|
39
|
+
</template>
|
|
40
|
+
</UserAuthPanel>
|
|
40
41
|
</template>
|
|
@@ -12,22 +12,8 @@ const { refreshCart } = useCart();
|
|
|
12
12
|
onMounted(async () => {
|
|
13
13
|
await refreshCart();
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
const links = [
|
|
17
|
-
{
|
|
18
|
-
label: "Zur Bestellung",
|
|
19
|
-
to: `/bestellung/${orderId}`,
|
|
20
|
-
icon: "i-lucide-receipt",
|
|
21
|
-
size: "xl" as const,
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
15
|
</script>
|
|
25
16
|
|
|
26
17
|
<template>
|
|
27
|
-
<
|
|
28
|
-
icon="i-lucide-circle-check"
|
|
29
|
-
title="Bestellung erfolgreich erstellt!"
|
|
30
|
-
description="Wir bereiten deine Bestellung jetzt vor."
|
|
31
|
-
:links="links"
|
|
32
|
-
/>
|
|
18
|
+
<OrderConfirmation :order-id="orderId" kind="success" />
|
|
33
19
|
</template>
|
|
@@ -49,8 +49,11 @@ const selectablePaymentMethods = computed(() =>
|
|
|
49
49
|
|
|
50
50
|
const isRetrying = ref(false);
|
|
51
51
|
|
|
52
|
+
const retryError = ref(false);
|
|
53
|
+
|
|
52
54
|
async function retryPayment() {
|
|
53
55
|
isRetrying.value = true;
|
|
56
|
+
retryError.value = false;
|
|
54
57
|
try {
|
|
55
58
|
if (selectedPaymentMethodId.value !== currentPaymentMethodId.value) {
|
|
56
59
|
await changePaymentMethod(selectedPaymentMethodId.value);
|
|
@@ -66,6 +69,9 @@ async function retryPayment() {
|
|
|
66
69
|
} else {
|
|
67
70
|
await navigateTo(`/bestellung/${orderId}/erfolg`);
|
|
68
71
|
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error("[order][retryPayment]", error);
|
|
74
|
+
retryError.value = true;
|
|
69
75
|
} finally {
|
|
70
76
|
isRetrying.value = false;
|
|
71
77
|
}
|
|
@@ -73,56 +79,62 @@ async function retryPayment() {
|
|
|
73
79
|
</script>
|
|
74
80
|
|
|
75
81
|
<template>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<UButton
|
|
109
|
-
label="Jetzt bezahlen"
|
|
110
|
-
icon="i-lucide-refresh-cw"
|
|
111
|
-
size="xl"
|
|
112
|
-
block
|
|
113
|
-
:loading="isRetrying"
|
|
114
|
-
:disabled="!selectedPaymentMethodId"
|
|
115
|
-
@click="retryPayment"
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<div v-else class="flex justify-center py-16">
|
|
121
|
-
<UIcon
|
|
122
|
-
name="i-lucide-loader-circle"
|
|
123
|
-
class="size-10 animate-spin text-primary"
|
|
82
|
+
<div
|
|
83
|
+
class="mx-auto flex w-full max-w-2xl flex-col gap-6 font-body text-sb-ink"
|
|
84
|
+
>
|
|
85
|
+
<header class="flex flex-col gap-3">
|
|
86
|
+
<h1 class="font-display text-4xl leading-tight sm:text-5xl">
|
|
87
|
+
Zahlung fehlgeschlagen
|
|
88
|
+
</h1>
|
|
89
|
+
<p class="text-lg">
|
|
90
|
+
Ihre Bestellung ist gespeichert, aber die Zahlung hat nicht geklappt.
|
|
91
|
+
Wählen Sie eine Zahlungsart und versuchen Sie es noch einmal.
|
|
92
|
+
</p>
|
|
93
|
+
</header>
|
|
94
|
+
<p v-if="!order" role="status" class="text-sb-ink-muted">
|
|
95
|
+
Bestellung wird geladen …
|
|
96
|
+
</p>
|
|
97
|
+
<template v-else>
|
|
98
|
+
<section
|
|
99
|
+
aria-labelledby="zahlung-wiederholen"
|
|
100
|
+
class="flex flex-col gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6"
|
|
101
|
+
>
|
|
102
|
+
<h2 id="zahlung-wiederholen" class="font-display text-2xl">
|
|
103
|
+
Zahlungsart
|
|
104
|
+
</h2>
|
|
105
|
+
<SbChoiceGroup
|
|
106
|
+
v-model="selectedPaymentMethodId"
|
|
107
|
+
legend="Zahlungsart"
|
|
108
|
+
hide-legend
|
|
109
|
+
variant="cards"
|
|
110
|
+
:options="selectablePaymentMethods ?? []"
|
|
124
111
|
/>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
112
|
+
<p
|
|
113
|
+
v-if="retryError"
|
|
114
|
+
role="alert"
|
|
115
|
+
class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
|
|
116
|
+
>
|
|
117
|
+
Die Zahlung konnte nicht gestartet werden. Bitte versuchen Sie es noch
|
|
118
|
+
einmal oder rufen Sie uns an.
|
|
119
|
+
</p>
|
|
120
|
+
<SbButton
|
|
121
|
+
block
|
|
122
|
+
size="lg"
|
|
123
|
+
:loading="isRetrying"
|
|
124
|
+
:disabled="!selectedPaymentMethodId || isRetrying"
|
|
125
|
+
@click="retryPayment"
|
|
126
|
+
>Jetzt bezahlen</SbButton
|
|
127
|
+
>
|
|
128
|
+
</section>
|
|
129
|
+
<section
|
|
130
|
+
aria-labelledby="bestellung-details"
|
|
131
|
+
class="rounded-sb-card border border-sb-line bg-sb-surface p-6"
|
|
132
|
+
>
|
|
133
|
+
<h2 id="bestellung-details" class="mb-4 font-display text-2xl">
|
|
134
|
+
Bestellung <span class="tabular-nums">{{ order.orderNumber }}</span>
|
|
135
|
+
</h2>
|
|
136
|
+
<OrderDetail :order="order" :status="status ?? undefined" />
|
|
137
|
+
</section>
|
|
138
|
+
</template>
|
|
139
|
+
</div>
|
|
128
140
|
</template>
|
|
@@ -1,95 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useOrderDetails } from "@shopware/composables";
|
|
3
|
-
import { formatDate } from "~/utils/formatDate";
|
|
4
|
-
|
|
5
|
-
import type { RouteParams } from "vue-router";
|
|
6
|
-
import type { ButtonProps } from "#ui/components/Button.vue";
|
|
7
|
-
|
|
8
|
-
interface OrderRouteParams extends RouteParams {
|
|
9
|
-
id: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
2
|
useSeoMeta({
|
|
13
3
|
title: "Bestellung",
|
|
4
|
+
robots: "noindex, nofollow",
|
|
14
5
|
});
|
|
15
6
|
|
|
16
7
|
const route = useRoute();
|
|
17
|
-
const
|
|
18
|
-
const { order, loadOrderDetails, status } = useOrderDetails(id);
|
|
19
|
-
// Shop phone number for the "call us" card; hidden without one (#251).
|
|
20
|
-
const { site } = useRuntimeConfig().public;
|
|
21
|
-
|
|
22
|
-
const isLoadingData = ref(true);
|
|
23
|
-
|
|
24
|
-
onMounted(async () => {
|
|
25
|
-
isLoadingData.value = true;
|
|
26
|
-
|
|
27
|
-
await loadOrderDetails();
|
|
28
|
-
|
|
29
|
-
isLoadingData.value = false;
|
|
30
|
-
});
|
|
31
|
-
const links = ref<ButtonProps[]>([
|
|
32
|
-
{
|
|
33
|
-
label: "Zurück zur Startseite",
|
|
34
|
-
to: "/",
|
|
35
|
-
color: "error",
|
|
36
|
-
variant: "subtle",
|
|
37
|
-
},
|
|
38
|
-
]);
|
|
8
|
+
const orderId = route.params.id as string;
|
|
39
9
|
</script>
|
|
40
10
|
|
|
41
11
|
<template>
|
|
42
|
-
<
|
|
43
|
-
<!-- Show loading spinner while fetching order data -->
|
|
44
|
-
<UPageHeader headline="BESTELLUNG" title="Lädt..." />
|
|
45
|
-
<UPageBody>
|
|
46
|
-
<div class="flex flex-col items-center justify-center py-16 gap-4">
|
|
47
|
-
<UIcon
|
|
48
|
-
name="i-lucide-loader-circle"
|
|
49
|
-
class="w-12 h-12 animate-spin text-primary"
|
|
50
|
-
/>
|
|
51
|
-
<p class="text-lg text-muted">Bestellung wird geladen...</p>
|
|
52
|
-
</div>
|
|
53
|
-
</UPageBody>
|
|
54
|
-
</UContainer>
|
|
55
|
-
|
|
56
|
-
<UContainer v-else-if="order">
|
|
57
|
-
<UPageHeader
|
|
58
|
-
headline="BESTELLUNG"
|
|
59
|
-
:title="order?.orderNumber"
|
|
60
|
-
:description="order.createdAt ? formatDate(order?.createdAt) : ''"
|
|
61
|
-
/>
|
|
62
|
-
<UPageBody>
|
|
63
|
-
<OrderDetail :order="order" :status="status ?? 'laden...'" />
|
|
64
|
-
<UCard v-if="site.telephone" class="mt-6">
|
|
65
|
-
<div
|
|
66
|
-
class="flex flex-col sm:flex-row items-start sm:items-center gap-4"
|
|
67
|
-
>
|
|
68
|
-
<div class="flex-1">
|
|
69
|
-
<p class="font-semibold">Stimmt etwas nicht?</p>
|
|
70
|
-
<p class="text-sm text-muted mt-0.5">
|
|
71
|
-
Ruf uns sofort an, damit wir deine Bestellung noch rechtzeitig
|
|
72
|
-
korrigieren können.
|
|
73
|
-
</p>
|
|
74
|
-
</div>
|
|
75
|
-
<UButton
|
|
76
|
-
:label="`Jetzt anrufen: ${site.telephone}`"
|
|
77
|
-
color="primary"
|
|
78
|
-
:to="toTelHref(site.telephone)"
|
|
79
|
-
icon="i-lucide-phone"
|
|
80
|
-
shrink-0
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
</UCard>
|
|
84
|
-
</UPageBody>
|
|
85
|
-
</UContainer>
|
|
86
|
-
|
|
87
|
-
<UContainer v-else>
|
|
88
|
-
<UPageSection
|
|
89
|
-
headline="FEHLER"
|
|
90
|
-
title="Irgendwas ist schief gelaufen"
|
|
91
|
-
description="Sie können Speisen und Getränke abholen, liefern lassen, oder vor Ort in unserem Restaurant genießen."
|
|
92
|
-
:links="links"
|
|
93
|
-
/>
|
|
94
|
-
</UContainer>
|
|
12
|
+
<OrderConfirmation :order-id="orderId" />
|
|
95
13
|
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// One-page checkout (#443): delivery or pickup, time, customer data,
|
|
3
|
+
// payment and the order on one page.
|
|
4
|
+
useSeoMeta({
|
|
5
|
+
title: "Kasse",
|
|
6
|
+
robots: "noindex, nofollow",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const { isEmpty } = useCart();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="flex flex-col gap-6 py-2 font-body text-sb-ink sm:gap-8">
|
|
14
|
+
<h1 class="font-display text-4xl leading-none sm:text-5xl">Kasse</h1>
|
|
15
|
+
<ClientOnly>
|
|
16
|
+
<div
|
|
17
|
+
v-if="isEmpty"
|
|
18
|
+
class="flex flex-col items-start gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6"
|
|
19
|
+
>
|
|
20
|
+
<p>Ihr Warenkorb ist noch leer.</p>
|
|
21
|
+
<SbButton to="/speisekarte/">Zur Speisekarte</SbButton>
|
|
22
|
+
</div>
|
|
23
|
+
<CheckoutSummary v-else />
|
|
24
|
+
<template #fallback>
|
|
25
|
+
<div class="h-96" aria-busy="true" aria-label="Kasse wird geladen" />
|
|
26
|
+
</template>
|
|
27
|
+
</ClientOnly>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
package/app/pages/bestellung.vue
CHANGED
|
@@ -1,65 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"/bestellung/warenkorb",
|
|
6
|
-
"/bestellung/zahlung-versand",
|
|
7
|
-
"/bestellung/bestaetigen",
|
|
8
|
-
] as const;
|
|
9
|
-
|
|
10
|
-
const route = useRoute();
|
|
11
|
-
const isPaymentReturnRoute = computed(() =>
|
|
12
|
-
/^\/bestellung\/[0-9a-f]{32}(\/erfolg|\/fehler)?$/.test(route.path),
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
// The active step follows the route, so the server renders the same step the
|
|
16
|
-
// browser hydrates. Setting it from the child pages ran after the stepper had
|
|
17
|
-
// been rendered on the server (#339).
|
|
18
|
-
const step = computed<number>({
|
|
19
|
-
get: () =>
|
|
20
|
-
Math.max(
|
|
21
|
-
0,
|
|
22
|
-
stepRoutes.findIndex((path) => path === route.path),
|
|
23
|
-
),
|
|
24
|
-
set: (index) => {
|
|
25
|
-
const path = stepRoutes[index];
|
|
26
|
-
if (path && path !== route.path) {
|
|
27
|
-
navigateTo(path);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const items = computed(
|
|
33
|
-
() =>
|
|
34
|
-
[
|
|
35
|
-
{
|
|
36
|
-
title: "Warenkorb",
|
|
37
|
-
icon: "i-lucide-shopping-cart",
|
|
38
|
-
disabled: false,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
title: "Zahlung & Versand",
|
|
42
|
-
icon: "i-lucide-truck",
|
|
43
|
-
disabled: step.value < 1,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
title: "Prüfen & Bestellen",
|
|
47
|
-
icon: "i-lucide-check",
|
|
48
|
-
disabled: step.value < 2,
|
|
49
|
-
},
|
|
50
|
-
] satisfies StepperItem[],
|
|
51
|
-
);
|
|
2
|
+
// Frame of the order pages: the one-page checkout (/bestellung/kasse, #443)
|
|
3
|
+
// and the order and payment result pages. The old step routes redirect to
|
|
4
|
+
// the checkout (routeRules in nuxt.config.ts).
|
|
52
5
|
</script>
|
|
53
6
|
|
|
54
7
|
<template>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<template #content>
|
|
61
|
-
<NuxtPage />
|
|
62
|
-
</template>
|
|
63
|
-
</UStepper>
|
|
64
|
-
</UPageSection>
|
|
8
|
+
<div
|
|
9
|
+
class="mx-auto w-full max-w-(--sb-container) px-4 pt-8 pb-16 sm:px-6 sm:pt-12 lg:px-8"
|
|
10
|
+
>
|
|
11
|
+
<NuxtPage />
|
|
12
|
+
</div>
|
|
65
13
|
</template>
|