@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.
Files changed (82) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +41 -0
  2. package/dist/_chunks/auth.d.mts +707 -0
  3. package/dist/_chunks/database.mjs +831 -0
  4. package/dist/_chunks/db.d.mts +7100 -0
  5. package/dist/_chunks/index.d.mts +178 -0
  6. package/dist/_chunks/lib.mjs +3073 -0
  7. package/dist/_chunks/libs/better-call.d.mts +478 -0
  8. package/dist/_chunks/libs/postgres.d.mts +1 -0
  9. package/dist/_chunks/rolldown-runtime.mjs +11 -0
  10. package/dist/server/db.d.mts +2 -0
  11. package/dist/server/db.mjs +108 -0
  12. package/dist/server/env.d.mts +21 -0
  13. package/dist/server/env.mjs +22 -0
  14. package/dist/server/lib.d.mts +362 -0
  15. package/dist/server/lib.mjs +2 -0
  16. package/dist/server/router.d.mts +1218 -0
  17. package/dist/server/router.mjs +1157 -0
  18. package/dist/server/schemas/auth.d.mts +2 -0
  19. package/dist/server/schemas/auth.mjs +62 -0
  20. package/package.json +58 -0
  21. package/storefront/Readme.md +0 -0
  22. package/storefront/auth.ts +29 -0
  23. package/storefront/cart/ResumeCart.vue +217 -0
  24. package/storefront/cart/ResumeCartSelect.vue +32 -0
  25. package/storefront/cart/ShoppinCart.vue +100 -0
  26. package/storefront/cart/ShoppinCartItem.vue +99 -0
  27. package/storefront/checkout/App.vue +36 -0
  28. package/storefront/checkout/AppCart.vue +72 -0
  29. package/storefront/checkout/AppCartDiscount.vue +74 -0
  30. package/storefront/checkout/AppCartTotals.vue +72 -0
  31. package/storefront/checkout/AppLoading.vue +55 -0
  32. package/storefront/checkout/composables.ts +28 -0
  33. package/storefront/checkout/constants.ts +0 -0
  34. package/storefront/checkout/main.ts +11 -0
  35. package/storefront/checkout/pages/Address/Address.vue +95 -0
  36. package/storefront/checkout/pages/Info/Info.vue +94 -0
  37. package/storefront/checkout/pages/Info/InfoUser.vue +38 -0
  38. package/storefront/checkout/pages/Pay/Pay.vue +115 -0
  39. package/storefront/checkout/pages/Pay/Providers/BancoEconomico/BancoEconomico.vue +9 -0
  40. package/storefront/checkout/pages/Pay/Providers/Cybersource/Cybersource.vue +9 -0
  41. package/storefront/checkout/pages/Pay/Providers/Datafast/Datafast.vue +9 -0
  42. package/storefront/checkout/pages/Pay/Providers/Multipago/Multipago.vue +9 -0
  43. package/storefront/checkout/pages/Pay/Providers/Pagomedios/Pagomedios.vue +93 -0
  44. package/storefront/checkout/pages/Pay/Providers/Pagomedios/composable.ts +23 -0
  45. package/storefront/checkout/pages/Pay/Providers/Paypal/Paypal.vue +168 -0
  46. package/storefront/checkout/pages/Pay/Providers/Paypal/composable.ts +33 -0
  47. package/storefront/checkout/pages/Pay/Providers/Placetopay/Placetopay.vue +9 -0
  48. package/storefront/checkout/pages/Pay/Providers/Wabi/Wabi.vue +9 -0
  49. package/storefront/checkout/pages/Pay/Providers/composable.ts +30 -0
  50. package/storefront/checkout/pages/Payment/Payment.vue +19 -0
  51. package/storefront/checkout/pages/Payment/PaymentStatus.vue +187 -0
  52. package/storefront/checkout/pages/Payment/PaymentStatusDetail.vue +77 -0
  53. package/storefront/checkout/pages/Payment/composable.ts +81 -0
  54. package/storefront/checkout/pages/Shipping/Shipping.vue +67 -0
  55. package/storefront/checkout/pages/StepInfo.vue +37 -0
  56. package/storefront/checkout/router.ts +59 -0
  57. package/storefront/index.ts +3 -0
  58. package/storefront/login/App.vue +9 -0
  59. package/storefront/login/main.ts +10 -0
  60. package/storefront/login/pages/SignIn/Login.vue +82 -0
  61. package/storefront/login/pages/SignUp/SignUp.vue +99 -0
  62. package/storefront/login/router.ts +15 -0
  63. package/storefront/product/AddProduct.vue +303 -0
  64. package/storefront/product/AddProductNumber.vue +62 -0
  65. package/storefront/product/AddProductVariant.vue +66 -0
  66. package/storefront/profile/App.vue +88 -0
  67. package/storefront/profile/main.ts +10 -0
  68. package/storefront/profile/pages/Addresses/Addresses.vue +79 -0
  69. package/storefront/profile/pages/Addresses/AddressesForm.vue +95 -0
  70. package/storefront/profile/pages/Addresses/AddressesModal.vue +24 -0
  71. package/storefront/profile/pages/Buys/Buys.vue +8 -0
  72. package/storefront/profile/pages/Me/Me.vue +15 -0
  73. package/storefront/profile/pages/Me/MeBilling.vue +79 -0
  74. package/storefront/profile/pages/Me/MeBillingForm.vue +66 -0
  75. package/storefront/profile/pages/Me/MeBillingModal.vue +24 -0
  76. package/storefront/profile/pages/Me/MeInfo.vue +75 -0
  77. package/storefront/profile/pages/Me/MePassword.vue +53 -0
  78. package/storefront/profile/pages/Me/MeSubscriptions.vue +15 -0
  79. package/storefront/profile/pages/Returns/Returns.vue +8 -0
  80. package/storefront/profile/pages/Whislist/Whislist.vue +8 -0
  81. package/storefront/profile/router.ts +32 -0
  82. package/storefront/stores.ts +320 -0
