@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.
Files changed (185) hide show
  1. package/.github/workflows/ci.yaml +54 -0
  2. package/CLAUDE.md +23 -8
  3. package/app/app.vue +10 -6
  4. package/app/assets/css/main.css +100 -61
  5. package/app/components/AddToWishlist.vue +15 -25
  6. package/app/components/Address/Card.vue +6 -11
  7. package/app/components/Address/Detail.vue +23 -23
  8. package/app/components/Address/Fields.vue +175 -73
  9. package/app/components/Address/Form.vue +107 -106
  10. package/app/components/Cart/Bar.vue +6 -9
  11. package/app/components/Cart/Item.vue +48 -63
  12. package/app/components/Cart/QuickView.vue +38 -25
  13. package/app/components/Cart/Upsell.vue +24 -62
  14. package/app/components/Category/Breadcrumb.vue +29 -3
  15. package/app/components/Category/FilterGroup.vue +20 -41
  16. package/app/components/Category/Listing.vue +100 -130
  17. package/app/components/Category/SearchInput.vue +22 -19
  18. package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
  19. package/app/components/Checkout/LoginOrRegister.vue +28 -29
  20. package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
  21. package/app/components/Checkout/Summary.vue +90 -60
  22. package/app/components/Checkout/VoucherInput.vue +40 -27
  23. package/app/components/Contact/Form.vue +164 -192
  24. package/app/components/DemoBanner.vue +5 -5
  25. package/app/components/Footer/StoreStatus.vue +2 -2
  26. package/app/components/Footer.vue +125 -57
  27. package/app/components/Header.vue +283 -18
  28. package/app/components/Home/Categories.vue +116 -0
  29. package/app/components/Home/Facts.vue +71 -0
  30. package/app/components/Home/Faq.vue +34 -16
  31. package/app/components/Home/Hero.vue +172 -0
  32. package/app/components/Home/Highlights.vue +29 -37
  33. package/app/components/Home/Restaurant.vue +102 -0
  34. package/app/components/Menu/BonCard.vue +180 -0
  35. package/app/components/Menu/CartPanel.vue +24 -0
  36. package/app/components/Menu/CategoryIndex.vue +54 -0
  37. package/app/components/Menu/OrderMode.vue +20 -0
  38. package/app/components/Menu/SectionHeader.vue +38 -0
  39. package/app/components/Navigation/MobileTop.vue +23 -15
  40. package/app/components/Order/Confirmation.vue +119 -0
  41. package/app/components/Order/Detail.vue +80 -88
  42. package/app/components/Product/CardSkeleton.vue +8 -12
  43. package/app/components/Product/Configurator.vue +8 -16
  44. package/app/components/Product/CrossSelling.vue +75 -83
  45. package/app/components/Product/DeselectIngredient.vue +17 -22
  46. package/app/components/Product/Detail.vue +35 -27
  47. package/app/components/Product/QuickView.vue +80 -51
  48. package/app/components/SalesChannelSwitch.vue +14 -28
  49. package/app/components/Sb/Button.vue +70 -0
  50. package/app/components/Sb/Checkbox.vue +73 -0
  51. package/app/components/Sb/Chip.vue +51 -0
  52. package/app/components/Sb/ChoiceGroup.vue +82 -0
  53. package/app/components/Sb/ConfirmDialog.vue +60 -0
  54. package/app/components/Sb/Field.vue +77 -0
  55. package/app/components/Sb/Icon.vue +66 -0
  56. package/app/components/Sb/IconButton.vue +55 -0
  57. package/app/components/Sb/Input.vue +23 -0
  58. package/app/components/Sb/SegmentedControl.vue +34 -0
  59. package/app/components/Sb/Select.vue +49 -0
  60. package/app/components/Sb/Sheet.vue +83 -0
  61. package/app/components/Sb/Stars.vue +60 -0
  62. package/app/components/Sb/StatusPill.vue +38 -0
  63. package/app/components/Sb/Stepper.vue +72 -0
  64. package/app/components/User/AccountHeader.vue +16 -0
  65. package/app/components/User/AuthPanel.vue +41 -0
  66. package/app/components/User/Detail.vue +32 -29
  67. package/app/components/User/LoginForm.vue +92 -98
  68. package/app/components/User/RegistrationForm.vue +285 -249
  69. package/app/components/Wishlist.vue +55 -155
  70. package/app/composables/useCartMutations.ts +9 -27
  71. package/app/composables/useCheckoutMethodGuard.ts +2 -24
  72. package/app/composables/useContactForm.ts +66 -0
  73. package/app/composables/useHomeMenuCategories.ts +41 -0
  74. package/app/composables/useNavigation.ts +10 -2
  75. package/app/composables/useOrderMode.ts +65 -0
  76. package/app/composables/useRegistrationForm.ts +161 -0
  77. package/app/composables/useRestaurantSchema.ts +1 -1
  78. package/app/composables/useShareLink.ts +3 -13
  79. package/app/composables/useSortingSelection.ts +13 -0
  80. package/app/composables/useThemePreset.ts +15 -0
  81. package/app/composables/useVoucherCode.ts +7 -16
  82. package/app/composables/useWishlistActions.ts +0 -51
  83. package/app/error.vue +31 -9
  84. package/app/layouts/account.vue +45 -50
  85. package/app/layouts/default.vue +2 -3
  86. package/app/layouts/listing.vue +3 -5
  87. package/app/pages/[...all].vue +8 -4
  88. package/app/pages/account/recover/password/index.vue +113 -80
  89. package/app/pages/anmelden.vue +11 -10
  90. package/app/pages/bestellung/[id]/erfolg.vue +1 -15
  91. package/app/pages/bestellung/[id]/fehler.vue +63 -51
  92. package/app/pages/bestellung/[id]/index.vue +3 -85
  93. package/app/pages/bestellung/kasse.vue +29 -0
  94. package/app/pages/bestellung.vue +8 -60
  95. package/app/pages/index.vue +12 -52
  96. package/app/pages/kontakt.vue +27 -7
  97. package/app/pages/konto/adressen.vue +106 -102
  98. package/app/pages/konto/bestellung/[id].vue +9 -43
  99. package/app/pages/konto/bestellungen.vue +55 -33
  100. package/app/pages/konto/index.vue +47 -62
  101. package/app/pages/konto/profil.vue +162 -100
  102. package/app/pages/maintenance.vue +8 -6
  103. package/app/pages/merkliste.vue +7 -8
  104. package/app/pages/passwort-vergessen.vue +92 -75
  105. package/app/pages/registrierung/bestaetigen.vue +20 -48
  106. package/app/pages/registrierung/index.vue +16 -7
  107. package/app/pages/suche.vue +94 -95
  108. package/app/plugins/theme-preset.ts +9 -0
  109. package/app/utils/highlight.ts +25 -0
  110. package/app/utils/product.ts +9 -0
  111. package/app/validation/registrationSchema.ts +1 -1
  112. package/modules/theme.ts +115 -0
  113. package/nuxt.config.ts +27 -15
  114. package/package.json +6 -8
  115. package/playwright.config.ts +11 -0
  116. package/server/api/listing/[categoryId].get.ts +3 -0
  117. package/shared/theme/presets.ts +303 -0
  118. package/test/a11y/presets.test.ts +225 -0
  119. package/test/nuxt/AccountPagesPreset.test.ts +191 -0
  120. package/test/nuxt/AuthPagesPreset.test.ts +87 -0
  121. package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
  122. package/test/nuxt/CartItem.test.ts +18 -3
  123. package/test/nuxt/CartUpsell.test.ts +1 -2
  124. package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
  125. package/test/nuxt/CheckoutOnePage.test.ts +115 -0
  126. package/test/nuxt/CheckoutSummary.test.ts +6 -6
  127. package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
  128. package/test/nuxt/ContactFormPreset.test.ts +115 -0
  129. package/test/nuxt/FooterStoreStatus.test.ts +2 -2
  130. package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
  131. package/test/nuxt/HomeFaq.test.ts +3 -2
  132. package/test/nuxt/MenuBonCard.test.ts +122 -0
  133. package/test/nuxt/OrderPagesPreset.test.ts +132 -0
  134. package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
  135. package/test/nuxt/ProductCrossSelling.test.ts +2 -1
  136. package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
  137. package/test/nuxt/ProductSheetPreset.test.ts +105 -0
  138. package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
  139. package/test/nuxt/RegistrationForm.test.ts +89 -270
  140. package/test/nuxt/SbBaseComponents.test.ts +170 -0
  141. package/test/nuxt/SbStars.test.ts +25 -0
  142. package/test/nuxt/useCartMutations.test.ts +3 -17
  143. package/test/nuxt/useCartUpsell.test.ts +1 -1
  144. package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
  145. package/test/nuxt/useShareLink.test.ts +1 -9
  146. package/test/nuxt/useWishlistActions.test.ts +3 -26
  147. package/test/unit/highlight.spec.ts +31 -0
  148. package/test/unit/product.spec.ts +12 -0
  149. package/test/unit/themePresets.spec.ts +61 -0
  150. package/app/app.config.ts +0 -19
  151. package/app/components/AnimatedSection.vue +0 -74
  152. package/app/components/BottomNavi.vue +0 -70
  153. package/app/components/Category/Header.vue +0 -48
  154. package/app/components/Checkout/PaymentMethod.vue +0 -30
  155. package/app/components/Checkout/ShippingMethod.vue +0 -30
  156. package/app/components/Cta.vue +0 -30
  157. package/app/components/Feature/Card.vue +0 -121
  158. package/app/components/Features.vue +0 -42
  159. package/app/components/Footer/Contact.vue +0 -82
  160. package/app/components/Header/Body.vue +0 -82
  161. package/app/components/Header/Right.vue +0 -187
  162. package/app/components/Header/Title.vue +0 -10
  163. package/app/components/Hero.vue +0 -233
  164. package/app/components/Home/MenuCategories.vue +0 -148
  165. package/app/components/ImageGallery.vue +0 -63
  166. package/app/components/Loading.vue +0 -29
  167. package/app/components/Navigation/DesktopLeft.vue +0 -39
  168. package/app/components/Product/Card.vue +0 -177
  169. package/app/components/Product/CardCompact.vue +0 -72
  170. package/app/components/Product/CardDietBadges.vue +0 -43
  171. package/app/components/Product/CardIngredients.vue +0 -35
  172. package/app/components/Product/CardKitchen.vue +0 -34
  173. package/app/components/Product/SearchBar.vue +0 -95
  174. package/app/components/PublicAnnouncement.vue +0 -17
  175. package/app/pages/bestellung/bestaetigen.vue +0 -16
  176. package/app/pages/bestellung/warenkorb.vue +0 -49
  177. package/app/pages/bestellung/zahlung-versand.vue +0 -25
  178. package/test/nuxt/AddressFields.test.ts +0 -222
  179. package/test/nuxt/AnimatedSection.test.ts +0 -67
  180. package/test/nuxt/ContactForm.test.ts +0 -207
  181. package/test/nuxt/FooterContact.test.ts +0 -102
  182. package/test/nuxt/HeaderRight.test.ts +0 -142
  183. package/test/nuxt/Hero.test.ts +0 -126
  184. package/test/nuxt/HomeMenuCategories.test.ts +0 -94
  185. package/test/nuxt/LoginForm.test.ts +0 -159
