Confirmation.vue
7.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
60
61
62
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
90
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<script setup>
const props = defineProps({
currentStep: {
type: Number,
required: false,
},
checkoutData: {
type: null,
required: true,
},
})
const emit = defineEmits([
'update:currentStep',
'update:checkout-data',
])
const selectedDeliveryAddress = computed(() => {
return props.checkoutData.addresses.filter(address => {
return address.value === props.checkoutData.deliveryAddress
})
})
const resolveDeliveryMethod = computed(() => {
if (props.checkoutData.deliverySpeed === 'overnight')
return {
method: 'Overnight Delivery',
desc: 'In 1 business day.',
}
else if (props.checkoutData.deliverySpeed === 'express')
return {
method: 'Express Delivery',
desc: 'Normally in 3-4 business days',
}
else
return {
method: 'Standard Delivery',
desc: 'Normally in 1 Week',
}
})
</script>
<template>
<section class="text-base">
<div class="text-center">
<h4 class="text-h4 mb-3">
Thank You! 😇
</h4>
<p class="text-body-1">
Your order <span class="text-high-emphasis font-weight-medium">#1536548131</span> has been placed!
</p>
<p class="mb-0">
We sent an email to <span class="text-high-emphasis font-weight-medium">john.doe@example.com</span> with your order confirmation and receipt.
</p>
<p>If the email hasn't arrived within two minutes, please check your spam folder to see if the email was routed there.</p>
<div class="d-flex align-center gap-2 justify-center">
<VIcon
size="20"
icon="ri-time-line"
/>
<span>Time placed: 25/05/2020 13:35pm</span>
</div>
</div>
<VRow class="border rounded ma-0 mt-5">
<VCol
cols="12"
md="4"
class="pa-5"
:class="$vuetify.display.mdAndUp ? 'border-e' : 'border-b'"
>
<div class="d-flex align-center gap-2 text-high-emphasis mb-4">
<VIcon
icon="ri-map-pin-line"
size="20"
/>
<div class="text-h6">
Shipping
</div>
</div>
<template
v-for="item in selectedDeliveryAddress"
:key="item.value"
>
<p class="mb-0">
{{ item.title }}
</p>
<p>
{{ item.desc }}
</p>
<h6 class="text-h6 text-medium-emphasis">
+{{ item.subtitle }}
</h6>
</template>
</VCol>
<VCol
cols="12"
md="4"
class="pa-5"
:class="$vuetify.display.mdAndUp ? 'border-e' : 'border-b'"
>
<div class="d-flex align-center gap-2 text-high-emphasis mb-4">
<VIcon
icon="ri-bank-card-line"
size="20"
/>
<span class="text-base font-weight-medium">
Billing Address
</span>
</div>
<template
v-for="item in selectedDeliveryAddress"
:key="item.value"
>
<p class="mb-0">
{{ item.title }}
</p>
<p>
{{ item.desc }}
</p>
<h6 class="text-h6 text-medium-emphasis">
+{{ item.subtitle }}
</h6>
</template>
</VCol>
<VCol
cols="12"
md="4"
class="pa-5"
>
<div class="d-flex align-center gap-2 text-high-emphasis mb-4">
<VIcon
icon="ri-ship-2-line"
size="20"
/>
<span class="text-base font-weight-medium">
Shipping Method
</span>
</div>
<p class="font-weight-medium">
Preferred Method:
</p>
<p class="mb-0">
{{ resolveDeliveryMethod.method }}
</p>
<p class="mb-0">
( {{ resolveDeliveryMethod.desc }} )
</p>
</VCol>
</VRow>
<VRow>
<VCol
cols="12"
md="9"
>
<!-- 👉 cart items -->
<div class="border rounded">
<template
v-for="(item, index) in props.checkoutData.cartItems"
:key="item.name"
>
<div
class="d-flex align-start gap-3 pa-5 position-relative flex-column flex-sm-row align-center"
:class="index ? 'border-t' : ''"
>
<div>
<VImg
width="80"
:src="item.image"
/>
</div>
<div
class="d-flex w-100"
:class="$vuetify.display.width <= 700 ? 'flex-column' : 'flex-row'"
>
<div>
<h6 class="text-h6 mb-2">
{{ item.name }}
</h6>
<div class="d-flex flex-column align-start text-no-wrap gap-2 text-base">
<div>
<span class="text-body-1 d-inline-block">Sold by:</span> <span class="text-primary text-body-1 d-inline-block">{{ item.seller }}</span>
</div>
<VChip
v-if="index !== props.checkoutData.cartItems.length - 1"
:color="item.inStock ? 'success' : 'error'"
size="small"
>
{{ item.inStock ? 'In Stock' : 'Out of Stock' }}
</VChip>
</div>
</div>
<VSpacer />
<div
class="d-flex flex-column justify-center"
:class="$vuetify.display.width <= 700 ? 'text-start' : 'text-end'"
>
<p class="text-base mb-0">
<span class="text-primary">${{ item.price }}</span>
<span>/</span>
<span class="text-disabled text-decoration-line-through">${{ item.discountPrice }}</span>
</p>
</div>
</div>
</div>
</template>
</div>
</VCol>
<VCol
cols="12"
md="3"
>
<div class="border rounded">
<div class="border-b pa-5">
<h6 class="text-h6 mb-4">
Price Details
</h6>
<div class="d-flex align-center justify-space-between text-sm mb-4">
<div class="text-body-1 text-high-emphasis">
Order Total
</div>
<div class="text-body-1">
${{ props.checkoutData.orderAmount }}.00
</div>
</div>
<div class="d-flex align-center justify-space-between text-sm">
<div class="text-body-1 text-high-emphasis">
Charges
</div>
<div
v-if="props.checkoutData.deliverySpeed === 'free'"
class="d-flex align-center"
>
<div class="me-2 text-body-1 text-disabled">
$5.00
</div>
<VChip
color="success"
size="small"
>
FREE
</VChip>
</div>
<div v-else>
<span>${{ props.checkoutData.deliveryCharges }}</span>
</div>
</div>
</div>
<div class="d-flex align-center justify-space-between text-h6 pa-5">
<span>Total</span>
<span>${{ props.checkoutData.orderAmount + props.checkoutData.deliveryCharges }}.00</span>
</div>
</div>
</VCol>
</VRow>
</section>
</template>