create-deal.vue
3.46 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
<script setup>
import DealDetails from '@/views/wizard-examples/create-deal/DealDetails.vue'
import DealReviewComplete from '@/views/wizard-examples/create-deal/DealReviewComplete.vue'
import CreateDealType from '@/views/wizard-examples/create-deal/DealType.vue'
import DealUsage from '@/views/wizard-examples/create-deal/DealUsage.vue'
const createDealSteps = [
{
title: 'Deal Type',
subtitle: 'Choose type of deal',
},
{
title: 'Deal Details',
subtitle: 'Provide deal details',
},
{
title: 'Deal Usage',
subtitle: 'Limitations & Offers',
},
{
title: 'Review & Complete',
subtitle: 'Launch a deal',
},
]
const currentStep = ref(0)
const createDealData = ref({
dealType: {
Offer: 'percentage',
discount: null,
region: null,
},
dealDetails: {
title: '',
code: '',
description: '',
offeredUItems: [],
cartCondition: null,
dealDuration: '',
notification: {
email: false,
sms: false,
pushNotification: false,
},
},
dealUsage: {
userType: null,
maxUsers: null,
cartAmount: null,
promotionFree: null,
paymentMethod: null,
dealStatus: null,
isSingleUserCustomer: false,
},
dealReviewComplete: { isDealDetailsConfirmed: true },
})
const onSubmit = () => {
console.log('createDealData :>> ', createDealData.value)
}
</script>
<template>
<VCard>
<VRow no-gutters>
<VCol
cols="12"
md="4"
lg="3"
:class="$vuetify.display.mdAndUp ? 'border-e' : 'border-b'"
>
<VCardText>
<AppStepper
v-model:current-step="currentStep"
direction="vertical"
:items="createDealSteps"
/>
</VCardText>
</VCol>
<VCol
cols="12"
md="8"
lg="9"
>
<VCardText>
<VWindow
v-model="currentStep"
class="disable-tab-transition"
>
<VWindowItem>
<CreateDealType v-model:form-data="createDealData.dealType" />
</VWindowItem>
<VWindowItem>
<DealDetails v-model:form-data="createDealData.dealDetails" />
</VWindowItem>
<VWindowItem>
<DealUsage v-model:form-data="createDealData.dealUsage" />
</VWindowItem>
<VWindowItem>
<DealReviewComplete v-model:form-data="createDealData.dealReviewComplete" />
</VWindowItem>
</VWindow>
<div class="d-flex flex-wrap gap-4 justify-space-between mt-6">
<VBtn
color="secondary"
variant="outlined"
:disabled="currentStep === 0"
@click="currentStep--"
>
<VIcon
icon="ri-arrow-left-line"
start
class="flip-in-rtl"
/>
Previous
</VBtn>
<VBtn
v-if="createDealSteps.length - 1 === currentStep"
color="success"
append-icon="ri-check-line"
@click="onSubmit"
>
submit
</VBtn>
<VBtn
v-else
@click="currentStep++"
>
Next
<VIcon
icon="ri-arrow-right-line"
end
class="flip-in-rtl"
/>
</VBtn>
</div>
</VCardText>
</VCol>
</VRow>
</VCard>
</template>