View beautyServices.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const services = [ | |
{ | |
name: 'Corte de cabello para hombres', | |
price: 100 | |
}, | |
{ | |
name: 'Corte de cabello para mujeres', | |
price: 120 | |
}, | |
{ |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getCurrentDate = () => { | |
const date = new Date(); | |
const day = date.getDate().toString().padStart(2, '0'); | |
const month = (date.getMonth() + 1).toString().padStart(2, '0'); | |
const year = date.getFullYear(); | |
return `${day}/${month}/${year}`; | |
} |
View EditProductView.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
import { watch, reactive } from 'vue' | |
import { useRoute, useRouter } from 'vue-router' | |
import { doc } from 'firebase/firestore' | |
import { useFirestore, useDocument } from 'vuefire' | |
import Link from '@/components/Link.vue'; | |
import { useProductsStore } from '@/stores/products'; | |
import useImage from '@/composables/useImage' | |
const { onFileChange, url, isImageUploaded } = useImage() |
View helpers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const formatCurrency = amount => Number(amount).toLocaleString('en-US', { | |
style: 'currency', | |
currency: 'USD' | |
}) |
View Seeder.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
import { ref, getDownloadURL, uploadBytesResumable } from 'firebase/storage' | |
import { collection, addDoc } from 'firebase/firestore' | |
import { useFirebaseStorage, useFirestore } from 'vuefire' | |
import { products } from '../../data/products' | |
const storage = useFirebaseStorage() | |
const db = useFirestore(); |
View .env.local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VITE_FIREBASE_API_KEY = | |
VITE_FIREBASE_AUTH_DOMAIN = | |
VITE_FIREBASE_PROJECT_ID = | |
VITE_FIREBASE_STORAGE_BUCKET = | |
VITE_FIREBASE_MESSAGING_SENDER_ID = | |
VITE_FIREBASE_APP_ID = |
View EditarPropiedadView.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch(propiedad, (propiedad) => { | |
titulo.value.value = propiedad.titulo | |
precio.value.value = propiedad.precio | |
habitaciones.value.value = propiedad.habitaciones | |
wc.value.value = propiedad.wc | |
estacionamiento.value.value = propiedad.estacionamiento | |
descripcion.value.value = propiedad.descripcion | |
alberca.value.value = propiedad.alberca | |
center.value = propiedad.ubicacion | |
}) |
View EditarPropiedadView.vue <script>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useField, useForm } from 'vee-validate' | |
import "leaflet/dist/leaflet.css"; | |
import { | |
LMap, | |
LTileLayer, | |
LMarker | |
} from "@vue-leaflet/vue-leaflet"; | |
import useImage from '@/composables/useImage' | |
import useLocationMap from '@/composables/useLocationMap' | |
import { validationSchema } from '@/validation/propiedadSchema' |
View propiedadSchema.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const validationSchema = { | |
titulo (value) { | |
if (value?.length >= 6 ) return true | |
return 'El titulo de la propiedad es obligatorio o muy corto' | |
}, | |
precio (value) { | |
/* | |
^ - Representa el inicio de la cadena. | |
[0-9]+ - Representa cualquier número del 0 al 9. El + indica que debe haber al menos un dígito, pero puede haber más. | |
$ - Representa el final de la cadena. |
View .env.local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VITE_FIREBASE_API_KEY = | |
VITE_FIREBASE_AUTH_DOMAIN = | |
VITE_FIREBASE_PROJECT_ID = | |
VITE_FIREBASE_STORAGE_BUCKET = | |
VITE_FIREBASE_MESSAGING_SENDER_ID = | |
VITE_FIREBASE_APP_ID = |
NewerOlder