Browse Source

Home Screen & Search foundation & restaurant Cats

master
George Williams 4 years ago
parent
commit
063d052d65

+ 54
- 0
package-lock.json View File

894
         "to-fast-properties": "^2.0.0"
894
         "to-fast-properties": "^2.0.0"
895
       }
895
       }
896
     },
896
     },
897
+    "@fortawesome/fontawesome-common-types": {
898
+      "version": "0.2.28",
899
+      "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.28.tgz",
900
+      "integrity": "sha512-gtis2/5yLdfI6n0ia0jH7NJs5i/Z/8M/ZbQL6jXQhCthEOe5Cr5NcQPhgTvFxNOtURE03/ZqUcEskdn2M+QaBg=="
901
+    },
897
     "@fortawesome/fontawesome-free": {
902
     "@fortawesome/fontawesome-free": {
898
       "version": "5.12.0",
903
       "version": "5.12.0",
899
       "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.12.0.tgz",
904
       "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.12.0.tgz",
900
       "integrity": "sha512-vKDJUuE2GAdBERaQWmmtsciAMzjwNrROXA5KTGSZvayAsmuTGjam5z6QNqNPCwDfVljLWuov1nEC3mEQf/n6fQ==",
905
       "integrity": "sha512-vKDJUuE2GAdBERaQWmmtsciAMzjwNrROXA5KTGSZvayAsmuTGjam5z6QNqNPCwDfVljLWuov1nEC3mEQf/n6fQ==",
901
       "dev": true
906
       "dev": true
902
     },
907
     },
908
+    "@fortawesome/fontawesome-svg-core": {
909
+      "version": "1.2.28",
910
+      "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.28.tgz",
911
+      "integrity": "sha512-4LeaNHWvrneoU0i8b5RTOJHKx7E+y7jYejplR7uSVB34+mp3Veg7cbKk7NBCLiI4TyoWS1wh9ZdoyLJR8wSAdg==",
912
+      "requires": {
913
+        "@fortawesome/fontawesome-common-types": "^0.2.28"
914
+      }
915
+    },
916
+    "@fortawesome/free-solid-svg-icons": {
917
+      "version": "5.13.0",
918
+      "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.13.0.tgz",
919
+      "integrity": "sha512-IHUgDJdomv6YtG4p3zl1B5wWf9ffinHIvebqQOmV3U+3SLw4fC+LUCCgwfETkbTtjy5/Qws2VoVf6z/ETQpFpg==",
920
+      "requires": {
921
+        "@fortawesome/fontawesome-common-types": "^0.2.28"
922
+      }
923
+    },
903
     "@hapi/address": {
924
     "@hapi/address": {
904
       "version": "2.1.4",
925
       "version": "2.1.4",
905
       "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz",
926
       "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz",
2411
       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
2432
       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
2412
       "dev": true
2433
       "dev": true
2413
     },
2434
     },
2435
+    "blueimp-canvas-to-blob": {
2436
+      "version": "3.27.0",
2437
+      "resolved": "https://registry.npmjs.org/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.27.0.tgz",
2438
+      "integrity": "sha512-AcIj+hCw6WquxzJuzC6KzgYmqxLFeTWe88KuY2BEIsW1zbEOfoinDAGlhyvFNGt+U3JElkVSK7anA1FaSdmmfA=="
2439
+    },
2414
     "bn.js": {
2440
     "bn.js": {
2415
       "version": "4.11.8",
2441
       "version": "4.11.8",
2416
       "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
2442
       "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
5555
         }
5581
         }
5556
       }
5582
       }
5557
     },
5583
     },
5584
+    "font-awesome": {
5585
+      "version": "4.7.0",
5586
+      "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz",
5587
+      "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM="
5588
+    },
5558
     "for-in": {
5589
     "for-in": {
5559
       "version": "1.0.2",
5590
       "version": "1.0.2",
5560
       "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
5591
       "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
7404
         "easy-stack": "^1.0.0"
7435
         "easy-stack": "^1.0.0"
7405
       }
7436
       }
7406
     },
7437
     },
7438
+    "js-sha256": {
7439
+      "version": "0.9.0",
7440
+      "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz",
7441
+      "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA=="
7442
+    },
7407
     "js-tokens": {
7443
     "js-tokens": {
7408
       "version": "4.0.0",
7444
       "version": "4.0.0",
7409
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
7445
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
12266
         "vue": "^2.5.17"
12302
         "vue": "^2.5.17"
12267
       }
12303
       }
12268
     },
12304
     },
12305
+    "vue-fontawesome-icon": {
12306
+      "version": "1.3.0",
12307
+      "resolved": "https://registry.npmjs.org/vue-fontawesome-icon/-/vue-fontawesome-icon-1.3.0.tgz",
12308
+      "integrity": "sha512-nuwBARz2AgxHV4sbS+xc/pvIPBVM3XbgW9R7aHW8AODkLLmf2qiMTov74/C0jspgcod7pxjPtRMyxX2j0feBEg==",
12309
+      "requires": {
12310
+        "core-js": "^2.6.5",
12311
+        "vue": "^2.6.10"
12312
+      }
12313
+    },
12269
     "vue-hot-reload-api": {
12314
     "vue-hot-reload-api": {
12270
       "version": "2.3.4",
12315
       "version": "2.3.4",
12271
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
12316
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
12272
       "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
12317
       "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
12273
       "dev": true
12318
       "dev": true
12274
     },
12319
     },
12320
+    "vue-image-upload-resize": {
12321
+      "version": "2.3.0",
12322
+      "resolved": "https://registry.npmjs.org/vue-image-upload-resize/-/vue-image-upload-resize-2.3.0.tgz",
12323
+      "integrity": "sha512-ElzyAVCluiDt8xSZkSK9FbuLY5mr23JlO4cHyyRo86RfEGLWtvXrTq7vYOgDstT8rNBmnTgNCkPKc0rpmyl1yA==",
12324
+      "requires": {
12325
+        "blueimp-canvas-to-blob": "^3.14.0",
12326
+        "vue": "^2.5.17"
12327
+      }
12328
+    },
12275
     "vue-js-modal": {
12329
     "vue-js-modal": {
12276
       "version": "1.3.33",
12330
       "version": "1.3.33",
12277
       "resolved": "https://registry.npmjs.org/vue-js-modal/-/vue-js-modal-1.3.33.tgz",
12331
       "resolved": "https://registry.npmjs.org/vue-js-modal/-/vue-js-modal-1.3.33.tgz",

+ 6
- 0
package.json View File

9
     "lint": "vue-cli-service lint"
9
     "lint": "vue-cli-service lint"
10
   },
10
   },
