CustomerBioPanel.vue
6.08 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
<script setup>
import rocketImg from '@images/eCommerce/rocket.png'
const props = defineProps({
customerData: {
type: null,
required: true,
},
})
const isUserInfoEditDialogVisible = ref(false)
const isUpgradePlanDialogVisible = ref(false)
const customerData = {
id: props.customerData.id,
fullName: props.customerData.customer,
company: '',
role: '',
username: props.customerData.customer.split(' ')[1],
country: props.customerData.country,
contact: props.customerData.contact,
email: props.customerData.email,
currentPlan: '',
status: props.customerData.status,
avatar: '',
taskDone: null,
projectDone: null,
taxId: 'Tax-8894',
language: 'English',
}
</script>
<template>
<VRow>
<!-- SECTION Customer Details -->
<VCol cols="12">
<VCard v-if="props.customerData">
<VCardText class="text-center pt-15">
<!-- 👉 Avatar -->
<VAvatar
rounded
:size="120"
:color="!props.customerData.customer ? 'primary' : undefined"
:variant="!props.customerData.avatar ? 'tonal' : undefined"
>
<VImg
v-if="props.customerData.avatar"
:src="props.customerData.avatar"
/>
<span
v-else
class="text-5xl font-weight-medium"
>
User Not Availaable
</span>
</VAvatar>
<!-- 👉 Customer fullName -->
<h6 class="text-h5 mt-4">
{{ props.customerData.customer }}
</h6>
<p class="text-body-1 mb-0">
Customer ID #{{ props.customerData.customerId }}
</p>
<div class="d-flex justify-space-evenly gap-x-12 mt-6">
<div class="d-flex align-center">
<VAvatar
variant="tonal"
color="primary"
rounded
class="me-4"
>
<VIcon icon="ri-shopping-cart-line" />
</VAvatar>
<div class="d-flex flex-column align-start">
<h5 class="text-h5">
{{ props.customerData.order }}
</h5>
<span class="text-body-1">Orders</span>
</div>
</div>
<div class="d-flex align-center">
<VAvatar
variant="tonal"
color="primary"
rounded
class="me-4"
>
<VIcon icon="ri-money-dollar-circle-line" />
</VAvatar>
<div class="d-flex flex-column align-start">
<h5 class="text-h5">
{{ Math.round(props.customerData.totalSpent) }}
</h5>
<span class="text-body-1">Spent</span>
</div>
</div>
</div>
</VCardText>
<!-- 👉 Customer Details -->
<VCardText>
<h5 class="text-h5">
Details
</h5>
<VDivider class="my-4" />
<VList class="card-list mt-2">
<VListItem>
<VListItemTitle>
<span class="font-weight-medium me-2">Username:</span>
<span class="text-body-1">
{{ props.customerData.customer }}
</span>
</VListItemTitle>
</VListItem>
<VListItem>
<VListItemTitle>
<span class="font-weight-medium me-2">Billing Email:</span>
<span class="text-body-1">
{{ props.customerData.email }}
</span>
</VListItemTitle>
</VListItem>
<VListItem>
<VListItemTitle>
<span class="font-weight-medium me-2">Status:</span>
<span class="text-body-1">
{{ props.customerData.status }}
</span>
</VListItemTitle>
</VListItem>
<VListItem>
<VListItemTitle>
<span class="font-weight-medium me-2">Contact:</span>
<span class="text-body-1">
{{ props.customerData.contact }}
</span>
</VListItemTitle>
</VListItem>
<VListItem>
<VListItemTitle>
<span class="font-weight-medium me-2">Country:</span>
<span class="text-body-1">
{{ props.customerData.country }}
</span>
</VListItemTitle>
</VListItem>
</VList>
<div class="mt-6 text-center">
<VBtn
block
@click="isUserInfoEditDialogVisible = !isUserInfoEditDialogVisible"
>
Edit Details
</VBtn>
</div>
</VCardText>
</VCard>
</VCol>
<!-- !SECTION -->
<!-- SECTION Upgrade to Premium -->
<VCol cols="12">
<VCard
flat
class="current-plan"
color="primary"
>
<VCardText>
<div class="d-flex align-center">
<div>
<h5 class="text-h5 text-white mb-4">
Upgrade to premium
</h5>
<p class="mb-6 text-wrap">
Upgrade customer to premium membership to access pro features.
</p>
</div>
<div>
<VImg
:src="rocketImg"
height="108"
width="108"
/>
</div>
</div>
<VBtn
color="#fff"
class="text-primary"
block
@click="isUpgradePlanDialogVisible = !isUpgradePlanDialogVisible"
>
Upgrade to Premium
</VBtn>
</VCardText>
</VCard>
</VCol>
<!-- !SECTION -->
</VRow>
<UserInfoEditDialog
v-model:isDialogVisible="isUserInfoEditDialogVisible"
:user-data="customerData"
/>
<UserUpgradePlanDialog v-model:isDialogVisible="isUpgradePlanDialogVisible" />
</template>
<style lang="scss" scoped>
.card-list {
--v-card-list-gap: 0.5rem;
}
</style>