@@ -0,0 +1,303 @@
1
+ <!-- eslint-disable ts/ban-ts-comment -->
2
+ <script lang="ts" setup>
3
+ import type { ProductStore, ProductStoreStocks } from '@monkeyplus/e-schema/models';
4
+ import { useEventBus } from '@vueuse/core';
5
+ import { ofetch } from 'ofetch';
6
+ import { computed, inject, onMounted, reactive, ref } from 'vue';
7
+ import { useCartStore } from '../stores.ts';
8
+ import AddProductNumber from './AddProductNumber.vue';
9
+ // import { useCrud, useShoppingCart, useTheProduct } from '../../helpers';
10
+ // import { EButton, InputNumber } from '../shared/exports';
11
+ import AddProductVariant from './AddProductVariant.vue';
12
+ // const props = defineProps({
13
+ // to: {
14
+ // type: String,
15
+ // },
16
+ // omitStock: {
17
+ // type: Boolean,
18
+ // default: false,
19
+ // },
20
+ // hideWhistlist: {
21
+ // type: Boolean,
22
+ // default: false,
23
+ // },
24
+ // maxQuantity: {
25
+ // type: Number,
26
+ // },
27
+ // messageMax: {
28
+ // type: String,
29
+ // },
30
+ // product:
31
+ // });
32
+ const props = defineProps<{
33
+ to?: string
34
+ omitStock?: boolean
35
+ hideWhistlist?: boolean
36
+ maxQuantity?: number
37
+ messageMax?: string
38
+ product: ProductStore
39
+ }>();
40
+ const emit = defineEmits(['stock']);
41
+
42
+ const { product } = props;
43
+
44
+ // const product = useTheProduct();
45
+ // const { store } = useShoppingCart();
46
+ const settings = reactive({
47
+ omitStock: props.omitStock || product.noVariants,
48
+ hideWhistlist: props.hideWhistlist,
49
+ to: props.to,
50
+ });
51
+ type Selections = Record<string, string>;
52
+
53
+ const busImages = useEventBus('busGalleryImages');
54
+ const busCart = useEventBus('busCart');
55
+ // const { crud: CrudCart } = useCrud('cart');
56
+ const cartStore = useCartStore();
57
+ const loading = ref(false);
58
+ const { options, variants, id, uid, price, sku } = product;
59
+
60
+ // const { state, uid: userId, user } = useIdentify();
61
+
62
+ // const {} = useCustomer();
63
+ // const whislist = useCrud('account/wishlist');
64
+
65
+ // const addToCart = ()=>{
66
+
67
+ // }
68
+ const firstVariant = variants[0];
69
+ const initValues = firstVariant.selectedOptions.reduce((acc, current) => {
70
+ return {
71
+ ...acc,
72
+ [current.name]: current.value,
73
+ };
74
+ }, {} as Selections);
75
+
76
+ const quantity = ref(1);
77
+ const selections = ref<Selections>(initValues);
78
+ const stock = ref({} as ProductStoreStocks);
79
+ // Initial images
80
+ busImages.emit(selections.value);
81
+
82
+ async function verifyStock() {
83
+ try {
84
+ loading.value = true;
85
+ const stocks = await ofetch<ProductStoreStocks>(`/storefront/cache/products/${product.id}/stock`);
86
+ stock.value = stocks;
87
+ emit('stock', stocks);
88
+ }
89
+ catch (error) {
90
+ console.warn(error);
91
+ }
92
+ finally {
93
+ loading.value = false;
94
+ }
95
+ }
96
+
97
+ if (!settings.omitStock)
98
+ verifyStock();
99
+ // console.log(selections.value);
100
+
101
+ const selected = computed(() => {
102
+ return variants.find((variant) => {
103
+ // console.log(variant.selectedOptions);
104
+
105
+ return variant.selectedOptions.every(el => selections.value[el.name] === el.value);
106
+ });
107
+ });
108
+ const loadingAdd = ref(false);
109
+ const loadingWhislist = ref(false);
110
+
111
+ const addToCartOmit = inject('addToCartOmit', (_id: any, _selected: any, _items: any) => true);
112
+ // const verify
113
+ async function addToCart(): Promise<void> {
114
+ loadingAdd.value = true;
115
+
116
+ try {
117
+ if (!addToCartOmit(`${id}:${selected.value?.id}`, selected.value, cartStore.items)) {
118
+ return;
119
+ }
120
+ // console.log(selected.value);
121
+ if (!settings.omitStock) {
122
+ const r = await ofetch(`/storefront/cache/products/${encodeURIComponent(`${uid! || product.id}`)}/verify?selectedOptions=${JSON.stringify(selected.value?.selectedOptions || {})}`, {
123
+ });
124
+
125
+ if (!r.ok)
126
+ return alert('Sin stock disponible');
127
+ }
128
+ const el = await cartStore.addToCart({
129
+ id: `${id}:${selected.value?.id}`,
130
+ quantity: quantity.value,
131
+ });
132
+ busCart.emit({
133
+ action: 'create',
134
+ payload: { ...el, product },
135
+ });
136
+
137
+ if (!props.to)
138
+ busCart.emit({ action: 'toogle' });
139
+ else
140
+ location.href = `${props.to}${props.to.includes('?') ? '&' : '?'}items=${el?.lineItems?.length}`;
141
+ }
142
+ catch (error) {
143
+ console.warn(error);
144
+ alert('Error agregando');
145
+ }
146
+ finally {
147
+ loadingAdd.value = false;
148
+ }
149
+ }
150
+ async function addToWhislist() {
151
+ // if (!state.isAuth)
152
+ // return alert('Debes iniciar sesión para agregar a deseos');
153
+
154
+ // loadingWhislist.value = true;
155
+ // try {
156
+ // await whislist.crud.create({
157
+ // productId: id,
158
+ // data: selected.value,
159
+ // storeId: product.store?.id,
160
+ // customerId: userId.value,
161
+ // });
162
+ // alert('Producto agregado a deseos');
163
+ // }
164
+ // catch (error) {
165
+ // alert('Error agregando');
166
+ // }
167
+ // finally {
168
+ // loadingWhislist.value = false;
169
+ // }
170
+ }
171
+ function changeSelect(data: any): void {
172
+ selections.value = { ...selections.value, ...data };
173
+ quantity.value = 1;
174
+ busImages.emit(selections.value);
175
+ }
176
+
177
+ const teleports = reactive({
178
+ price: false,
179
+ });
180
+ onMounted(() => {
181
+ teleports.price = document.getElementById('price') !== null;
182
+ });
183
+ const thePrice = computed(() => {
184
+ return (+(selected.value?.price || price)).toFixed(2);
185
+ });
186
+
187
+ const variantStock = computed(() => {
188
+ if (settings.omitStock) {
189
+ return {
190
+ group: true,
191
+ item: true,
192
+ itemStock: 8,
193
+ };
194
+ }
195
+ const key = options[0].name;
196
+ const value = selections.value[key];
197
+
198
+ const variantId = options.map(el => selections.value[el.name]).join('/');
199
+
200
+ const item = stock.value?.stocks?.find((el: any) => el.variant === variantId)?.quantity;
201
+
202
+ return {
203
+ group: !!stock.value?.firstOption?.[value],
204
+ item: !!item,
205
+ itemStock: item || 8,
206
+ };
207
+ });
208
+
209
+ const isMax = computed(() => {
210
+ if (!props.maxQuantity)
211
+ return false;
212
+ return quantity.value > props.maxQuantity;
213
+ });
214
+ // const disabledSelect = computed(() => {
215
+ // return !variantStock.item || !selected || loadingAdd;
216
+ // });
217
+ </script>
218
+
219
+ <template>
220
+ <div
221
+ class="relative z-0" :class="{
222
+ 'opacity-80 animate-pulse': loading,
223
+ }"
224
+ >
225
+ <div v-if="loading" class="absolute animate-pulse w-full h-full cursor-wait z-10 flex items-center justify-center">
226
+ <div class="w-full h-full flex items-center justify-center">
227
+ <i-mdi-loading class="text-4xl animate-spin" />
228
+ </div>
229
+ </div>
230
+ <teleport v-if="teleports.price" to="#price">
231
+ <!-- {{ selected?. }} -->
232
+ {{ thePrice }}
233
+ </teleport>
234
+ <div v-if="!product.noVariants" class="mb-2 space-y-1">
235
+ <div
236
+ v-for="(option, group) in options"
237
+ :key="option.id"
238
+ class=" pb-4 "
239
+ >
240
+ <div class="font-medium pb-1 capitalize">
241
+ {{ option.name }}: <span class="font-bold">
242
+ {{ selections[option.name] }}
243
+ </span>
244
+ </div>
245
+ <div class="flex space-x-3 items-center flex-wrap">
246
+ <div v-for="(item, index) in option.values" :key="`${option.id + index}e`">
247
+ <AddProductVariant
248
+ :selections="selections"
249
+ :group="group"
250
+ :option="{ value: item, name: option.name }"
251
+ :stock="group === 0 ? stock?.firstOption : {}"
252
+ :disable="group === 0 ? false : !variantStock.group"
253
+ @change="changeSelect"
254
+ />
255
+ </div>
256
+ </div>
257
+ </div>
258
+ </div>
259
+ <div class=" space-y-3">
260
+ <!-- <el-input-number
261
+ v-model="quantity"
262
+ :min="1"
263
+ :max="8"
264
+ size="medium"
265
+ class="w-32"
266
+ /> -->
267
+ <div class="p-1px">
268
+ <AddProductNumber v-model="quantity" :min="1" :max="variantStock.itemStock" size="large" class="w-[8rem]" />
269
+ </div>
270
+ <UButton
271
+
272
+ :disabled="!variantStock.item || !selected || loadingAdd || isMax"
273
+ :loading="loadingAdd"
274
+ icon="i-bytesize-cart"
275
+ size="xl"
276
+ block
277
+ @click="addToCart"
278
+ >
279
+ <!-- <i-bytesize-cart class="relative -left-3 text-xl dark:text-white" /> -->
280
+ <span class="text-white font-medium uppercase "> {{ !variantStock.item ? 'Sin existencias' : 'Agregar al carrito' }} </span>
281
+ </UButton>
282
+ <div v-if="!settings.hideWhistlist">
283
+ <UButton
284
+ :disabled=" !selected || loadingAdd || loadingWhislist "
285
+ :loading="loadingWhislist"
286
+ icon="i-mdi-heart-outline"
287
+ size="lg"
288
+ variant="subtle"
289
+ @click="addToWhislist"
290
+ >
291
+ <!-- <i-mdi-heart-outline class="relative -left-3 text-xl" /> -->
292
+ <span class=" font-medium uppercase"> Añadir a deseos
293
+ <!-- {{ state.isAuth }} -->
294
+ </span>
295
+ </UButton>
296
+ </div>
297
+ </div>
298
+ <div v-if="messageMax && isMax" class="mt-2 text-sm text-red-600">
299
+ {{ messageMax }}
300
+ </div>
301
+ <slot :id="id" :quantity="quantity" :sku="sku" />
302
+ </div>
303
+ </template>
@@ -0,0 +1,62 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps({
3
+ modelValue: {
4
+ type: Number,
5
+ default: 1,
6
+ required: true,
7
+ },
8
+ min: {
9
+ type: Number,
10
+ default: 0,
11
+ },
12
+ max: {
13
+ type: Number,
14
+ default: 10000,
15
+ },
16
+ small: Boolean,
17
+ light: Boolean,
18
+
19
+ });
20
+
21
+ const emit = defineEmits(['update:modelValue', 'change']);
22
+
23
+ function setValue(nValue: number) {
24
+ emit('update:modelValue', nValue);
25
+ emit('change', nValue);
26
+ }
27
+ function update(value: number) {
28
+ const nValue = props.modelValue + value;
29
+ if (value < 0 && nValue >= props.min)
30
+ setValue(nValue);
31
+ if (value > 0 && nValue <= props.max)
32
+ setValue(nValue);
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <div class="flex items-center *:justify-center border rounded overflow-hidden">
38
+ <button
39
+ class="w-[2.5rem] h-[2.5rem] flex items-center justify-center border-r bg-gray-50 text-gray-600 hover:text-gray-950 text-lg"
40
+ :class="{ 'cursor-not-allowed children:opacity-50': modelValue === min }"
41
+ @click="update(-1)"
42
+ >
43
+ <i-mdi-minus />
44
+ </button>
45
+ <div
46
+ class="h-8 min-w-10 flex-1 flex items-center justify-center text-xl "
47
+ :class="{
48
+ 'dark:text-slate-50': !light,
49
+ }"
50
+ >
51
+ {{ modelValue }}
52
+ </div>
53
+ <button
54
+ class="w-[2.5rem] h-[2.5rem] flex items-center justify-center border-l bg-gray-50 text-gray-600 hover:text-gray-950 text-lg"
55
+ :class="{ 'cursor-not-allowed children:opacity-50': modelValue === max }"
56
+
57
+ @click="update(1)"
58
+ >
59
+ <i-mdi-plus />
60
+ </button>
61
+ </div>
62
+ </template>
@@ -0,0 +1,66 @@
1
+ <script lang="ts" setup>
2
+ // import type { PVariant } from '@monkeyplus/e-schema/storefront/objects';
3
+ import { computed } from 'vue';
4
+
5
+ const props = defineProps({
6
+ group: {
7
+ type: Number,
8
+ required: true,
9
+ },
10
+ option: {
11
+ type: Object,
12
+ required: true,
13
+ },
14
+ selections: {
15
+ type: Object,
16
+ required: true,
17
+ },
18
+ stock: {
19
+ type: Object,
20
+ },
21
+ disable: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
25
+
26
+ });
27
+ const emit = defineEmits(['change']);
28
+
29
+ function emitChange(): void {
30
+ emit('change', { [props.option.name]: props.option.value }, props.group);
31
+ }
32
+ const active = computed(() => {
33
+ const isActive = props.selections[props.option.name] === props.option.value;
34
+ return {
35
+ class: isActive ? '!border border-4 border-eprimary pr-5 dark:border-white' : '!border border-1 !border-dashed border-gray-400',
36
+ isActive,
37
+ };
38
+ });
39
+ const disabled = computed(() => {
40
+ if (!props.stock)
41
+ return false;
42
+ if (props.disable)
43
+ return true;
44
+
45
+ return props.stock[props.option.value] === 0;
46
+ });
47
+ </script>
48
+
49
+ <template>
50
+ <div>
51
+ <button
52
+ :disabled="disabled"
53
+ class="py-3 px-4 rounded cursor-pointer text-center relative disabled:opacity-50 disabled:cursor-not-allowed disabled:border-dashed"
54
+
55
+ :class="[active.class]"
56
+ @click="emitChange"
57
+ >
58
+ <div class="inline-block text-10px absolute right-1 top-1 opacity-80 text-eprimary dark:text-gray-50">
59
+ <i-mdi-check-circle v-if="active.isActive" />
60
+ </div>
61
+ <span class="dark:text-gray-50">
62
+ {{ option.value }}
63
+ </span>
64
+ </button>
65
+ </div>
66
+ </template>
@@ -0,0 +1,88 @@
1
+ <script setup lang="ts">
2
+ import type { TabsItem } from '@nuxt/ui';
3
+ import { computed, ref } from 'vue';
4
+ import { useRoute, useRouter } from 'vue-router';
5
+ import { useAccountStore } from '../stores';
6
+
7
+ const accountStore = useAccountStore();
8
+ const items = ref<TabsItem[]>([
9
+ {
10
+ label: 'Información personal',
11
+ icon: 'i-lucide-user',
12
+ value: 'me',
13
+ },
14
+ {
15
+ label: 'Direcciones',
16
+ icon: 'i-lucide-lock',
17
+ value: 'address',
18
+ },
19
+ {
20
+ label: 'Historial de pedidos',
21
+ icon: 'i-lucide-lock',
22
+ value: 'orders',
23
+ },
24
+ {
25
+ label: 'Devoluciones',
26
+ icon: 'i-lucide-lock',
27
+ value: 'returns',
28
+ },
29
+ {
30
+ label: 'Mis deseos',
31
+ icon: 'i-lucide-lock',
32
+ value: 'wishes',
33
+ },
34
+ ]);
35
+ const route = useRoute();
36
+ const router = useRouter();
37
+ const active = computed({
38
+ get() {
39
+ return (route.name as string) || 'me';
40
+ },
41
+ set(tab) {
42
+ // Hash is specified here to prevent the page from scrolling to the top
43
+ router.push({
44
+ name: tab,
45
+ });
46
+ },
47
+ });
48
+ const open = ref(true);
49
+ </script>
50
+
51
+ <template>
52
+ <UApp>
53
+ <div class="container mx-auto p-3 rounded-xl border-gray-200 m-3 contain-paint flex">
54
+ <!-- -->
55
+ <div class="lg:w-64">
56
+ <u-sidebar
57
+ v-model:open="open"
58
+ >
59
+ <ul class="space-y-[2px]">
60
+ <li v-for="item in items" :key="item.value" class="bg-e-primary text-e-primary-contrast p-4 ">
61
+ <button>
62
+ <!-- -->
63
+ {{ item.label }}
64
+ </button>
65
+ </li>
66
+ <li class="mt-6">
67
+ <button class="bg-e-secondary text-e-secondary-contrast p-4 w-full font-bold">
68
+ Cerrar sesión
69
+ </button>
70
+ </li>
71
+ </ul>
72
+ </u-sidebar>
73
+ </div>
74
+ <div class="flex-1">
75
+ <router-view />
76
+ </div>
77
+ </div>
78
+ <button
79
+
80
+ class="fixed h-12 w-12 bottom-4 left-4 flex items-center justify-center bg-e-primary rounded-full text-e-primary-contrast lg:hidden"
81
+ @click="open = !open"
82
+ >
83
+ <u-icon
84
+ name="mdi-menu"
85
+ />
86
+ </button>
87
+ </UApp>
88
+ </template>
@@ -0,0 +1,10 @@
1
+ import { createApp } from 'vue';
2
+ import App from './App.vue';
3
+ import { router } from './router';
4
+
5
+ export function registerProfileApp() {
6
+ const app = createApp(App);
7
+ app.use(router);
8
+
9
+ app.mount('#app');
10
+ }
@@ -0,0 +1,79 @@
1
+ <script setup lang="ts">
2
+ import { useAccountStore } from '../../../stores';
3
+ import AddressesModal from './AddressesModal.vue';
4
+
5
+ const account = useAccountStore();
6
+
7
+ const overlay = useOverlay();
8
+
9
+ const modal = overlay.create(AddressesModal);
10
+ async function onAdd() {
11
+ const instance = modal.open({
12
+ title: 'Agregar datos de envio',
13
+ });
14
+ const shouldIncrement = await instance.result;
15
+ console.log('shoultIncrement', shouldIncrement);
16
+ }
17
+ async function onEdit(item: any) {
18
+ const instance = modal.open({
19
+ title: 'Editar datos de envio',
20
+ data: item,
21
+ });
22
+ const shouldIncrement = await instance.result;
23
+ console.log('shoultIncrement', shouldIncrement);
24
+ }
25
+ function onRemove(data: any) {
26
+ //
27
+ }
28
+ </script>
29
+
30
+ <template>
31
+ <div class="max-w-lg mx-auto py-6">
32
+ <!-- <div class="text-center text-xl font-light pb-2 dark:text-white dark:font-medium">
33
+ Datos de facturación
34
+ </div> -->
35
+ <div>
36
+ <div class="pb-2 space-y-1">
37
+ <!-- -->
38
+ <div v-for="item in account.addresses" :key="item.id" class="border px-2 rounded py-3 bg-white items-center border-gray-300">
39
+ <div class="flex-1 text-sm text-gray-700">
40
+ <div class="text-lg font-bold">
41
+ {{ item.name }}
42
+ </div>
43
+ <div class="text-base">
44
+ {{ item.formatted }}
45
+ </div>
46
+ <div>
47
+ Número de teléfono: {{ item.phone }}
48
+ </div>
49
+ </div>
50
+ <div class="space-x-3 mt-3">
51
+ <button class="hover:underline" @click="onEdit(item)">
52
+ Editar
53
+ </button>
54
+ <div class="inline-block">
55
+ |
56
+ </div>
57
+ <button class="hover:underline" @click="onRemove(item)">
58
+ Quitar
59
+ </button>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ <!-- -->
64
+ <div class="text-center">
65
+ <UButton
66
+ block
67
+ size="xl"
68
+ variant="outline"
69
+ class="border-dashed border"
70
+ color="secondary"
71
+ @click="onAdd()"
72
+ >
73
+ Agregar nueva dirección
74
+ </UButton>
75
+ </div>
76
+ </div>
77
+ <!-- <FormPassword :initial-values="selected" @submit="onSave" /> -->
78
+ </div>
79
+ </template>