11
   "dependencies": {
11
   "dependencies": {
12
+    "@fortawesome/fontawesome-svg-core": "^1.2.28",
13
+    "@fortawesome/free-solid-svg-icons": "^5.13.0",
12
     "@nuxtjs/axios": "^5.9.3",
14
     "@nuxtjs/axios": "^5.9.3",
13
     "animate.css": "^3.7.2",
15
     "animate.css": "^3.7.2",
14
     "axios": "^0.19.2",
16
     "axios": "^0.19.2",
15
     "core-js": "^2.6.11",
17
     "core-js": "^2.6.11",
16
     "datatables.net": "^1.10.20",
18
     "datatables.net": "^1.10.20",
19
+    "font-awesome": "^4.7.0",
17
     "jquery": "^3.4.1",
20
     "jquery": "^3.4.1",
21
+    "js-sha256": "^0.9.0",
18
     "lodash": "^4.17.15",
22
     "lodash": "^4.17.15",
19
     "material-design-icons-iconfont": "^3.0.3",
23
     "material-design-icons-iconfont": "^3.0.3",
20
     "moment": "^2.24.0",
24
     "moment": "^2.24.0",
27
     "vue-browser-geolocation": "^1.8.0",
31
     "vue-browser-geolocation": "^1.8.0",
28
     "vue-carousel": "^0.18.0",
32
     "vue-carousel": "^0.18.0",
29
     "vue-eva-icons": "^1.1.1",
33
     "vue-eva-icons": "^1.1.1",
34
+    "vue-fontawesome-icon": "^1.3.0",
35
+    "vue-image-upload-resize": "^2.3.0",
30
     "vue-js-modal": "^1.3.33",
36
     "vue-js-modal": "^1.3.33",
31
     "vue-json-excel": "^0.2.98",
37
     "vue-json-excel": "^0.2.98",
32
     "vue-router": "^3.1.5",
38
     "vue-router": "^3.1.5",

BIN
public/img/AltImage.png View File


BIN
public/img/delivery-truck-with-circular-clock.png View File


BIN
public/img/delivery-truck-with-dollar.png View File


BIN
public/img/logos/Provision-logoCropped.png View File


+ 63
- 79
src/components/accounts/login.vue View File

1
 <template>
1
 <template>
2
-  <!-- <div>
3
-    <div class="container" style="padding-top:120px; padding-left:18%;">
4
-      <div class="col-md-12" style="text-align:left">
5
-        <b-card title="Login" tag="article" style="max-width: 20rem;" class="mb-6">
6
-          <div class="row">
7
-            <div class="col-md-12" style="margin-bottom: 1em">
8
-              <label>Cellphone / Email</label>
9
-              <div class="input-group-prepend">
10
-                <input class="form-control" type="text" name="username" />
11
-              </div>
12
-            </div>
13
-          </div>
14
-          <div class="row">
15
-            <div class="col-md-12" style="margin-bottom: 1em">
16
-              <label>Password</label>
17
-              <div class="input-group-prepend">
18
-                <input class="form-control" type="password" name="password" />
19
-              </div>
20
-            </div>
21
-          </div>
22
-
23
-          <b-button variant="primary" @click="Login">Login</b-button>
24
-        </b-card>
25
-      </div>
26
-    </div>
27
-  </div>-->
28
   <div class="login-page">
2
   <div class="login-page">
29
-    <form id="signIn">
30
-      <div class="form col-md-12">
31
-        <div>
32
-          <h4>Login</h4>
33
-        </div>
34
-        <div v-if="false">
35
-          <alert
36
-            :text="'User doesn\'t exist or Username and Password is incorrect'"
37
-            :type="'ERROR'"
38
-          />
39
-        </div>
40
-        <div class="row">
41
-          <div class="col-md-12" style="margin-bottom: 1em">
42
-            <div class="input-group mb-3">
43
-              <div class="input-group-prepend">
44
-                <span class="input-group-text">
45
-                  <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
46
-                </span>
47
-                <input
48
-                  class="form-control"
49
-                  type="text"
50
-                  placeholder="Email / Cell"
51
-                  v-model="username"
52
-                  value
53
-                />
54
-              </div>
3
+    <div class="form col-md-12">
4
+      <div>
5
+        <h4>Login</h4>
6
+      </div>
7
+      <div v-if="hasError">
8
+        <alert :text="errorMessage" :type="'ERROR'" />
9
+      </div>
10
+      <div class="row">
11
+        <div class="col-md-12" style="margin-bottom: 1em">
12
+          <div class="input-group mb-3">
13
+            <div class="input-group-prepend">
14
+              <span class="input-group-text">
15
+                <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
16
+              </span>
17
+              <input
18
+                class="form-control"
19
+                type="text"
20
+                placeholder="Email Address"
21
+                v-model="auth.emailAddress"
22
+                value
23
+              />
55
             </div>
24
             </div>
56
-            <div class="input-group mb-3">
57
-              <div class="input-group-prepend">
58
-                <span class="input-group-text">
59
-                  <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
25
+          </div>
26
+          <div class="input-group mb-3">
27
+            <div class="input-group-prepend">
28
+              <span class="input-group-text">
29
+                <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
30
+              </span>
31
+              <input
32
+                class="form-control"
33
+                :type="isPasswordShown"
34
+                v-model="auth.password"
35
+                id="password"
36
+                placeholder="Password"
37
+                value
38
+              />
39
+              <div class="input-group-append">
40
+                <span class="input-group-text" @click="togglePassword()">
41
+                  <eva-icon v-if="showPassword" name="eye-off-outline" fill="#60CBEB"></eva-icon>
42
+                  <eva-icon v-else name="eye-outline" fill="#60CBEB"></eva-icon>
60
                 </span>
43
                 </span>
61
-                <input
62
-                  class="form-control"
63
-                  :type="isPasswordShown"
64
-                  v-model="password"
65
-                  id="password"
66
-                  placeholder="Password"
67
-                  value
68
-                />
69
-                <div class="input-group-append">
70
-                  <span class="input-group-text">
71
-                    <eva-icon
72
-                      v-if="showPassword"
73
-                      name="eye-off-outline"
74
-                      fill="#60CBEB"
75
-                      @click="togglePassword()"
76
-                    ></eva-icon>
77
-                    <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="togglePassword()"></eva-icon>
78
-                  </span>
79
-                </div>
80
               </div>
44
               </div>
81
             </div>
45
             </div>
82
           </div>
46
           </div>
83
         </div>
47
         </div>
84
-        <button @click="Login()" class="btn btn-b-n" type="submit">Login</button>
85
       </div>
48
       </div>
86
-    </form>
49
+      <button @click="Login()" class="btn btn-b-n" type="button">Login</button>
50
+    </div>
87
   </div>
51
   </div>
88
 </template>
52
 </template>
89
 
53
 
90
 <script>
54
 <script>
55
+import { mapState, mapActions } from "vuex";
56
+
91
 export default {
57
 export default {
92
   name: "Login",
58
   name: "Login",
93
   data() {
59
   data() {
94
     return {
60
     return {
95
       isPasswordShown: "password",
61
       isPasswordShown: "password",
96
-      showPassword: false
62
+      showPassword: false,
63
+      hasError: false,
64
+      errorMessage: ""
97
     };
65
     };
98
   },
66
   },
99
   methods: {
67
   methods: {
68
+    ...mapActions("authentiaction", ["getAuthentication", "Login"]),
100
     Login() {
69
     Login() {
101
-      //Handle Login
70
+      this.Login(this.auth).then(() => {
71
+        if (this.$store.state.auth.resault === "Access Granted") {
72
+          console.log(JSON.stringify(this.auth));
73
+          this.$router.push("/");
74
+        } else {
75
+          console.log(JSON.stringify(this.auth));
76
+          this.hasError = true;
77
+          this.errorMessage = this.$store.state.auth.resault;
78
+        }
79
+      });
102
     },
80
     },
103
     togglePassword() {
81
     togglePassword() {
104
       if (this.showPassword) {
82
       if (this.showPassword) {
109
 
87
 
110
       this.showPassword = !this.showPassword;
88
       this.showPassword = !this.showPassword;
111
     }
89
     }
90
+  },
91
+  computed: {
92
+    ...mapState("authentiaction", ["auth"])
93
+  },
94
+  mounted() {
95
+    this.getAuthentication();
112
   }
96
   }
113
 };
97
 };
114
 </script>
98
 </script>

+ 156
- 108
src/components/accounts/register.vue View File

1
 <template>
1
 <template>
2
-  <form>
3
-    <div class="reg-page">
4
-      <div class="regform">
5
-        <div class="col-md-12" style="text-align:left">
6
-          <h4>User Registration</h4>
7
-          <div class="form-group row"></div>
8
-          <div class="row" style="text-align:left">
9
-            <div class="col-md-12" style="margin-bottom: 1em">
10
-              <div class="input-group-prepend">
11
-                <span class="input-group-text">
12
-                  <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
13
-                </span>
14
-                <input class="form-control" type="text" name="name" placeholder="Name" />
15
-              </div>
2
+  <div class="reg-page">
3
+    <div class="regform">
4
+      <div class="col-md-12" style="text-align:left">
5
+        <h4>User Registration</h4>
6
+        <div class="form-group row"></div>
7
+        <div v-if="hasError" class="form-group row">
8
+          <div>
9
+            <alert :text="resultString" :type="'ERROR'" class="col-md-12" />
10
+          </div>
11
+        </div>
12
+        <div class="row" style="text-align:left">
13
+          <div class="col-md-12" style="margin-bottom: 1em">
14
+            <label>Name</label>
15
+            <div class="input-group-prepend">
16
+              <span class="input-group-text">
17
+                <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
18
+              </span>
19
+              <input class="form-control" type="text" name="name" v-model="userContainer.firstName" />
16
             </div>
20
             </div>
17
-            <div class="col-md-12" style="margin-bottom: 1em">
18
-              <div class="input-group-prepend">
19
-                <span class="input-group-text">
20
-                  <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
21
-                </span>
22
-                <input class="form-control" type="text" name="surname" placeholder="Surname" />
23
-              </div>
21
+          </div>
22
+        </div>
23
+        <div class="row" style="text-align:left">
24
+          <div class="col-md-12" style="margin-bottom: 1em">
25
+            <label>Surname</label>
26
+            <div class="input-group-prepend">
27
+              <span class="input-group-text">
28
+                <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
29
+              </span>
30
+              <input
31
+                class="form-control"
32
+                type="text"
33
+                name="surname"
34
+                v-model="userContainer.surname"
35
+              />
24
             </div>
36
             </div>
25
-            <div class="col-md-12" style="margin-bottom: 1em">
26
-              <div class="input-group-prepend">
27
-                <span class="input-group-text">
28
-                  <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
29
-                </span>
30
-                <input class="form-control" type="text" name="email" placeholder="Email Address" />
31
-              </div>
37
+          </div>
38
+        </div>
39
+        <div class="row" style="text-align:left">
40
+          <div class="col-md-12" style="margin-bottom: 1em">
41
+            <label>Email Address</label>
42
+            <div class="input-group-prepend">
43
+              <span class="input-group-text">
44
+                <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
45
+              </span>
46
+              <input
47
+                class="form-control"
48
+                type="text"
49
+                name="email"
50
+                v-model="userContainer.emailAddress"
51
+              />
32
             </div>
52
             </div>
33
-            <div class="col-md-12" style="margin-bottom: 1em">
34
-              <div class="input-group-prepend">
35
-                <span class="input-group-text">
36
-                  <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
37
-                </span>
38
-                <input
39
-                  class="form-control"
40
-                  type="text"
41
-                  name="cellnumber"
42
-                  placeholder="Cellphone Number"
43
-                />
44
-              </div>
53
+          </div>
54
+        </div>
55
+        <div class="row" style="text-align:left">
56
+          <div class="col-md-12" style="margin-bottom: 1em">
57
+            <label>Cellphone</label>
58
+            <div class="input-group-prepend">
59
+              <span class="input-group-text">
60
+                <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
61
+              </span>
62
+              <input
63
+                class="form-control"
64
+                type="text"
65
+                name="cellnumber"
66
+                v-model="userContainer.cellphone"
67
+              />
45
             </div>
68
             </div>
46
           </div>
69
           </div>
47
-          <div class="row" style="text-align:left">
48
-            <div class="col-md-12" style="margin-bottom: 1em">
49
-              <div class="input-group-prepend">
50
-                <span class="input-group-text">
51
-                  <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
52
-                </span>
53
-                <input
54
-                  class="form-control"
55
-                  :type="PasswordBoxType"
56
-                  id="password"
57
-                  placeholder="Password"
58
-                  name="password"
59
-                  value
60
-                />
61
-              </div>
70
+        </div>
71
+        <div class="row" style="text-align:left">
72
+          <div class="col-md-12" style="margin-bottom: 1em">
73
+            <label>Password</label>
74
+            <div class="input-group-prepend">
75
+              <span class="input-group-text">
76
+                <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
77
+              </span>
78
+              <input
79
+                class="form-control"
80
+                :type="PasswordBoxType"
81
+                id="password"
82
+                name="password"
83
+                v-model="userContainer.password"
84
+                value
85
+              />
62
             </div>
86
             </div>
63
-            <div class="col-md-12" style="margin-bottom: 1em">
64
-              <div class="input-group-prepend">
65
-                <span class="input-group-text">
66
-                  <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
67
-                </span>
68
-                <input
69
-                  class="form-control"
70
-                  :type="PasswordBoxType"
71
-                  id="confirmpassword"
72
-                  placeholder="Confirm Password"
73
-                  name="confirmpassword"
74
-                  v-model="confirmpassword"
75
-                  value
76
-                />
77
-                <div>
78
-                  <div class="input-group-append">
79
-                    <span class="input-group-text">
80
-                      <eva-icon
81
-                        v-if="showPassword"
82
-                        name="eye-off-outline"
83
-                        fill="#60CBEB"
84
-                        @click="togglePassword()"
85
-                      ></eva-icon>
86
-                      <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="togglePassword()"></eva-icon>
87
-                    </span>
88
-                  </div>
87
+          </div>
88
+        </div>
89
+        <div class="row" style="text-align:left">
90
+          <div class="col-md-12" style="margin-bottom: 1em">
91
+            <label>Confirm Password</label>
92
+            <div class="input-group-prepend">
93
+              <span class="input-group-text">
94
+                <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
95
+              </span>
96
+              <input
97
+                class="form-control"
98
+                :type="PasswordBoxType"
99
+                id="confirmpassword"
100
+                name="confirmpassword"
101
+                v-model="confirmpassword"
102
+                value
103
+              />
104
+              <div>
105
+                <div class="input-group-append">
106
+                  <span class="input-group-text">
107
+                    <eva-icon
108
+                      v-if="showPassword"
109
+                      name="eye-off-outline"
110
+                      fill="#60CBEB"
111
+                      @click="togglePassword()"
112
+                    ></eva-icon>
113
+                    <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="togglePassword()"></eva-icon>
114
+                  </span>
89
                 </div>
115
                 </div>
90
               </div>
116
               </div>
91
             </div>
117
             </div>
92
           </div>
118
           </div>
93
-          <div class="form-group row"></div>
94
-          <div class="row offset-md-4">
95
-            <div class="col-md-2">
96
-              <button
97
-                @click="SubmitData()"
98
-                class="btn btn-b-n"
99
-                type="submit"
100
-                data-dismiss="modal"
101
-              >Submit</button>
102
-            </div>
103
-            <div class="col-md-2 offset-md-1">
104
-              <button @click="Close()" class="btn btn-b-n" type="submit" data-dismiss="modal">Cancel</button>
105
-            </div>
119
+        </div>
120
+        <div class="form-group row"></div>
121
+        <div class="row offset-md-4">
122
+          <div class="col-md-2">
123
+            <button
124
+              @click="RegisterData()"
125
+              class="btn btn-b-n"
126
+              type="submit"
127
+              data-dismiss="modal"
128
+            >Submit</button>
129
+          </div>
130
+          <div class="col-md-2 offset-md-1">
131
+            <button @click="Close()" class="btn btn-b-n" type="button" data-dismiss="modal">Cancel</button>
106
           </div>
132
           </div>
107
         </div>
133
         </div>
108
       </div>
134
       </div>
109
     </div>
135
     </div>
110
-  </form>
136
+  </div>
111
 </template>
137
 </template>
112
 
138
 
113
 <script>
139
 <script>
114
 import { mapState, mapActions } from "vuex";
140
 import { mapState, mapActions } from "vuex";
115
-//import { sha256 } from 'js-sha256'
141
+import alert from "../shared/alert.vue";
142
+
116
 export default {
143
 export default {
117
   name: "registration",
144
   name: "registration",
145
+  components: {
146
+    alert
147
+  },
118
   data() {
148
   data() {
119
     return {
149
     return {
120
-      passwordCheck: "",
121
       showPassword: false,
150
       showPassword: false,
122
       PasswordBoxType: "password",
151
       PasswordBoxType: "password",
123
-      confirmpassword: ""
152
+      confirmpassword: "",
153
+      hasError: false,
154
+      errorMsg: ""
124
     };
155
     };
125
   },
156
   },
126
   methods: {
157
   methods: {
127
-    ...mapActions("registration", ["regUser", "getUser"]),
158
+    ...mapActions("registration", ["regUser", "getUserContainer"]),
128
     RegisterData() {
159
     RegisterData() {
129
-      this.regUser(this.user).then(() => {
130
-        if (this.user.id > 0) {
131
-          this.$router.push("/login");
132
-        } else {
133
-          alert("Error");
134
-        }
135
-      });
160
+      this.hasError = false;
161
+      this.errorMsg = "";
162
+
163
+      if (this.userContainer.password !== this.confirmpassword) {
164
+        this.hasError = true;
165
+        this.errorMsg = "Passwords do not match.";
166
+        return;
167
+      }
168
+
169
+      // this.regUser(this.userContainer).then(() => {
170
+      //   if (this.userContainer.Id > 0) {
171
+      //     this.$router.push("/login");
172
+      //   } else {
173
+      //     this.errorMsg = this.userContainer.resultString;
174
+      //     this.hasError = true;
175
+      //     this.userContainer.password = "";
176
+      //     this.confirmpassword = "";
177
+      //   }
178
+      // });
179
+      this.regUser(this.userContainer);
180
+      this.$router.push("/login");
136
     },
181
     },
137
     Close() {
182
     Close() {
138
       this.$router.push("/");
183
       this.$router.push("/");
148
     }
193
     }
149
   },
194
   },
150
   computed: {
195
   computed: {
151
-    ...mapState("registration", ["user"])
196
+    ...mapState("registration", ["userContainer"]),
197
+    resultString() {
198
+      return this.userContainer.resultString;
199
+    }
152
   },
200
   },
153
   mounted() {
201
   mounted() {
154
-    //this.getUser(0);
202
+    this.getUserContainer();
155
   }
203
   }
156
 };
204
 };
157
 </script>
205
 </script>

+ 380
- 224
src/components/accounts/restaurantRegistration.vue View File

1
 <template>
1
 <template>
2
-  <form>
3
-    <div class="reg-page">
4
-      <div class="regform">
5
-        <div class="col-md-12" style="text-align:left">
6
-          <h4>Restaurant Registration</h4>
7
-          <div class="form-group row"></div>
8
-          <div class="form-group row">
9
-            <div class="col-md-12" style="text-align:left">
10
-              <h5>Restaurant Details</h5>
11
-            </div>
2
+  <div class="reg-page">
3
+    <div class="regform">
4
+      <div class="col-md-12" style="text-align:left">
5
+        <h4>Restaurant Registration</h4>
6
+        <div class="form-group row"></div>
7
+        <div v-if="hasError" class="form-group row">
8
+          <div>
9
+            <alert :text="resultString" :type="'ERROR'" class="col-md-12" />
12
           </div>
10
           </div>
13
-          <div class="row" style="text-align:left">
14
-            <div class="col-md-12" style="margin-bottom: 1em">
15
-              <div class="input-group-prepend">
16
-                <span class="input-group-text">
17
-                  <eva-icon name="activity-outline" fill="#60CBEB"></eva-icon>
18
-                </span>
19
-                <input class="form-control" type="text" name="rname" placeholder="Name" />
20
-              </div>
21
-            </div>
11
+        </div>
12
+        <div class="form-group row">
13
+          <div class="col-md-12" style="text-align:left">
14
+            <h5>Restaurant Details</h5>
22
           </div>
15
           </div>
23
-          <div class="row" style="text-align:left">
24
-            <div class="col-md-12" style="margin-bottom: 1em">
25
-              <div class="input-group-prepend">
26
-                <span class="input-group-text">
27
-                  <eva-icon name="image-outline" fill="#60CBEB"></eva-icon>
28
-                </span>
29
-                <input type="file" name="logo" placeholder="Logo" />
30
-              </div>
16
+        </div>
17
+        <div class="row" style="text-align:left">
18
+          <div class="col-md-12" style="margin-bottom: 1em">
19
+            <label>Name</label>
20
+            <div class="input-group-prepend">
21
+              <span class="input-group-text">
22
+                <eva-icon name="edit-2-outline" fill="#60CBEB"></eva-icon>
23
+              </span>
24
+              <input
25
+                class="form-control"
26
+                type="text"
27
+                name="rname"
28
+                v-model="restaurantContainer.name"
29
+              />
31
             </div>
30
             </div>
32
           </div>
31
           </div>
33
-          <div class="row" style="text-align:left">
34
-            <div class="col-md-12" style="margin-bottom: 1em">
35
-              <div class="input-group-prepend">
36
-                <label>Are you part of a chain?</label>
37
-                <div class="custom-control custom-switch">
38
-                  <input
39
-                    style="margin-left: 1px"
40
-                    type="checkbox"
41
-                    class="custom-control-input"
42
-                    id="customSwitch1"
43
-                    :checked="chain"
44
-                    @change="ChangeChain"
45
-                  />
46
-                  <label
47
-                    class="custom-control-label"
48
-                    for="customSwitch1"
49
-                    style="margin-left: 40px"
50
-                  >{{chain ? 'Yes' : 'No'}}</label>
51
-                </div>
52
-              </div>
32
+        </div>
33
+        <div class="row" style="text-align:left">
34
+          <div class="col-md-12" style="margin-bottom: 1em">
35
+            <label>Logo / Cover Picture</label>
36
+            <div class="input-group-prepend">
37
+              <image-uploader
38
+                :preview="true"
39
+                :className="['fileinput', { 'fileinput--loaded': hasImage }]"
40
+                capture="environment"
41
+                :debug="1"
42
+                doNotResize="gif"
43
+                :autoRotate="true"
44
+                outputFormat="verbose"
45
+                @input="setImage"
46
+              >
47
+                <label for="fileInput" slot="upload-label">
48
+                  <figure>
49
+                    <path
50
+                      class="path1"
51
+                      d="M9.5 19c0 3.59 2.91 6.5 6.5 6.5s6.5-2.91 6.5-6.5-2.91-6.5-6.5-6.5-6.5 2.91-6.5 6.5zM30 8h-7c-0.5-2-1-4-3-4h-8c-2 0-2.5 2-3 4h-7c-1.1 0-2 0.9-2 2v18c0 1.1 0.9 2 2 2h28c1.1 0 2-0.9 2-2v-18c0-1.1-0.9-2-2-2zM16 27.875c-4.902 0-8.875-3.973-8.875-8.875s3.973-8.875 8.875-8.875c4.902 0 8.875 3.973 8.875 8.875s-3.973 8.875-8.875 8.875zM30 14h-4v-2h4v2z"
52
+                    ></path>
53
+                  </figure>
54
+                </label>
55
+              </image-uploader>
53
             </div>
56
             </div>
54
           </div>
57
           </div>
55
-          <div class="row" style="text-align:left">
56
-            <div class="col-md-12" style="margin-bottom: 1em">
57
-              <div class="input-group-prepend">
58
-                <span class="input-group-text">
59
-                  <eva-icon name="credit-card-outline" fill="#60CBEB"></eva-icon>
60
-                </span>
61
-                <input
62
-                  class="form-control"
63
-                  type="number"
64
-                  name="deliveryFee"
65
-                  placeholder="Delivery Fee"
66
-                />
67
-              </div>
58
+        </div>
59
+        <div class="row" style="text-align:left">
60
+          <div class="col-md-12" style="margin-bottom: 1em">
61
+            <label>Delivery Fee</label>
62
+            <div class="input-group-prepend">
63
+              <span class="input-group-text">
64
+                <eva-icon name="credit-card-outline" fill="#60CBEB"></eva-icon>
65
+              </span>
66
+              <input
67
+                class="form-control"
68
+                type="number"
69
+                name="deliveryFee"
70
+                v-model="restaurantContainer.deliveryFee"
71
+              />
68
             </div>
72
             </div>
69
           </div>
73
           </div>
70
-          <div class="row" style="text-align:left">
71
-            <div class="col-md-12" style="margin-bottom: 1em">
72
-              <div class="input-group-prepend">
73
-                <span class="input-group-text">
74
-                  <eva-icon name="navigation-2-outline" fill="#60CBEB"></eva-icon>
75
-                </span>
76
-                <input
77
-                  class="form-control"
78
-                  type="number"
79
-                  name="deliveryRadius"
80
-                  placeholder="Delivery Radius(KM)"
81
-                />
82
-              </div>
74
+        </div>
75
+        <div class="row" style="text-align:left">
76
+          <div class="col-md-12" style="margin-bottom: 1em">
77
+            <label>Delivery Radius (KM)</label>
78
+            <div class="input-group-prepend">
79
+              <span class="input-group-text">
80
+                <eva-icon name="pin-outline" fill="#60CBEB"></eva-icon>
81
+              </span>
82
+              <input
83
+                class="form-control"
84
+                type="number"
85
+                name="deliveryRadius"
86
+                v-model="restaurantContainer.deliveryRadius"
87
+              />
83
             </div>
88
             </div>
84
           </div>
89
           </div>
85
-          <div class="row" style="text-align:left">
86
-            <div class="col-md-12" style="margin-bottom: 1em">
87
-              <div class="input-group-prepend">
88
-                <label>Methods Of Payment</label>
89
-                <!-- <span class="input-group-text">
90
-                  <eva-icon name="credit-card-outline" fill="#60CBEB"></eva-icon>
91
-                </span>-->
92
-                <ul>
93
-                  <li v-for="(mop, i) in mops" :key="i">
94
-                    <input type="checkbox" :id="mop.name" :value="mop.name" v-model="selectedMops" />
95
-                    <label :for="mop.name">{{ mop.name }}</label>
96
-                  </li>
97
-                </ul>
98
-              </div>
90
+        </div>
91
+        <div class="row" style="text-align:left">
92
+          <div class="col-md-12" style="margin-bottom: 1em">
93
+            <label>Delivery Time (Minutes)</label>
94
+            <div class="input-group-prepend">
95
+              <span class="input-group-text">
96
+                <eva-icon name="clock-outline" fill="#60CBEB"></eva-icon>
97
+              </span>
98
+              <input
99
+                class="form-control"
100
+                type="number"
101
+                name="deliveryRadius"
102
+                placeholder="From"
103
+                v-model="deliverfrom"
104
+              />
105
+              <input
106
+                class="form-control"
107
+                type="number"
108
+                name="deliveryRadius"
109
+                placeholder="To"
110
+                v-model="deliverTo"
111
+              />
99
             </div>
112
             </div>
100
           </div>
113
           </div>
101
-          <div class="row" style="text-align:left">
102
-            <div class="col-md-12" style="margin-bottom: 1em">
103
-              <div class="input-group-prepend">
104
-                <span class="input-group-text">
105
-                  <eva-icon name="activity-outline" fill="#60CBEB"></eva-icon>
106
-                </span>
107
-                <input
108
-                  class="form-control"
109
-                  type="text"
110
-                  name="shopName"
111
-                  placeholder="Shopping Centre"
112
-                />
113
-              </div>
114
+        </div>
115
+        <div class="row" style="text-align:left">
116
+          <div class="col-md-12" style="margin-bottom: 1em">
117
+            <div class="input-group-prepend">
118
+              <label>Methods Of Payment</label>
119
+              <ul>
120
+                <li v-for="(mop, i) in mops" :key="i">
121
+                  <input type="checkbox" :id="mop.name" :value="mop.name" v-model="selectedMops" />
122
+                  <label :for="mop.name">{{ mop.name }}</label>
123
+                </li>
124
+              </ul>
114
             </div>
125
             </div>
115
           </div>
126
           </div>
116
-          <div class="row" style="text-align:left">
117
-            <div class="col-md-12" style="margin-bottom: 1em">
118
-              <div class="input-group-prepend">
119
-                <span class="input-group-text">
120
-                  <eva-icon name="activity-outline" fill="#60CBEB"></eva-icon>
121
-                </span>
122
-                <input class="form-control" type="text" name="shopNo" placeholder="Shop Number" />
123
-              </div>
127
+        </div>
128
+        <div class="row" style="text-align:left">
129
+          <div class="col-md-12" style="margin-bottom: 1em">
130
+            <label>Shopping Centre</label>
131
+            <div class="input-group-prepend">
132
+              <span class="input-group-text">
133
+                <eva-icon name="shopping-cart-outline" fill="#60CBEB"></eva-icon>
134
+              </span>
135
+              <input
136
+                class="form-control"
137
+                type="text"
138
+                name="shopName"
139
+                v-model="restaurantContainer.shoppingCentre"
140
+              />
124
             </div>
141
             </div>
125
           </div>
142
           </div>
126
-          <div class="row" style="text-align:left">
127
-            <div class="col-md-12" style="margin-bottom: 1em">
128
-              <Map @GoogleAddress="UpdateAddress" />
143
+        </div>
144
+        <div class="row" style="text-align:left">
145
+          <div class="col-md-12" style="margin-bottom: 1em">
146
+            <label>Shop Number</label>
147
+            <div class="input-group-prepend">
148
+              <span class="input-group-text">
149
+                <eva-icon name="hash-outline" fill="#60CBEB"></eva-icon>
150
+              </span>
151
+              <input
152
+                class="form-control"
153
+                type="text"
154
+                name="shopNo"
155
+                v-model="restaurantContainer.shopNumber"
156
+              />
129
             </div>
157
             </div>
130
           </div>
158
           </div>
131
-          <div class="row" style="text-align:left">
132
-            <div class="col-md-12" style="margin-bottom: 1em">
133
-              <label>Trading Hours</label>
134
-              <ListView
135
-                :items="tradingHours"
136
-                :showColumnChooser="false"
137
-                :hideSearch="true"
138
-                :deleteable="true"
139
-                @onDelete="Delete"
140
-                @onNew="New"
159
+        </div>
160
+        <div class="row" style="text-align:left">
161
+          <div class="col-md-12" style="margin-bottom: 1em">
162
+            <Map @GoogleAddress="UpdateAddress" />
163
+          </div>
164
+        </div>
165
+        <div class="row" style="text-align:left">
166
+          <div class="col-md-12" style="margin-bottom: 1em">
167
+            <label>Trading Hours</label>
168
+            <ListView
169
+              :items="tradingHours"
170
+              :showColumnChooser="false"
171
+              :hideSearch="true"
172
+              :deleteable="true"
173
+              @onDelete="Delete"
174
+              @onNew="New"
175
+            />
176
+            <modal name="tradingHours" :width="600" :height="380">
177
+              <TradingHours @tradingUpdate="TradingUpdate" />
178
+            </modal>
179
+          </div>
180
+        </div>
181
+        <div class="row" style="text-align:left">
182
+          <div class="col-md-12" style="margin-bottom: 1em">
183
+            <label>Categories</label>
184
+            <ListView
185
+              :items="categories"
186
+              :showColumnChooser="false"
187
+              :hideSearch="true"
188
+              :deleteable="true"
189
+              :displayColumn="columns"
190
+              :sortKey="Description"
191
+              @onDelete="DeleteCat"
192
+              @onNew="NewCat"
193
+            />
194
+            <modal name="Categories" :width="600" :height="500">
195
+              <Categories @selected="selectedCategory" />
196
+            </modal>
197
+          </div>
198
+        </div>
199
+        <hr />
200
+        <div class="form-group row">
201
+          <div class="col-md-12" style="text-align:left">
202
+            <h5>Restaurant Admin Details</h5>
203
+          </div>
204
+        </div>
205
+        <div class="row" style="text-align:left">
206
+          <div class="col-md-12" style="margin-bottom: 1em">
207
+            <label>First Name</label>
208
+            <div class="input-group-prepend">
209
+              <span class="input-group-text">
210
+                <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
211
+              </span>
212
+              <input
213
+                class="form-control"
214
+                type="text"
215
+                name="name"
216
+                v-model="restaurantContainer.userFirstName"
141
               />
217
               />
142
-              <modal name="tradingHours" :width="600" :height="330">
143
-                <TradingHours @tradingUpdate="TradingUpdate" />
144
-              </modal>
145
             </div>
218
             </div>
146
           </div>
219
           </div>
147
-          <hr />
148
-          <div class="form-group row">
149
-            <div class="col-md-12" style="text-align:left">
150
-              <h5>Restaurant Admin Details</h5>
220
+          <div class="col-md-12" style="margin-bottom: 1em">
221
+            <label>Surname</label>
222
+            <div class="input-group-prepend">
223
+              <span class="input-group-text">
224
+                <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
225
+              </span>
226
+              <input
227
+                class="form-control"
228
+                type="text"
229
+                name="surname"
230
+                v-model="restaurantContainer.userSurname"
231
+              />
151
             </div>
232
             </div>
152
           </div>
233
           </div>
153
-          <div class="row" style="text-align:left">
154
-            <div class="col-md-12" style="margin-bottom: 1em">
155
-              <div class="input-group-prepend">
156
-                <span class="input-group-text">
157
-                  <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
158
-                </span>
159
-                <input class="form-control" type="text" name="name" placeholder="Name" />
160
-              </div>
161
-            </div>
162
-            <div class="col-md-12" style="margin-bottom: 1em">
163
-              <div class="input-group-prepend">
164
-                <span class="input-group-text">
165
-                  <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
166
-                </span>
167
-                <input class="form-control" type="text" name="surname" placeholder="Surname" />
168
-              </div>
169
-            </div>
170
-            <div class="col-md-12" style="margin-bottom: 1em">
171
-              <div class="input-group-prepend">
172
-                <span class="input-group-text">
173
-                  <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
174
-                </span>
175
-                <input class="form-control" type="text" name="email" placeholder="Email Address" />
176
-              </div>
177
-            </div>
178
-            <div class="col-md-12" style="margin-bottom: 1em">
179
-              <div class="input-group-prepend">
180
-                <span class="input-group-text">
181
-                  <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
182
-                </span>
183
-                <input
184
-                  class="form-control"
185
-                  type="text"
186
-                  name="cellnumber"
187
-                  placeholder="Cellphone Number"
188
-                />
189
-              </div>
234
+          <div class="col-md-12" style="margin-bottom: 1em">
235
+            <label>Email Address</label>
236
+            <div class="input-group-prepend">
237
+              <span class="input-group-text">
238
+                <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
239
+              </span>
240
+              <input
241
+                class="form-control"
242
+                type="text"
243
+                name="email"
244
+                v-model="restaurantContainer.userEmailAddress"
245
+              />
190
             </div>
246
             </div>
191
           </div>
247
           </div>
192
-          <div class="row" style="text-align:left">
193
-            <div class="col-md-12" style="margin-bottom: 1em">
194
-              <div class="input-group-prepend">
195
-                <span class="input-group-text">
196
-                  <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
197
-                </span>
198
-                <input
199
-                  class="form-control"
200
-                  :type="PasswordBoxType"
201
-                  id="password"
202
-                  placeholder="Password"
203
-                  name="password"
204
-                  value
205
-                />
206
-              </div>
248
+        </div>
249
+        <div class="row" style="text-align:left">
250
+          <div class="col-md-12" style="margin-bottom: 1em">
251
+            <label>Password</label>
252
+            <div class="input-group-prepend">
253
+              <span class="input-group-text">
254
+                <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
255
+              </span>
256
+              <input
257
+                class="form-control"
258
+                :type="PasswordBoxType"
259
+                id="password"
260
+                name="password"
261
+                value
262
+                v-model="restaurantContainer.userPassword"
263
+              />
207
             </div>
264
             </div>
208
-            <div class="col-md-12" style="margin-bottom: 1em">
209
-              <div class="input-group-prepend">
210
-                <span class="input-group-text">
211
-                  <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
212
-                </span>
213
-                <input
214
-                  class="form-control"
215
-                  :type="PasswordBoxType"
216
-                  id="confirmpassword"
217
-                  placeholder="Confirm Password"
218
-                  name="confirmpassword"
219
-                  v-model="confirmpassword"
220
-                  value
221
-                />
222
-                <div>
223
-                  <div class="input-group-append">
224
-                    <span class="input-group-text">
225
-                      <eva-icon
226
-                        v-if="showPassword"
227
-                        name="eye-off-outline"
228
-                        fill="#60CBEB"
229
-                        @click="togglePassword()"
230
-                      ></eva-icon>
231
-                      <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="togglePassword()"></eva-icon>
232
-                    </span>
233
-                  </div>
265
+          </div>
266
+          <div class="col-md-12" style="margin-bottom: 1em">
267
+            <label>Confirm Password</label>
268
+            <div class="input-group-prepend">
269
+              <span class="input-group-text">
270
+                <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
271
+              </span>
272
+              <input
273
+                class="form-control"
274
+                :type="PasswordBoxType"
275
+                id="confirmpassword"
276
+                name="confirmpassword"
277
+                v-model="confirmpassword"
278
+                value
279
+              />
280
+              <div>
281
+                <div class="input-group-append">
282
+                  <span class="input-group-text">
283
+                    <eva-icon
284
+                      v-if="showPassword"
285
+                      name="eye-off-outline"
286
+                      fill="#60CBEB"
287
+                      @click="togglePassword()"
288
+                    ></eva-icon>
289
+                    <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="togglePassword()"></eva-icon>
290
+                  </span>
234
                 </div>
291
                 </div>
235
               </div>
292
               </div>
236
             </div>
293
             </div>
237
           </div>
294
           </div>
238
-          <div class="form-group row"></div>
239
-          <div class="row offset-md-4">
240
-            <div class="col-md-2">
241
-              <button
242
-                @click="SubmitData()"
243
-                class="btn btn-b-n"
244
-                type="submit"
245
-                data-dismiss="modal"
246
-              >Submit</button>
247
-            </div>
248
-            <div class="col-md-2 offset-md-1">
249
-              <button @click="Close()" class="btn btn-b-n" type="submit" data-dismiss="modal">Cancel</button>
295
+        </div>
296
+        <div class="form-group row"></div>
297
+        <div class="row offset-md-4">
298
+          <div class="col-md-2">
299
+            <button
300
+              @click="SubmitData()"
301
+              class="btn btn-b-n"
302
+              type="button"
303
+              data-dismiss="modal"
304
+            >Submit</button>
305
+          </div>
306
+          <div class="col-md-2 offset-md-1">
307
+            <button @click="Close()" class="btn btn-b-n" type="button" data-dismiss="modal">Cancel</button>
308
+          </div>
309
+        </div>
310
+        <div class="row" style="text-align:left">
311
+          <div class="col-md-12" style="margin-bottom: 1em">
312
+            <div v-if="hasError" class="form-group row">
313
+              <div>
314
+                <alert :text="resultString" :type="'ERROR'" class="col-md-12" />
315
+              </div>
250
             </div>
316
             </div>
251
           </div>
317
           </div>
252
         </div>
318
         </div>
253
       </div>
319
       </div>
254
     </div>
320
     </div>
255
-  </form>
321
+  </div>
256
 </template>
322
 </template>
257
 
323
 
258
 <script>
324
 <script>
260
 import ListView from "../shared/listView";
326
 import ListView from "../shared/listView";
261
 import Switches from "vue-switches";
327
 import Switches from "vue-switches";
262
 import TradingHours from "../accounts/tradingHours";
328
 import TradingHours from "../accounts/tradingHours";
329
+import { mapState, mapActions } from "vuex";
330
+import ImageUploader from "vue-image-upload-resize";
331
+import Categories from "../restaurants/restaurantCategorySelect";
263
 
332
 
264
 export default {
333
 export default {
265
   name: "RestaurantRegistration",
334
   name: "RestaurantRegistration",
267
     Map,
336
     Map,
268
     ListView,
337
     ListView,
269
     Switches,
338
     Switches,
270
-    TradingHours
339
+    TradingHours,
340
+    ImageUploader,
341
+    Categories
271
   },
342
   },
272
   data() {
343
   data() {
273
     return {
344
     return {
277
         { name: "Credit Card" },
348
         { name: "Credit Card" },
278
         { name: "EFT" },
349
         { name: "EFT" },
279
         { name: "Account" },
350
         { name: "Account" },
280
-        { name: "Cash On Delivery" }
351
+        { name: "Cash On Delivery" },
352
+        { name: "Instant EFT" }
281
       ],
353
       ],
282
-      tradingHours: []
354
+      tradingHours: [],
355
+      categories: [],
356
+      hasError: false,
357
+      confirmpassword: "",
358
+      showPassword: false,
359
+      PasswordBoxType: "password",
360
+      hasImage: false,
361
+      image: null,
362
+      columns: ["Description"],
363
+      deliverfrom: "",
364
+      deliverTo: ""
283
     };
365
     };
284
   },
366
   },
285
   methods: {
367
   methods: {
368
+    ...mapActions("registration", ["regRestaurant", "getRestaurantContainer"]),
286
     UpdateAddress(address) {
369
     UpdateAddress(address) {
287
-      console.log(JSON.stringify(address));
370
+      this.restaurantContainer.streetNumber = address.streetNumber;
371
+      this.restaurantContainer.streetName = address.streetName;
372
+      this.restaurantContainer.suburb = address.suburb;
373
+      this.restaurantContainer.city = address.city;
374
+      this.restaurantContainer.province = address.province;
375
+      this.restaurantContainer.country = address.country;
376
+      this.restaurantContainer.postalCode = address.postalCode;
377
+      this.restaurantContainer.googleMapUrl = address.url;
378
+      this.restaurantContainer.latitude = address.coordinates.lat;
379
+      this.restaurantContainer.longitude = address.coordinates.lng;
288
     },
380
     },
289
     New() {
381
     New() {
290
-      //Create Model
291
       this.$modal.show("tradingHours");
382
       this.$modal.show("tradingHours");
292
     },
383
     },
293
     Delete(item) {
384
     Delete(item) {
294
       this.tradingHours.pop(item);
385
       this.tradingHours.pop(item);
295
     },
386
     },
387
+    NewCat() {
388
+      this.$modal.show("Categories");
389
+    },
390
+    DeleteCat(item) {
391
+      this.categories.pop(item);
392
+    },
393
+    selectedCategory(item) {
394
+      this.categories.push(item[0]);
395
+      this.$modal.hide("Categories");
396
+    },
296
     TradingUpdate(item) {
397
     TradingUpdate(item) {
297
       this.tradingHours.push(item);
398
       this.tradingHours.push(item);
298
       this.$modal.hide("tradingHours");
399
       this.$modal.hide("tradingHours");
299
     },
400
     },
300
     ChangeChain() {
401
     ChangeChain() {
301
       this.chain = !this.chain;
402
       this.chain = !this.chain;
403
+    },
404
+    Close() {
405
+      this.$router.push("/");
406
+    },
407
+    SubmitData() {
408
+      this.hasError = false;
409
+      this.errorMsg = "";
410
+
411
+      this.restaurantContainer.tHours = this.tradingHours;
412
+      this.restaurantContainer.logo = this.image;
413
+
414
+      var mops = "";
415
+      for (let i = 0; i < this.selectedMops.length; i++) {
416
+        mops = mops + this.selectedMops[i] + "|";
417
+      }
418
+
419
+      var cats = "";
420
+      for (let i = 0; i < this.categories.length; i++) {
421
+        cats = cats + this.categories[i].description + "|";
422
+      }
423
+
424
+      this.restaurantContainer.categories = cats;
425
+      this.restaurantContainer.methodsOfPayment = mops;
426
+      this.restaurantContainer.deliveryTime =
427
+        this.deliverfrom + " - " + this.deliverTo + " Min";
428
+
429
+      if (this.restaurantContainer.userPassword !== this.confirmpassword) {
430
+        this.hasError = true;
431
+        this.errorMsg = "Passwords do not match.";
432
+        return;
433
+      }
434
+
435
+      this.regRestaurant(this.restaurantContainer);
436
+      this.$router.push("/login");
437
+    },
438
+    togglePassword() {
439
+      this.showPassword = !this.showPassword;
440
+      if (this.showPassword) {
441
+        this.PasswordBoxType = "text";
442
+      } else {
443
+        this.PasswordBoxType = "password";
444
+      }
445
+    },
446
+    setImage: function(output) {
447
+      this.hasImage = true;
448
+      this.image = output.dataUrl;
449
+    }
450
+  },
451
+  computed: {
452
+    ...mapState("registration", ["restaurantContainer"]),
453
+    resultString() {
454
+      return this.restaurantContainer.result;
302
     }
455
     }
456
+  },
457
+  mounted() {
458
+    this.getRestaurantContainer();
303
   }
459
   }
304
 };
460
 };
