@monkeyplus/payscope 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-LICENSES.md +41 -0
- package/dist/_chunks/auth.d.mts +707 -0
- package/dist/_chunks/database.mjs +831 -0
- package/dist/_chunks/db.d.mts +7100 -0
- package/dist/_chunks/index.d.mts +178 -0
- package/dist/_chunks/lib.mjs +3073 -0
- package/dist/_chunks/libs/better-call.d.mts +478 -0
- package/dist/_chunks/libs/postgres.d.mts +1 -0
- package/dist/_chunks/rolldown-runtime.mjs +11 -0
- package/dist/server/db.d.mts +2 -0
- package/dist/server/db.mjs +108 -0
- package/dist/server/env.d.mts +21 -0
- package/dist/server/env.mjs +22 -0
- package/dist/server/lib.d.mts +362 -0
- package/dist/server/lib.mjs +2 -0
- package/dist/server/router.d.mts +1218 -0
- package/dist/server/router.mjs +1157 -0
- package/dist/server/schemas/auth.d.mts +2 -0
- package/dist/server/schemas/auth.mjs +62 -0
- package/package.json +58 -0
- package/storefront/Readme.md +0 -0
- package/storefront/auth.ts +29 -0
- package/storefront/cart/ResumeCart.vue +217 -0
- package/storefront/cart/ResumeCartSelect.vue +32 -0
- package/storefront/cart/ShoppinCart.vue +100 -0
- package/storefront/cart/ShoppinCartItem.vue +99 -0
- package/storefront/checkout/App.vue +36 -0
- package/storefront/checkout/AppCart.vue +72 -0
- package/storefront/checkout/AppCartDiscount.vue +74 -0
- package/storefront/checkout/AppCartTotals.vue +72 -0
- package/storefront/checkout/AppLoading.vue +55 -0
- package/storefront/checkout/composables.ts +28 -0
- package/storefront/checkout/constants.ts +0 -0
- package/storefront/checkout/main.ts +11 -0
- package/storefront/checkout/pages/Address/Address.vue +95 -0
- package/storefront/checkout/pages/Info/Info.vue +94 -0
- package/storefront/checkout/pages/Info/InfoUser.vue +38 -0
- package/storefront/checkout/pages/Pay/Pay.vue +115 -0
- package/storefront/checkout/pages/Pay/Providers/BancoEconomico/BancoEconomico.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Cybersource/Cybersource.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Datafast/Datafast.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Multipago/Multipago.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Pagomedios/Pagomedios.vue +93 -0
- package/storefront/checkout/pages/Pay/Providers/Pagomedios/composable.ts +23 -0
- package/storefront/checkout/pages/Pay/Providers/Paypal/Paypal.vue +168 -0
- package/storefront/checkout/pages/Pay/Providers/Paypal/composable.ts +33 -0
- package/storefront/checkout/pages/Pay/Providers/Placetopay/Placetopay.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Wabi/Wabi.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/composable.ts +30 -0
- package/storefront/checkout/pages/Payment/Payment.vue +19 -0
- package/storefront/checkout/pages/Payment/PaymentStatus.vue +187 -0
- package/storefront/checkout/pages/Payment/PaymentStatusDetail.vue +77 -0
- package/storefront/checkout/pages/Payment/composable.ts +81 -0
- package/storefront/checkout/pages/Shipping/Shipping.vue +67 -0
- package/storefront/checkout/pages/StepInfo.vue +37 -0
- package/storefront/checkout/router.ts +59 -0
- package/storefront/index.ts +3 -0
- package/storefront/login/App.vue +9 -0
- package/storefront/login/main.ts +10 -0
- package/storefront/login/pages/SignIn/Login.vue +82 -0
- package/storefront/login/pages/SignUp/SignUp.vue +99 -0
- package/storefront/login/router.ts +15 -0
- package/storefront/product/AddProduct.vue +303 -0
- package/storefront/product/AddProductNumber.vue +62 -0
- package/storefront/product/AddProductVariant.vue +66 -0
- package/storefront/profile/App.vue +88 -0
- package/storefront/profile/main.ts +10 -0
- package/storefront/profile/pages/Addresses/Addresses.vue +79 -0
- package/storefront/profile/pages/Addresses/AddressesForm.vue +95 -0
- package/storefront/profile/pages/Addresses/AddressesModal.vue +24 -0
- package/storefront/profile/pages/Buys/Buys.vue +8 -0
- package/storefront/profile/pages/Me/Me.vue +15 -0
- package/storefront/profile/pages/Me/MeBilling.vue +79 -0
- package/storefront/profile/pages/Me/MeBillingForm.vue +66 -0
- package/storefront/profile/pages/Me/MeBillingModal.vue +24 -0
- package/storefront/profile/pages/Me/MeInfo.vue +75 -0
- package/storefront/profile/pages/Me/MePassword.vue +53 -0
- package/storefront/profile/pages/Me/MeSubscriptions.vue +15 -0
- package/storefront/profile/pages/Returns/Returns.vue +8 -0
- package/storefront/profile/pages/Whislist/Whislist.vue +8 -0
- package/storefront/profile/router.ts +32 -0
- package/storefront/stores.ts +320 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useEventBus } from '@vueuse/core';
|
|
3
|
+
import { ofetch } from 'ofetch';
|
|
4
|
+
import { computed, inject, onBeforeMount, ref, watch } from 'vue';
|
|
5
|
+
import { useCheckoutStore } from '../stores.ts';
|
|
6
|
+
import AppCartDiscount from './AppCartDiscount.vue';
|
|
7
|
+
import AppCartTotals from './AppCartTotals.vue';
|
|
8
|
+
|
|
9
|
+
defineProps({
|
|
10
|
+
isPayLink: Boolean,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const checkout = useCheckoutStore();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div>
|
|
18
|
+
<div v-for="item in checkout.items" :key="item.id" class="flex items-center w-full">
|
|
19
|
+
<div
|
|
20
|
+
class="
|
|
21
|
+
border-1
|
|
22
|
+
rounded
|
|
23
|
+
border-gray-200
|
|
24
|
+
overflow-hidden overflow-visible
|
|
25
|
+
"
|
|
26
|
+
>
|
|
27
|
+
<div class="relative">
|
|
28
|
+
<div
|
|
29
|
+
class=" h-[4.5rem] w-[4.5rem] min-w-[4.5rem] bg-gray-50 flex justify-center items-center"
|
|
30
|
+
>
|
|
31
|
+
<img
|
|
32
|
+
:src="item?.image?.src"
|
|
33
|
+
alt="h-full w-full object-containt"
|
|
34
|
+
>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
class="
|
|
38
|
+
h-6
|
|
39
|
+
w-6
|
|
40
|
+
absolute
|
|
41
|
+
-top-2
|
|
42
|
+
-right-2
|
|
43
|
+
rounded-full
|
|
44
|
+
bg-gray-500
|
|
45
|
+
flex items-center justify-center
|
|
46
|
+
text-sm text-center text-white
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
{{ item.quantity }}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="flex-auto px-3">
|
|
54
|
+
{{ item.title }}
|
|
55
|
+
<div
|
|
56
|
+
v-for="(option) in item.options"
|
|
57
|
+
:key="option.name"
|
|
58
|
+
class="text-xs"
|
|
59
|
+
>
|
|
60
|
+
<span class="font-bold"> {{ option.name }}: </span>
|
|
61
|
+
<span>
|
|
62
|
+
{{ option.value }}
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div>$ {{ item.total }}</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="h-[2px] bg-gray-200 my-8" />
|
|
69
|
+
<AppCartDiscount />
|
|
70
|
+
<AppCartTotals />
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import { useCheckoutStore } from '../stores';
|
|
4
|
+
|
|
5
|
+
const loading = ref(false);
|
|
6
|
+
const discountCode = ref('');
|
|
7
|
+
const messageDiscount = ref('');
|
|
8
|
+
const checkout = useCheckoutStore();
|
|
9
|
+
|
|
10
|
+
function sendDiscount() {
|
|
11
|
+
checkout.applyDiscount(discountCode.value);
|
|
12
|
+
}
|
|
13
|
+
function removeDiscount() {
|
|
14
|
+
//
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div class="relative">
|
|
20
|
+
<div v-if="loading" class="absolute w-full h-full top-0 left-0 flex items-center justify-center z-20 bg-eprimary bg-opacity-80 all:text-white">
|
|
21
|
+
<UButton :loading="loading" text-loading="Aplicando" />
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="true" class="flex space-x-3 mb-2">
|
|
24
|
+
<div class="flex-auto">
|
|
25
|
+
<input
|
|
26
|
+
v-model="discountCode"
|
|
27
|
+
class="
|
|
28
|
+
w-full
|
|
29
|
+
px-4
|
|
30
|
+
py-2
|
|
31
|
+
border border-gray-200
|
|
32
|
+
focus:ring-yellow-300 focus:border-yellow-300
|
|
33
|
+
rounded-md
|
|
34
|
+
"
|
|
35
|
+
name="name"
|
|
36
|
+
placeholder="Codigo de descuento"
|
|
37
|
+
>
|
|
38
|
+
</div>
|
|
39
|
+
<div>
|
|
40
|
+
<UButton
|
|
41
|
+
size="xl"
|
|
42
|
+
:disabled="discountCode.length < 3"
|
|
43
|
+
@click="sendDiscount"
|
|
44
|
+
>
|
|
45
|
+
Usar
|
|
46
|
+
</UButton>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div v-if="messageDiscount" class="bg-red-400 text-center shadow-md text-gray-950 rounded px-3 py-2 flex items-center">
|
|
50
|
+
{{ messageDiscount }}
|
|
51
|
+
</div>
|
|
52
|
+
<template v-for="(discount, ix) in checkout?.invoice?.discounts">
|
|
53
|
+
<div v-if="discount" :key="ix" class="border text-econtrast rounded px-3 py-2 flex items-center">
|
|
54
|
+
<div class="left-3">
|
|
55
|
+
<div class="text-sm">
|
|
56
|
+
Descuento aplicado:
|
|
57
|
+
</div>
|
|
58
|
+
<span class="text-xl font-bold">
|
|
59
|
+
{{ discount?.title || discount?.code || discount?.value }}
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div class="flex-1" />
|
|
64
|
+
<button
|
|
65
|
+
v-if="discount?.code || discount?.value"
|
|
66
|
+
class="underline"
|
|
67
|
+
@click="removeDiscount"
|
|
68
|
+
>
|
|
69
|
+
Quitar
|
|
70
|
+
</button>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import { useCheckoutStore } from '../stores';
|
|
4
|
+
|
|
5
|
+
const checkout = useCheckoutStore();
|
|
6
|
+
const taxIncluded = ref(false);
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div>
|
|
11
|
+
<div class="pt-3 space-y-1">
|
|
12
|
+
<div v-if="checkout.invoice?.discount || checkout.invoice?.discounts?.length" class="border-b mb-2 pb-1">
|
|
13
|
+
<div class="flex">
|
|
14
|
+
<div>
|
|
15
|
+
Total
|
|
16
|
+
<span class="text-xs">(Sin descuentos)</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="flex-auto" />
|
|
19
|
+
<div>
|
|
20
|
+
{{ checkout.totals.subtotal }}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="checkout.invoice?.discount || checkout.invoice?.discounts?.length" class="flex items-center">
|
|
24
|
+
<div>Descuento</div>
|
|
25
|
+
<div class="flex-auto" />
|
|
26
|
+
<div>- {{ checkout.totals.discount }}</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="flex">
|
|
30
|
+
<div>Subtotal</div>
|
|
31
|
+
<div class="flex-auto" />
|
|
32
|
+
<div>
|
|
33
|
+
{{ checkout.totals.base }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="flex">
|
|
37
|
+
<div>
|
|
38
|
+
Impuestos
|
|
39
|
+
</div>
|
|
40
|
+
<div class="flex-auto" />
|
|
41
|
+
<div v-if="!taxIncluded">
|
|
42
|
+
{{ checkout.totals.totalTax }}
|
|
43
|
+
</div>
|
|
44
|
+
<div v-else class="italic text-sm">
|
|
45
|
+
Ya incluidos
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="flex">
|
|
49
|
+
<div>Envio</div>
|
|
50
|
+
<div class="flex-auto" />
|
|
51
|
+
<div>
|
|
52
|
+
{{ checkout.totals.shipping }}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="border-b-1 border-black opacity-10 my-4 border" />
|
|
57
|
+
<div class="flex">
|
|
58
|
+
<div>
|
|
59
|
+
<div class="text-lg text-gray-700">
|
|
60
|
+
Total
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="flex-auto" />
|
|
64
|
+
<div class="text-2xl text-gray-800">
|
|
65
|
+
<span class="text-sm">
|
|
66
|
+
USD
|
|
67
|
+
</span>
|
|
68
|
+
{{ checkout.totals.total }} $
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Pantalla de carga con enfoque en seguridad
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="flex-1 flex flex-col items-center justify-center min-h-[70vh] text-center px-4">
|
|
7
|
+
<div class="relative flex items-center justify-center mb-8">
|
|
8
|
+
<!-- Anillos pulsantes para efecto de escaneo/seguridad -->
|
|
9
|
+
<div class="absolute inset-0 rounded-full bg-emerald-500/20 animate-ping" style="animation-duration: 2.5s;"></div>
|
|
10
|
+
<div class="absolute inset-[-1.5rem] rounded-full bg-emerald-500/10 animate-pulse" style="animation-duration: 3s;"></div>
|
|
11
|
+
|
|
12
|
+
<!-- Icono central de escudo/candado -->
|
|
13
|
+
<div class="relative z-10 w-24 h-24 bg-gradient-to-br from-emerald-400 to-emerald-600 rounded-full flex items-center justify-center shadow-lg shadow-emerald-500/30">
|
|
14
|
+
<i-mdi-shield-lock-outline class="text-white text-5xl" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<h2 class="text-2xl font-semibold text-gray-800 mb-2">
|
|
19
|
+
Estableciendo conexión segura
|
|
20
|
+
</h2>
|
|
21
|
+
|
|
22
|
+
<p class="text-gray-500 max-w-md mx-auto mb-8">
|
|
23
|
+
Estamos preparando tu entorno de pago. Toda tu información viajará encriptada de extremo a extremo.
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<!-- Barra de progreso indeterminada -->
|
|
27
|
+
<div class="w-64 h-1.5 bg-gray-200 rounded-full overflow-hidden relative">
|
|
28
|
+
<div class="absolute top-0 left-0 h-full bg-gradient-to-r from-emerald-400 to-emerald-600 rounded-full animate-progress"></div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- Badges de confianza -->
|
|
32
|
+
<div class="mt-8 flex items-center space-x-4 text-sm font-medium text-gray-500">
|
|
33
|
+
<div class="flex items-center space-x-1 bg-gray-50 px-3 py-1.5 rounded-full border border-gray-100">
|
|
34
|
+
<i-mdi-lock-outline class="text-emerald-500" />
|
|
35
|
+
<span>SSL 256-bit</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="flex items-center space-x-1 bg-gray-50 px-3 py-1.5 rounded-full border border-gray-100">
|
|
38
|
+
<i-mdi-check-decagram class="text-emerald-500" />
|
|
39
|
+
<span>Pago Seguro</span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
.animate-progress {
|
|
47
|
+
width: 40%;
|
|
48
|
+
animation: progress-bar 1.5s ease-in-out infinite alternate;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes progress-bar {
|
|
52
|
+
0% { transform: translateX(-50%); }
|
|
53
|
+
100% { transform: translateX(200%); }
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
// type Pages = 'info' | 'address' | 'shipping' | 'pay';
|
|
3
|
+
import { inject } from 'vue';
|
|
4
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
5
|
+
|
|
6
|
+
export const PAGES = Symbol('pages') as InjectionKey<string[]>;
|
|
7
|
+
|
|
8
|
+
export function useNavigation() {
|
|
9
|
+
const pages = inject(PAGES, ['address', 'shipping', 'pay']);
|
|
10
|
+
|
|
11
|
+
const route = useRoute();
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
const getCurrentPage = () => {
|
|
14
|
+
return route.name as string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const toNext = () => {
|
|
18
|
+
const currentPage = getCurrentPage();
|
|
19
|
+
const index = pages.indexOf(currentPage);
|
|
20
|
+
if (index < pages.length - 1) {
|
|
21
|
+
router.push({ name: pages[index + 1] });
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
pages,
|
|
26
|
+
toNext,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { installFlowVuePlugins } from '@monkeyplus/flow/vue';
|
|
2
|
+
import { createApp } from 'vue';
|
|
3
|
+
import App from './App.vue';
|
|
4
|
+
import { router } from './router';
|
|
5
|
+
|
|
6
|
+
export function registerCheckoutApp() {
|
|
7
|
+
const app = createApp(App);
|
|
8
|
+
app.use(router);
|
|
9
|
+
installFlowVuePlugins(app);
|
|
10
|
+
app.mount('#app');
|
|
11
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { RadioGroupItem } from '@nuxt/ui';
|
|
3
|
+
import { computed, inject, ref, watch } from 'vue';
|
|
4
|
+
import { useAccountStore, useCheckoutStore } from '../../../stores.ts';
|
|
5
|
+
import { useNavigation } from '../../composables.ts';
|
|
6
|
+
import InfoUser from '../Info/InfoUser.vue';
|
|
7
|
+
|
|
8
|
+
const title = 'Dirección de envio';
|
|
9
|
+
const subtitle = 'Selecciona una dirección de envio';
|
|
10
|
+
|
|
11
|
+
const account = useAccountStore();
|
|
12
|
+
const checkout = useCheckoutStore();
|
|
13
|
+
const requireIdentification = inject('requireIdentification', false);
|
|
14
|
+
const requireUserInfo = inject('requireUserInfo', false);
|
|
15
|
+
const validInfoUser = inject('validInfoUser', false);
|
|
16
|
+
// const router = us
|
|
17
|
+
const { toNext } = useNavigation();
|
|
18
|
+
function onNext() {
|
|
19
|
+
toNext();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const items = computed(() => {
|
|
23
|
+
return account.addresses.map((address: any) => {
|
|
24
|
+
return {
|
|
25
|
+
label: address.name,
|
|
26
|
+
value: address.id,
|
|
27
|
+
description: address.formatted,
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
const address = ref(checkout.address.id || 0);
|
|
32
|
+
|
|
33
|
+
watch(address, (v) => {
|
|
34
|
+
const _a = account.addresses.find((a: any) => a.id === v);
|
|
35
|
+
checkout.setAddress(_a);
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div class="space-y-5 mx-auto min-w-xl mt-6">
|
|
41
|
+
<div>
|
|
42
|
+
<div class="text-2xl font-bold">
|
|
43
|
+
Información de contacto
|
|
44
|
+
</div>
|
|
45
|
+
<div class="pt-3">
|
|
46
|
+
<InfoUser />
|
|
47
|
+
<div v-if="requireUserInfo && !validInfoUser" class="pt-2">
|
|
48
|
+
<div class="text-sm text-red-500">
|
|
49
|
+
* Por favor completa tu información personal
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div>
|
|
55
|
+
<div class="text-2xl font-bold">
|
|
56
|
+
{{ title }}
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
{{ subtitle }}
|
|
60
|
+
</div>
|
|
61
|
+
<div class="w-full pt-4">
|
|
62
|
+
<div class="w-full max-w-lg px-1">
|
|
63
|
+
<URadioGroup
|
|
64
|
+
v-model="address"
|
|
65
|
+
color="primary"
|
|
66
|
+
variant="table"
|
|
67
|
+
default-value="pro"
|
|
68
|
+
:items="items"
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
<!-- TODO: include aditional Fields -->
|
|
72
|
+
<div class="flex items-center pt-4">
|
|
73
|
+
<div class="flex justify-end items-center space-x-2" @click="onAdd">
|
|
74
|
+
<button class=" p-3 rounded-full shadow hover:shadow-lg w-12 h-12 flex items-center justify-center cursor-pointer bg-secondary text-white">
|
|
75
|
+
<i-mdi-plus class="text-xl" />
|
|
76
|
+
</button>
|
|
77
|
+
<div class="font-bold text-gray-600 text-sm">
|
|
78
|
+
Agregar dirección
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="flex-auto" />
|
|
82
|
+
|
|
83
|
+
<UButton
|
|
84
|
+
size="lg"
|
|
85
|
+
:disabled="!checkout.address?.id"
|
|
86
|
+
@click="onNext"
|
|
87
|
+
>
|
|
88
|
+
Continuar
|
|
89
|
+
</UButton>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { RadioGroupItem } from '@nuxt/ui';
|
|
3
|
+
import { computed, inject, ref } from 'vue';
|
|
4
|
+
import { useAccountStore } from '../../../stores.ts';
|
|
5
|
+
import InfoUser from './InfoUser.vue';
|
|
6
|
+
|
|
7
|
+
const title = 'Dirección de envio';
|
|
8
|
+
const subtitle = 'Selecciona una dirección de envio';
|
|
9
|
+
|
|
10
|
+
const account = useAccountStore();
|
|
11
|
+
const requireIdentification = inject('requireIdentification', false);
|
|
12
|
+
const requireUserInfo = inject('requireUserInfo', false);
|
|
13
|
+
|
|
14
|
+
function toNext() {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const items = computed(() => {
|
|
19
|
+
return account.addresses.map((address: any) => {
|
|
20
|
+
return {
|
|
21
|
+
label: address.name,
|
|
22
|
+
value: address.id,
|
|
23
|
+
description: address.formatted,
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class="space-y-5">
|
|
31
|
+
<div>
|
|
32
|
+
<div class="text-2xl font-bold">
|
|
33
|
+
Información de contacto
|
|
34
|
+
</div>
|
|
35
|
+
<div class="pt-3">
|
|
36
|
+
<InfoUser />
|
|
37
|
+
<div v-if="requireUserInfo && !validInfoUser" class="pt-2">
|
|
38
|
+
<div class="text-sm text-red-500">
|
|
39
|
+
* Por favor completa tu información personal
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<div class="text-2xl font-bold">
|
|
46
|
+
{{ title }}
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
{{ subtitle }}
|
|
50
|
+
</div>
|
|
51
|
+
<div class="w-full pt-4">
|
|
52
|
+
<div class="w-full max-w-lg px-1">
|
|
53
|
+
<URadioGroup color="primary" variant="table" default-value="pro" :items="items" />
|
|
54
|
+
<!-- <RadioOptions :items="checkout.state.addresses" option-description="formatted" :initial-value="checkout.customer.shippingAddress?.id" @edit="onEdit" @change="onChange(0, $event)" /> -->
|
|
55
|
+
<!-- <div v-if="requireIdentification" class="pt-3">
|
|
56
|
+
<div class="text-sm">
|
|
57
|
+
Cedula de quien recibira el pedido
|
|
58
|
+
</div>
|
|
59
|
+
<input
|
|
60
|
+
v-model="celuda"
|
|
61
|
+
class="
|
|
62
|
+
w-full
|
|
63
|
+
px-4
|
|
64
|
+
py-2
|
|
65
|
+
border border-gray-200
|
|
66
|
+
focus:ring-yellow-300 focus:border-yellow-300
|
|
67
|
+
rounded-md
|
|
68
|
+
"
|
|
69
|
+
name="name"
|
|
70
|
+
>
|
|
71
|
+
</div> -->
|
|
72
|
+
<div class="flex items-center pt-4">
|
|
73
|
+
<div class="flex justify-end items-center space-x-2" @click="onAdd">
|
|
74
|
+
<button class=" p-3 rounded-full shadow hover:shadow-lg w-12 h-12 flex items-center justify-center cursor-pointer bg-secondary text-white">
|
|
75
|
+
<i-mdi-plus class="text-xl" />
|
|
76
|
+
</button>
|
|
77
|
+
<div class="font-bold text-gray-600 text-sm">
|
|
78
|
+
Agregar dirección
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="flex-auto" />
|
|
82
|
+
|
|
83
|
+
<UButton
|
|
84
|
+
:disabled="!isValid || !validInfoUser" :loading="loadingNext"
|
|
85
|
+
@click="toNext"
|
|
86
|
+
>
|
|
87
|
+
Continuar
|
|
88
|
+
</UButton>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useSession } from '../../../auth';
|
|
3
|
+
|
|
4
|
+
const { user } = useSession();
|
|
5
|
+
function onEdit() {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="bg-gray-50 p-4 rounded-lg inline-flex space-x-4 items-center">
|
|
12
|
+
<!-- <el-avatar :src="user?.picture" /> -->
|
|
13
|
+
<div class="bg-gray-200 h-14 w-14 border rounded-full flex items-center justify-center">
|
|
14
|
+
<span class="capitalize">
|
|
15
|
+
{{ user?.name?.at(0) }}
|
|
16
|
+
</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="leading-4 pr-5 ">
|
|
19
|
+
<div class="text-base ">
|
|
20
|
+
{{ user?.name }}
|
|
21
|
+
</div>
|
|
22
|
+
<div class="text-[0.8rem] pb-1">
|
|
23
|
+
{{ user?.email }} |
|
|
24
|
+
<span v-if="user?.phone">
|
|
25
|
+
{{ user?.phone }}
|
|
26
|
+
</span>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="text-[0.8rem]">
|
|
29
|
+
<!-- {{ user?.picture }} -->
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<button class="underline" @click="onEdit">
|
|
34
|
+
Editar
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TabsItem } from '@nuxt/ui';
|
|
3
|
+
import { computed, ref, watch } from 'vue';
|
|
4
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
5
|
+
import { useAccountStore, useCheckoutStore } from '../../../stores.ts';
|
|
6
|
+
import { useNavigation } from '../../composables.ts';
|
|
7
|
+
import StepInfo from '../StepInfo.vue';
|
|
8
|
+
|
|
9
|
+
const account = useAccountStore();
|
|
10
|
+
const checkout = useCheckoutStore();
|
|
11
|
+
checkout.getShippings();
|
|
12
|
+
|
|
13
|
+
const { toNext } = useNavigation();
|
|
14
|
+
|
|
15
|
+
const items = computed(() => {
|
|
16
|
+
return account.billings.map((item: any) => {
|
|
17
|
+
return {
|
|
18
|
+
label: item.formatted,
|
|
19
|
+
value: item.id,
|
|
20
|
+
// description: item.price,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
function onNext() {
|
|
25
|
+
toNext();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const select = ref(checkout.billing.id || 0);
|
|
29
|
+
|
|
30
|
+
watch(select, (v) => {
|
|
31
|
+
const _a = account.billings.find((a: any) => a.id === v);
|
|
32
|
+
checkout.setBilling(_a);
|
|
33
|
+
});
|
|
34
|
+
const tabs = ref<TabsItem[]>([
|
|
35
|
+
{
|
|
36
|
+
label: 'Paypal',
|
|
37
|
+
value: 'paypal',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Placetopay',
|
|
41
|
+
value: 'placetopay',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Pagomedios',
|
|
45
|
+
value: 'placetopay',
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'Datafast',
|
|
50
|
+
value: 'placetopay',
|
|
51
|
+
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'Cybersource',
|
|
55
|
+
value: 'placetopay',
|
|
56
|
+
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
const route = useRoute();
|
|
60
|
+
const router = useRouter();
|
|
61
|
+
|
|
62
|
+
const tabPay = computed({
|
|
63
|
+
get() {
|
|
64
|
+
return (route.name as string) || 'me';
|
|
65
|
+
},
|
|
66
|
+
set(tab) {
|
|
67
|
+
// Hash is specified here to prevent the page from scrolling to the top
|
|
68
|
+
router.push({
|
|
69
|
+
name: tab,
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<div class="space-y-5 mx-auto lg:min-w-xl mt-6">
|
|
77
|
+
<div class="pt-3">
|
|
78
|
+
<StepInfo />
|
|
79
|
+
</div>
|
|
80
|
+
<div class="text-2xl font-bold leading-0 pt-3">
|
|
81
|
+
Datos de facturación
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div>
|
|
85
|
+
<URadioGroup
|
|
86
|
+
v-model="select"
|
|
87
|
+
color="primary"
|
|
88
|
+
variant="table"
|
|
89
|
+
default-value="pro"
|
|
90
|
+
:items="items"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="text-2xl font-bold leading-0 pt-3">
|
|
94
|
+
Formas de pago
|
|
95
|
+
</div>
|
|
96
|
+
<div>
|
|
97
|
+
<UTabs v-model="tabPay" variant="pill" :content="false" :items="tabs" class="w-full" />
|
|
98
|
+
</div>
|
|
99
|
+
<div>
|
|
100
|
+
<router-view />
|
|
101
|
+
</div>
|
|
102
|
+
<div class="flex items-center pt-4">
|
|
103
|
+
<!-- -->
|
|
104
|
+
<div class="flex-auto" />
|
|
105
|
+
|
|
106
|
+
<UButton
|
|
107
|
+
size="lg"
|
|
108
|
+
:disabled="!checkout.shipping?.id"
|
|
109
|
+
@click="onNext"
|
|
110
|
+
>
|
|
111
|
+
Continuar
|
|
112
|
+
</UButton>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|