espacio input
This commit is contained in:
Vendored
+1
-1
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" type=image/png href=assets/icono.png><title>Portal Editorial Acatlán</title><link href=css/app.8b7905fb.css rel=preload as=style><link href=css/chunk-vendors.138628b4.css rel=preload as=style><link href=js/app.28972bfe.js rel=preload as=script><link href=js/chunk-vendors.38425f87.js rel=preload as=script><link href=css/chunk-vendors.138628b4.css rel=stylesheet><link href=css/app.8b7905fb.css rel=stylesheet></head><body><noscript><strong>We're sorry but portal doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.38425f87.js></script><script src=js/app.28972bfe.js></script></body></html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" type=image/png href=assets/icono.png><title>Portal Editorial Acatlán</title><link href=css/app.8b7905fb.css rel=preload as=style><link href=css/chunk-vendors.138628b4.css rel=preload as=style><link href=js/app.face5fb9.js rel=preload as=script><link href=js/chunk-vendors.38425f87.js rel=preload as=script><link href=css/chunk-vendors.138628b4.css rel=stylesheet><link href=css/app.8b7905fb.css rel=stylesheet></head><body><noscript><strong>We're sorry but portal doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.38425f87.js></script><script src=js/app.face5fb9.js></script></body></html>
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
+38
-45
@@ -16,21 +16,24 @@
|
||||
|
||||
<form class="my-5">
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-12 col-md-12 col-xl-7 col-lg-7 d-flex flex-column justify-content-around ">
|
||||
<div class="form-group row d-flex justify-content-between align-items-center">
|
||||
<div
|
||||
class="col-12 col-md-12 col-xl-7 col-lg-7 d-flex flex-column justify-content-around "
|
||||
>
|
||||
<div
|
||||
class="form-group row d-flex justify-content-between align-items-center"
|
||||
>
|
||||
<label for="formGroupExampleInput">Nombre</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
class="form-control mb-4"
|
||||
id="formGroupExampleInput"
|
||||
v-model="nombre"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row d-flex my-4 justify-content-between">
|
||||
<div class="form-group row d-flex justify-content-between">
|
||||
<label for="inputEmail3">Correo electrónico</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
@@ -55,15 +58,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-5" @click="enviar()"
|
||||
v-show="nombre != '' && correo !='' && mensaje !='' "
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-primary mt-5"
|
||||
@click="enviar()"
|
||||
v-show="nombre != '' && correo != '' && mensaje != ''"
|
||||
>
|
||||
Enviar
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<Footer></Footer>
|
||||
</div>
|
||||
</template>
|
||||
@@ -76,9 +82,7 @@ import Footer from "./../components/footer.vue";
|
||||
|
||||
import axios from "axios";
|
||||
import config from "../config/config.js";
|
||||
import Swal from 'sweetalert2'
|
||||
|
||||
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -89,60 +93,49 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nombre: '',
|
||||
correo: '',
|
||||
mensaje: ''
|
||||
nombre: "",
|
||||
correo: "",
|
||||
mensaje: ""
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
async enviar() {
|
||||
if (this.nombre == "") return alert("falta agregar nombre");
|
||||
if (this.mensaje == "") return alert("falta agregar comentario");
|
||||
if (this.correo == "") return alert("falta agregar correo");
|
||||
|
||||
if (this.nombre == "") return alert("falta agregar nombre")
|
||||
if (this.mensaje == "") return alert("falta agregar comentario")
|
||||
if (this.correo == "") return alert("falta agregar correo")
|
||||
|
||||
let arroba = 0;
|
||||
|
||||
for (let i = 0; i < this.correo.length; i++) {
|
||||
if (`${this.correo[i]}` === `@`) arroba=1;
|
||||
}
|
||||
|
||||
if(!arroba) return alert("El correo no es valido");
|
||||
|
||||
let arroba = 0;
|
||||
|
||||
for (let i = 0; i < this.correo.length; i++) {
|
||||
if (`${this.correo[i]}` === `@`) arroba = 1;
|
||||
}
|
||||
|
||||
if (!arroba) return alert("El correo no es valido");
|
||||
|
||||
await axios
|
||||
.post(`${config.api}/email`, {
|
||||
correo: this.correo,
|
||||
mensaje: this.mensaje,
|
||||
nombre:this.nombre
|
||||
nombre: this.nombre
|
||||
})
|
||||
.then(function(response) {
|
||||
|
||||
Swal.fire({
|
||||
|
||||
icon: 'success',
|
||||
title: 'Correo enviado correctamente',
|
||||
showConfirmButton: false,
|
||||
timer: 2000
|
||||
})
|
||||
Swal.fire({
|
||||
icon: "success",
|
||||
title: "Correo enviado correctamente",
|
||||
showConfirmButton: false,
|
||||
timer: 2000
|
||||
});
|
||||
console.log(response);
|
||||
})
|
||||
.catch(function(error) {
|
||||
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Oops...',
|
||||
text: 'hubo un error. Intentalo más tarde ',
|
||||
|
||||
})
|
||||
Swal.fire({
|
||||
icon: "error",
|
||||
title: "Oops...",
|
||||
text: "hubo un error. Intentalo más tarde "
|
||||
});
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user