123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <div class="container">
- <!-- eslint-disable max-len -->
- <div class="login-page">
- <form id="signIn">
- <div class="form col-md-12">
- <div>
- <h4>Login</h4>
- </div>
- <button
- @click="routerGoTo('/user/register')"
- class="btn"
- style="margin:2px; color: #60CBEB"
- >Register</button>
- <button
- @click="routerGoTo('/user/registeragency')"
- class="btn"
- style="margin:2px; color: #60CBEB"
- >Agency Registration</button>
- <div v-if="this.$store.state.authentication.status === 'error'">
- <alert
- :text="'User doesn\'t exist or Username and Password is incorrect'"
- :type="'ERROR'"
- />
- </div>
- <div class="row">
- <div class="col-md-12" style="margin-bottom: 1em">
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text">
- <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
- </span>
- <input
- class="form-control"
- type="text"
- name="username"
- placeholder="Username"
- v-model="username"
- value
- />
- </div>
- </div>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text">
- <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
- </span>
- <input
- class="form-control"
- :type="isPasswordShown"
- v-model="password"
- id="password"
- placeholder="Password"
- name="password"
- value
- />
- <div class="input-group-append">
- <span class="input-group-text">
- <eva-icon
- v-if="!showPassword"
- name="eye-off-outline"
- fill="#60CBEB"
- @click="togglePassword()"
- ></eva-icon>
- <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="passwordToggled()"></eva-icon>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <button @click="Login()" class="btn btn-b-n" type="submit">Sign In</button>
- <hr />
- <div
- @click="ToggleTrouble()"
- class="btn cursor: pointer;"
- style="margin:2px; color: #60CBEB; font-size:110%;"
- >Trouble signing in?</div>
- <br />
- <div v-if="troubleToggle">
- <!-- <alert :text="'Username & password request email sent'" :type="'SUCCESS'" /> -->
- <div class="row">
- <div class="input-group-prepend">
- <span class="input-group-text">
- <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
- </span>
- <input class="form-control" placeholder="Your Email" type="text" name="email" value />
- </div>
- </div>
- <br />
- <button @click="SendMail()" class="btn btn-b-n" type="submit">Submit</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </template>
-
- <script>
- import { mapActions, mapState } from 'vuex';
- import alert from '../shared/alert.vue';
-
- export default {
- name: 'Login',
- components: {
- alert,
- },
- data() {
- return {
- username: '',
- password: '',
- isPasswordShown: 'password',
- selectItems: [{ text: 'password', value: 0 }],
- selectErrors: 'Some error with the field',
- select: null,
- textErrors: 'Some error with the field',
- text: '',
- showPassword: false,
- email: '',
- troubleToggle: false,
- };
- },
- computed: {
- ...mapState('authentication', ['token', 'status']),
- },
- methods: {
- ...mapActions('authentication', ['login', 'init']),
- ToggleTrouble() {
- if (this.troubleToggle) {
- this.troubleToggle = false;
- } else this.troubleToggle = true;
- },
- Login() {
- this.login({ username: this.username, password: this.password }).then(
- () => {
- if (this.$store.state.authentication.status === 'error') {
- this.$router.push('/user/login');
- } else {
- this.$router.push('/about/us');
- }
- },
- );
- },
- togglePassword() {
- this.showPassword = true;
- this.isPasswordShown = 'text';
- },
- passwordToggled() {
- this.showPassword = false;
- this.isPasswordShown = 'password';
- },
- SendMail() {},
- routerGoTo(goTo) {
- console.log(goTo);
- this.$router.push(goTo);
- },
- },
- };
- </script>
-
- <style>
- .goDown {
- margin-top: 150px;
- }
- </style>
|