CustomerTabAddressAndBilling.vue
12.2 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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
<script setup>
import usFlag from '@images/icons/countries/us.png'
import americanExpress from '@images/icons/payments/img/american-express.png'
import mastercard from '@images/icons/payments/img/mastercard.png'
import visa from '@images/icons/payments/img/visa-light.png'
const show = ref([
true,
false,
false,
])
const paymentShow = ref([
true,
false,
false,
])
const isEditAddressDialogVisible = ref(false)
const isCardAddDialogVisible = ref(false)
const isNewEditAddressDialogVisible = ref(false)
const isNewCardAddDialogVisible = ref(false)
const currentCardDetails = {
number: '1234 5678 9012 3456',
name: 'John Doe',
expiry: '12/2028',
cvv: '123',
isPrimary: false,
type: '',
}
const editBillingData = {
firstName: 'Gertrude',
lastName: 'Jennings',
selectedCountry: 'USA',
addressLine1: '100 Water Plant Avenue',
addressLine2: 'Building 1303 Wake Island',
landmark: 'Near Wake Island',
contact: '+1(609) 933-44-22',
country: 'USA',
state: 'Queensland',
zipCode: 403114,
}
const addressData = [
{
title: 'Home',
subtitle: '23 Shatinon Mekalan',
owner: 'Violet Mendoza',
defaultAddress: true,
address: ` 23 Shatinon Mekalan,
<br>
Melbourne, VIC 3000,
<br>
LondonUK`,
},
{
title: 'Office',
subtitle: '45 Rocker Terrace',
owner: 'Violet Mendoza',
defaultAddress: false,
address: ` 45 Rocker Terrace,
<br>
Latheronwheel,
<br>
KW5 8NW, London,
<br>
UK`,
},
{
title: 'Family',
subtitle: '512 Water Plant',
owner: 'Violet Mendoza',
defaultAddress: false,
address: ` 512 Water Plant,
<br>
Melbourne, VIC 3000,
<br>
LondonUK`,
},
]
const paymentData = [
{
title: 'Mastercard',
subtitle: 'Expries Apr 2028',
isDefaultMethod: false,
image: mastercard,
},
{
title: 'American Express',
subtitle: 'Expries Apr 2028',
isDefaultMethod: false,
image: americanExpress,
},
{
title: 'Visa',
subtitle: '45 Roker Terrace',
isDefaultMethod: true,
image: visa,
},
]
</script>
<template>
<!-- eslint-disable vue/no-v-html -->
<!-- 👉 Address Book -->
<VCard class="mb-6">
<VCardText>
<div class="d-flex justify-space-between mb-5 flex-wrap align-center gap-y-4 gap-x-6">
<h5 class="text-h5">
Address Book
</h5>
<VBtn
variant="outlined"
size="small"
@click="isNewEditAddressDialogVisible = !isNewEditAddressDialogVisible"
>
Add new Address
</VBtn>
</div>
<template
v-for="(address, index) in addressData"
:key="index"
>
<div class="d-flex justify-space-between mb-3 gap-y-2 flex-wrap align-center">
<div class="d-flex align-center gap-x-2">
<IconBtn
density="comfortable"
@click="show[index] = !show[index]"
>
<VIcon
:icon="show[index] ? 'ri-arrow-down-s-line' : 'ri-arrow-right-s-line'"
class="flip-in-rtl text-high-emphasis"
/>
</IconBtn>
<div>
<div class="d-flex align-center mb-1">
<h6 class="text-h6 me-2">
{{ address.title }}
</h6>
<VChip
v-if="address.defaultAddress"
color="success"
size="small"
>
Default Address
</VChip>
</div>
<span class="text-body-1">{{ address.subtitle }}</span>
</div>
</div>
<div class="ms-11">
<IconBtn @click="isEditAddressDialogVisible = true">
<VIcon
icon="ri-edit-box-line"
class="flip-in-rtl"
/>
</IconBtn>
<IconBtn>
<VIcon
icon="ri-delete-bin-7-line"
class="flip-in-rtl"
/>
</IconBtn>
<IconBtn>
<VIcon
icon="ri-more-2-fill"
class="flip-in-rtl"
/>
</IconBtn>
</div>
</div>
<VExpandTransition>
<div
v-show="show[index]"
class="ps-12"
>
<div class="mb-1 font-weight-medium text-high-emphasis">
{{ address.owner }}
</div>
<div v-html="address.address" />
</div>
</VExpandTransition>
<VDivider
v-if="index !== addressData.length - 1"
class="my-3"
/>
</template>
</VCardText>
</VCard>
<!-- 👉 Payment Methods -->
<VCard>
<VCardText>
<div class="d-flex justify-space-between mb-5 flex-wrap align-center gap-y-4 gap-x-6">
<h5 class="text-h5">
Payment Methods
</h5>
<VBtn
variant="outlined"
size="small"
@click="isNewCardAddDialogVisible = !isNewCardAddDialogVisible"
>
Add Payment Methods
</VBtn>
</div>
<template
v-for="(payment, index) in paymentData"
:key="index"
>
<div class="d-flex justify-space-between mb-4 gap-y-2 flex-wrap align-center">
<div class="d-flex align-center gap-2">
<IconBtn
density="comfortable"
@click="paymentShow[index] = !paymentShow[index]"
>
<VIcon
:icon="paymentShow[index] ? 'ri-arrow-down-s-line' : 'ri-arrow-right-s-line'"
class="flip-in-rtl text-high-emphasis"
/>
</IconBtn>
<VImg
:src="payment.image"
height="30"
width="50"
class="me-4"
/>
<div>
<div class="d-flex flex-wrap mb-1">
<h6 class="text-h6 me-2">
{{ payment.title }}
</h6>
<VChip
v-if="payment.isDefaultMethod"
color="success"
density="comfortable"
>
Default Method
</VChip>
</div>
<span class="text-body-1">{{ payment.subtitle }}</span>
</div>
</div>
<div class="ms-11">
<IconBtn @click="isCardAddDialogVisible = true">
<VIcon
icon="ri-edit-box-line"
class="flip-in-rtl"
/>
</IconBtn>
<IconBtn>
<VIcon
icon="ri-delete-bin-7-line"
class="flip-in-rtl"
/>
</IconBtn>
<IconBtn>
<VIcon
icon="ri-more-2-fill"
class="flip-in-rtl"
/>
</IconBtn>
</div>
</div>
<VExpandTransition>
<div
v-show="paymentShow[index]"
class="ps-12"
>
<VRow>
<VCol
cols="12"
md="6"
>
<VTable>
<tr>
<td
class="text-sm pb-1"
style="inline-size: 100px;"
>
Name
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
Violet Mendoza
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Number
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
**** 4487
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Expires
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
08/2028
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Type
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
Master Card
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Issuer
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
VICBANK
</td>
</tr>
<tr>
<td class="text-sm pb-1">
ID
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
DH73DJ8
</td>
</tr>
</VTable>
</VCol>
<VCol
cols="12"
md="6"
>
<VTable>
<tr>
<td
class="text-sm pb-1"
style="inline-size: 100px;"
>
Billing
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
United Kingdom
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Number
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
+7634 983 637
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Email
</td>
<td class="text-sm text-high-emphasis font-weight-medium">
vafgot@vultukir.org
</td>
</tr>
<tr>
<td class="text-sm pb-1">
Origin
</td>
<td class="d-flex">
<div class="text-body-2 font-weight-medium text-high-emphasis me-2">
United States
</div>
<img
:src="usFlag"
height="20"
width="20"
>
</td>
</tr>
<tr>
<td class="text-sm pb-1">
CVC
</td>
<td class="d-flex">
<div class="text-body-2 font-weight-medium text-high-emphasis me-2">
Passed
</div>
<VAvatar
variant="tonal"
color="success"
size="20"
inline
>
<VIcon
icon="ri-check-line"
color="success"
size="12"
/>
</VAvatar>
</td>
</tr>
</VTable>
</VCol>
</VRow>
</div>
</VExpandTransition>
<VDivider v-if="index !== paymentData.length - 1" />
</template>
</VCardText>
</VCard>
<AddEditAddressDialog
v-model:isDialogVisible="isEditAddressDialogVisible"
:billing-address="editBillingData"
/>
<AddEditAddressDialog v-model:isDialogVisible="isNewEditAddressDialogVisible" />
<CardAddEditDialog
v-model:isDialogVisible="isCardAddDialogVisible"
:card-details="currentCardDetails"
/>
<CardAddEditDialog v-model:isDialogVisible="isNewCardAddDialogVisible" />
<AddEditAddressDialog
v-model:isDialogVisible="isEditAddressDialogVisible"
:billing-address="editBillingData"
/>
<AddEditAddressDialog v-model:isDialogVisible="isNewEditAddressDialogVisible" />
<CardAddEditDialog
v-model:isDialogVisible="isCardAddDialogVisible"
:card-details="currentCardDetails"
/>
<CardAddEditDialog v-model:isDialogVisible="isNewCardAddDialogVisible" />
</template>