Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgeInge committed Jun 4, 2024
2 parents 403b470 + c01e41a commit b6d1103
Show file tree
Hide file tree
Showing 29 changed files with 850 additions and 256 deletions.
6 changes: 3 additions & 3 deletions client/public/scripts/step1.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ document.getElementById('step-one').addEventListener('click',async ()=>{
let temporal = document.getElementById(arreglo[indice][0]);
temporal.style.borderColor='orange';

if(arreglo[indice][1] != ''){ // si el mensaje es un mensaje vacio, entonces no mostara ningun alert
let toastBox = document.getElementById('toastBox');
let div = document.createElement('div');
div.classList.add('toast');
div.innerHTML = '<div id="texto">no pusiste '+arreglo[indice][1]+'</div> <div id="icono"><i class="fa-solid fa-circle-exclamation"></i></div>';
div.innerHTML = '<div id="texto">No pusiste '+arreglo[indice][1]+'</div> <div id="icono"><i class="fa-solid fa-circle-exclamation"></i></div>';
div.classList.add('orange');
toastBox.appendChild(div);
setTimeout(()=>{
div.remove();
},6000)

//
}
}
return;
}
Expand Down
4 changes: 2 additions & 2 deletions client/public/scripts/step2.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ document.getElementById('step2').addEventListener('click', async ()=>{
let toastBox = document.getElementById('toastBox');
let div = document.createElement('div');
div.classList.add('toast');
div.innerHTML = '<div id="texto">dejaste en blanco la pregunta '+arreglo[indice].slice(1);+'</div> <div id="icono"><i class="fa-solid fa-circle-exclamation"></i></div>';
div.innerHTML = '<div id="texto">Dejaste en blanco la pregunta '+arreglo[indice].slice(1);+'</div> <div id="icono"><i class="fa-solid fa-circle-exclamation"></i></div>';
div.classList.add('orange');
toastBox.appendChild(div);
setTimeout(()=>{
Expand All @@ -84,7 +84,7 @@ document.getElementById('step2').addEventListener('click', async ()=>{
let toastBox = document.getElementById('toastBox');
let div = document.createElement('div');
div.classList.add('toast');
div.innerHTML = '<div id="texto">se mas especifico en la pregunta '+arreglo[indice].slice(1);+', escribe mas al respecto</div> <div id="icono"> <i class="fa-solid fa-circle-xmark"> </div>';
div.innerHTML = '<div id="texto">Se más específico en la pregunta '+arreglo[indice].slice(1);+', escribe más al respecto</div> <div id="icono"> <i class="fa-solid fa-circle-xmark"> </div>';
toastBox.appendChild(div);
setTimeout(()=>{
div.remove();
Expand Down
14 changes: 7 additions & 7 deletions client/public/scripts/step3.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ proximamente.innerHTML = `<h1 className="soon-title">
</h1>
<h4 className="soon-desc">
La contraseña esta <br />
siendo procesada <br />
siendo procesada. <br />
</h4>`;


Expand Down Expand Up @@ -56,7 +56,7 @@ document.getElementById('step3').addEventListener('click',async ()=>{
let toastBox = document.getElementById('toastBox');
let div = document.createElement('div');
div.classList.add('toast');
div.innerHTML = '<div id="texto">Debes de aceptar las politicas</div><div id="icono"><i class="fa-solid fa-lock"></i></div>';
div.innerHTML = '<div id="texto">Debes de aceptar las políticas</div><div id="icono"><i class="fa-solid fa-lock"></i></div>';
div.classList.add('blue');
toastBox.appendChild(div);
setTimeout(()=>{
Expand Down Expand Up @@ -129,7 +129,7 @@ document.getElementById('step3').addEventListener('click',async ()=>{
for(let i in arreglo){
let div = document.createElement('div');
div.classList.add('toast');
div.innerHTML = '<div id="texto">tu contraseña '+arreglo[i]+'</div> <div id="icono"><i class="fa-solid fa-circle-xmark"></i></div>';
div.innerHTML = '<div id="texto">Tu contraseña '+arreglo[i]+'</div> <div id="icono"><i class="fa-solid fa-circle-xmark"></i></div>';
toastBox.appendChild(div);

setTimeout(()=>{
Expand All @@ -144,18 +144,18 @@ document.getElementById('step3').addEventListener('click',async ()=>{

if(respuestaJson.redirect = '/spa/signUp/Confirmacion'){

proximamente.innerHTML = `<img id="process-img" src="../../../../../../public/pictures/ArrowCut.png" />`;
proximamente.innerHTML = `<img id="process-img" src="../../pictures/ArrowCut.png" />`;

await new Promise(resolve=> setTimeout(resolve, 1200));

proximamente.innerHTML = `<h1 className="soon-title">
<i id='alarm' class="fa-solid fa-user-plus"></i>
Insercion de Usuario
Inserción de Usuario
<i id='alarm' class="fa-solid fa-user-plus"></i>
</h1>
<h4 className="soon-desc">
Felicidades, en un momento se creara tu cuenta <br />
este proceso puede tardar unos segundos, se paciente <br />
Felicidades, en un momento se creará tu cuenta. <br />
Este proceso puede tardar unos segundos, se paciente. <br />
</h4>`;
}

Expand Down
9 changes: 6 additions & 3 deletions client/src/components/ui/Agenda.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function Agenda({ restart, next }) {
const [soon, setSoon] = useState(false);
const [del, setDel] = useState(false);
const [selectedCitaIndex, setSelectedCitaIndex] = useState(null);
const [sus, setSus] = useState(false); //<<< CARACTERISTICA GRAFICA DE QUE EL USUARIO ES SOCIO

const handleModificar = () => {
selectedCitaIndex === null && notify();
Expand Down Expand Up @@ -105,9 +106,7 @@ function Agenda({ restart, next }) {
const iva = (total * 0.08).toFixed(2);
const totalIva = (parseFloat(total) + parseFloat(iva)).toFixed(2);

const puntos = parseFloat(totalIva) / 10;
//En caso de ser Socio VVV
//const puntos = (parseInt(totalIva))/5;
const puntos = (sus ? ((parseInt(totalIva))/5):((parseFloat(totalIva)) / 10));

localStorage.setItem("total", total);
localStorage.setItem("totalIva", totalIva);
Expand Down Expand Up @@ -264,6 +263,10 @@ function Agenda({ restart, next }) {
${totalIva}
</span>
</div>
<div className='flex justify-between p-6 px-10 mb-4 border-2 shadow-md rounded-xl border-gray'>
<h4 className='text-xl font-bold'>Puntos obtenidos:</h4>
<span className='font-bold text-[rgb(3,109,99)] text-xl'>{parseInt(puntos)}</span>
</div>
</div>
<div className="flex justify-around mb-6">
<button
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/ui/Carrito.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { useNavigate } from "react-router-dom";

export const CarritoProvider = ({ children }) => {

localStorage.setItem('tarjeta',null)
localStorage.setItem('monedero',-1)
localStorage.setItem('tarjeta', null)
localStorage.setItem('monedero', -1)

const [cartItems, setCartItems] = useState(() => {
const savedCart = localStorage.getItem('cartItems');
Expand Down Expand Up @@ -199,7 +199,7 @@ const Carrito = ({ cerrar, totalProductos, logCart }) => {
<p>Total:</p>
<span className='font-bold'>${total}</span>
</div>
<button className='m-auto w-full hover:bg-opacity-90 rounded-xl py-2 px-6 text-white bg-[#45B59C]' onClick={log ? (handleComprar):(logCart)}>
<button className='m-auto w-full hover:bg-opacity-90 rounded-xl py-2 px-6 text-white bg-[#45B59C]' onClick={log ? (handleComprar) : (logCart)}>
Comprar
</button>
</>
Expand Down
49 changes: 41 additions & 8 deletions client/src/components/ui/Favoritos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,35 @@ function Favoritos() {
const [estetica, setEstetica] = useState([]);
const [color1, setColor1] = useState("#EB5765");
const [color2, setColor2] = useState("#F6B3B9");
const [id, setId] = useState(0);
const [st, setSt] = useState(false);

let respuestaJson = null;
async function checkLogin() {
try {
const respuesta = await fetch("/api/logueado", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});

respuestaJson = await respuesta.json();
if (respuestaJson.logueado == true) {
await setId(respuestaJson.clave);
}
} catch (error) {
setLog(false);
}
}

useEffect(() => {
checkLogin();
}, []);

useEffect(() => {
setTimeout(() => {
fetch("/api/admin/favoritos/ServiceFavoritosSpa")
fetch(`/api/admin/favoritos/ServiceFavoritosSpa/${id}`)
.then((response) => {
if (!response.ok) {
throw new Error("Error al obtener los favoritos de spa");
Expand All @@ -97,11 +122,11 @@ function Favoritos() {
console.log("error", error);
});
}, 3000);
}, []);
}, [id, st]);

useEffect(() => {
setTimeout(() => {
fetch("/api/admin/favoritos/ServiceFavoritosEstetica")
fetch(`/api/admin/favoritos/ServiceFavoritosEstetica/${id}`)
.then((response) => {
if (!response.ok) {
throw new Error("Error al obtener los favoritos de estetica");
Expand All @@ -115,7 +140,7 @@ function Favoritos() {
console.log("error", error);
});
}, 3000);
}, []);
}, [id, st]);

const toggleService = (index) => {
if (index === 1) {
Expand Down Expand Up @@ -155,6 +180,10 @@ function Favoritos() {
}
};

function changeSt() {
setSt(!st);
}

return (
<>
<img
Expand Down Expand Up @@ -189,14 +218,16 @@ function Favoritos() {
return (
<TarjetaFavoritos
props={{
id: id,
ps: servicio.pkIdPS,
nombre: servicio.nombre,
descr: servicio.descripcion,
img: servicio.img,
precio: servicio.precio,
dur: servicio.tiempo,
rating: servicio.valoracion,
//isFavorite: servicio.fav,
isFavorite: true,
favorito: servicio.favorito,
st: changeSt,
}}
/>
);
Expand All @@ -209,14 +240,16 @@ function Favoritos() {
return (
<TarjetaFavoritos
props={{
id: id,
ps: servicio.pkIdPS,
nombre: servicio.nombre,
descr: servicio.descripcion,
img: servicio.img,
precio: servicio.precio,
dur: servicio.tiempo,
rating: servicio.valoracion,
//isFavorite: servicio.fav,
isFavorite: true,
favorito: servicio.favorito,
st: changeSt,
}}
/>
);
Expand Down
6 changes: 2 additions & 4 deletions client/src/components/ui/Filtros.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function Filtros() {
},
});
respuestaJson = await respuesta.json();
setId(respuestaJson.clave);
await setId(respuestaJson.clave);
} catch (error) {
console.log("Error");
}
Expand All @@ -97,7 +97,6 @@ export default function Filtros() {

useEffect(() => {
setTimeout(() => {
console.log(id);
fetch(`/api/admin/favoritos/ProductFavoritosbyId/${id}`)
.then((response) => {
if (!response.ok) {
Expand All @@ -107,7 +106,6 @@ export default function Filtros() {
})
.then((data) => {
setProductosFavorites(data);
console.log("favoritos" + data);
})
.catch((error) => {
//setErrorSpa(error.message);
Expand Down Expand Up @@ -196,7 +194,7 @@ export default function Filtros() {
console.log("error", error);
});
}, [1000]);
}, []);
}, [id]);

// Función para manejar la búsqueda
const handleSearch = (e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import React, { useState, useEffect } from "react";
import '../../../../../txt.css';

const InformacionBasica = () => {
const [selectedImage, setSelectedImage] = useState(null);

const handleImageChange = (e) => {
if (e.target.files && e.target.files[0]) {
const file = e.target.files[0];
setSelectedImage(URL.createObjectURL(file));
}
};

return (
<div>
Expand Down Expand Up @@ -127,7 +135,7 @@ const InformacionBasica = () => {
<input
id="lada"
type="text"
maxLength={2}
maxLength={3}
placeholder="52"
className="bg-slate-200 rounded-full w-[9rem] md:w-[9.25rem] lg:w-[12rem] mb-1 mr-2 py-2 focus:outline-none focus:ring-1 focus:ring-slate-800 focus:border-transparent px-6"

Expand All @@ -145,7 +153,7 @@ const InformacionBasica = () => {
<input
id="phone"
type="text"
maxLength={10}
maxLength={12}
placeholder="6862223344"
className="bg-slate-200 rounded-full w-[9rem] md:w-[9.25rem] lg:w-[12rem] mb-1 mr-2 py-2 focus:outline-none focus:ring-1 focus:ring-slate-800 focus:border-transparent px-6"

Expand Down Expand Up @@ -227,7 +235,6 @@ const InformacionBasica = () => {
<input
id="numero"
type="text"
maxLength={5}
placeholder="#1234"
className="bg-slate-200 rounded-full w-[19rem] lg:w-[24.75rem] mb-1 mx-0 py-2 focus:outline-none focus:ring-1 focus:ring-slate-800 focus:border-transparent px-6"

Expand All @@ -251,9 +258,16 @@ const InformacionBasica = () => {
</div>
</form>
<div className="relative w-[8rem] h-[8rem] lg:w-[11rem] lg:h-[11rem] left-[5.75rem] top-[6rem] md:left-[0.25rem] md:top-[10rem] -mt-20 grid place-items-center rounded-full bg-white bg-clip-border ring-2 ring-gray-400">
<img src={user1} alt="" className="logo2 absolute h-full" />
<img src={selectedImage === null ? user1 : selectedImage} alt="" className="logo2 absolute h-full rounded-full aspect-square" />
<div className="absolute w-[2.5rem] h-[2.5rem] lg:w-[3rem] lg:h-[3rem] bg-white rounded-full place-self-end ring-2 ring-gray-500">
<input type="file" id="imagen"/>
<input
type="file"
id="imagen"
accept="image/*"
onChange={handleImageChange}
placeholder=""
className=" aspect-square rounded-full w-[3rem] h-[3rem]"
/>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit b6d1103

Please sign in to comment.