checkout.vue
3.97 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
<script setup>
import Footer from '@/views/front-pages/front-page-footer.vue'
import Navbar from '@/views/front-pages/front-page-navbar.vue'
import AddressContent from '@/views/wizard-examples/checkout/Address.vue'
import CartContent from '@/views/wizard-examples/checkout/Cart.vue'
import ConfirmationContent from '@/views/wizard-examples/checkout/Confirmation.vue'
import PaymentContent from '@/views/wizard-examples/checkout/Payment.vue'
import googleHome from '@images/pages/google-home.png'
import iphone11 from '@images/pages/iphone-11.png'
import customAddress from '@images/svg/address.svg'
import customCart from '@images/svg/cart.svg'
import customPayment from '@images/svg/payment.svg'
import customTrending from '@images/svg/trending.svg'
import { useConfigStore } from '@core/stores/config'
definePage({
meta: {
layout: 'blank',
public: true,
},
})
const store = useConfigStore()
store.skin = 'default'
const checkoutSteps = [
{
title: 'Cart',
icon: customCart,
},
{
title: 'Address',
icon: customAddress,
},
{
title: 'Payment',
icon: customPayment,
},
{
title: 'Confirmation',
icon: customTrending,
},
]
const checkoutData = ref({
cartItems: [
{
id: 1,
name: 'Google - Google Home - White',
seller: 'Google',
inStock: true,
rating: 4,
price: 299,
discountPrice: 359,
image: googleHome,
quantity: 1,
estimatedDelivery: '18th Nov 2021',
},
{
id: 2,
name: 'Apple iPhone 11 (64GB, Black)',
seller: 'Apple',
inStock: true,
rating: 4,
price: 899,
discountPrice: 999,
image: iphone11,
quantity: 1,
estimatedDelivery: '20th Nov 2021',
},
],
promoCode: '',
orderAmount: 1198,
deliveryAddress: 'home',
deliverySpeed: 'free',
deliveryCharges: 0,
addresses: [
{
title: 'John Doe (Default)',
desc: '4135 Parkway Street, Los Angeles, CA, 90017',
subtitle: '1234567890',
value: 'home',
},
{
title: 'ACME Inc.',
desc: '87 Hoffman Avenue, New York, NY, 10016',
subtitle: '1234567890',
value: 'office',
},
],
})
const currentStep = ref(0)
</script>
<template>
<div class="checkout-page">
<Navbar />
<VContainer>
<div class="checkout-card">
<VCard>
<VCardText>
<!-- 👉 Stepper -->
<AppStepper
v-model:current-step="currentStep"
class="checkout-stepper"
:items="checkoutSteps"
:direction="$vuetify.display.mdAndUp ? 'horizontal' : 'vertical'"
align="center"
/>
</VCardText>
<VDivider />
<VCardText>
<!-- 👉 stepper content -->
<VWindow
v-model="currentStep"
class="disable-tab-transition"
:touch="false"
>
<VWindowItem>
<CartContent
v-model:current-step="currentStep"
v-model:checkout-data="checkoutData"
/>
</VWindowItem>
<VWindowItem>
<AddressContent
v-model:current-step="currentStep"
v-model:checkout-data="checkoutData"
/>
</VWindowItem>
<VWindowItem>
<PaymentContent
v-model:current-step="currentStep"
v-model:checkout-data="checkoutData"
/>
</VWindowItem>
<VWindowItem>
<ConfirmationContent v-model:checkout-data="checkoutData" />
</VWindowItem>
</VWindow>
</VCardText>
</VCard>
</div>
</VContainer>
<Footer />
</div>
</template>
<style lang="scss">
.checkout-card {
margin-block: 9.25rem 5.25rem;
}
@media (max-width: 960px) and (min-width: 600px) {
.checkout-page {
.v-container {
padding-inline: 2rem !important;
}
}
}
</style>