@@ -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" class="relative">
37
- <Hero
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
- <HomeMenuCategories
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
- <UPageSection
69
- v-if="page.mittagstisch"
70
- :reverse="page.mittagstisch.reverse"
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
- :images="page.gallery.images"
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>
@@ -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
- <UPageSection
16
- title="Sie haben eine Frage oder Anregung? Wir freuen uns auf Ihre Nachricht."
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
- <ContactForm />
22
- </UPageSection>
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
- async function makeDefaultShippingAddress(addressId: string) {
41
- await setDefaultCustomerShippingAddress(addressId);
42
- await reloadCustomerData();
43
- toast.add({
44
- title: "Standard Lieferadresse wurde geändert!",
45
- color: "success",
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 makeDefaultBillingAddress(addressId: string) {
50
- await setDefaultCustomerBillingAddress(addressId);
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
- const openEditModal = ref(false);
59
- const openNewModal = ref(false);
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
- <UContainer>
64
- <UPageHeader
65
- headline="KONTO"
66
- title="Adressen"
67
- description="Verwalte deine Adressen."
68
- />
69
- <UPageBody>
70
- <div class="relative grid grid-cols-1 sm:grid-cols-2 gap-8">
71
- <AddressCard
72
- v-if="userDefaultShippingAddress"
73
- :address="userDefaultShippingAddress"
74
- title="Standard Lieferadresse"
75
- icon="i-lucide-house"
76
- />
77
- <AddressCard
78
- v-if="userDefaultBillingAddress"
79
- :address="userDefaultBillingAddress"
80
- title="Standard Rechnungsadresse"
81
- icon="i-lucide-receipt-text"
82
- />
83
- </div>
84
- <USeparator label="Alle Adressen" color="primary" />
85
- <UPageGrid>
86
- <div
87
- v-for="address in customerAddresses ?? []"
88
- :key="address.id"
89
- class="space-y-4"
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
- <AddressCard :address="address" />
92
- <div class="flex justify-between">
93
- <UModal v-model:open="openEditModal" title="Adresse bearbeiten">
94
- <UButton
95
- label="Bearbeiten"
96
- variant="outline"
97
- icon="i-lucide-pen"
98
- />
99
- <template #body>
100
- <div class="p-8">
101
- <AddressForm
102
- :address="address"
103
- @submit-success="reloadCustomerData"
104
- />
105
- </div>
106
- </template>
107
- </UModal>
108
- <div class="flex gap-2">
109
- <UTooltip
110
- v-if="address.id !== userDefaultShippingAddress?.id"
111
- text="Als Standard Lieferaddresse setzten"
112
- >
113
- <UButton
114
- color="secondary"
115
- variant="subtle"
116
- icon="i-lucide-house"
117
- @click="makeDefaultShippingAddress(address.id)"
118
- />
119
- </UTooltip>
120
- <UTooltip
121
- v-if="address.id !== userDefaultBillingAddress?.id"
122
- text="Als Standard Rechnungsaddresse setzten"
123
- >
124
- <UButton
125
- color="secondary"
126
- variant="subtle"
127
- icon="i-lucide-receipt-text"
128
- @click="makeDefaultBillingAddress(address.id)"
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
- </UPageGrid>
135
- <UModal v-model:open="openNewModal" title="Neue Adresse erstellen">
136
- <UButton label="Neue Adresse hinzufügen" icon="i-lucide-plus" />
137
-
138
- <template #body>
139
- <div class="p-8">
140
- <AddressForm
141
- :address="undefined"
142
- @submit-success="reloadCustomerData"
143
- />
144
- </div>
145
- </template>
146
- </UModal>
147
- </UPageBody>
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 { id } = route.params as OrderRouteParams;
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
- <UContainer>
44
- <UPageHeader
45
- headline="BESTELLUNG"
46
- :title="order?.orderNumber"
47
- :description="formatDate(order?.createdAt)"
48
- />
49
- <UPageBody>
50
- <OrderDetail
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
- loadOrders();
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
- <UContainer>
23
- <UPageHeader
24
- headline="KONTO"
25
- title="Meine Bestellungen"
26
- description="Historie deiner Bestellungen."
27
- />
28
- <UPageBody>
29
- <UPageList divide>
30
- <UPageCard
31
- v-for="order in orders"
32
- :key="order.id"
33
- variant="ghost"
34
- :to="'/konto/bestellung/' + order.id"
35
- :ui="{
36
- root: 'shadow-md rounded-md',
37
- footer: 'w-full',
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
- <template #default>
41
- <div class="flex flex-row justify-between">
42
- <div>Bestellung: {{ order.orderNumber }}</div>
43
- <div>vom: {{ formatDate(order.createdAt) }}</div>
44
- <div>
45
- Gesamtbetrag: {{ getFormattedPrice(order.amountTotal) }}
46
- </div>
47
- <UIcon name="i-lucide-eye" class="size-6" />
48
- </div>
49
- </template>
50
- </UPageCard>
51
- </UPageList>
52
- </UPageBody>
53
- </UContainer>
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
- <UContainer>
16
- <UPageHeader
17
- headline="KONTO"
18
- title="Übersicht"
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
- <UPageBody>
22
- <UPageGrid>
23
- <div class="flex flex-col gap-2 w-full">
24
- <UPageCard
25
- class="h-full"
26
- icon="i-lucide-user"
27
- title="Persönliches Profil"
28
- :ui="{
29
- root: 'shadow-md rounded-md',
30
- footer: 'w-full',
31
- }"
32
- >
33
- <div class="h-full">
34
- <p>{{ user?.firstName }} {{ user?.lastName }}</p>
35
- <p>{{ user?.email }}</p>
36
- </div>
37
- </UPageCard>
38
- <UButton
39
- variant="outline"
40
- label="Bearbeiten"
41
- icon="i-lucide-pen"
42
- block
43
- to="/konto/profil"
44
- />
45
- </div>
46
- <div class="flex flex-col gap-2 w-full">
47
- <AddressCard
48
- :address="userDefaultShippingAddress"
49
- title="Standard Lieferadresse"
50
- icon="i-lucide-house"
51
- />
52
- <UButton
53
- variant="outline"
54
- label="Bearbeiten"
55
- icon="i-lucide-pen"
56
- block
57
- to="/konto/adressen"
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>