first commit
This commit is contained in:
293
resources/js/views/wizard-examples/checkout/Address.vue
Normal file
293
resources/js/views/wizard-examples/checkout/Address.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
currentStep: {
|
||||
type: Number,
|
||||
required: false,
|
||||
},
|
||||
checkoutData: {
|
||||
type: null,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:currentStep',
|
||||
'update:checkout-data',
|
||||
])
|
||||
|
||||
const checkoutAddressDataLocal = ref(props.checkoutData)
|
||||
const isEditAddressDialogVisible = ref(false)
|
||||
|
||||
const deliveryOptions = [
|
||||
{
|
||||
icon: 'ri-user-line',
|
||||
title: 'Standard',
|
||||
desc: 'Get your product in 1 Week.',
|
||||
value: 'free',
|
||||
},
|
||||
{
|
||||
icon: 'ri-star-smile-line',
|
||||
title: 'Express',
|
||||
desc: 'Get your product in 3-4 days.',
|
||||
value: 'express',
|
||||
},
|
||||
{
|
||||
icon: 'ri-vip-crown-line',
|
||||
title: 'Overnight',
|
||||
desc: 'Get your product in 1 day.',
|
||||
value: 'overnight',
|
||||
},
|
||||
]
|
||||
|
||||
const resolveAddressBadgeColor = {
|
||||
home: 'primary',
|
||||
office: 'success',
|
||||
}
|
||||
|
||||
const resolveDeliveryBadgeData = {
|
||||
free: {
|
||||
color: 'success',
|
||||
price: 'Free',
|
||||
},
|
||||
express: {
|
||||
color: 'secondary',
|
||||
price: 10,
|
||||
},
|
||||
overnight: {
|
||||
color: 'secondary',
|
||||
price: 15,
|
||||
},
|
||||
}
|
||||
|
||||
const totalPriceWithDeliveryCharges = computed(() => {
|
||||
checkoutAddressDataLocal.value.deliveryCharges = 0
|
||||
if (checkoutAddressDataLocal.value.deliverySpeed !== 'free')
|
||||
checkoutAddressDataLocal.value.deliveryCharges = resolveDeliveryBadgeData[checkoutAddressDataLocal.value.deliverySpeed].price
|
||||
|
||||
return checkoutAddressDataLocal.value.orderAmount + checkoutAddressDataLocal.value.deliveryCharges
|
||||
})
|
||||
|
||||
const updateAddressData = () => {
|
||||
emit('update:checkout-data', checkoutAddressDataLocal.value)
|
||||
}
|
||||
|
||||
const nextStep = () => {
|
||||
updateAddressData()
|
||||
emit('update:currentStep', props.currentStep ? props.currentStep + 1 : 1)
|
||||
}
|
||||
|
||||
watch(() => props.currentStep, updateAddressData)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="8"
|
||||
>
|
||||
<!-- 👉 Address options -->
|
||||
<div class="text-body-1 text-high-emphasis font-weight-medium mb-4">
|
||||
Select your preferable address
|
||||
</div>
|
||||
|
||||
<!-- 👉 Address custom input -->
|
||||
<CustomRadios
|
||||
v-model:selected-radio="checkoutAddressDataLocal.deliveryAddress"
|
||||
:radio-content="checkoutAddressDataLocal.addresses"
|
||||
:grid-column="{ cols: '12', sm: '6' }"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="w-100">
|
||||
<div class="d-flex justify-space-between mb-4">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
|
||||
<VChip
|
||||
:color="resolveAddressBadgeColor[item.value]"
|
||||
size="small"
|
||||
class="text-capitalize"
|
||||
>
|
||||
{{ item.value }}
|
||||
</VChip>
|
||||
</div>
|
||||
|
||||
<p class="text-body-2 mb-0">
|
||||
{{ item.desc }}
|
||||
</p>
|
||||
<p class="text-body-2 mb-0">
|
||||
Mobile: {{ item.subtitle }}
|
||||
</p>
|
||||
<p class="text-body-2 mb-3">
|
||||
Cash/Card on delivery available
|
||||
</p>
|
||||
|
||||
<VDivider class="pb-2" />
|
||||
|
||||
<div class="d-flex gap-x-4 py-2">
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
class="text-base"
|
||||
>Edit</a>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
class="text-base"
|
||||
>Remove</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CustomRadios>
|
||||
|
||||
<!-- 👉 Add New Address -->
|
||||
<VBtn
|
||||
variant="outlined"
|
||||
class="mt-4 mb-6"
|
||||
size="small"
|
||||
@click="isEditAddressDialogVisible = !isEditAddressDialogVisible"
|
||||
>
|
||||
Add New Address
|
||||
</VBtn>
|
||||
|
||||
<!-- 👉 Delivery options -->
|
||||
<div class="text-body-1 text-high-emphasis font-weight-medium mb-4">
|
||||
Choose Delivery Speed
|
||||
</div>
|
||||
|
||||
<!-- 👉 Delivery options custom input -->
|
||||
<CustomRadiosWithIcon
|
||||
v-model:selected-radio="checkoutAddressDataLocal.deliverySpeed"
|
||||
:radio-content="deliveryOptions"
|
||||
:grid-column="{ cols: '12', sm: '4' }"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="d-flex flex-column align-center gap-2 w-100">
|
||||
<div class="d-flex justify-end w-100 mb-n3">
|
||||
<VChip
|
||||
:color="resolveDeliveryBadgeData[item.value].color"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
resolveDeliveryBadgeData[item.value].price === 'Free'
|
||||
? resolveDeliveryBadgeData[item.value].price : `$${resolveDeliveryBadgeData[item.value].price}`
|
||||
}}
|
||||
</VChip>
|
||||
</div>
|
||||
|
||||
<VIcon
|
||||
size="28"
|
||||
:icon="item.icon"
|
||||
class="text-high-emphasis"
|
||||
/>
|
||||
|
||||
<h6 class="text-h6">
|
||||
{{ item.title }}
|
||||
</h6>
|
||||
<p class="text-body-2 mb-0">
|
||||
{{ item.desc }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</CustomRadiosWithIcon>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VCard
|
||||
flat
|
||||
variant="outlined"
|
||||
>
|
||||
<!-- 👉 Delivery estimate date -->
|
||||
<VCardText>
|
||||
<h6 class="text-h6 mb-4">
|
||||
Estimated Delivery Date
|
||||
</h6>
|
||||
|
||||
<VList class="card-list">
|
||||
<VListItem
|
||||
v-for="product in checkoutAddressDataLocal.cartItems"
|
||||
:key="product.name"
|
||||
>
|
||||
<template #prepend>
|
||||
<VImg
|
||||
width="54"
|
||||
height="70"
|
||||
:src="product.image"
|
||||
class="me-2"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<div class="text-body-1">
|
||||
{{ product.name }}
|
||||
</div>
|
||||
<div class="text-body-1 font-weight-medium">
|
||||
{{ product.estimatedDelivery }}
|
||||
</div>
|
||||
</VListItem>
|
||||
</VList>
|
||||
</VCardText>
|
||||
|
||||
<VDivider />
|
||||
|
||||
<!-- 👉 Price details -->
|
||||
<VCardText>
|
||||
<h6 class="text-h6 mb-4">
|
||||
Price Details
|
||||
</h6>
|
||||
|
||||
<div class="d-flex align-center justify-space-between text-sm mb-2">
|
||||
<div class="text-high-emphasis text-body-1">
|
||||
Order Total
|
||||
</div>
|
||||
<div class="text-body-1">
|
||||
${{ checkoutAddressDataLocal.orderAmount }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Delivery Charges
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-x-2">
|
||||
<div class="text-body-1 text-disabled">
|
||||
$5.00
|
||||
</div>
|
||||
<VChip
|
||||
size="small"
|
||||
color="success"
|
||||
>
|
||||
Free
|
||||
</VChip>
|
||||
</div>
|
||||
</div>
|
||||
</VCardText>
|
||||
|
||||
<VDivider />
|
||||
|
||||
<VCardText class="d-flex align-center justify-space-between text-high-emphasis">
|
||||
<span class="text-base font-weight-medium">Total</span>
|
||||
<span class="text-base font-weight-medium">
|
||||
${{ totalPriceWithDeliveryCharges }}
|
||||
</span>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
|
||||
<VBtn
|
||||
block
|
||||
class="mt-4"
|
||||
@click="nextStep"
|
||||
>
|
||||
Place Order
|
||||
</VBtn>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<AddEditAddressDialog v-model:isDialogVisible="isEditAddressDialogVisible" />
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card-list {
|
||||
--v-card-list-gap: 16px;
|
||||
}
|
||||
</style>
|
320
resources/js/views/wizard-examples/checkout/Cart.vue
Normal file
320
resources/js/views/wizard-examples/checkout/Cart.vue
Normal file
@@ -0,0 +1,320 @@
|
||||
<script setup>
|
||||
import emptyCartImg from '@images/pages/empty-cart.png'
|
||||
|
||||
const props = defineProps({
|
||||
currentStep: {
|
||||
type: Number,
|
||||
required: false,
|
||||
},
|
||||
checkoutData: {
|
||||
type: null,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:currentStep',
|
||||
'update:checkout-data',
|
||||
])
|
||||
|
||||
const checkoutCartDataLocal = ref(props.checkoutData)
|
||||
|
||||
const removeItem = item => {
|
||||
checkoutCartDataLocal.value.cartItems = checkoutCartDataLocal.value.cartItems.filter(i => i.id !== item.id)
|
||||
}
|
||||
|
||||
const totalCost = computed(() => {
|
||||
return checkoutCartDataLocal.value.orderAmount = checkoutCartDataLocal.value.cartItems.reduce((acc, item) => {
|
||||
return acc + item.price * item.quantity
|
||||
}, 0)
|
||||
})
|
||||
|
||||
const updateCartData = () => {
|
||||
emit('update:checkout-data', checkoutCartDataLocal.value)
|
||||
}
|
||||
|
||||
const nextStep = () => {
|
||||
updateCartData()
|
||||
emit('update:currentStep', props.currentStep ? props.currentStep + 1 : 1)
|
||||
}
|
||||
|
||||
watch(() => props.currentStep, updateCartData)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow v-if="checkoutCartDataLocal">
|
||||
<VCol
|
||||
cols="12"
|
||||
md="8"
|
||||
>
|
||||
<!-- 👉 Offers alert -->
|
||||
<VAlert
|
||||
color="success"
|
||||
variant="tonal"
|
||||
icon="ri-percent-line"
|
||||
closable
|
||||
>
|
||||
<VAlertTitle class="text-success mb-1">
|
||||
Available Offers
|
||||
</VAlertTitle>
|
||||
|
||||
<p class="mb-0">
|
||||
- 0% Instant Discount on Bank of America Corp Bank Debit and Credit cards
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
- 50% Cashback Voucher of up to $60 on first ever PayPal transaction. TCA
|
||||
</p>
|
||||
</VAlert>
|
||||
|
||||
<h5 class="text-h5 my-4">
|
||||
My Shopping Bag ({{ checkoutCartDataLocal.cartItems.length }} Items)
|
||||
</h5>
|
||||
|
||||
<!-- 👉 Cart items -->
|
||||
<div
|
||||
v-if="checkoutCartDataLocal.cartItems.length"
|
||||
class="border rounded"
|
||||
>
|
||||
<template
|
||||
v-for="(item, index) in checkoutCartDataLocal.cartItems"
|
||||
:key="item.name"
|
||||
>
|
||||
<div
|
||||
class="d-flex align-center gap-3 pa-5 position-relative flex-column flex-sm-row"
|
||||
:class="index ? 'border-t' : ''"
|
||||
>
|
||||
<IconBtn
|
||||
size="x-small"
|
||||
class="checkout-item-remove-btn"
|
||||
color="disabled"
|
||||
@click="removeItem(item)"
|
||||
>
|
||||
<VIcon
|
||||
size="18"
|
||||
icon="ri-close-line"
|
||||
/>
|
||||
</IconBtn>
|
||||
|
||||
<div>
|
||||
<VImg
|
||||
width="140"
|
||||
:src="item.image"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="d-flex w-100"
|
||||
:class="(($vuetify.display.width <= 1280 && $vuetify.display.width >= 960) || $vuetify.display.width <= 700) ? 'flex-column' : 'flex-row'"
|
||||
>
|
||||
<div>
|
||||
<h6 class="text-h6 mb-2">
|
||||
{{ item.name }}
|
||||
</h6>
|
||||
<div class="d-flex align-center text-no-wrap gap-2 text-base">
|
||||
<span class="text-disabled">Sold by:</span>
|
||||
<span class="text-primary">{{ item.seller }}</span>
|
||||
<VChip
|
||||
:color="item.inStock ? 'success' : 'error'"
|
||||
size="small"
|
||||
>
|
||||
{{ item.inStock ? 'In Stock' : 'Out of Stock' }}
|
||||
</VChip>
|
||||
</div>
|
||||
|
||||
<div class="my-2">
|
||||
<VRating
|
||||
:model-value="item.rating"
|
||||
size="24"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<VTextField
|
||||
v-model="item.quantity"
|
||||
type="number"
|
||||
density="compact"
|
||||
style="inline-size: 7.5rem;"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<VSpacer />
|
||||
|
||||
<div
|
||||
class="d-flex flex-column mt-5"
|
||||
:class="(($vuetify.display.width <= 1280 && $vuetify.display.width >= 960) || $vuetify.display.width <= 700) ? 'text-start' : 'text-end'"
|
||||
>
|
||||
<p class="text-base">
|
||||
<span class="text-primary">${{ item.price }}</span>
|
||||
<span>/</span>
|
||||
<span class="text-decoration-line-through">${{ item.discountPrice }}</span>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<VBtn
|
||||
size="small"
|
||||
variant="outlined"
|
||||
>
|
||||
move to wishlist
|
||||
</VBtn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- 👉 Empty Cart -->
|
||||
<div v-else>
|
||||
<VImg :src="emptyCartImg" />
|
||||
</div>
|
||||
|
||||
<!-- 👉 Add more from wishlist -->
|
||||
<div
|
||||
class="d-flex align-center justify-space-between border rounded px-5 text-base mt-4"
|
||||
style="padding-block:7px"
|
||||
>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
class="font-weight-medium"
|
||||
>Add more products from wishlist</a>
|
||||
<VIcon
|
||||
icon="ri-arrow-right-line"
|
||||
class="flip-in-rtl"
|
||||
size="16"
|
||||
color="primary"
|
||||
/>
|
||||
</div>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VCard
|
||||
flat
|
||||
variant="outlined"
|
||||
>
|
||||
<!-- 👉 payment offer -->
|
||||
<VCardText>
|
||||
<h6 class="text-h6 mb-4">
|
||||
Offer
|
||||
</h6>
|
||||
|
||||
<div class="d-flex align-center gap-4">
|
||||
<VTextField
|
||||
v-model="checkoutCartDataLocal.promoCode"
|
||||
placeholder="Enter Promo Code"
|
||||
density="compact"
|
||||
/>
|
||||
|
||||
<VBtn
|
||||
variant="outlined"
|
||||
@click="updateCartData"
|
||||
>
|
||||
Apply
|
||||
</VBtn>
|
||||
</div>
|
||||
|
||||
<!-- 👉 Gift wrap banner -->
|
||||
<div class="bg-var-theme-background rounded pa-5 mt-4">
|
||||
<h6 class="text-h6">
|
||||
Buying gift for a loved one?
|
||||
</h6>
|
||||
|
||||
<p class="my-2 text-body-1">
|
||||
Gift wrap and personalized message on card, Only for $2.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
class="font-weight-medium d-inline-block"
|
||||
>Add a gift wrap</a>
|
||||
</div>
|
||||
</VCardText>
|
||||
|
||||
<VDivider />
|
||||
|
||||
<!-- 👉 Price details -->
|
||||
<VCardText>
|
||||
<h6 class="text-h6 mb-4">
|
||||
Price Details
|
||||
</h6>
|
||||
|
||||
<div class="text-sm text-high-emphasis">
|
||||
<div class="d-flex justify-space-between mb-2">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Bag Total
|
||||
</div>
|
||||
<div class="text-body-1">
|
||||
${{ totalCost }}.00
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between mb-2">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Coupon Discount
|
||||
</div>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
class="text-base d-inline-block"
|
||||
>Apply Coupon</a>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between mb-2">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Order Total
|
||||
</div>
|
||||
<div class="text-body-1">
|
||||
${{ totalCost }}.00
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Delivery Charges
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-x-2">
|
||||
<div class="text-decoration-line-through text-body-1 text-disabled">
|
||||
$5.00
|
||||
</div>
|
||||
<VChip
|
||||
size="small"
|
||||
color="success"
|
||||
>
|
||||
Free
|
||||
</VChip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</VCardText>
|
||||
|
||||
<VDivider />
|
||||
|
||||
<VCardText class="d-flex justify-space-between py-4">
|
||||
<h6 class="text-h6">
|
||||
Total
|
||||
</h6>
|
||||
<h6 class="text-h6">
|
||||
${{ totalCost }}.00
|
||||
</h6>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
|
||||
<VBtn
|
||||
block
|
||||
class="mt-4"
|
||||
@click="nextStep"
|
||||
>
|
||||
Place Order
|
||||
</VBtn>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.checkout-item-remove-btn {
|
||||
position: absolute;
|
||||
inset-block-start: 10px;
|
||||
inset-inline-end: 10px;
|
||||
}
|
||||
</style>
|
271
resources/js/views/wizard-examples/checkout/Confirmation.vue
Normal file
271
resources/js/views/wizard-examples/checkout/Confirmation.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
currentStep: {
|
||||
type: Number,
|
||||
required: false,
|
||||
},
|
||||
checkoutData: {
|
||||
type: null,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:currentStep',
|
||||
'update:checkout-data',
|
||||
])
|
||||
|
||||
const selectedDeliveryAddress = computed(() => {
|
||||
return props.checkoutData.addresses.filter(address => {
|
||||
return address.value === props.checkoutData.deliveryAddress
|
||||
})
|
||||
})
|
||||
|
||||
const resolveDeliveryMethod = computed(() => {
|
||||
if (props.checkoutData.deliverySpeed === 'overnight')
|
||||
return {
|
||||
method: 'Overnight Delivery',
|
||||
desc: 'In 1 business day.',
|
||||
}
|
||||
else if (props.checkoutData.deliverySpeed === 'express')
|
||||
return {
|
||||
method: 'Express Delivery',
|
||||
desc: 'Normally in 3-4 business days',
|
||||
}
|
||||
else
|
||||
return {
|
||||
method: 'Standard Delivery',
|
||||
desc: 'Normally in 1 Week',
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="text-base">
|
||||
<div class="text-center">
|
||||
<h4 class="text-h4 mb-3">
|
||||
Thank You! 😇
|
||||
</h4>
|
||||
<p class="text-body-1">
|
||||
Your order <span class="text-high-emphasis font-weight-medium">#1536548131</span> has been placed!
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
We sent an email to <span class="text-high-emphasis font-weight-medium">john.doe@example.com</span> with your order confirmation and receipt.
|
||||
</p>
|
||||
<p>If the email hasn't arrived within two minutes, please check your spam folder to see if the email was routed there.</p>
|
||||
<div class="d-flex align-center gap-2 justify-center">
|
||||
<VIcon
|
||||
size="20"
|
||||
icon="ri-time-line"
|
||||
/>
|
||||
<span>Time placed: 25/05/2020 13:35pm</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<VRow class="border rounded ma-0 mt-5">
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
class="pa-5"
|
||||
:class="$vuetify.display.mdAndUp ? 'border-e' : 'border-b'"
|
||||
>
|
||||
<div class="d-flex align-center gap-2 text-high-emphasis mb-4">
|
||||
<VIcon
|
||||
icon="ri-map-pin-line"
|
||||
size="20"
|
||||
/>
|
||||
<div class="text-h6">
|
||||
Shipping
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template
|
||||
v-for="item in selectedDeliveryAddress"
|
||||
:key="item.value"
|
||||
>
|
||||
<p class="mb-0">
|
||||
{{ item.title }}
|
||||
</p>
|
||||
<p>
|
||||
{{ item.desc }}
|
||||
</p>
|
||||
|
||||
<h6 class="text-h6 text-medium-emphasis">
|
||||
+{{ item.subtitle }}
|
||||
</h6>
|
||||
</template>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
class="pa-5"
|
||||
:class="$vuetify.display.mdAndUp ? 'border-e' : 'border-b'"
|
||||
>
|
||||
<div class="d-flex align-center gap-2 text-high-emphasis mb-4">
|
||||
<VIcon
|
||||
icon="ri-bank-card-line"
|
||||
size="20"
|
||||
/>
|
||||
<span class="text-base font-weight-medium">
|
||||
Billing Address
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<template
|
||||
v-for="item in selectedDeliveryAddress"
|
||||
:key="item.value"
|
||||
>
|
||||
<p class="mb-0">
|
||||
{{ item.title }}
|
||||
</p>
|
||||
<p>
|
||||
{{ item.desc }}
|
||||
</p>
|
||||
|
||||
<h6 class="text-h6 text-medium-emphasis">
|
||||
+{{ item.subtitle }}
|
||||
</h6>
|
||||
</template>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
class="pa-5"
|
||||
>
|
||||
<div class="d-flex align-center gap-2 text-high-emphasis mb-4">
|
||||
<VIcon
|
||||
icon="ri-ship-2-line"
|
||||
size="20"
|
||||
/>
|
||||
<span class="text-base font-weight-medium">
|
||||
Shipping Method
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<p class="font-weight-medium">
|
||||
Preferred Method:
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
{{ resolveDeliveryMethod.method }}
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
( {{ resolveDeliveryMethod.desc }} )
|
||||
</p>
|
||||
</VCol>
|
||||
</VRow>
|
||||
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="9"
|
||||
>
|
||||
<!-- 👉 cart items -->
|
||||
<div class="border rounded">
|
||||
<template
|
||||
v-for="(item, index) in props.checkoutData.cartItems"
|
||||
:key="item.name"
|
||||
>
|
||||
<div
|
||||
class="d-flex align-start gap-3 pa-5 position-relative flex-column flex-sm-row align-center"
|
||||
:class="index ? 'border-t' : ''"
|
||||
>
|
||||
<div>
|
||||
<VImg
|
||||
width="80"
|
||||
:src="item.image"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="d-flex w-100"
|
||||
:class="$vuetify.display.width <= 700 ? 'flex-column' : 'flex-row'"
|
||||
>
|
||||
<div>
|
||||
<h6 class="text-h6 mb-2">
|
||||
{{ item.name }}
|
||||
</h6>
|
||||
<div class="d-flex flex-column align-start text-no-wrap gap-2 text-base">
|
||||
<div>
|
||||
<span class="text-body-1 d-inline-block">Sold by:</span> <span class="text-primary text-body-1 d-inline-block">{{ item.seller }}</span>
|
||||
</div>
|
||||
<VChip
|
||||
v-if="index !== props.checkoutData.cartItems.length - 1"
|
||||
:color="item.inStock ? 'success' : 'error'"
|
||||
size="small"
|
||||
>
|
||||
{{ item.inStock ? 'In Stock' : 'Out of Stock' }}
|
||||
</VChip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<VSpacer />
|
||||
|
||||
<div
|
||||
class="d-flex flex-column justify-center"
|
||||
:class="$vuetify.display.width <= 700 ? 'text-start' : 'text-end'"
|
||||
>
|
||||
<p class="text-base mb-0">
|
||||
<span class="text-primary">${{ item.price }}</span>
|
||||
<span>/</span>
|
||||
<span class="text-disabled text-decoration-line-through">${{ item.discountPrice }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="3"
|
||||
>
|
||||
<div class="border rounded">
|
||||
<div class="border-b pa-5">
|
||||
<h6 class="text-h6 mb-4">
|
||||
Price Details
|
||||
</h6>
|
||||
|
||||
<div class="d-flex align-center justify-space-between text-sm mb-4">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Order Total
|
||||
</div>
|
||||
<div class="text-body-1">
|
||||
${{ props.checkoutData.orderAmount }}.00
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-center justify-space-between text-sm">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Charges
|
||||
</div>
|
||||
<div
|
||||
v-if="props.checkoutData.deliverySpeed === 'free'"
|
||||
class="d-flex align-center"
|
||||
>
|
||||
<div class="me-2 text-body-1 text-disabled">
|
||||
$5.00
|
||||
</div>
|
||||
<VChip
|
||||
color="success"
|
||||
size="small"
|
||||
>
|
||||
FREE
|
||||
</VChip>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span>${{ props.checkoutData.deliveryCharges }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-center justify-space-between text-h6 pa-5">
|
||||
<span>Total</span>
|
||||
<span>${{ props.checkoutData.orderAmount + props.checkoutData.deliveryCharges }}.00</span>
|
||||
</div>
|
||||
</div>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</section>
|
||||
</template>
|
322
resources/js/views/wizard-examples/checkout/Payment.vue
Normal file
322
resources/js/views/wizard-examples/checkout/Payment.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
currentStep: {
|
||||
type: Number,
|
||||
required: false,
|
||||
},
|
||||
checkoutData: {
|
||||
type: null,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:currentStep',
|
||||
'update:checkout-data',
|
||||
])
|
||||
|
||||
const prop = __props
|
||||
const checkoutPaymentDataLocal = ref(prop.checkoutData)
|
||||
const selectedPaymentMethod = ref('card')
|
||||
|
||||
const cardFormData = ref({
|
||||
cardNumber: null,
|
||||
cardName: '',
|
||||
cardExpiry: '',
|
||||
cardCvv: null,
|
||||
isCardSave: true,
|
||||
})
|
||||
|
||||
const giftCardFormData = ref({
|
||||
giftCardNumber: null,
|
||||
giftCardPin: null,
|
||||
})
|
||||
|
||||
const selectedDeliveryAddress = computed(() => {
|
||||
return checkoutPaymentDataLocal.value.addresses.filter(address => {
|
||||
return address.value === checkoutPaymentDataLocal.value.deliveryAddress
|
||||
})
|
||||
})
|
||||
|
||||
const updateCartData = () => {
|
||||
emit('update:checkout-data', checkoutPaymentDataLocal.value)
|
||||
}
|
||||
|
||||
const nextStep = () => {
|
||||
updateCartData()
|
||||
emit('update:currentStep', prop.currentStep ? prop.currentStep + 1 : 1)
|
||||
}
|
||||
|
||||
watch(() => prop.currentStep, updateCartData)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
md="8"
|
||||
>
|
||||
<!-- 👉 Offers alert -->
|
||||
<VAlert
|
||||
color="success"
|
||||
variant="tonal"
|
||||
icon="ri-percent-line"
|
||||
closable
|
||||
class="mb-6"
|
||||
>
|
||||
<VAlertTitle class="text-success mb-1">
|
||||
Available Offers
|
||||
</VAlertTitle>
|
||||
|
||||
<p class="mb-0">
|
||||
- 10% Instant Discount on Bank of America Corp Bank Debit and Credit cards
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
- 25% Cashback Voucher of up to $60 on first ever PayPal transaction. TCA
|
||||
</p>
|
||||
</VAlert>
|
||||
|
||||
<VTabs
|
||||
v-model="selectedPaymentMethod"
|
||||
class="v-tabs-pill"
|
||||
>
|
||||
<VTab value="card">
|
||||
Card
|
||||
</VTab>
|
||||
<VTab value="cash-on-delivery">
|
||||
Cash on Delivery
|
||||
</VTab>
|
||||
<VTab value="gift-card">
|
||||
Gift Card
|
||||
</VTab>
|
||||
</VTabs>
|
||||
|
||||
<VWindow
|
||||
v-model="selectedPaymentMethod"
|
||||
class="pt-6"
|
||||
style="max-inline-size: 600px;"
|
||||
>
|
||||
<VWindowItem value="card">
|
||||
<VForm>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VTextField
|
||||
v-model="cardFormData.cardNumber"
|
||||
type="number"
|
||||
label="Card Number"
|
||||
placeholder="1234 5678 9012 3456"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<VTextField
|
||||
v-model="cardFormData.cardName"
|
||||
label="Name"
|
||||
placeholder="John Doe"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="6"
|
||||
md="3"
|
||||
>
|
||||
<VTextField
|
||||
v-model="cardFormData.cardExpiry"
|
||||
label="Expiry"
|
||||
placeholder="MM/YY"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="6"
|
||||
md="3"
|
||||
>
|
||||
<VTextField
|
||||
v-model="cardFormData.cardCvv"
|
||||
label="CVV"
|
||||
placeholder="123"
|
||||
type="number"
|
||||
>
|
||||
<template #append-inner>
|
||||
<VTooltip
|
||||
text="Card Verification Value"
|
||||
location="bottom"
|
||||
>
|
||||
<template #activator="{ props: tooltipProps }">
|
||||
<VIcon
|
||||
v-bind="tooltipProps"
|
||||
size="20"
|
||||
icon="ri-question-line"
|
||||
/>
|
||||
</template>
|
||||
</VTooltip>
|
||||
</template>
|
||||
</VTextField>
|
||||
</VCol>
|
||||
|
||||
<VCol cols="12">
|
||||
<VSwitch
|
||||
v-model="cardFormData.isCardSave"
|
||||
label="Save Card for future billing?"
|
||||
/>
|
||||
|
||||
<div class="mt-4">
|
||||
<VBtn
|
||||
class="me-4"
|
||||
@click="nextStep"
|
||||
>
|
||||
Save Changes
|
||||
</VBtn>
|
||||
<VBtn
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
>
|
||||
Reset
|
||||
</VBtn>
|
||||
</div>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VForm>
|
||||
</VWindowItem>
|
||||
|
||||
<VWindowItem value="cash-on-delivery">
|
||||
<p class="text-base text-high-emphasis my-6">
|
||||
Cash on Delivery is a type of payment method where the recipient make payment for the order at the time of delivery rather than in advance.
|
||||
</p>
|
||||
|
||||
<VBtn @click="nextStep">
|
||||
Pay on delivery
|
||||
</VBtn>
|
||||
</VWindowItem>
|
||||
|
||||
<VWindowItem value="gift-card">
|
||||
<h6 class="text-base font-weight-medium my-6">
|
||||
Enter Gift Card Details
|
||||
</h6>
|
||||
<VForm>
|
||||
<VRow>
|
||||
<VCol cols="12">
|
||||
<VTextField
|
||||
v-model="giftCardFormData.giftCardNumber"
|
||||
label="Gift Card Number"
|
||||
placeholder="1234 5678 9012 3456"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
<VCol cols="12">
|
||||
<VTextField
|
||||
v-model="giftCardFormData.giftCardPin"
|
||||
label="Gift Card Pin"
|
||||
placeholder="1234"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
<VCol cols="12">
|
||||
<VBtn @click="nextStep">
|
||||
Redeem Gift Card
|
||||
</VBtn>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VForm>
|
||||
</VWindowItem>
|
||||
</VWindow>
|
||||
</VCol>
|
||||
|
||||
<VCol
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<VCard
|
||||
flat
|
||||
variant="outlined"
|
||||
>
|
||||
<VCardText>
|
||||
<h6 class="text-h6 mb-4">
|
||||
Price Details
|
||||
</h6>
|
||||
|
||||
<div class="d-flex justify-space-between text-sm mb-2">
|
||||
<div class="text-body-1 text-high-emphasis">
|
||||
Order Total
|
||||
</div>
|
||||
<div class="text-body-1">
|
||||
${{ checkoutPaymentDataLocal.orderAmount }}.00
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between text-sm">
|
||||
<div class="text-high-emphasis text-body-1">
|
||||
Delivery Charges
|
||||
</div>
|
||||
<div
|
||||
v-if="checkoutPaymentDataLocal.deliverySpeed === 'free'"
|
||||
class="d-flex align-center"
|
||||
>
|
||||
<div class="text-body-1 text-disabled me-2">
|
||||
$5.00
|
||||
</div>
|
||||
<VChip
|
||||
color="success"
|
||||
size="small"
|
||||
>
|
||||
FREE
|
||||
</VChip>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span>${{ checkoutPaymentDataLocal.deliveryCharges }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</VCardText>
|
||||
|
||||
<VDivider />
|
||||
|
||||
<VCardText>
|
||||
<div class="d-flex justify-space-between text-base mb-2">
|
||||
<div class="text-high-emphasis font-weight-medium">
|
||||
Total
|
||||
</div>
|
||||
<h6 class="text-h6 text-medium-emphasis">
|
||||
${{ checkoutPaymentDataLocal.orderAmount + checkoutPaymentDataLocal.deliveryCharges }}.00
|
||||
</h6>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between text-base mb-4">
|
||||
<h6 class="text-h6">
|
||||
Deliver to:
|
||||
</h6>
|
||||
<VChip
|
||||
color="primary"
|
||||
size="small"
|
||||
class="text-capitalize"
|
||||
>
|
||||
{{ checkoutPaymentDataLocal.deliveryAddress }}
|
||||
</VChip>
|
||||
</div>
|
||||
|
||||
<template
|
||||
v-for="item in selectedDeliveryAddress"
|
||||
:key="item.value"
|
||||
>
|
||||
<h6 class="text-h6">
|
||||
{{ item.title }}
|
||||
</h6>
|
||||
<p class="text-body-1 mb-1">
|
||||
{{ item.desc }}
|
||||
</p>
|
||||
<p class="text-base mb-4">
|
||||
Mobile : {{ item.subtitle }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
class="font-weight-medium text-base d-inline-block"
|
||||
>Change address</a>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
1
resources/js/views/wizard-examples/checkout/types.js
Normal file
1
resources/js/views/wizard-examples/checkout/types.js
Normal file
@@ -0,0 +1 @@
|
||||
export {}
|
Reference in New Issue
Block a user