305
 </script>
461
 </script>

+ 38
- 3
src/components/accounts/tradingHours.vue View File

31
           <span class="input-group-text" style="color: #60CBEB">
31
           <span class="input-group-text" style="color: #60CBEB">
32
             <b>F</b>
32
             <b>F</b>
33
           </span>
33
           </span>
34
-          <VueTimepicker v-model="tradingData.from"></VueTimepicker>
34
+          <VueTimepicker v-model="tradingData.from" :disabled="EnableTime"></VueTimepicker>
35
         </div>
35
         </div>
36
       </div>
36
       </div>
37
       <div class="col-md-6" style="margin-bottom: 1em">
37
       <div class="col-md-6" style="margin-bottom: 1em">
40
           <span class="input-group-text" style="color: #60CBEB">
40
           <span class="input-group-text" style="color: #60CBEB">
41
             <b>T</b>
41
             <b>T</b>
42
           </span>
42
           </span>
43
-          <VueTimepicker v-model="tradingData.to"></VueTimepicker>
43
+          <VueTimepicker v-model="tradingData.to" :disabled="EnableTime"></VueTimepicker>
44
+        </div>
45
+      </div>
46
+    </div>
47
+    <div class="row" style="text-align:left">
48
+      <div class="col-md-12" style="margin-bottom: 1em">
49
+        <div class="custom-control custom-switch">
50
+          <label>Opened 24 Hours?</label>
51
+          <input
52
+            style="margin-left: 1px"
53
+            type="checkbox"
54
+            class="custom-control-input"
55
+            id="th24HSwitch"
56
+            :checked="tradingData.open24"
57
+            @change="selectionChangedHours"
58
+            :disabled="tradingData.closed"
59
+          />
60
+          <label
61
+            class="custom-control-label"
62
+            for="th24HSwitch"
63
+            style="margin-left: 40px"
64
+          >{{tradingData.open24 ? 'Yes' : 'No'}}</label>
44
         </div>
