construido para pruebas
This commit is contained in:
Generated
+13
@@ -9971,6 +9971,11 @@
|
||||
"util.promisify": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"sweetalert2": {
|
||||
"version": "9.15.2",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-9.15.2.tgz",
|
||||
"integrity": "sha512-evJfoa49s5ZzSmVc62tslNkzlQoCg2GHjB3MQxawfESppvY5AlXKLGQ3nNKxHXKdodKmIHbkl39DgUhcOK7LgQ=="
|
||||
},
|
||||
"table": {
|
||||
"version": "5.4.6",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
|
||||
@@ -10718,6 +10723,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"vue-sweetalert2": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/vue-sweetalert2/-/vue-sweetalert2-3.0.6.tgz",
|
||||
"integrity": "sha512-uT+UrASTlwVCeNCZwPVdzN28KQfnVDEYXdfJr3OJwt77bWfcVZrNDOqezZq0Y45SWpkpYKjrQr1/mjieuriWmg==",
|
||||
"requires": {
|
||||
"sweetalert2": "9.x"
|
||||
}
|
||||
},
|
||||
"vue-template-compiler": {
|
||||
"version": "2.6.11",
|
||||
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz",
|
||||
|
||||
+3
-1
@@ -12,9 +12,11 @@
|
||||
"bootstrap": "^4.5.0",
|
||||
"bootstrap-vue": "^2.15.0",
|
||||
"core-js": "^3.6.5",
|
||||
"sweetalert2": "^9.15.2",
|
||||
"vue": "^2.6.11",
|
||||
"vue-axios": "^2.1.5",
|
||||
"vue-router": "^3.3.4"
|
||||
"vue-router": "^3.3.4",
|
||||
"vue-sweetalert2": "^3.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.4.0",
|
||||
|
||||
+44
-17
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="registro-general">
|
||||
<form class="pure-form pure-form-stacked">
|
||||
<form class="pure-form pure-form-stacked" v-if="!cargando">
|
||||
<fieldset>
|
||||
<legend>Datos Generales <br /></legend>
|
||||
<div class="pure-u-1 pure-u-md-2-2">
|
||||
@@ -9,7 +9,6 @@
|
||||
type="text"
|
||||
id="nombre-equipo"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="nombreEquipo"
|
||||
onkeypress="return ( (event.charCode >= 48 && event.charCode <= 57) || (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -65,7 +64,6 @@
|
||||
type="text"
|
||||
id="nombreLider"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="nombreLider"
|
||||
onkeypress="return ( (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -76,7 +74,6 @@
|
||||
type="text"
|
||||
id="apellidoPaLider"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="apellidoPaLider"
|
||||
onkeypress="return ( (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -87,7 +84,6 @@
|
||||
type="text"
|
||||
id="apellidoMaLider"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="apellidoMaLider"
|
||||
onkeypress="return ( (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -98,7 +94,6 @@
|
||||
type="email"
|
||||
id="correoLider"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="correoLider"
|
||||
/>
|
||||
</div>
|
||||
@@ -126,7 +121,6 @@
|
||||
type="text"
|
||||
id="item.nombre"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="item.nombre"
|
||||
onkeypress="return ( (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -137,7 +131,6 @@
|
||||
type="text"
|
||||
id="item.apellidoP"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="item.apellidoP"
|
||||
onkeypress="return ( (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -148,7 +141,6 @@
|
||||
type="text"
|
||||
id="item.apellidoM"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="item.apellidoM"
|
||||
onkeypress="return ( (event.charCode >= 32 && event.charCode <= 32) ||(event.charCode >= 65 && event.charCode <= 90) ||(event.charCode >= 97))"
|
||||
/>
|
||||
@@ -159,7 +151,6 @@
|
||||
type="text"
|
||||
id="item.correo"
|
||||
class="pure-u-23-24"
|
||||
required=""
|
||||
v-model="item.correo"
|
||||
/>
|
||||
</div>
|
||||
@@ -169,7 +160,7 @@
|
||||
|
||||
<div class="pure-g espacio">
|
||||
<div class="pure-u-1 pure-u-md-1-2">
|
||||
<button class="button_salir ">Salir</button>
|
||||
<button class="button_salir " @click="salir()">Salir</button>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-2">
|
||||
<button class="button " v-if="checkFull()" @click="registrar()">
|
||||
@@ -180,12 +171,23 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div v-else class="text-center">
|
||||
<div
|
||||
class="spinner-grow"
|
||||
role="status"
|
||||
style="width: 10rem; height: 10rem;"
|
||||
>
|
||||
<span class="sr-only">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import config from "../config/config.js";
|
||||
import Swal from "sweetalert2";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -198,7 +200,8 @@ export default {
|
||||
correoLider: "",
|
||||
carrera: "",
|
||||
noIntegrantes: 1,
|
||||
integrantes: []
|
||||
integrantes: [],
|
||||
cargando: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -259,13 +262,29 @@ export default {
|
||||
}
|
||||
return true;
|
||||
},
|
||||
async salir() {
|
||||
await Swal.fire({
|
||||
title: "¿Seguro que quieres salir?",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Si"
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
window.location.href =
|
||||
"https://www.acatlan.unam.mx/hackaton/index.html#head";
|
||||
}
|
||||
});
|
||||
},
|
||||
async registrar() {
|
||||
this.cargando = true;
|
||||
const data = {
|
||||
nombreEqui: this.nombreEquipo,
|
||||
desafio: this.desafio,
|
||||
campus: this.campus,
|
||||
numeroIntegrantes: 2,
|
||||
nombreLider: this.noIntegrantes,
|
||||
numeroIntegrantes: this.noIntegrantes,
|
||||
nombreLider: this.nombreLider,
|
||||
apellidoPaLider: this.apellidoPaLider,
|
||||
apellidoMaLider: this.apellidoMaLider,
|
||||
correoLider: this.correoLider,
|
||||
@@ -275,12 +294,20 @@ export default {
|
||||
axios
|
||||
.post(`${config.api}/registro`, data)
|
||||
.then(async respose => {
|
||||
this.cargando = false;
|
||||
console.log(respose.data.msj);
|
||||
await alert(respose.data.msj);
|
||||
await Swal.fire("Has sido registrado", "", "success");
|
||||
window.location.href =
|
||||
"https://www.acatlan.unam.mx/hackaton/index.html#head";
|
||||
})
|
||||
.catch(async error => {
|
||||
console.log(error.response.data.msj);
|
||||
await alert(error.response.data.msj);
|
||||
this.cargando = false;
|
||||
console.log(error.response.data.msj);
|
||||
await Swal.fire(
|
||||
"Ocurrio un error",
|
||||
`${error.response.data.msj}`,
|
||||
"error"
|
||||
).then((window.location.href = "#"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const config = {
|
||||
api: "http://localhost:3000"
|
||||
// api: "https://venus.acatlan.unam.mx/redinvestigacion"
|
||||
//api: "http://localhost:3000"
|
||||
api: "https://venus.acatlan.unam.mx/hackaton"
|
||||
};
|
||||
module.exports = config;
|
||||
|
||||
Reference in New Issue
Block a user