ECommerceWebsiteTransactions.vue
2.86 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
<script setup>
const chartOptions = {
chart: {
type: 'bar',
parentHeightOffset: 0,
toolbar: { show: false },
sparkline: { enabled: true },
},
grid: { show: false },
colors: ['rgba(var(--v-theme-primary))'],
plotOptions: {
bar: {
barHeight: '85%',
columnWidth: '7px',
borderRadius: 3,
distributed: true,
},
},
legend: { show: false },
dataLabels: { enabled: false },
xaxis: {
labels: { show: false },
axisBorder: { show: false },
axisTicks: { show: false },
},
yaxis: { show: false },
tooltip: { enabled: false },
}
const series = [{
name: '2020',
data: [
50,
40,
110,
80,
40,
60,
40,
],
}]
const websiteStatistics = [
{
title: 'Direct',
color: 'success',
traffic: '86,471',
percentage: '-15',
},
{
title: 'Organic Search',
color: 'primary',
traffic: '57,484',
percentage: '+85',
},
{
title: 'Referral',
color: 'warning',
traffic: '2,534',
percentage: '+48',
},
{
title: 'Mail',
color: 'error',
traffic: '977',
percentage: '-36',
},
]
</script>
<template>
<VCard>
<VCardItem class="position-relative">
<VCardTitle>Transactions</VCardTitle>
<template #append>
<div class="me-n3">
<MoreBtn />
</div>
</template>
</VCardItem>
<VCardText>
<div class="d-flex align-center justify-space-between">
<div>
<h1 class="text-h1 mb-2">
4,590
</h1>
<div class="text-body-2">
Total Traffic
</div>
</div>
<div>
<VueApexCharts
:options="chartOptions"
:series="series"
height="80"
width="120"
/>
</div>
</div>
</VCardText>
<VCardText>
<div
v-for="(data, index) in websiteStatistics"
:key="data.title"
>
<div class="d-flex py-3 align-center">
<div
class="bubble"
:class="`bg-${data.color}`"
/>
<div class="text-body-1 text-high-emphasis">
{{ data.title }}
</div>
<VSpacer />
<h6 class="text-h6 me-8">
{{ data.traffic }}
</h6>
<h6 class="text-h6 me-2">
{{ data.percentage.slice(1) }}%
</h6>
<VIcon
:size="24"
:color="data.percentage.charAt(0) === '+' ? 'success' : 'error'"
>
{{ data.percentage.charAt(0) === '+' ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line' }}
</VIcon>
</div>
<VDivider v-if="index !== websiteStatistics.length - 1" />
</div>
</VCardText>
</VCard>
</template>
<style lang="scss" scoped>
.bubble {
border-radius: 50%;
block-size: 1rem;
inline-size: 1rem;
margin-inline-end: 0.5rem;
}
</style>