65
         </div>
45
       </div>
66
       </div>
46
     </div>
67
     </div>
55
             id="thCloseSwitch"
76
             id="thCloseSwitch"
56
             :checked="tradingData.closed"
77
             :checked="tradingData.closed"
57
             @change="selectionChanged"
78
             @change="selectionChanged"
79
+            :disabled="tradingData.open24"
58
           />
80
           />
59
           <label
81
           <label
60
             class="custom-control-label"
82
             class="custom-control-label"
91
         description: "",
113
         description: "",
92
         from: "",
114
         from: "",
93
         to: "",
115
         to: "",
94
-        closed: false
116
+        closed: false,
117
+        open24: false
95
       }
118
       }
96
     };
119
     };
97
   },
120
   },
101
     },
124
     },
102
     selectionChanged() {
125
     selectionChanged() {
103
       this.tradingData.closed = !this.tradingData.closed;
126
       this.tradingData.closed = !this.tradingData.closed;
127
+    },
128
+    selectionChangedHours() {
129
+      this.tradingData.open24 = !this.tradingData.open24;
130
+    }
131
+  },
132
+  computed: {
133
+    EnableTime() {
134
+      if (this.tradingData.closed || this.tradingData.open24) {
135
+        return true;
136
+      } else {
137
+        return false;
138
+      }
104
     }
139
     }
105
   }
140
   }
106
 };
141
 };

+ 94
- 0
src/components/home/restaurantCategory.vue View File

