<template> <div> <div class="header"> <img alt="logo" src="@/assets/logo_pigma.png"/> </div> <div class="center"> <b-container class="msg" v-if="btnVariant=='success'"> <p> Merci pour votre inscription. </p> <p> Vous recevrez une notification lors de l'activation de votre compte par l'administrateur de la plateforme. </p> <!-- <b-button type="button" variant="outline-primary" @click.prevent="$router.push({ name: 'SignIn' })"> Ouvrir la page de connexion </b-button> --> </b-container> <b-container class="msg" v-else-if="btnVariant=='danger'"> <p> Une erreur est survenue. Veuillez contacter l'administrateur du site. </p> </b-container> <b-container class="msg" v-else> <p> Pour confirmer votre inscription <b-button :pressed="btnPressed" :variant="btnVariant" @click.prevent="submit">Cliquez ici</b-button> </p> </b-container> </div> <small class="footer"> <p>Propulsé par <a href="https://www.neogeo.fr/" target="_blank" rel="noopener">Neogeo-Technologies</a></p> </small> </div> </template> <script> import { mapGetters, mapState, mapActions, mapMutations } from 'vuex'; const validationRegistrationStoreName = 'validation-registration'; const validationRegistrationGetters = { status: 'getStatus', }; const validationRegistrationState = ['accountStatus']; const validationRegistrationMutations = ['SET_TOKEN']; const validationRegistrationActions = ['POST_TOKEN']; export default { name: 'ValidationRegistration', data: () => { return { btnPressed: false, }; }, computed: { ...mapState(validationRegistrationStoreName, validationRegistrationState), ...mapGetters(validationRegistrationStoreName, validationRegistrationGetters), btnVariant() { if (this.status === true) { return 'success'; } else if (this.status === false) { return 'danger'; } else { return ''; } }, }, created() { this.$store.commit('validation-registration/SET_TOKEN', this.$route.query.token); }, methods: { ...mapActions(validationRegistrationStoreName, validationRegistrationActions), ...mapMutations(validationRegistrationStoreName, validationRegistrationMutations), async submit() { this.btnPressed = true; await this.$store.dispatch('validation-registration/POST_TOKEN'); }, }, }; </script> <style lang="less" scoped> .header { position: absolute; top: 0; left: 0; } .header > img { width: 440px; } .center { position: initial; } .center .msg.container { margin: 0; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; } .center .msg.container, .center .msg.container button { font-size: large; } .footer { position: absolute; bottom: 0; font-size: small; } .footer a { text-decoration: none; } </style>