github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/server/frontend/bv/src/pages/inscription/complet/FastMail.vue (about) 1 <template> 2 <div> 3 <b-modal 4 v-model="showDialog" 5 title="Recherche de votre adresse mail" 6 ok-only 7 > 8 <div v-if="mailFound"> 9 Votre adresse mail a bien été utilisée sur un de nos séjours. <br /> 10 Afin de protéger vos données personnelles, un <b>lien</b> sécurisé vous 11 y a été envoyé ({{ mail }}). 12 <p class="font-italic"> 13 Vous pouvez quitter cette page, vous y serez ramené par le lien. 14 </p> 15 </div> 16 <div v-else> 17 Votre adresse n'a pas été trouvée. Aucun problème, vous pouvez reprendre 18 l'inscription standard ! 19 </div> 20 </b-modal> 21 22 <b-row class="border rounded border-primary py-2 mb-2"> 23 <b-col md="5"> 24 <h4 class="pt-1">Inscription rapide</h4> 25 <div class="mb-1"> 26 Vous avez déjà participé à un de nos séjours ? Pré-remplissez ce 27 formulaire en fournissant votre adresse e-mail ! 28 </div> 29 </b-col> 30 <b-col md="1"></b-col> 31 <b-col md="6" class="align-self-center"> 32 <b-form inline> 33 <b-form-input 34 v-model="mail" 35 @input="onChange" 36 @keydown.enter.prevent="checkMail({ spinning: true })" 37 class="mx-2" 38 type="email" 39 placeholder="Mail" 40 required 41 ></b-form-input> 42 <btn variant="secondary" @click="checkMail" 43 >Rechercher mon adresse</btn 44 > 45 </b-form> 46 </b-col> 47 </b-row> 48 </div> 49 </template> 50 51 <script lang="ts"> 52 import Vue from "vue"; 53 import Component from "vue-class-component"; 54 import Btn from "../../../shared/Btn.vue"; 55 import { C } from "./controller"; 56 import { ValidEvent } from "../../../shared/utils"; 57 import Axios from "axios"; 58 59 const FastMailProps = Vue.extend({ 60 props: {} 61 }); 62 63 @Component({ 64 components: { Btn } 65 }) 66 export default class FastMail extends FastMailProps { 67 mail = ""; 68 69 showDialog = false; 70 mailFound = false; 71 72 onChange(mail: string) { 73 if (C.data == null) return; 74 Vue.set(C.data.initial_inscription, "mail", mail); 75 } 76 77 async checkMail(ev: ValidEvent) { 78 ev.spinning = true; 79 const mailFound = await C.checkMail(this.mail); 80 ev.spinning = false; 81 if (mailFound !== undefined) { 82 this.showDialog = true; 83 this.mailFound = mailFound; 84 } 85 } 86 } 87 </script> 88 89 <style scoped></style>