1
+<template>
2
+  <div class="container">
3
+    <div class="form-group row"></div>
4
+    <div class="form-group row">
5
+      <div class="col-md-4" v-for="cat in restaurantsCategories" :key="cat.id">
6
+        <router-link :to="`/property/property/${cat.id}`">
7
+          <div class="card-box-a card-shadow">
8
+            <div class="img-box-a">
9
+              <img
10
+                :src="cat.image"
11
+                alt
12
+                class="img-a img-fluid"
13
+                style="height:350px; width:350px; object-fit: cover;"
14
+              />
15
+            </div>
16
+            <div class="card-overlay">
17
+              <div class="card-overlay-a-content">
18
+                <div class="card-header-a">
19
+                  <h4 class="card-title-a">
20
+                    <router-link :to="`/property/property/${cat.id}`" class="link-a">
21
+                      {{
22
+                      cat.description
23
+                      }}
24
+                    </router-link>
25
+                  </h4>
26
+                  <!-- <h4 class="card-title-c">
27
+                    <router-link :to="`/property/property/${cat.id}`" class="link-a">
28
+                      {{
29
+                      restaurant.subText
30
+                      }}
31
+                    </router-link>
32
+                  </h4>-->
33
+                </div>
34
+                <!-- <div class="card-body-a">
35
+                  <div class="price-box d-flex"></div>
36
+                  <router-link :to="`/property/property/${cat.id}`" class="link-a">
37
+                    Click here to view
38
+                    <span class="ion-ios-arrow-forward"></span>
39
+                  </router-link>
40
+                </div>
41
+                <div class="card-footer-a">
42
+                  <ul class="card-info d-flex justify-content-around">
43
+                    <li>
44
+                      <h4 class="card-info-title">
45
+                        <img src="/img/delivery-truck-with-dollar.png" height="30px" width="30px" />
46
+                      </h4>
47
+                      <span>{{ restaurant.deliveryFee }}</span>
48
+                    </li>
49
+                    <li>
50
+                      <h4 class="card-info-title">
51
+                        <img
52
+                          src="/img/delivery-truck-with-circular-clock.png"
53
+                          height="30px"
54
+                          width="30px"
55
+                        />
56
+                      </h4>
57
+                      <span>{{ restaurant.deliveryTime }}</span>
58
+                    </li>
59
+                  </ul>
60
+                </div>-->
61
+              </div>
62
+            </div>
63
+          </div>
64
+        </router-link>
65
+        <br />
66
+      </div>
67
+    </div>
68
+    <div v-if="wait" id="preloader"></div>
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+import { mapState, mapActions } from "vuex";
74
+
75
+export default {
76
+  name: "restaurantCategorySearch",
77
+  data() {
78
+    return {
79
+      wait: true
80
+    };
81
+  },
82
+  methods: {
83
+    ...mapActions("restaurantCategories", ["getCategories"])
84
+  },
85
+  computed: {
86
+    ...mapState("restaurantCategories", ["restaurantsCategories"])
87
+  },
88
+  mounted() {
89
+    this.getCategories().then(() => {
90
+      this.wait = false;
91
+    });
92
+  }
93
+};
94
+</script>

+ 99
- 0
src/components/home/restaurantsSection.vue View File

1
+<template>
2
+  <div class="container">
3
+    <div class="form-group row"></div>
4
+    <div class="form-group row">
5
+      <div class="col-md-4" v-for="restaurant in restaurants" :key="restaurant.id">
6
+        <router-link :to="`/property/property/${restaurant.id}`">
7
+          <div class="card-box-a card-shadow">
8
+            <div class="img-box-a">
9
+              <img
10
+                :src="restaurant.logo"
11
+                alt
12
+                class="img-a img-fluid"
13
+                style="height:350px; width:350px; object-fit: cover;"
14
+              />
15
+            </div>
16
+            <div class="card-overlay">
17
+              <div class="card-overlay-a-content">
18
+                <div class="card-header-a">
19
+                  <h2 class="card-title-a">
20
+                    <router-link :to="`/property/property/${restaurant.id}`" class="link-a">
21
+                      {{
22
+                      restaurant.name
23
+                      }}
24
+                    </router-link>
25
+                  </h2>
26
+                  <h3 class="card-title-b">
27
+                    <router-link :to="`/property/property/${restaurant.id}`" class="link-a">
28
+                      {{
29
+                      restaurant.suburb
30
+                      }}
31
+                    </router-link>
32
+                  </h3>
33
+                  <h4 class="card-title-c">
34
+                    <router-link :to="`/property/property/${restaurant.id}`" class="link-a">
35
+                      {{
36
+                      restaurant.subText
37
+                      }}
38
+                    </router-link>
39
+                  </h4>
40
+                </div>
41
+                <div class="card-body-a">
42
+                  <div class="price-box d-flex"></div>
43
+                  <router-link :to="`/property/property/${restaurant.id}`" class="link-a">
44
+                    <span class="ion-ios-arrow-forward"></span>
45
+                  </router-link>
46
+                </div>
47
+                <div class="card-footer-a">
48
+                  <ul class="card-info d-flex justify-content-around">
49
+                    <li>
50
+                      <h4 class="card-info-title">
51
+                        <img src="/img/delivery-truck-with-dollar.png" height="30px" width="30px" />
52
+                      </h4>
53
+                      <span>{{ restaurant.deliveryFee }}</span>
54
+                    </li>
55
+                    <li>
56
+                      <h4 class="card-info-title">
57
+                        <img
58
+                          src="/img/delivery-truck-with-circular-clock.png"
59
+                          height="30px"
60
+                          width="30px"
61
+                        />
62
+                      </h4>
63
+                      <span>{{ restaurant.deliveryTime }}</span>
64
+                    </li>
65
+                  </ul>
66
+                </div>
67
+              </div>
68
+            </div>
69
+          </div>
70
+        </router-link>
71
+      </div>
72
+    </div>
73
+    <div v-if="wait" id="preloader"></div>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import { mapState, mapActions } from "vuex";
79
+
80
+export default {
81
+  name: "restaurantSections",
82
+  data() {
83
+    return {
84
+      wait: true
85
+    };
86
+  },
87
+  methods: {
88
+    ...mapActions("restaurantSearch", ["getRestaurants"])
89
+  },
90
+  computed: {
91
+    ...mapState("restaurantSearch", ["restaurants"])
92
+  },
93
+  mounted() {
94
+    this.getRestaurants().then(() => {
95
+      this.wait = false;
96
+    });
97
+  }
98
+};
99
+</script>

+ 98
- 0
src/components/restaurants/restaurantCategories.vue View File

1
+<template>
2
+  <div>
3
+    <div class="container">
4
+      <div class="container">
5
+        <div class="row">
6
+          <div class="col-md-12 col-lg-8">
7
+            <div class="title-box-d">
8
+              <br />
9
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Restaurant Categories</h1>
10
+            </div>
11
+          </div>
12
+        </div>
13
+      </div>
14
+    </div>
15
+    <div class="container">
16
+      <div class="form-group row">
17
+        <div class="col-md-12">
18
+          <ListView
19
+            :items="restaurantsCategories"
20
+            :showColumnChooser="false"
21
+            :editable="true"
22
+            :hideSearch="true"
23
+            :deleteable="true"
24
+            :displayFormats="formats"
25
+            :sortKey="Description"
26
+            @onEdit="Edit"
27
+            @onDelete="Delete"
28
+            @onNew="New"
29
+          />
30
+        </div>
31
+        <modal name="Category" :width="600" :height="600">
32
+          <Category @CategoryUpdate="CategoryUpdate" :editCategory="CurrentCategory" />
33
+        </modal>
34
+      </div>
35
+      <div v-if="wait" id="preloader"></div>
36
+    </div>
37
+  </div>
38
+</template>
39
+
40
+<script>
41
+import Category from "../restaurants/restaurantCategory";
42
+import ListView from "../shared/listView";
43
+import { mapState, mapActions } from "vuex";
44
+
45
+export default {
46
+  name: "RestaurantCategoryList",
47
+  components: {
48
+    ListView,
49
+    Category
50
+  },
51
+  data() {
52
+    return {
53
+      wait: true,
54
+      formats: ["", "", "image"],
55
+      category: {}
56
+    };
57
+  },
58
+  methods: {
59
+    ...mapActions("restaurantCategories", [
60
+      "getCategories",
61
+      "addCategory",
62
+      "updateCategory",
63
+      "deleteCategory"
64
+    ]),
65
+    New() {
66
+      this.category = null;
67
+      this.$modal.show("Category");
68
+    },
69
+    Edit(item) {
70
+      this.category = item;
71
+      this.$modal.show("Category");
72
+    },
73
+    Delete(item) {
74
+      this.deleteCategory(item.id);
75
+    },
76
+    CategoryUpdate(item) {
77
+      //Add new
78
+      if (item.id == 0) {
79
+        this.addCategory(item);
80
+      } else {
81
+        this.updateCategory(item);
82
+      }
83
+      this.$modal.hide("Category");
84
+    }
85
+  },
86
+  computed: {
87
+    ...mapState("restaurantCategories", ["restaurantsCategories"]),
88
+    CurrentCategory() {
89
+      return this.category;
90
+    }
91
+  },
92
+  mounted() {
93
+    this.getCategories().then(() => {
94
+      this.wait = false;
95
+    });
96
+  }
97
+};
98
+</script>

+ 109
- 0
src/components/restaurants/restaurantCategory.vue View File

1
+<template>
2
+  <div class="container">
3
+    <div class="row">
4
+      <div class="col-md-12" style="margin-bottom: 1em">
5
+        <h1>Category</h1>
6
+      </div>
7
+    </div>
8
+    <div class="row" style="text-align:left">
9
+      <div class="col-md-12" style="margin-bottom: 1em">
10
+        <label>Description</label>
11
+        <div class="input-group-prepend">
12
+          <span class="input-group-text">
13
+            <eva-icon name="credit-card-outline" fill="#60CBEB"></eva-icon>
14
+          </span>
15
+          <input class="form-control" type="text" name="description" v-model="category.description" />
16
+        </div>
17
+      </div>
18
+    </div>
19
+    <div v-if="!category.image" class="row" style="text-align:left">
20
+      <div class="col-md-12" style="margin-bottom: 1em">
21
+        <label>Image</label>
22
+        <div class="input-group-prepend">
23
+          <image-uploader
24
+            :preview="true"
25
+            :className="['fileinput', { 'fileinput--loaded': hasImage }]"
26
+            capture="environment"
27
+            :debug="1"
28
+            doNotResize="gif"
29
+            :autoRotate="true"
30
+            outputFormat="verbose"
31
+            @input="setImage"
32
+          >
33
+            <label for="fileInput" slot="upload-label">
34
+              <figure>
35
+                <path
36
+                  class="path1"
37
+                  d="M9.5 19c0 3.59 2.91 6.5 6.5 6.5s6.5-2.91 6.5-6.5-2.91-6.5-6.5-6.5-6.5 2.91-6.5 6.5zM30 8h-7c-0.5-2-1-4-3-4h-8c-2 0-2.5 2-3 4h-7c-1.1 0-2 0.9-2 2v18c0 1.1 0.9 2 2 2h28c1.1 0 2-0.9 2-2v-18c0-1.1-0.9-2-2-2zM16 27.875c-4.902 0-8.875-3.973-8.875-8.875s3.973-8.875 8.875-8.875c4.902 0 8.875 3.973 8.875 8.875s-3.973 8.875-8.875 8.875zM30 14h-4v-2h4v2z"
38
+                ></path>
39
+              </figure>
40
+            </label>
41
+          </image-uploader>
42
+        </div>
43
+      </div>
44
+    </div>
45
+    <div v-else class="row" style="text-align:left">
46
+      <div class="col-md-12" style="margin-bottom: 1em">
47
+        <img :src="category.image" style="height:200px; width:200px; object-fit: cover;" />
48
+        <br />
49
+        <span class="input-group-text" align="center" style="width:150px" @click="removeImage()">
50
+          <eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
51
+        </span>
52
+      </div>
53
+    </div>
54
+    <div class="row"></div>
55
+    <div class="row">
56
+      <div class="col-md-12" style="margin-bottom: 1em">
57
+        <div class="input-group-prepend">
58
+          <b-button class="btn btn-b-n" @click="Ok">Ok</b-button>
59
+        </div>
60
+      </div>
61
+    </div>
62
+  </div>
63
+</template>
64
+
65
+<script>
66
+import ImageUploader from "vue-image-upload-resize";
67
+
68
+export default {
69
+  name: "Category",
70
+  props: {
71
+    editCategory: { default: {} }
72
+  },
73
+  components: {
74
+    ImageUploader
75
+  },
76
+  data() {
77
+    return {
78
+      hasImage: false,
79
+      category: {
80
+        id: 0,
81
+        image: null,
82
+        description: ""
83
+      }
84
+    };
85
+  },
86
+  methods: {
87
+    setImage: function(output) {
88
+      this.hasImage = true;
89
+      this.category.image = output.dataUrl;
90
+    },
91
+    Ok() {
92
+      this.$emit("CategoryUpdate", this.category);
93
+    },
94
+    removeImage() {
95
+      this.category.image = null;
96
+    }
97
+  },
98
+  watch: {
99
+    editCategory: {
100
+      immediate: true,
101
+      handler(val, oldVal) {
102
+        if (val) {
103
+          this.category = val;
104
+        }
105
+      }
106
+    }
107
+  }
108
+};
109
+</script>

+ 53
- 0
src/components/restaurants/restaurantCategorySelect.vue View File

1
+<template>
2
+  <div class="container">
3
+    <div class="row">
4
+      <div class="col-md-12" style="margin-bottom: 1em">
5
+        <h1>Categories</h1>
6
+      </div>
7
+    </div>
8
+    <div class="row">
9
+      <div class="col-md-12" style="margin-bottom: 1em">
10
+        <ListView
11
+          :items="restaurantsCategories"
12
+          :showColumnChooser="false"
13
+          :hideSearch="false"
14
+          :deleteable="false"
15
+          :displayColumn="columns"
16
+          :sortKey="Description"
17
+          :showNew="false"
18
+          @onRowClick="onRowClick"
19
+        />
20
+        <!-- will need to emit the seleted item  -->
21
+      </div>
22
+    </div>
23
+  </div>
24
+</template>
25
+
26
+<script>
27
+import ListView from "../shared/listView";
28
+import { mapState, mapActions } from "vuex";
29
+
30
+export default {
31
+  name: "RestaurantCategories",
32
+  components: {
33
+    ListView
34
+  },
35
+  data() {
36
+    return {
37
+      columns: ["Description"]
38
+    };
39
+  },
40
+  methods: {
41
+    ...mapActions("restaurantCategories", ["getCategories"]),
42
+    onRowClick(item) {
43
+      this.$emit("selected", item);
44
+    }
45
+  },
46
+  computed: {
47
+    ...mapState("restaurantCategories", ["restaurantsCategories"])
48
+  },
49
+  mounted() {
50
+    this.getCategories();
51
+  }
52
+};
53
+</script>

