Blame view

src/pages/forgetpassword.vue 3.62 KB
93a68cfa1   Jatinder Singh   first commit
1
2
  <template>
    <v-app id="login">
07095d4d8   Jatinder Singh   regex
3
      <v-toolbar color="grey lighten">
93a68cfa1   Jatinder Singh   first commit
4
        <v-toolbar-items>
e3e2a04c6   Neeraj Sharma   first commit
5
6
         <!-- <img src="/static/ana@2x.png" height="36" alt="ana" /> -->
         <h3 class="white--text my-3 ml-4">School-Management</h3>
93a68cfa1   Jatinder Singh   first commit
7
8
9
10
11
      </v-toolbar-items>
    </v-toolbar>
      <v-content>
        <v-container fluid fill-height>
          <v-layout align-center justify-center>
03dcbf0c1   Neeraj Sharma   fix all api and r...
12
            <v-flex xs12 sm8 md7 lg5>
7e8044568   Jatinder Singh   table header changes
13
14
            <v-toolbar color="black" dark>
            <v-spacer></v-spacer>
93a68cfa1   Jatinder Singh   first commit
15
            <v-toolbar-title>Forget Password</v-toolbar-title>
03dcbf0c1   Neeraj Sharma   fix all api and r...
16
            <v-spacer></v-spacer>  
93a68cfa1   Jatinder Singh   first commit
17
          </v-toolbar>
04e3fbc56   Jatinder Singh   minor fix
18
              <v-card class="elevation-1 pa-1">
93a68cfa1   Jatinder Singh   first commit
19
                <v-card-text>
03dcbf0c1   Neeraj Sharma   fix all api and r...
20
21
22
                  <h5 class="text-xs-center"> Not to Worry! Enter to your registered Email ID. </h5>
                  <h5 class="text-xs-center"> We'll send you a reset.</h5>
                  <v-flex lg4 sm6 xs10 offset-sm3 offset-xs1 offset-lg4>                           
4413a8d93   Jatinder Singh   changes
23
24
                  <v-form class="mt-4">
                  <div class="custom-input-align">
7e8044568   Jatinder Singh   table header changes
25
                  <v-text-field 
4413a8d93   Jatinder Singh   changes
26
27
                    class="text-md-center"
                    v-validate="'required|email'" 
03dcbf0c1   Neeraj Sharma   fix all api and r...
28
                    v-model="changePassword" 
4413a8d93   Jatinder Singh   changes
29
30
31
                    :error-messages="errors.collect('email')" 
                    label="Enter Your email ID" 
                    data-vv-name="email" 
7e8044568   Jatinder Singh   table header changes
32
33
                    required>
                  </v-text-field>
03dcbf0c1   Neeraj Sharma   fix all api and r...
34
35
36
37
38
                  </div>  
                  </v-form></v-flex>
                  </v-card-text>
                  <v-card-actions>
                  <v-flex text-xs-center>
9f9522c1d   Neeraj Sharma   fix button text a...
39
                  <v-btn round class="mt-1 button" color="black" dark large @click="reset">Send Request</v-btn></v-flex>
93a68cfa1   Jatinder Singh   first commit
40
                  </v-card-actions>
04e3fbc56   Jatinder Singh   minor fix
41
42
                  <v-snackbar
                   :timeout="timeout"
03dcbf0c1   Neeraj Sharma   fix all api and r...
43
44
45
                   :top="y === 'top'"
                   :right="x === 'right'"
                   :vertical="mode === 'vertical'"
04e3fbc56   Jatinder Singh   minor fix
46
                   v-model="snackbar"
03dcbf0c1   Neeraj Sharma   fix all api and r...
47
48
49
50
                   :color= color
                   >
                    {{ text }}
                 </v-snackbar>
7e8044568   Jatinder Singh   table header changes
51
                </v-snackbar>
93a68cfa1   Jatinder Singh   first commit
52
53
54
55
56
              </v-card>
            </v-flex>
          </v-layout>
        </v-container>
      </v-content>
03dcbf0c1   Neeraj Sharma   fix all api and r...
57
    <v-footer class="pa-4" color="grey darken-2"> 
93a68cfa1   Jatinder Singh   first commit
58
59
60
61
    </v-footer>
    </v-app>
  </template>
  <script>
03dcbf0c1   Neeraj Sharma   fix all api and r...
62
  import http from '@/Services/http.js';
93a68cfa1   Jatinder Singh   first commit
63
64
  export default {
    data: () => ({
03dcbf0c1   Neeraj Sharma   fix all api and r...
65
      changePassword:'',
04e3fbc56   Jatinder Singh   minor fix
66
      snackbar: false,
03dcbf0c1   Neeraj Sharma   fix all api and r...
67
68
69
70
71
      y: 'top',
      x: 'right',
      mode: '',
      timeout: 4000,
      text: '',
93a68cfa1   Jatinder Singh   first commit
72
      loading: false,
04e3fbc56   Jatinder Singh   minor fix
73
      email: ''
93a68cfa1   Jatinder Singh   first commit
74
75
76
    }),
  
    methods: {
e173bab21   Jatinder Singh   api
77
      reset () {
03dcbf0c1   Neeraj Sharma   fix all api and r...
78

e3e2a04c6   Neeraj Sharma   first commit
79
        http().get('/schoolForgotPassword?email='+ this.changePassword)
e173bab21   Jatinder Singh   api
80
          .then(response => {
03dcbf0c1   Neeraj Sharma   fix all api and r...
81
82
83
84
85
86
87
88
            console.log("response=====>",response);
            this.loading = true;
            if(this.snackbar=true){
                this.text= "Please check your email and Copy your password!"              
            }
            setTimeout(() => {
            this.$router.push('/');
         }, 1000);
e173bab21   Jatinder Singh   api
89
         }).catch(err => {
03dcbf0c1   Neeraj Sharma   fix all api and r...
90
91
92
             this.text="User Not Found or Incorrect Email"
             this.snackbar= true;
             this.loading = false;
e173bab21   Jatinder Singh   api
93
         })
93a68cfa1   Jatinder Singh   first commit
94
      }
03dcbf0c1   Neeraj Sharma   fix all api and r...
95
96
97
98
99
100
    },
    computed:{
    color(){
      return this.loading ? 'success' : 'error'
  }
  }
93a68cfa1   Jatinder Singh   first commit
101
102
103
104
105
106
107
108
109
110
111
112
113
  
  };
  </script>
  <style scoped lang="css">
    #login {
      height: 50%;
      width: 100%;
      position: absolute;
      top: 0;
      left: 0;
      content: "";
      z-index: 0;
    }
04e3fbc56   Jatinder Singh   minor fix
114
115
116
117
118
119
120
121
  img{
  position:absolute;
  top:13px;
  left:50px;
  }
  .v-btn--large {
      padding: 0px 74px;
  }
9f9522c1d   Neeraj Sharma   fix button text a...
122
123
124
  .button{
    text-transform: none;
  }
03dcbf0c1   Neeraj Sharma   fix all api and r...
125
126
127
128
129
130
131
132
133
  @media screen and (max-width: 472px) {
  .v-btn--large {
      padding:0px 20px !important;
      font-size:13px;
  }
  h5 {
      font-size: 11px;
  }
  }
a0fe54618   Neeraj Sharma   finally fix
134
135
136
137
138
139
140
141
  @media screen and (max-width: 600px) {  
  img{
  top:16px;
  left:10px;
  height: 24px;
  width: 66px;;
  }
  }
93a68cfa1   Jatinder Singh   first commit
142
  </style>