@revenexx/cover 0.2.16 → 0.2.18
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/app/components/account/address/AccountAddressView.vue +433 -0
- package/app/components/account/dashboard/AccountDashboard.vue +10 -330
- package/app/components/account/dashboard/AccountDashboardBudgets.vue +71 -0
- package/app/components/account/dashboard/AccountDashboardGreeting.vue +17 -0
- package/app/components/account/dashboard/AccountDashboardKpis.vue +71 -0
- package/app/components/account/dashboard/AccountDashboardQuickActions.vue +36 -0
- package/app/components/account/dashboard/AccountDashboardRecentOrders.vue +70 -0
- package/app/components/account/dashboard/AccountDashboardRequisitions.vue +60 -0
- package/app/components/account/profile/AccountPasswordForm.vue +155 -0
- package/app/components/account/profile/AccountProfileForm.vue +159 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationActions.vue +52 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationHero.vue +41 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationNextSteps.vue +60 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationOrderRecap.vue +102 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationView.vue +30 -265
- package/app/components/listing/ListingActiveFilters.vue +59 -0
- package/app/components/listing/ListingFilterBar.vue +24 -0
- package/app/components/listing/ListingFilterDrawer.vue +72 -0
- package/app/components/listing/ListingFilterRail.vue +23 -0
- package/app/components/listing/ListingResults.vue +88 -0
- package/app/components/listing/ListingToolbar.vue +46 -0
- package/app/components/listing/ListingView.vue +14 -204
- package/app/components/product/detail/ProductDetailIdentity.vue +44 -0
- package/app/components/product/detail/ProductDetailPrice.vue +39 -0
- package/app/components/search/filter/SearchFacets.vue +12 -102
- package/app/components/search/filter/SearchFacetsBar.vue +161 -0
- package/app/composables/useAccountDashboard.ts +112 -0
- package/app/composables/useCartStore.ts +23 -12
- package/app/composables/useCategoryListing.ts +92 -0
- package/app/composables/useCheckoutConfirmation.ts +63 -0
- package/app/composables/useFacetFilters.ts +122 -0
- package/app/composables/useSearchListing.ts +71 -0
- package/app/interfaces/checkout.ts +27 -0
- package/i18n/locales/de/editor.json +33 -0
- package/i18n/locales/en/editor.json +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Account password card — read/edit view of the password fields. Self-contained
|
|
4
|
+
* demo UI: there is no password BFF endpoint yet, so submit is a no-op; the
|
|
5
|
+
* card only toggles between the masked read view and the edit form.
|
|
6
|
+
*/
|
|
7
|
+
const { icon } = useIcons();
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
|
|
10
|
+
const isEditing = ref(false);
|
|
11
|
+
|
|
12
|
+
const passwordState = reactive({
|
|
13
|
+
currentPassword: "",
|
|
14
|
+
newPassword: "",
|
|
15
|
+
confirmNewPassword: "",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
function toggleEdit() {
|
|
19
|
+
if (isEditing.value) {
|
|
20
|
+
passwordState.currentPassword = "";
|
|
21
|
+
passwordState.newPassword = "";
|
|
22
|
+
passwordState.confirmNewPassword = "";
|
|
23
|
+
}
|
|
24
|
+
isEditing.value = !isEditing.value;
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<UCard>
|
|
30
|
+
<template #header>
|
|
31
|
+
<div class="flex items-start justify-between">
|
|
32
|
+
<div class="space-y-1">
|
|
33
|
+
<h2 class="text-base font-semibold text-highlighted">
|
|
34
|
+
{{ t('auth.resetPassword.title') }}
|
|
35
|
+
</h2>
|
|
36
|
+
<p class="text-sm text-muted">
|
|
37
|
+
{{ t('auth.resetPassword.description') }}
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
<UTooltip :text="t('actions.edit')">
|
|
41
|
+
<UButton
|
|
42
|
+
:icon="icon('edit')"
|
|
43
|
+
variant="ghost"
|
|
44
|
+
color="primary"
|
|
45
|
+
:aria-label="t('actions.edit')"
|
|
46
|
+
@click="toggleEdit"
|
|
47
|
+
/>
|
|
48
|
+
</UTooltip>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
v-if="!isEditing"
|
|
54
|
+
class="space-y-4"
|
|
55
|
+
>
|
|
56
|
+
<div class="w-full sm:w-1/2 rounded-lg border border-(--ui-border) p-4">
|
|
57
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
58
|
+
{{ t('auth.currentPassword.fields.currentPassword') }}
|
|
59
|
+
</dt>
|
|
60
|
+
<dd class="mt-1 text-sm text-highlighted tracking-widest">
|
|
61
|
+
••••••••
|
|
62
|
+
</dd>
|
|
63
|
+
</div>
|
|
64
|
+
<dl class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
65
|
+
<div class="rounded-lg border border-(--ui-border) p-4">
|
|
66
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
67
|
+
{{ t('auth.resetPassword.fields.password') }}
|
|
68
|
+
</dt>
|
|
69
|
+
<dd class="mt-1 text-sm text-highlighted tracking-widest">
|
|
70
|
+
••••••••
|
|
71
|
+
</dd>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="rounded-lg border border-(--ui-border) p-4">
|
|
74
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
75
|
+
{{ t('auth.resetPassword.fields.passwordConfirm') }}
|
|
76
|
+
</dt>
|
|
77
|
+
<dd class="mt-1 text-sm text-highlighted tracking-widest">
|
|
78
|
+
••••••••
|
|
79
|
+
</dd>
|
|
80
|
+
</div>
|
|
81
|
+
</dl>
|
|
82
|
+
</div>
|
|
83
|
+
<UForm
|
|
84
|
+
v-else
|
|
85
|
+
:state="passwordState"
|
|
86
|
+
class="space-y-4"
|
|
87
|
+
>
|
|
88
|
+
<div class="w-full sm:w-1/2 rounded-lg border border-(--ui-border) p-4">
|
|
89
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
90
|
+
{{ t('auth.currentPassword.fields.currentPassword') }}
|
|
91
|
+
<span class="text-error">*</span>
|
|
92
|
+
</dt>
|
|
93
|
+
<dd class="mt-1">
|
|
94
|
+
<UFormField
|
|
95
|
+
name="currentPassword"
|
|
96
|
+
required
|
|
97
|
+
>
|
|
98
|
+
<UiFormsPasswordInput
|
|
99
|
+
v-model="passwordState.currentPassword"
|
|
100
|
+
autocomplete="current-password"
|
|
101
|
+
:placeholder="t('auth.currentPassword.fields.currentPasswordPlaceholder')"
|
|
102
|
+
/>
|
|
103
|
+
</UFormField>
|
|
104
|
+
</dd>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<dl class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
108
|
+
<div class="rounded-lg border border-(--ui-border) p-4">
|
|
109
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
110
|
+
{{ t('auth.resetPassword.fields.password') }}
|
|
111
|
+
<span class="text-error">*</span>
|
|
112
|
+
</dt>
|
|
113
|
+
<dd class="mt-1">
|
|
114
|
+
<UFormField
|
|
115
|
+
name="newPassword"
|
|
116
|
+
required
|
|
117
|
+
>
|
|
118
|
+
<UiFormsPasswordInput
|
|
119
|
+
v-model="passwordState.newPassword"
|
|
120
|
+
autocomplete="new-password"
|
|
121
|
+
:placeholder="t('auth.resetPassword.fields.passwordPlaceholder')"
|
|
122
|
+
/>
|
|
123
|
+
</UFormField>
|
|
124
|
+
</dd>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="rounded-lg border border-(--ui-border) p-4">
|
|
128
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
129
|
+
{{ t('auth.resetPassword.fields.passwordConfirm') }}
|
|
130
|
+
<span class="text-error">*</span>
|
|
131
|
+
</dt>
|
|
132
|
+
<dd class="mt-1">
|
|
133
|
+
<UFormField
|
|
134
|
+
name="confirmNewPassword"
|
|
135
|
+
required
|
|
136
|
+
>
|
|
137
|
+
<UiFormsPasswordInput
|
|
138
|
+
v-model="passwordState.confirmNewPassword"
|
|
139
|
+
autocomplete="new-password"
|
|
140
|
+
:placeholder="t('auth.resetPassword.fields.passwordConfirmPlaceholder')"
|
|
141
|
+
/>
|
|
142
|
+
</UFormField>
|
|
143
|
+
</dd>
|
|
144
|
+
</div>
|
|
145
|
+
</dl>
|
|
146
|
+
|
|
147
|
+
<div class="pt-2 flex justify-end">
|
|
148
|
+
<UButton
|
|
149
|
+
type="submit"
|
|
150
|
+
:label="t('profile.actions.changePassword')"
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
</UForm>
|
|
154
|
+
</UCard>
|
|
155
|
+
</template>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Account profile fields card — read/edit the signed-in user's phone and
|
|
4
|
+
* company. Self-contained: reads the profile via useAccount and persists
|
|
5
|
+
* through updateProfile (PUT /api/account/profile).
|
|
6
|
+
*/
|
|
7
|
+
import type { AccountProfileFormState } from "../../../interfaces/account/profile";
|
|
8
|
+
|
|
9
|
+
const { icon } = useIcons();
|
|
10
|
+
const { t } = useI18n();
|
|
11
|
+
const toast = useToast();
|
|
12
|
+
const { user, updateProfile } = useAccount();
|
|
13
|
+
|
|
14
|
+
const saving = ref(false);
|
|
15
|
+
const saveError = ref<string | null>(null);
|
|
16
|
+
const isEditing = ref(false);
|
|
17
|
+
|
|
18
|
+
const profileState = reactive<AccountProfileFormState>({
|
|
19
|
+
phone: "",
|
|
20
|
+
company: "",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
watch(user, (value) => {
|
|
24
|
+
profileState.phone = value.phone;
|
|
25
|
+
profileState.company = value.company;
|
|
26
|
+
}, { immediate: true });
|
|
27
|
+
|
|
28
|
+
const profileFields = computed(() => [
|
|
29
|
+
{ key: "name", label: t("profile.fields.name"), value: user.value.name },
|
|
30
|
+
{ key: "email", label: t("profile.fields.email"), value: user.value.email },
|
|
31
|
+
{ key: "phone", label: t("profile.fields.phone"), value: user.value.phone },
|
|
32
|
+
{ key: "company", label: t("profile.fields.company"), value: user.value.company },
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
function getValue(value: string): string {
|
|
36
|
+
return value.trim() ? value : t("profile.fields.empty");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function toggleEdit() {
|
|
40
|
+
if (isEditing.value) {
|
|
41
|
+
profileState.phone = user.value.phone;
|
|
42
|
+
profileState.company = user.value.company;
|
|
43
|
+
saveError.value = null;
|
|
44
|
+
}
|
|
45
|
+
isEditing.value = !isEditing.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function onSubmit() {
|
|
49
|
+
saving.value = true;
|
|
50
|
+
saveError.value = null;
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
await updateProfile({
|
|
54
|
+
phone: profileState.phone,
|
|
55
|
+
company: profileState.company,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
toast.add({
|
|
59
|
+
title: t("profile.success.updated"),
|
|
60
|
+
color: "success",
|
|
61
|
+
icon: icon("success"),
|
|
62
|
+
});
|
|
63
|
+
isEditing.value = false;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
const message = (error as { statusMessage?: string }).statusMessage;
|
|
67
|
+
saveError.value = typeof message === "string" ? message : t("auth.login.errors.unknown");
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
saving.value = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<UCard>
|
|
77
|
+
<template #header>
|
|
78
|
+
<div class="flex items-start justify-between">
|
|
79
|
+
<div class="space-y-1">
|
|
80
|
+
<h2 class="text-base font-semibold text-highlighted">
|
|
81
|
+
{{ t('profile.form.title') }}
|
|
82
|
+
</h2>
|
|
83
|
+
<p class="text-sm text-muted">
|
|
84
|
+
{{ t('profile.form.description') }}
|
|
85
|
+
</p>
|
|
86
|
+
</div>
|
|
87
|
+
<UTooltip :text="t('actions.edit')">
|
|
88
|
+
<UButton
|
|
89
|
+
:icon="icon('edit')"
|
|
90
|
+
variant="ghost"
|
|
91
|
+
color="primary"
|
|
92
|
+
:aria-label="t('actions.edit')"
|
|
93
|
+
@click="toggleEdit"
|
|
94
|
+
/>
|
|
95
|
+
</UTooltip>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<FormKit
|
|
100
|
+
type="form"
|
|
101
|
+
:actions="false"
|
|
102
|
+
@submit="onSubmit"
|
|
103
|
+
>
|
|
104
|
+
<dl class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
105
|
+
<div
|
|
106
|
+
v-for="field in profileFields"
|
|
107
|
+
:key="field.key"
|
|
108
|
+
class="rounded-lg border border-(--ui-border) p-4"
|
|
109
|
+
>
|
|
110
|
+
<dt class="text-xs font-medium uppercase tracking-wide text-muted">
|
|
111
|
+
{{ field.label }}
|
|
112
|
+
<span
|
|
113
|
+
v-if="isEditing && (field.key === 'phone' || field.key === 'company')"
|
|
114
|
+
class="text-error"
|
|
115
|
+
>*</span>
|
|
116
|
+
</dt>
|
|
117
|
+
<dd class="mt-1 text-sm text-highlighted break-words">
|
|
118
|
+
<FormKit
|
|
119
|
+
v-if="isEditing && field.key === 'phone'"
|
|
120
|
+
v-model="profileState.phone"
|
|
121
|
+
type="text"
|
|
122
|
+
name="phone"
|
|
123
|
+
validation="required|length:8,16|phoneNumber"
|
|
124
|
+
:validation-messages="{ phoneNumber: t('validation.invalidPhoneNumber') }"
|
|
125
|
+
autocomplete="tel"
|
|
126
|
+
/>
|
|
127
|
+
<FormKit
|
|
128
|
+
v-else-if="isEditing && field.key === 'company'"
|
|
129
|
+
v-model="profileState.company"
|
|
130
|
+
type="text"
|
|
131
|
+
name="company"
|
|
132
|
+
validation="required|length:3,64"
|
|
133
|
+
autocomplete="organization"
|
|
134
|
+
/>
|
|
135
|
+
<template v-else>
|
|
136
|
+
{{ getValue(field.value) }}
|
|
137
|
+
</template>
|
|
138
|
+
</dd>
|
|
139
|
+
</div>
|
|
140
|
+
</dl>
|
|
141
|
+
|
|
142
|
+
<template v-if="isEditing">
|
|
143
|
+
<UAlert
|
|
144
|
+
v-if="saveError"
|
|
145
|
+
color="error"
|
|
146
|
+
variant="soft"
|
|
147
|
+
:title="saveError"
|
|
148
|
+
/>
|
|
149
|
+
<div class="flex justify-end">
|
|
150
|
+
<UButton
|
|
151
|
+
type="submit"
|
|
152
|
+
:loading="saving"
|
|
153
|
+
:label="t('profile.actions.updateData')"
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
</FormKit>
|
|
158
|
+
</UCard>
|
|
159
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ConfirmationType } from "../../../interfaces/checkout";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The confirmation actions: continue shopping (resets the checkout and
|
|
6
|
+
* returns home) and — when a recap was loaded — a link to the order or
|
|
7
|
+
* requisition detail page.
|
|
8
|
+
*/
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
type: ConfirmationType;
|
|
11
|
+
recordId: string;
|
|
12
|
+
hasRecap: boolean;
|
|
13
|
+
}>();
|
|
14
|
+
|
|
15
|
+
const { icon } = useIcons();
|
|
16
|
+
const { t } = useI18n();
|
|
17
|
+
const localePath = useLocalePath();
|
|
18
|
+
const { to } = useAppUrl();
|
|
19
|
+
const checkout = useCheckoutOnePage();
|
|
20
|
+
|
|
21
|
+
const detailLink = computed(() =>
|
|
22
|
+
props.type === "requisition"
|
|
23
|
+
? localePath(`/account/requisitions/${props.recordId}`)
|
|
24
|
+
: localePath(`/account/orders/${props.recordId}`));
|
|
25
|
+
|
|
26
|
+
function continueShopping() {
|
|
27
|
+
checkout.reset();
|
|
28
|
+
void navigateTo(to("/"));
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
34
|
+
<UButton
|
|
35
|
+
color="primary"
|
|
36
|
+
size="lg"
|
|
37
|
+
tabindex="0"
|
|
38
|
+
:label="t('confirmation.continueShopping')"
|
|
39
|
+
:trailing-icon="icon('arrow-right')"
|
|
40
|
+
@click="continueShopping"
|
|
41
|
+
/>
|
|
42
|
+
<UButton
|
|
43
|
+
v-if="hasRecap"
|
|
44
|
+
color="neutral"
|
|
45
|
+
variant="outline"
|
|
46
|
+
size="lg"
|
|
47
|
+
tabindex="0"
|
|
48
|
+
:label="type === 'requisition' ? t('confirmation.viewRequisition') : t('confirmation.viewOrder')"
|
|
49
|
+
:to="detailLink"
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ConfirmationType } from "../../../interfaces/checkout";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The confirmation hero: thank-you eyebrow, outcome title, the record id
|
|
6
|
+
* ("order received") line, and — for the approval outcome — the approvers note.
|
|
7
|
+
*/
|
|
8
|
+
defineProps<{
|
|
9
|
+
type: ConfirmationType;
|
|
10
|
+
recordId: string;
|
|
11
|
+
approvers: string[];
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const { t } = useI18n();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="max-w-xl">
|
|
19
|
+
<p class="text-base font-semibold text-primary">
|
|
20
|
+
{{ t('confirmation.thanks') }}
|
|
21
|
+
</p>
|
|
22
|
+
<h1 class="mt-2 text-4xl sm:text-5xl font-bold tracking-tight text-highlighted">
|
|
23
|
+
{{ t(`confirmation.${type}.title`) }}
|
|
24
|
+
</h1>
|
|
25
|
+
<i18n-t
|
|
26
|
+
:keypath="`confirmation.${type}.received`"
|
|
27
|
+
tag="p"
|
|
28
|
+
class="mt-3 text-base text-muted"
|
|
29
|
+
>
|
|
30
|
+
<template #id>
|
|
31
|
+
<span class="font-semibold text-highlighted">{{ recordId }}</span>
|
|
32
|
+
</template>
|
|
33
|
+
</i18n-t>
|
|
34
|
+
<p
|
|
35
|
+
v-if="type === 'approval' && approvers.length"
|
|
36
|
+
class="mt-2 text-sm text-warning font-medium"
|
|
37
|
+
>
|
|
38
|
+
{{ t('confirmation.approval.approvers', { names: approvers.join(', ') }) }}
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ConfirmationType } from "../../../interfaces/checkout";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The "what happens next" steps for the given outcome — three cards driven
|
|
6
|
+
* by the localized `confirmation.steps.<type>` copy and the per-type icons.
|
|
7
|
+
*/
|
|
8
|
+
interface NextStep { title: string; text: string }
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
type: ConfirmationType;
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const { icon } = useIcons();
|
|
15
|
+
const { tm, rt, t } = useI18n();
|
|
16
|
+
|
|
17
|
+
const nextSteps = computed<NextStep[]>(() =>
|
|
18
|
+
(tm(`confirmation.steps.${props.type}`) as unknown[]).map(step => ({
|
|
19
|
+
title: rt((step as Record<string, never>).title),
|
|
20
|
+
text: rt((step as Record<string, never>).text),
|
|
21
|
+
})));
|
|
22
|
+
|
|
23
|
+
const stepIcons: Record<ConfirmationType, string[]> = {
|
|
24
|
+
order: ["mail", "package", "delivery"],
|
|
25
|
+
approval: ["shield", "package", "delivery"],
|
|
26
|
+
requisition: ["route", "cart", "eye"],
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<section>
|
|
32
|
+
<h2 class="text-xs font-semibold uppercase tracking-wide text-muted">
|
|
33
|
+
{{ t('confirmation.nextSteps') }}
|
|
34
|
+
</h2>
|
|
35
|
+
<ol class="mt-4 grid grid-cols-1 sm:grid-cols-3 border border-(--ui-border) rounded-xl overflow-hidden">
|
|
36
|
+
<li
|
|
37
|
+
v-for="(step, index) in nextSteps"
|
|
38
|
+
:key="step.title"
|
|
39
|
+
class="relative p-4 sm:p-5 border-(--ui-border)
|
|
40
|
+
max-sm:not-first:border-t sm:not-first:border-l"
|
|
41
|
+
>
|
|
42
|
+
<span class="flex items-center gap-2.5">
|
|
43
|
+
<span
|
|
44
|
+
class="flex size-8 shrink-0 items-center justify-center rounded-full
|
|
45
|
+
bg-primary/10"
|
|
46
|
+
>
|
|
47
|
+
<UIcon
|
|
48
|
+
:name="icon(stepIcons[type][index] ?? 'check')"
|
|
49
|
+
class="size-4 text-primary"
|
|
50
|
+
/>
|
|
51
|
+
</span>
|
|
52
|
+
<span class="text-sm font-semibold text-highlighted">{{ step.title }}</span>
|
|
53
|
+
</span>
|
|
54
|
+
<p class="mt-2.5 text-sm text-muted">
|
|
55
|
+
{{ step.text }}
|
|
56
|
+
</p>
|
|
57
|
+
</li>
|
|
58
|
+
</ol>
|
|
59
|
+
</section>
|
|
60
|
+
</template>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ConfirmationRecap } from "../../../interfaces/checkout";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The order/requisition recap for signed-in customers: positions with
|
|
6
|
+
* images and pricing, the delivery/billing/payment summary, and the total.
|
|
7
|
+
*/
|
|
8
|
+
defineProps<{
|
|
9
|
+
recap: ConfirmationRecap;
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const { t } = useI18n();
|
|
13
|
+
const { getImage } = useProductImage();
|
|
14
|
+
const { formatCurrency } = useCartSummaryFormatting();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<section>
|
|
19
|
+
<h2 class="text-xs font-semibold uppercase tracking-wide text-muted">
|
|
20
|
+
{{ t('confirmation.summaryTitle') }}
|
|
21
|
+
</h2>
|
|
22
|
+
<div class="mt-4 border border-(--ui-border) rounded-xl overflow-hidden">
|
|
23
|
+
<ul class="divide-y divide-(--ui-border) px-4 sm:px-5">
|
|
24
|
+
<li
|
|
25
|
+
v-for="line in recap.lines"
|
|
26
|
+
:key="line.id"
|
|
27
|
+
class="flex items-center gap-4 py-4"
|
|
28
|
+
>
|
|
29
|
+
<span
|
|
30
|
+
class="size-16 shrink-0 flex items-center justify-center rounded-lg
|
|
31
|
+
bg-elevated/60 ring-1 ring-(--ui-border) p-1.5"
|
|
32
|
+
>
|
|
33
|
+
<img
|
|
34
|
+
v-if="line.image"
|
|
35
|
+
:src="getImage(line.image)"
|
|
36
|
+
:alt="line.name"
|
|
37
|
+
class="max-h-full max-w-full object-contain"
|
|
38
|
+
>
|
|
39
|
+
</span>
|
|
40
|
+
<div class="min-w-0 flex-1">
|
|
41
|
+
<p class="text-sm font-medium text-highlighted truncate">
|
|
42
|
+
{{ line.name }}
|
|
43
|
+
</p>
|
|
44
|
+
<p class="text-xs text-muted">
|
|
45
|
+
{{ line.sku }} · {{ line.quantity }}× {{ formatCurrency(line.unitPrice) }}
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
<span class="text-sm tabular-nums text-highlighted shrink-0">
|
|
49
|
+
{{ formatCurrency(line.lineTotal) }}
|
|
50
|
+
</span>
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
53
|
+
|
|
54
|
+
<dl
|
|
55
|
+
v-if="recap.deliveryLines.length || recap.billingLines.length || recap.paymentMethod"
|
|
56
|
+
class="grid grid-cols-1 sm:grid-cols-3 gap-x-6 gap-y-5 px-4 sm:px-5 py-5
|
|
57
|
+
border-t border-(--ui-border) text-sm"
|
|
58
|
+
>
|
|
59
|
+
<div v-if="recap.deliveryLines.length">
|
|
60
|
+
<dt class="font-medium text-highlighted">
|
|
61
|
+
{{ t('orders.deliveryAddress') }}
|
|
62
|
+
</dt>
|
|
63
|
+
<dd class="mt-2 text-muted">
|
|
64
|
+
<span
|
|
65
|
+
v-for="line in recap.deliveryLines"
|
|
66
|
+
:key="line"
|
|
67
|
+
class="block"
|
|
68
|
+
>{{ line }}</span>
|
|
69
|
+
</dd>
|
|
70
|
+
</div>
|
|
71
|
+
<div v-if="recap.billingLines.length">
|
|
72
|
+
<dt class="font-medium text-highlighted">
|
|
73
|
+
{{ t('orders.detail.billingAddress') }}
|
|
74
|
+
</dt>
|
|
75
|
+
<dd class="mt-2 text-muted">
|
|
76
|
+
<span
|
|
77
|
+
v-for="line in recap.billingLines"
|
|
78
|
+
:key="line"
|
|
79
|
+
class="block"
|
|
80
|
+
>{{ line }}</span>
|
|
81
|
+
</dd>
|
|
82
|
+
</div>
|
|
83
|
+
<div v-if="recap.paymentMethod">
|
|
84
|
+
<dt class="font-medium text-highlighted">
|
|
85
|
+
{{ t('orders.detail.paymentMethodLabel') }}
|
|
86
|
+
</dt>
|
|
87
|
+
<dd class="mt-2 text-muted">
|
|
88
|
+
{{ t(`paymentMethods.${recap.paymentMethod}`) }}
|
|
89
|
+
</dd>
|
|
90
|
+
</div>
|
|
91
|
+
</dl>
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
class="flex justify-between px-4 sm:px-5 py-4 border-t border-(--ui-border)
|
|
95
|
+
text-sm font-semibold text-highlighted"
|
|
96
|
+
>
|
|
97
|
+
<span>{{ t('orders.card.total') }}</span>
|
|
98
|
+
<span class="tabular-nums">{{ formatCurrency(recap.total) }}</span>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</section>
|
|
102
|
+
</template>
|