Advertisement
Guest User

Untitled

a guest
Mar 11th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.78 KB | None | 0 0
  1. <template>
  2.   <v-app id="inspire">
  3.     <v-content class="white">
  4.       <v-container fluid grid-list-md px-2 py-2 fill-height>
  5.         <v-layout justify-center align-center text-xs-center fill-height wrap>
  6.           <v-flex xs12 sm8 md4>
  7.             <v-card tile class="px-3 pt-3 pb-5 custom-border">
  8.               <v-card-text>
  9.                 <img id="logo" src="~@/assets/logo3.png" alt="electron-vue" width="125px">
  10.  
  11.                 <div class="font-weight-medium headline text-xs-center mb-2">Login</div>
  12.                 <div
  13.                  class="font-weight-regular subheading text-xs-center mb-5"
  14.                >Use your Forca POS account</div>
  15.                 <v-form>
  16.                   <v-text-field
  17.                    prepend-inner-icon="person"
  18.                    solo
  19.                    hide-details
  20.                    name="username"
  21.                    label="Username"
  22.                    type="text"
  23.                    class="mb-2"
  24.                    v-model="form.username"
  25.                  ></v-text-field>
  26.                   <v-text-field
  27.                    prepend-inner-icon="lock"
  28.                    solo
  29.                    hide-details
  30.                    name="password"
  31.                    label="Password"
  32.                    id="password"
  33.                    type="password"
  34.                    v-model="form.password"
  35.                  ></v-text-field>
  36.                 </v-form>
  37.               </v-card-text>
  38.               <v-card-actions class="mt-4">
  39.                 <v-btn color="primary" class="text-none" flat>Create account</v-btn>
  40.                 <v-spacer></v-spacer>
  41.                 <v-btn
  42.                  color="primary"
  43.                  depressed
  44.                  class="mr-2 text-none"
  45.                  :loading="loading"
  46.                  :disabled="loading"
  47.                  @click="login()"
  48.                >Login</v-btn>
  49.               </v-card-actions>
  50.             </v-card>
  51.           </v-flex>
  52.         </v-layout>
  53.       </v-container>
  54.     </v-content>
  55.   </v-app>
  56. </template>
  57.  
  58. <script>
  59. /* eslint-disable */
  60.  
  61. export default {
  62.   name: "login-page",
  63.   data() {
  64.     return {
  65.       loading: false,
  66.       form: {
  67.         username : "",
  68.         password : ""
  69.       }
  70.     };
  71.   },
  72.   methods: {
  73.     login() {
  74.       this.loading = true;
  75.       this.$store.dispatch("GET_AUTH", this.form).then(result => {
  76.         if(result.status == 200){
  77.           this.$router.push({
  78.             name : "cashier-page"
  79.           })
  80.         } else {
  81.           console.log("Username and/or Password are wrong");
  82.         }
  83.         this.loading = false;
  84.       });
  85.     }
  86.   },
  87.  
  88.   mounted() {},
  89.   props: {
  90.     source: String
  91.   },
  92.   watch: {},
  93.   created() {},
  94.   computed: {}
  95. };
  96. </script>
  97.  
  98. <style scoped>
  99. /* CSS */
  100. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement