funciona enviar correo a editoriales
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.8ef62da4.js rel=preload as=script><link href=js/chunk-vendors.5c31e50f.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.5c31e50f.js></script><script src=js/app.8ef62da4.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.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>
|
||||
+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
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+73
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Vendored
-68
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
Generated
+5
@@ -9981,6 +9981,11 @@
|
||||
"util.promisify": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"sweetalert2": {
|
||||
"version": "10.5.1",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-10.5.1.tgz",
|
||||
"integrity": "sha512-WU2rcWJldFKSxLmO+nBRVZfK5+/XHonQXLYbjiY/r+OFpGkpiHpaqg7hysVGQ+paAWk2BZK+QKiUYL3RK7dnMw=="
|
||||
},
|
||||
"table": {
|
||||
"version": "5.4.6",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"core-js": "^3.6.5",
|
||||
"jquery": "^3.5.1",
|
||||
"popper.js": "^1.16.1",
|
||||
"sweetalert2": "^10.5.1",
|
||||
"vue": "^2.6.11",
|
||||
"vue-router": "^3.3.4"
|
||||
},
|
||||
|
||||
+89
-8
@@ -16,38 +16,54 @@
|
||||
|
||||
<form class="my-5">
|
||||
<div class="form-group row">
|
||||
<div class="col-6 d-flex flex-column justify-content-around ">
|
||||
<div class="form-group row d-flex justify-content-between">
|
||||
|
||||
<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"
|
||||
id="formGroupExampleInput"
|
||||
v-model="nombre"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row d-flex justify-content-between">
|
||||
<div class="form-group row d-flex my-4 justify-content-between">
|
||||
<label for="inputEmail3">Correo electrónico</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="email" class="form-control" id="inputEmail3" />
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
id="inputEmail3"
|
||||
v-model="correo"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div class="col-12 col-md-8 col-lg-8 col-xl-8 mx-auto mt-3">
|
||||
<div class="form-group">
|
||||
<label for="comment">Comentario</label>
|
||||
<textarea class="form-control" rows="5" id="comment"></textarea>
|
||||
<textarea
|
||||
class="form-control"
|
||||
rows="5"
|
||||
id="comment"
|
||||
v-model="mensaje"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-5">Enviar</button>
|
||||
<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>
|
||||
@@ -57,12 +73,77 @@ import Header from "./../components/header.vue";
|
||||
import Nav from "./../components/nav.vue";
|
||||
import Nav2 from "./../components/nav2.vue";
|
||||
import Footer from "./../components/footer.vue";
|
||||
|
||||
import axios from "axios";
|
||||
import config from "../config/config.js";
|
||||
import Swal from 'sweetalert2'
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
Nav,
|
||||
Nav2,
|
||||
Footer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
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")
|
||||
|
||||
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
|
||||
})
|
||||
.then(function(response) {
|
||||
|
||||
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 ',
|
||||
|
||||
})
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user