+ 59
- 90
src/components/shared/home.vue View File

1
 <template>
1
 <template>
2
   <div class="container">
2
   <div class="container">
3
-    <h1>Food Glorious Food</h1>
4
-    <P>
5
-      Is it worth the waiting for?
6
-      <br />If we live 'til eighty four
7
-      <br />All we ever get is gru... el!
8
-      <br />Ev'ry day we say our prayer --
9
-      <br />Will they change the bill of fare?
10
-      <br />Still we get the same old gru... el!
11
-      <br />There's not a crust, not a crumb can we find
12
-      <br />Can we beg, can we borrow, or cadge
13
-      <br />But there's nothing to stop us from getting a thrill
14
-      <br />When we all close our eyes and imag... ine
15
-    </P>
16
-    <P>
17
-      Food, glorious food!
18
-      <br />Hot sausage and mustard!
19
-      <br />While we're in the mood --
20
-      <br />Cold jelly and custard!
21
-      <br />Peas, pudding and saveloys!
22
-      <br />What next is the question?
23
-      <br />Rich gentlemen have it, boys --
24
-      <br />In-di-gestion!
25
-    </P>
26
-    <P>
27
-      Food, glorious food!
28
-      <br />We're anxious to try it
29
-      <br />Three banquets a day --
30
-      <br />Our favourite diet!
31
-    </P>
32
-    <P>
33
-      Just picture a great big steak --
34
-      <br />Fried, roasted or stewed
35
-      <br />Oh, food
36
-      <br />Wonderful food
37
-      <br />Marvellous food
38
-      <br />Glorious food
39
-    </P>
40
-    <P>
41
-      Food, glorious food!
42
-      <br />What is there more handsome?
43
-      <br />Gulped, swallowed or chewed --
44
-      <br />Still worth a king's ransom!
45
-      <br />What is it we dream about?
46
-      <br />What brings on a sigh?
47
-      <br />Piled pieahes and cream, about
48
-      <br />Six feet high!
49
-    </P>
50
-    <P>
51
-      Food, glorious food!
52
-      <br />Eat right through the menu
53
-      <br />Just loosen your belt
54
-      <br />Two inches and then you
55
-      <br />Work up a new appetite
56
-      <br />In this interlude --
57
-      <br />The food
58
-      <br />Once again, food
59
-      <br />Fabulous food
60
-      <br />Glorious food
61
-      <br />
62
-    </P>
63
-    <P>
64
-      Food, glorious food!
65
-      <br />Don't care what it looks like --
66
-      <br />Burned!
67
-      <br />Underdone!
68
-      <br />Crude!
69
-      <br />Don't care what the cook's like
70
-      <br />Just thinking of growing fat --
71
-      <br />Our senses go reeling
72
-      <br />One moment of knowing that
73
-      <br />Full-up feeling!
74
-      <br />
75
-    </P>
76
-    <P>
77
-      Food, glorious food!
78
-      <br />What wouldn't we give for
79
-      <br />That extra bit more --
80
-      <br />That's all that we live for
81
-      <br />Why should we be fated to
82
-      <br />Do nothing but brood
83
-      <br />On food
84
-      <br />Magical food
85
-      <br />Wonderful food
86
-      <br />Marvellous food
87
-      <br />Fabulous food
88
-    </P>
89
-    <P>
90
-      Beautiful food
91
-      <br />Glorious food!
92
-    </P>
3
+    <div class="form-group row">
4
+      <div class="col-md-10 offset-md-1">
5
+        <ul class="nav nav-pills-a nav-pills mb-3 section-t3" id="pills-tab" role="tablist">
6
+          <li class="nav-item">
7
+            <a
8
+              class="nav-link active"
9
+              id="pills-video-tab"
10
+              data-toggle="pill"
11
+              href="#pills-video"
12
+              role="tab"
13
+              aria-controls="pills-video"
14
+              aria-selected="true"
15
+            >Restaurants</a>
16
+          </li>
17
+          <li class="nav-item">
18
+            <a
19
+              class="nav-link"
20
+              id="pills-plans-tab"
21
+              data-toggle="pill"
22
+              href="#pills-plans"
23
+              role="tab"
24
+              aria-controls="pills-plans"
25
+              aria-selected="false"
26
+            >Categories</a>
27
+          </li>
28
+        </ul>
29
+        <div class="tab-content" id="pills-tabContent">
30
+          <div
31
+            class="tab-pane fade show active"
32
+            id="pills-video"
33
+            role="tabpanel"
34
+            aria-labelledby="pills-video-tab"
35
+          >
36
+            <Cards />
37
+          </div>
38
+          <div
39
+            class="tab-pane fade"
40
+            id="pills-plans"
41
+            role="tabpanel"
42
+            aria-labelledby="pills-plans-tab"
43
+          >
44
+            <Categories />
45
+          </div>
46
+        </div>
47
+      </div>
48
+    </div>
93
   </div>
49
   </div>
94
 </template>
50
 </template>
51
+
52
+<script>
53
+import Cards from "../home/restaurantsSection";
54
+import Categories from "../home/restaurantCategory";
55
+
56
+export default {
57
+  name: "HomePage",
58
+  components: {
59
+    Cards,
60
+    Categories
61
+  }
62
+};
63
+</script>

+ 86
- 0
src/components/shared/imageLoader.vue View File

1
+<template>
2
+  <div>
3
+    <div>
4
+      <label class="btn btn-b-n" style="width: 85px; height:40px;">
5
+        Upload
6
+        <input
7
+          type="file"
8
+          accept=".jpeg, .jpg, .gif, .png"
9
+          value="Upload Photo"
10
+          style="width: 0px;height: 0px;overflow: hidden;"
11
+          name="images[]"
12
+          @change="imagesAdd"
13
+          :multiple="false"
14
+          :disabled="!mayEdit"
15
+        />
16
+      </label>
17
+    </div>
18
+    <br />
19
+    <div class="form-group row">
20
+      <div v-for="(img, i) in image" class="col-md-2" :key="i">
21
+        <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
22
+        <br />
23
+        <span class="input-group-text" align="center" style="width:150px" @click="removeImage(key)">
24
+          <eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
25
+        </span>
26
+      </div>
27
+      <br />
28
+    </div>
29
+  </div>
30
+</template>
31
+
32
+<script>
33
+export default {
34
+  props: {
35
+    loadedImages: Function,
36
+    mayEdit: { type: Boolean, default: () => true }
37
+  },
38
+  data() {
39
+    return {
40
+      images: {},
41
+      image: [],
42
+      imagesDefault: []
43
+    };
44
+  },
45
+  methods: {
46
+    imagesAdd(e) {
47
+      if (!this.allowMultiple) {
48
+        this.images = {};
49
+        this.image = [];
50
+      }
51
+
52
+      const files = e.target.files || e.dataTransfer.files;
53
+
54
+      this.images = [];
55
+      Array.prototype.push.apply(this.images, files);
56
+      if (!this.images.length) return;
57
+
58
+      this.createImage(this.images);
59
+      this.loadedImages(this.images);
60
+
61
+      this.$emit("ImageLoaded", this.images);
62
+    },
63
+
64
+    createImage(file) {
65
+      for (let i = 0; i < file.length; i++) {
66
+        const reader = new FileReader();
67
+        var vm = this;
68
+
69
+        reader.onload = e => {
70
+          vm.image.push(e.target.result);
71
+        };
72
+        reader.readAsDataURL(file[i]);
73
+      }
74
+    },
75
+
76
+    removeImage(key) {
77
+      this.image.splice(key, 1);
78
+      this.images.splice(key, 1);
79
+
80
+      if (!this.image.length) {
81
+        this.$refs.im.value = "";
82
+      }
83
+    }
84
+  }
85
+};
86
+</script>

+ 37
- 48
src/components/shared/listView.vue View File

1
-/* eslint-disable no-restricted-syntax */ /* eslint-disable guard-for-in */
2
 <template>
1
 <template>
3
   <div>
2
   <div>
4
     <div style="height:5px"></div>
3
     <div style="height:5px"></div>
16
               class="btn btn-primary myBackground btn-width cursor-pointer"
15
               class="btn btn-primary myBackground btn-width cursor-pointer"
17
               data-toggle="modal"
16
               data-toggle="modal"
18
               data-target="#myModal"
17
               data-target="#myModal"
19
-            >Column Chooser</div>
18
+            >
19
+              Column Chooser
20
+            </div>
20
             <div class="col-md-12">
21
             <div class="col-md-12">
21
               <div id="myModal" class="modal fade" role="dialog">
22
               <div id="myModal" class="modal fade" role="dialog">
22
                 <div class="modal-dialog modal-lg">
23
                 <div class="modal-dialog modal-lg">
38
             <div
39
             <div
39
               class="btn btn-primary myBackground btn-width cursor-pointer"
40
               class="btn btn-primary myBackground btn-width cursor-pointer"
40
               @click="onClearSelected()"
41
               @click="onClearSelected()"
41
-            >Clear Selected</div>
42
+            >
43
+              Clear Selected
44
+            </div>
42
           </div>
45
           </div>
43
           <div class="p2" v-if="showNew">
46
           <div class="p2" v-if="showNew">
44
-            <div class="btn btn-primary myBackground btn-width cursor-pointer" @click="onNew()">New</div>
47
+            <div class="btn btn-primary myBackground btn-width cursor-pointer" @click="onNew()">
48
+              New
49
+            </div>
45
           </div>
50
           </div>
46
         </div>
51
         </div>
47
       </div>
52
       </div>
62
                 :class="{ active: hover === c }"
67
                 :class="{ active: hover === c }"
63
               >
68
               >
64
                 <div class="d-flex bd-highlight">
69
                 <div class="d-flex bd-highlight">
65
-                  <div
66
-                    v-if="displayHeaders.length === 0"
67
-                    class="p-2 w-100 bd-highlight"
68
-                  >{{ column | toProper }}</div>
69
-                  <div
70
-                    v-else
71
-                    class="p-2 w-100 bd-highlight"
72
-                  >{{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}</div>
70
+                  <div v-if="displayHeaders.length === 0" class="p-2 w-100 bd-highlight">
71
+                    {{ column | toProper }}
72
+                  </div>
73
+                  <div v-else class="p-2 w-100 bd-highlight">
74
+                    {{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}
75
+                  </div>
73
                   <div class="p-2 flex-shrink-1 bd-highlight">
76
                   <div class="p-2 flex-shrink-1 bd-highlight">
74
                     <img
77
                     <img
75
                       src="../../../public/img/sort-up.png"
78
                       src="../../../public/img/sort-up.png"
98
             :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
101
             :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
99
           >
102
           >
100
             <td v-for="(column, c) in Columns" :key="c">
103
             <td v-for="(column, c) in Columns" :key="c">
101
-              <div
102
-                v-if="displayFormats.length === 0"
103
-              >{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
104
+              <div v-if="displayFormats.length === 0">
105
+                {{ isObject(item[column]) ? item[column].display : item[column] }}
106
+              </div>
104
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
107
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
105
-                <div
106
-                  v-if="item[column] !== '0001-01-01T00:00:00'"
107
-                >{{ isObject(item[column]) ? item[column].display : item[column] | toDate }}</div>
108
+                <div v-if="item[column] !== '0001-01-01T00:00:00'">
109
+                  {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
110
+                </div>
111
+              </div>
112
+              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'">
113
+                {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
108
               </div>
114
               </div>
109
-              <div
110
-                v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'"
111
-              >{{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}</div>
112
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
115
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
113
                 <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
116
                 <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
114
               </div>
117
               </div>
115
               <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
118
               <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
116
             </td>
119
             </td>
117
             <td v-if="showCustomAction" class="my-width">
120
             <td v-if="showCustomAction" class="my-width">
118
-              <button
119
-                type="button"
120
-                class="btn my-btn"
121
-                @click="onCustomClick(item)"
122
-              >{{ CustomActionHeading }}</button>
121
+              <button type="button" class="btn my-btn" @click="onCustomClick(item)">
122
+                {{ CustomActionHeading }}
123
+              </button>
123
             </td>
124
             </td>
124
             <td v-if="editable" class="my-width">
125
             <td v-if="editable" class="my-width">
125
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
126
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
133
       <div class="d-flex justify-content-between" v-if="showPager">
134
       <div class="d-flex justify-content-between" v-if="showPager">
134
         <div class="p-1">
135
         <div class="p-1">
135
           {{
136
           {{
136
-          currentPage +
137
-          " / " +
138
-          PageCount +
139
-          (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
137
+            currentPage +
138
+              " / " +
139
+              PageCount +
140
+              (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
140
           }}
141
           }}
141
         </div>
142
         </div>
142
         <div class="p-1">
143
         <div class="p-1">
183
     ListViewControl
184
     ListViewControl
184
   },
185
   },
185
   mounted() {
186
   mounted() {
186
-    try {
187
-      // to assign initial value to itemsPerPage
188
-      if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
189
-        const [startItem] = this.itemsPerPageList;
190
-        this.visibleItemsPerPageCount = startItem;
191
-      }
192
-    } catch (error) {
193
-      throw error;
187
+    if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
188
+      const [startItem] = this.itemsPerPageList;
189
+      this.visibleItemsPerPageCount = startItem;
194
     }
190
     }
195
     this.getInitColumn();
191
     this.getInitColumn();
196
   },
192
   },
268
       hover: -1,
264
       hover: -1,
269
       selectedItems: [],
265
       selectedItems: [],
270
       showControl: false,
266
       showControl: false,
271
-      sortKey: "",
272
       reverse: false,
267
       reverse: false,
273
       searchItem: "",
268
       searchItem: "",
274
       visibleItemsPerPageCount: 20,
269
       visibleItemsPerPageCount: 20,
290
       this.allColumn = list;
285
       this.allColumn = list;
291
     },
286
     },
292
     getInitColumn() {
287
     getInitColumn() {
293
-      const list = [];
294
       const listAll = [];
288
       const listAll = [];
295
       if (this.items) {
289
       if (this.items) {
296
         for (const i in Object.keys(this.items)) {
290
         for (const i in Object.keys(this.items)) {
297
           const item = this.items[i];
291
           const item = this.items[i];
298
           for (const o in Object.keys(item)) {
292
           for (const o in Object.keys(item)) {
299
-            if (
300
-              !listAll.includes(Object.keys(item)[o]) &&
301
-              !Array.isArray(Object.values(item)[o])
302
-            ) {
293
+            if (!listAll.includes(Object.keys(item)[o]) && !Array.isArray(Object.values(item)[o])) {
303
               const columnName = Object.keys(item)[o];
294
               const columnName = Object.keys(item)[o];
304
               if (!listAll.some(x => x.column === columnName)) {
295
               if (!listAll.some(x => x.column === columnName)) {
305
                 listAll.push({
296
                 listAll.push({
448
     },
439
     },
449
     AllColumns() {
440
     AllColumns() {
450
       const list = [];
441
       const list = [];
451
-      if (this.items) {
452
-      }
453
       return list;
442
       return list;
454
     },
443
     },
455
     FilteredItems() {
444
     FilteredItems() {
471
         endSlice = list.length;
460
         endSlice = list.length;
472
       }
461
       }
473
       return list.slice(startSlice, endSlice);
462
       return list.slice(startSlice, endSlice);
474
-    },
475
-    GetAllColumn() {}
463
+    }
464
+    //GetAllColumn() {}
476
   }
465
   }
477
 };
466
 };
478
 </script>
467
 </script>

+ 6
- 1
src/components/shared/mapSetLocation.vue View File

2
   <div>
2
   <div>
3
     <label>Location</label>
3
     <label>Location</label>
4
     <div class="input-group-prepend">
4
     <div class="input-group-prepend">
5
+      <span class="input-group-text">
6
+        <eva-icon name="map" fill="#60CBEB"></eva-icon>
7
+      </span>
5
       <gmap-autocomplete class="form-control" @place_changed="setPlace"></gmap-autocomplete>
8
       <gmap-autocomplete class="form-control" @place_changed="setPlace"></gmap-autocomplete>
6
       <button class="btn btn-primary btn-l" @click="addMarker">Add</button>
9
       <button class="btn btn-primary btn-l" @click="addMarker">Add</button>
7
       <br />
10
       <br />
87
         if (place.address_components[i].types[0] === "locality") {
90
         if (place.address_components[i].types[0] === "locality") {
88
           this.city = place.address_components[i].long_name;
91
           this.city = place.address_components[i].long_name;
89
         }
92
         }
90
-        if (place.address_components[i].types[0] === "administrative_area_level_1") {
93
+        if (
94
+          place.address_components[i].types[0] === "administrative_area_level_1"
95
+        ) {
91
           this.province = place.address_components[i].long_name;
96
           this.province = place.address_components[i].long_name;
92
         }
97
         }
93
         if (place.address_components[i].types[0] === "country") {
98
         if (place.address_components[i].types[0] === "country") {

+ 79
- 121
src/components/shared/navBar.vue View File

3
 
3
 
4
   <nav class="navbar navbar-light bg-light navbar-expand-lg fixed-top" style="font-size:18px;">
4
   <nav class="navbar navbar-light bg-light navbar-expand-lg fixed-top" style="font-size:18px;">
5
     <div class="container-fluid">
5
     <div class="container-fluid">
6
-      <div class="col-md-2">
6
+      <div class="col-md-2 offset-1">
7
         <button
7
         <button
8
           class="navbar-toggler collapsed"
8
           class="navbar-toggler collapsed"
9
           type="button"
9
           type="button"
32
           data-toggle="collapse"
32
           data-toggle="collapse"
33
           data-target="#navbarTogglerDemo01"
33
           data-target="#navbarTogglerDemo01"
34
           aria-expanded="false"
34
           aria-expanded="false"
35
-        >
36
-          <span class="fa fa-search" aria-hidden="true"></span>
37
-        </button>
35
+        ></button>
38
       </div>
36
       </div>
39
-
40
-      <div class="col-md-8">
37
+      <div class="col-md-1 offset-2">
38
+        <div class="input-group-prepend">
39
+          <input type="text" placeholder="search" />
40
+          <span class="input-group-text">
41
+            <i class="fa fa-search" style="color:#60CBEB"></i>
42
+          </span>
43
+        </div>
44
+      </div>
45
+      <div class="col-md-5">
41
         <div class="navbar-collapse collapse justify-content-center" id="navbarDefault">
46
         <div class="navbar-collapse collapse justify-content-center" id="navbarDefault">
42
           <ul class="navbar-nav">
47
           <ul class="navbar-nav">
43
-            <li class="nav-item dropdown">
48
+            <li class="nav-item dropdown" v-if="!isLoggedIn">
44
               <a
49
               <a
45
                 class="nav-link dropdown-toggle"
50
                 class="nav-link dropdown-toggle"
46
                 href="#"
51
                 href="#"
49
                 data-toggle="dropdown"
54
                 data-toggle="dropdown"
50
                 aria-haspopup="true"
55
                 aria-haspopup="true"
51
                 aria-expanded="false"
56
                 aria-expanded="false"
52
-                >Register</a
53
-              >
57
+              >Register</a>
54
               <!--@click="routerGoTo('/RegistrationPage')" -->
58
               <!--@click="routerGoTo('/RegistrationPage')" -->
55
               <div class="dropdown-menu" aria-labelledby="navbarDropdown">
59
               <div class="dropdown-menu" aria-labelledby="navbarDropdown">
56
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Registration')"
57
-                  >Individual User</a
58
-                >
59
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/RegisterRestaurant')"
60
-                  >Restaurant</a
61
-                >
62
-              </div>
63
-            </li>
64
-            <!-- <li class="nav-item dropdown">
65
-              <a
66
-                class="nav-link dropdown-toggle"
67
-                href="#"
68
-                id="navbarDropdown"
69
-                role="button"
70
-                data-toggle="dropdown"
71
-                aria-haspopup="true"
72
-                aria-expanded="false"
73
-                >Properties</a
74
-              >
75
-              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
76
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/property/Search')"
77
-                  >Search</a
78
-                >
79
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/property/new/Sale')"
80
-                  >To Sell</a
81
-                >
82
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/property/new/Rental')"
83
-                  >To Rent</a
84
-                >
85
-                <hr v-if="isLoggedIn" />
86
                 <a
60
                 <a
87
-                  v-if="isLoggedIn"
88
                   class="dropdown-item cursor-pointer"
61
                   class="dropdown-item cursor-pointer"
89
-                  @click="routerGoTo('/properties')"
90
-                  >My Properties</a
91
-                >
92
-              </div>
93
-            </li> -->
94
-
95
-            <!-- <li class="nav-item dropdown">
96
-              <a
97
-                class="nav-link dropdown-toggle"
98
-                href="#"
99
-                id="navbarDropdown"
100
-                role="button"
101
-                data-toggle="dropdown"
102
-                aria-haspopup="true"
103
-                aria-expanded="false"
104
-                >About</a
105
-              >
106
-              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
107
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/about/us')"
108
-                  >About Us</a
109
-                >
110
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/about/timeshare')"
111
-                  >About Timeshare</a
112
-                >
62
+                  @click="routerGoTo('/Registration')"
63
+                >Individual User</a>
64
+                <a
65
+                  class="dropdown-item cursor-pointer"
66
+                  @click="routerGoTo('/RegisterRestaurant')"
67
+                >Restaurant</a>
113
               </div>
68
               </div>
114
-            </li> -->
69
+            </li>
115
 
70
 
116
-            <li class="nav-item dropdown">
71
+            <li class="nav-item dropdown" v-if="isLoggedIn">
117
               <a
72
               <a
118
                 class="nav-link dropdown-toggle"
73
                 class="nav-link dropdown-toggle"
119
                 href="#"
74
                 href="#"
123
                 aria-haspopup="true"
78
                 aria-haspopup="true"
124
                 aria-expanded="false"
79
                 aria-expanded="false"
125
                 v-if="isLoggedIn"
80
                 v-if="isLoggedIn"
126
-                >{{ NAME }}</a
127
               >
81
               >
128
-              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
129
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/status/list')"
130
-                  >Status</a
131
-                >
82
+                <!--{{ NAME }}-->
83
+                User
84
+              </a>
85
+              <div
86
+                v-if="SystemRole === 'Customer'"
87
+                class="dropdown-menu"
88
+                aria-labelledby="navbarDropdown"
89
+              >
132
                 <a
90
                 <a
133
                   class="dropdown-item cursor-pointer"
91
                   class="dropdown-item cursor-pointer"
134
-                  @click="routerGoTo('/status/timeshareAdmin')"
135
-                  >Timeshare Week Admin</a
136
-                >
92
+                  @click="routerGoTo('/status/list')"
93
+                >My Details</a>
137
                 <a
94
                 <a
138
                   class="dropdown-item cursor-pointer"
95
                   class="dropdown-item cursor-pointer"
139
-                  @click="routerGoTo('/status/tenderWeekAdmin')"
140
-                  >Tender Week Management</a
141
-                >
96
+                  @click="routerGoTo('/status/timeshareAdmin')"
97
+                >My Orders</a>
98
+              </div>
99
+              <div
100
+                v-if="SystemRole === 'RestaurantAdmin' || SystemRole === 'RestaurantUser'"
101
+                class="dropdown-menu"
102
+                aria-labelledby="navbarDropdown"
103
+              >
142
                 <a
104
                 <a
143
                   class="dropdown-item cursor-pointer"
105
                   class="dropdown-item cursor-pointer"
144
-                  @click="routerGoTo('/unitConfiguration/list')"
145
-                  >Unit Configuration</a
146
-                >
106
+                  @click="routerGoTo('/status/list')"
107
+                >Restaurant Details</a>
147
                 <a
108
                 <a
148
                   class="dropdown-item cursor-pointer"
109
                   class="dropdown-item cursor-pointer"
149
-                  @click="routerGoTo('/communication/template')"
150
-                  >Templates</a
151
-                >
110
+                  @click="routerGoTo('/status/timeshareAdmin')"
111
+                >Menu</a>
152
                 <hr />
112
                 <hr />
153
                 <a
113
                 <a
154
                   class="dropdown-item cursor-pointer"
114
                   class="dropdown-item cursor-pointer"
155
-                  @click="routerGoTo('/status/userManagementPage')"
156
-                  >User Management & Access</a
157
-                >
158
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/status/changeLogPage')"
159
-                  >Changes Logs</a
160
-                >
115
+                  @click="routerGoTo('/status/timeshareAdmin')"
116
+                >Users</a>
161
                 <a
117
                 <a
162
                   class="dropdown-item cursor-pointer"
118
                   class="dropdown-item cursor-pointer"
163
-                  @click="routerGoTo('/userDefinedGroups/list')"
164
-                  >Property User Defined Groups</a
165
-                >
166
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/propertyTypes/list')"
167
-                  >Property Types</a
168
-                >
169
-                <hr />
170
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/searchLog')"
171
-                  >Search Logs</a
172
-                >
173
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
174
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Carousel')"
175
-                  >Carousel</a
176
-                >
119
+                  @click="routerGoTo('/status/timeshareAdmin')"
120
+                >Roles</a>
121
+              </div>
122
+              <div
123
+                v-if="SystemRole === 'SuperAdmin'"
124
+                class="dropdown-menu"
125
+                aria-labelledby="navbarDropdown"
126
+              >
177
                 <a
127
                 <a
178
                   class="dropdown-item cursor-pointer"
128
                   class="dropdown-item cursor-pointer"
179
-                  @click="routerGoTo('/user/updateProfileInfo')"
180
-                  >Update Info</a
181
-                >
182
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/payments')"
183
-                  >Payments</a
184
-                >
185
-                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/landingPages')"
186
-                  >Landing Pages / Campaignes</a
187
-                >
129
+                  @click="routerGoTo('/status/list')"
130
+                >Restaurants</a>
131
+                <a
132
+                  class="dropdown-item cursor-pointer"
133
+                  @click="routerGoTo('/RestaurantCategory')"
134
+                >Restaurant Categories</a>
135
+                <a
136
+                  class="dropdown-item cursor-pointer"
137
+                  @click="routerGoTo('/status/timeshareAdmin')"
138
+                >Customers</a>
188
               </div>
139
               </div>
189
             </li>
140
             </li>
190
             <li class="nav-item dropdown" v-if="!isLoggedIn">
141
             <li class="nav-item dropdown" v-if="!isLoggedIn">
196
                 data-toggle="dropdown"
147
                 data-toggle="dropdown"
197
                 aria-haspopup="true"
148
                 aria-haspopup="true"
198
                 aria-expanded="false"
149
                 aria-expanded="false"
199
-                >Login</a
200
-              >
150
+              >Login</a>
201
             </li>
151
             </li>
202
             <li class="nav-item dropdown" v-if="isLoggedIn">
152
             <li class="nav-item dropdown" v-if="isLoggedIn">
203
               <span>
153
               <span>
205
               </span>
155
               </span>
206
             </li>
156
             </li>
207
           </ul>
157
           </ul>
158
+          <!-- <i class="fa fa-shopping-cart"></i> -->
208
         </div>
159
         </div>
209
       </div>
160
       </div>
210
     </div>
161
     </div>
212
 </template>
163
 </template>
213
 
164
 
214
 <script>
165
 <script>
215
-import { mapState, mapActions } from "vuex";
216
-import Log from "../../assets/Log";
166
+// import { mapState, mapActions } from "vuex";
167
+// import Log from "../../assets/Log";
217
 
168
 
218
 export default {
169
 export default {
219
   computed: {
170
   computed: {
220
-    ...mapState("authentication", ["user", "flag", "status", "person", "token"]),
171
+    //...mapState("authentication", ["user", "flag", "status", "person", "token"]),
221
     isLoggedIn() {
172
     isLoggedIn() {
222
-      console.log(Log.isLoggedIn());
223
-      return Log.isLoggedIn();
173
+      // console.log(Log.isLoggedIn());
174
+      // return Log.isLoggedIn();
175
+      return true;
224
     },
176
     },
225
     NAME() {
177
     NAME() {
226
-      return Log.getPerson().name;
178
+      //return Log.getPerson().name;
179
+      return "UserName";
180
+    },
181
+    SystemRole() {
182
+      //return "Customer";
183
+      return "SuperAdmin";
184
+      //return "RestaurantAdmin";
227
     },
185
     },
228
     // eslint-disable-next-line vue/return-in-computed-property
186
     // eslint-disable-next-line vue/return-in-computed-property
229
     Logout() {
187
     Logout() {
231
     }
189
     }
232
   },
190
   },
233
   methods: {
191
   methods: {
234
-    ...mapActions("authentication", ["logout"]),
192
+    //...mapActions("authentication", ["logout"]),
235
 
193
 
236
     routerGoTo(goTo) {
194
     routerGoTo(goTo) {
237
       this.$emit("routerGoTo", goTo);
195
       this.$emit("routerGoTo", goTo);

+ 30
- 29
src/main.js View File

1
 /* eslint-disable prefer-template */
1
 /* eslint-disable prefer-template */
2
-import Vue from 'vue';
3
-import EvaIcons from 'vue-eva-icons';
4
-import axios from 'axios';
5
-import moment from 'moment';
6
-import App from './App.vue';
7
-import router from './router';
8
-import store from './store';
9
-import VModal from 'vue-js-modal'
2
+import Vue from "vue";
3
+import EvaIcons from "vue-eva-icons";
4
+import axios from "axios";
5
+import moment from "moment";
6
+import App from "./App.vue";
7
+import router from "./router";
8
+import store from "./store";
9
+import VModal from "vue-js-modal";
10
+import "font-awesome/css/font-awesome.min.css";
11
+import VueGeolocation from "vue-browser-geolocation";
12
+import * as VueGoogleMaps from "vue2-google-maps";
10
 
13
 
11
-import VueGeolocation from 'vue-browser-geolocation'
12
-Vue.use(VueGeolocation)
13
-import * as VueGoogleMaps from 'vue2-google-maps'
14
+Vue.use(VueGeolocation);
14
 Vue.use(VueGoogleMaps, {
15
 Vue.use(VueGoogleMaps, {
15
   load: {
16
   load: {
16
-    key: 'AIzaSyC1Ksf24t03oxHkQYb-DymF9HipgGP30ao',
17
-    libraries: 'places', // necessary for places input
18
-  },
19
-})
20
-
17
+    key: "AIzaSyC1Ksf24t03oxHkQYb-DymF9HipgGP30ao",
18
+    libraries: "places" // necessary for places input
19
+  }
20
+});
21
 
21
 
22
+Vue.component("VueFontawesome", require("vue-fontawesome-icon/VueFontawesome.vue").default);
22
 
23
 
23
 Vue.use(EvaIcons);
24
 Vue.use(EvaIcons);
24
 
25
 
27
 Vue.prototype.$axios = axios;
28
 Vue.prototype.$axios = axios;
28
 
29
 
29
 Vue.prototype.$http = axios;
30
 Vue.prototype.$http = axios;
30
-const token = localStorage.getItem('token');
31
+const token = localStorage.getItem("token");
31
 if (token) {
32
 if (token) {
32
   Vue.prototype.$http.defaults.headers.common.Authorization = token;
33
   Vue.prototype.$http.defaults.headers.common.Authorization = token;
33
 }
34
 }
38
       next();
39
       next();
39
       return;
40
       return;
40
     }
41
     }
41
-    next('/users/login');
42
+    next("/users/login");
42
   } else {
43
   } else {
43
     next();
44
     next();
44
   }
45
   }
45
 });
46
 });
46
 
47
 
47
-Vue.filter('toCurrency', (value) => {
48
-  if (typeof value !== 'number') {
48
+Vue.filter("toCurrency", value => {
49
+  if (typeof value !== "number") {
49
     return value;
50
     return value;
50
   }
51
   }
51
-  const formatter = new Intl.NumberFormat('en-US', {
52
-    minimumFractionDigits: 2,
52
+  const formatter = new Intl.NumberFormat("en-US", {
53
+    minimumFractionDigits: 2
53
   });
54
   });
54
   return `R ${formatter.format(value)}`;
55
   return `R ${formatter.format(value)}`;
55
 });
56
 });
56
 
57
 
57
-Vue.filter('toProper', (value) => {
58
-  if (typeof value !== 'string') {
58
+Vue.filter("toProper", value => {
59
+  if (typeof value !== "string") {
59
     console.log(typeof value);
60
     console.log(typeof value);
60
     return value;
61
     return value;
61
   }
62
   }
62
-  value = value.replace(/([a-z])([A-Z])/g, '$1 $2');
63
+  value = value.replace(/([a-z])([A-Z])/g, "$1 $2");
63
   return value.charAt(0).toUpperCase() + value.slice(1);
64
   return value.charAt(0).toUpperCase() + value.slice(1);
64
 });
65
 });
65
 
66
 
66
-Vue.filter('toDate', value => value.substring(0, value.length > 9 ? 10 : value.length));
67
+Vue.filter("toDate", value => value.substring(0, value.length > 9 ? 10 : value.length));
67
 
68
 
68
-Vue.filter('toTime', value => moment(String(value)).format('hh:mm'));
69
+Vue.filter("toTime", value => moment(String(value)).format("hh:mm"));
69
 
70
 
70
 new Vue({
71
 new Vue({
71
   render: h => h(App),
72
   render: h => h(App),
72
   router,
73
   router,
73
-  store,
74
-}).$mount('#app');
74
+  store
75
+}).$mount("#app");
75
 
76
 
76
 Vue.use(VModal);
77
 Vue.use(VModal);

+ 8
- 3
src/router/index.js View File

8
 import Login from "../components/accounts/login.vue";
8
 import Login from "../components/accounts/login.vue";
9
 import RegisterRestaurant from "../components/accounts/restaurantRegistration.vue";
9
 import RegisterRestaurant from "../components/accounts/restaurantRegistration.vue";
10
 import RegistrationPage from "../components/accounts/registrationPage.vue";
10
 import RegistrationPage from "../components/accounts/registrationPage.vue";
11
+import RestaurantCategory from "../components/restaurants/restaurantCategories.vue"
11
 
12
 
12
 Vue.use(Router);
13
 Vue.use(Router);
13
 
14
 
19
       y: 0
20
       y: 0
20
     };
21
     };
21
   },
22
   },
22
-  routes: [
23
-    {
23
+  routes: [{
24
       path: "/",
24
       path: "/",
25
       name: "Home",
25
       name: "Home",
26
       component: Home
26
       component: Home
43
     {
43
     {
44
       path: "/RegistrationPage",
44
       path: "/RegistrationPage",
45
       name: "RegistrationPage",
45
       name: "RegistrationPage",
46
-      components: RegistrationPage
46
+      component: RegistrationPage
47
+    },
48
+    {
49
+      path: "/RestaurantCategory",
50
+      name: "RestaurantCategory",
51
+      component: RestaurantCategory
47
     }
52
     }
48
   ]
53
   ]
49
 });
54
 });

+ 8
- 4
src/store/index.js View File

1
 import Vue from 'vue';
1
 import Vue from 'vue';
2
 import Vuex from 'vuex';
2
 import Vuex from 'vuex';
3
 
3
 
4
-//import TimeshareModule from './modules/timeshare/timeshare';
5
-
4
+import Registration from './modules/accounts/registration';
5
+import Authentication from './modules/accounts/authentication';
6
+import RestaurantSearch from './modules/restaurants/restaurantSearch';
7
+import RestaurantCategories from './modules/restaurants/restaurantCategories';
6
 
8
 
7
 Vue.use(Vuex);
9
 Vue.use(Vuex);
8
 /* eslint no-param-reassign: ["error", { "props": false }] */
10
 /* eslint no-param-reassign: ["error", { "props": false }] */
9
 export default new Vuex.Store({
11
 export default new Vuex.Store({
10
   modules: {
12
   modules: {
11
 
13
 
12
-    //timeshare: TimeshareModule,
13
-
14
+    registration: Registration,
15
+    authentiaction: Authentication,
16
+    restaurantSearch: RestaurantSearch,
17
+    restaurantCategories: RestaurantCategories
14
   },
18
   },
15
 });
19
 });

+ 44
- 0
src/store/modules/accounts/authentication.js View File

1
+import Vue from 'vue';
2
+import Vuex from 'vuex';
3
+import axios from 'axios';
4
+
5
+Vue.use(Vuex);
6
+
7
+export default {
8
+  namespaced: true,
9
+  state: {
10
+    auth: {}
11
+  },
12
+  mutations: {
13
+    setAuthentication(state, auth) {
14
+      state.auth = auth;
15
+    }
16
+  },
17
+  getters: {},
18
+  actions: {
19
+    getAuthentication({
20
+      commit
21
+    }) {
22
+      axios
23
+        .get('api/Authentication')
24
+        .then(result => commit('setAuthentication', result.data));
25
+    },
26
+    Login({
27
+      commit
28
+    }, auth) {
29
+      //   axios
30
+      //     .post('api/Authentication', auth)
31
+      //     .then(result => commit('setAuthentication', result.data));
32
+      axios({
33
+        url: 'api/Authentication',
34
+        data: {
35
+          emailAddress: auth.emailAddress,
36
+          password: auth.password,
37
+        },
38
+        method: 'POST',
39
+      }).then((resp) => {
40
+        commit('setAuthentication', resp.data);
41
+      });
42
+    }
43
+  }
44
+}

+ 57
- 0
src/store/modules/accounts/registration.js View File

1
+import axios from 'axios'
2
+import {
3
+  sha256
4
+} from 'js-sha256'
5
+
6
+export default {
7
+  namespaced: true,
8
+  state: {
9
+    userContainer: {},
10
+    restaurantContainer: {}
11
+  },
12
+  mutations: {
13
+    addUserContainer(state, userContainer) {
14
+      state.userContainer = userContainer
15
+    },
16
+    addRestaurantContainer(state, restaurantContainer) {
17
+      state.restaurantContainer = restaurantContainer;
18
+    },
19
+  },
20
+  getters: {},
21
+  actions: {
22
+    getUserContainer({
23
+      commit
24
+    }) {
25
+      axios
26
+        .get('/api/registration/GetUserContainer')
27
+        .then((result) => commit('addUserContainer', result.data))
28
+        .catch(console.error)
29
+    },
30
+    regUser({
31
+      commit
32
+    }, user) {
33
+      user.password = sha256(user.password + '≡∆≤≥√∞ProVision')
34
+      axios
35
+        .post('/api/registration/resgisterUser', user)
36
+        .then((result) => commit('addUserContainer', result.data))
37
+        .catch(console.error)
38
+    },
39
+    getRestaurantContainer({
40
+      commit
41
+    }) {
42
+      axios
43
+        .get('/api/registration/GetRestaurantContainer')
44
+        .then((result) => commit('addRestaurantContainer', result.data))
45
+        .catch(console.error)
46
+    },
47
+    regRestaurant({
48
+      commit
49
+    }, restaurant) {
50
+      restaurant.userPassword = sha256(restaurant.userPassword + '≡∆≤≥√∞ProVision')
51
+      axios
52
+        .post('/api/registration/resgisterRestaurant', restaurant)
53
+        .then((result) => commit('addRestaurantContainer', result.data))
54
+        .catch(console.error)
55
+    }
56
+  }
57
+}

+ 58
- 0
src/store/modules/restaurants/restaurantCategories.js View File

1
+import axios from 'axios';
2
+
3
+export default {
4
+  namespaced: true,
5
+  state: {
6
+    restaurantsCategories: [],
7
+    restaurantCategory: {}
8
+  },
9
+  mutations: {
10
+    setRestaurantsCategories(state, categories) {
11
+      state.restaurantsCategories = categories;
12
+    },
13
+    addCategory(state, category) {
14
+      state.restaurantCategory = category;
15
+      state.restaurantsCategories.push(category);
16
+    },
17
+    updateCategories(state, category) {
18
+      state.restaurantsCategories.find(item => item.id === category.id).description = category
19
+        .description;
20
+      state.restaurantsCategories.find(item => item.id === category.id).image = category
21
+        .image;
22
+    },
23
+    removeCategories(state, id) {
24
+      state.restaurantsCategories.pop(state.restaurantsCategories.find(item => item.id === id));
25
+    }
26
+  },
27
+  getters: {},
28
+  actions: {
29
+    getCategories({
30
+      commit
31
+    }) {
32
+      axios
33
+        .get('/api/RestaurantCategory')
34
+        .then(result => commit('setRestaurantsCategories', result.data));
35
+    },
36
+    addCategory({
37
+      commit
38
+    }, category) {
39
+      axios
40
+        .post('/api/RestaurantCategory', category)
41
+        .then(result => commit('addCategory', result.data));
42
+    },
43
+    updateCategory({
44
+      commit
45
+    }, category) {
46
+      axios
47
+        .put('/api/RestaurantCategory', category)
48
+        .then(result => commit('updateCategories', result.data));
49
+    },
50
+    deleteCategory({
51
+      commit
52
+    }, id) {
53
+      axios
54
+        .delete(`/api/RestaurantCategory/${id}`)
55
+        .then(result => commit('removeCategories', id));
56
+    }
57
+  }
58
+}

+ 21
- 0
src/store/modules/restaurants/restaurantSearch.js View File

1
+import axios from 'axios'
2
+
3
+export default {
4
+  namespaced: true,
5
+  state: {
6
+    restaurants: []
7
+  },
8
+  mutations: {
9
+    setRestaurants(state, rests) {
10
+      state.restaurants = rests;
11
+    }
12
+  },
13
+  getters: {},
14
+  actions: {
15
+    getRestaurants({
16
+      commit
17
+    }) {
18
+      axios.get('/api/restaurant').then(result => commit('setRestaurants', result.data));
19
+    }
20
+  }
21
+}

Loading…
Cancel
Save