George Williams 5 years ago
parent
commit
3258643b25
31 changed files with 407 additions and 159 deletions
  1. 10
    0
      src/App.vue
  2. 9
    0
      src/assets/Log.js
  3. 4
    7
      src/components/about/aboutTimeshare.vue
  4. 9
    7
      src/components/about/aboutUsPage.vue
  5. 17
    8
      src/components/admin/property/propertyTypeList.vue
  6. 17
    8
      src/components/admin/property/userDefinedGroupsPage.vue
  7. 18
    8
      src/components/admin/status/changeLogPage.vue
  8. 16
    8
      src/components/admin/status/statusPage.vue
  9. 18
    8
      src/components/admin/status/tenderWeekAdminPage.vue
  10. 16
    8
      src/components/admin/status/timeshareAdminPage.vue
  11. 16
    8
      src/components/admin/status/userManagementPage.vue
  12. 16
    8
      src/components/admin/unitConfiguration/unitConfigurationPage.vue
  13. 24
    4
      src/components/home/testimonialSection.vue
  14. 3
    6
      src/components/misc/contactUs.vue
  15. 3
    6
      src/components/misc/privacyPolicyPage.vue
  16. 22
    9
      src/components/property/propertyList.vue
  17. 12
    13
      src/components/property/propertySearchPage.vue
  18. 3
    6
      src/components/property/propertyeditPage.vue
  19. 30
    2
      src/components/shared/navBar.vue
  20. 4
    7
      src/components/timeshare/buy/buyPage.vue
  21. 3
    6
      src/components/timeshare/faqPage.vue
  22. 3
    3
      src/components/timeshare/resort/resortPage.vue
  23. 3
    3
      src/components/timeshare/resort/unitPage.vue
  24. 3
    6
      src/components/timeshare/sell/sellPage.vue
  25. 19
    0
      src/components/user/logOut.vue
  26. 14
    10
      src/components/user/loginPage.vue
  27. 5
    0
      src/components/user/secure.vue
  28. 19
    0
      src/main.js
  29. 2
    0
      src/router/index.js
  30. 2
    0
      src/store/index.js
  31. 67
    0
      src/store/modules/user/authentication.js

+ 10
- 0
src/App.vue View File

@@ -24,6 +24,16 @@ export default {
24 24
     NavBar,
25 25
     FooterSection,
26 26
   },
27
+  // created() {
28
+  //   this.$http.interceptors.response.use(undefined, (err) => {
29
+  //     return new Promise(function(resolve, reject) {
30
+  //       if (err.status === 401 && err.config && !err.config.__isRetryRequest) {
31
+  //         this.$store.dispatch(logout);
32
+  //       }
33
+  //       throw err;
34
+  //     });
35
+  //   });
36
+  // },
27 37
   methods: {
28 38
     routerGoTo(goTo) {
29 39
       this.$router.push(goTo);

+ 9
- 0
src/assets/Log.js View File

@@ -0,0 +1,9 @@
1
+const items = {
2
+  isLoggedIn() {
3
+    return localStorage.getItem('token') !== undefined;
4
+  },
5
+  getUser() {
6
+    return localStorage.getItem('User');
7
+  },
8
+};
9
+export default items;

+ 4
- 7
src/components/about/aboutTimeshare.vue View File

@@ -9,14 +9,11 @@
9 9
               src="img/timeshare2.jpg"
10 10
               alt="About Timeshare"
11 11
               class="img-fluid"
12
-              style="width:800px;height:400px;"
12
+              style="width:800px;height:400px; border-radius:10px"
13 13
             />
14 14
           </div>
15
-          <div class="sinse-box">
16
-            <h3 class="sinse-title">
17
-              Timeshare Resales
18
-              <span></span>
19
-            </h3>
15
+          <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
16
+            <h3 class="sinse-title">Timeshare Resales</h3>
20 17
           </div>
21 18
         </div>
22 19
         <div class="col-md-12 section-t8">
@@ -65,7 +62,7 @@
65 62
                   src="img/timeshare.jpg"
66 63
                   alt
67 64
                   class="img-fluid"
68
-                  style="width:500px;height:330px;"
65
+                  style="width:500px;height:330px; border-radius:10px"
69 66
                 />
70 67
               </p>
71 68
             </div>

+ 9
- 7
src/components/about/aboutUsPage.vue View File

@@ -9,14 +9,11 @@
9 9
               src="img/slide-about-1.jpg"
10 10
               alt
11 11
               class="img-fluid"
12
-              style="width:800px;height:400px;"
12
+              style="width:800px;height:400px; border-radius:10px"
13 13
             />
14 14
           </div>
15
-          <div class="sinse-box">
16
-            <h3 class="sinse-title">
17
-              About Us
18
-              <span></span>
19
-            </h3>
15
+          <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
16
+            <h3 class="sinse-title">About Us</h3>
20 17
           </div>
21 18
         </div>
22 19
         <div class="col-md-12 section-t8">
@@ -69,7 +66,12 @@
69 66
                 <strong>Uni-Vate is able to assist you.</strong>
70 67
               </p>
71 68
               <p>
72
-                <img src="img/plan2.jpg" alt class="img-fluid" style="width:450px;height:200px;" />
69
+                <img
70
+                  src="img/plan2.jpg"
71
+                  alt
72
+                  class="img-fluid"
73
+                  style="width:450px;height:200px; border-radius:10px"
74
+                />
73 75
               </p>
74 76
             </div>
75 77
           </div>

+ 17
- 8
src/components/admin/property/propertyTypeList.vue View File

@@ -2,17 +2,25 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4 4
     <div class="container">
5
-      <section class="intro-single">
6
-        <div class="container">
7
-          <div class="row">
8
-            <div class="col-md-12 col-lg-8">
9
-              <div class="title-single-box">
10
-                <h1 class="title-single">Property Types</h1>
11
-              </div>
5
+      <!-- <section class="intro-single"> -->
6
+      <div class="container">
7
+        <br />
8
+        <br />
9
+        <br />
10
+        <br />
11
+        <div class="row">
12
+          <div class="col-md-12 col-lg-8">
13
+            <!-- <div class="title-single-box"> -->
14
+            <!-- <h1 class="title-single">Property Types</h1> -->
15
+            <!-- </div> -->
16
+            <div class="title-box-d">
17
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Property Types</h1>
12 18
             </div>
19
+            <br />
13 20
           </div>
14 21
         </div>
15
-      </section>
22
+      </div>
23
+      <!-- </section> -->
16 24
     </div>
17 25
     <div class="container">
18 26
       <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
@@ -52,6 +60,7 @@
52 60
         </tbody>
53 61
       </table>
54 62
     </div>
63
+    <br />
55 64
   </div>
56 65
 </template>
57 66
 

+ 17
- 8
src/components/admin/property/userDefinedGroupsPage.vue View File

@@ -1,17 +1,25 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4
-    <section class="intro-single">
5
-      <div class="container">
6
-        <div class="row">
7
-          <div class="col-md-12 col-lg-8">
8
-            <div class="title-single-box">
9
-              <h2 class="title-single">User Defined Groups List</h2>
10
-            </div>
4
+    <!-- <section class="intro-single"> -->
5
+    <div class="container">
6
+      <br />
7
+      <br />
8
+      <br />
9
+      <br />
10
+      <div class="row">
11
+        <div class="col-md-12 col-lg-8">
12
+          <!-- <div class="title-single-box"> -->
13
+          <!-- <h2 class="title-single">User Defined Groups List</h2> -->
14
+          <!-- </div> -->
15
+          <div class="title-box-d">
16
+            <h1 class="title-d" style="text-align:left; font-size: 250%">User Defined Groups List</h1>
11 17
           </div>
18
+          <br />
12 19
         </div>
13 20
       </div>
14
-    </section>
21
+    </div>
22
+    <!-- </section> -->
15 23
     <div class="container">
16 24
       <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
17 25
       <table class="table table-bordered">
@@ -51,6 +59,7 @@
51 59
         </tbody>
52 60
       </table>
53 61
     </div>
62
+    <br />
54 63
   </div>
55 64
 </template>
56 65
 <script>

+ 18
- 8
src/components/admin/status/changeLogPage.vue View File

@@ -1,18 +1,28 @@
1 1
 <template>
2
-  <section class="intro-single">
3
-    <div class="container">
4
-      <div class="row">
5
-        <div class="col-md-12 col-lg-8">
6
-          <div class="title-single-box">
7
-            <h1 class="title-single" style="text-align:left;">Change Log</h1>
8
-          </div>
2
+  <!-- <section class="intro-single"> -->
3
+  <div class="container">
4
+    <br />
5
+    <br />
6
+    <br />
7
+    <br />
8
+    <div class="row">
9
+      <div class="col-md-12 col-lg-8">
10
+        <!-- <div class="title-single-box"> -->
11
+        <!-- <h1 class="title-single" style="text-align:left;">Change Log</h1> -->
12
+        <!-- </div> -->
13
+        <div class="title-box-d">
14
+          <h1 class="title-d" style="text-align:left; font-size: 250%">Change Log</h1>
9 15
         </div>
16
+        <br />
10 17
       </div>
11 18
     </div>
12 19
     <div id="table" class="col-xs-12 table-responsive">
13 20
       <datatable :columns="columns" :data="rows"></datatable>
14 21
     </div>
15
-  </section>
22
+    <br />
23
+  </div>
24
+
25
+  <!-- </section> -->
16 26
 </template>
17 27
 <script>
18 28
 import { mapState, mapActions } from 'vuex';

+ 16
- 8
src/components/admin/status/statusPage.vue View File

@@ -1,16 +1,24 @@
1 1
 <template>
2 2
   <div>
3
-    <section class="intro-single">
4
-      <div class="container">
5
-        <div class="row">
6
-          <div class="col-md-12 col-lg-8">
7
-            <div class="title-single-box">
8
-              <h2 class="title-single">Status List</h2>
9
-            </div>
3
+    <!-- <section class="intro-single"> -->
4
+    <div class="container">
5
+      <br />
6
+      <br />
7
+      <br />
8
+      <br />
9
+      <div class="row">
10
+        <div class="col-md-12 col-lg-8">
11
+          <!-- <div class="title-single-box"> -->
12
+          <!-- <h2 class="title-single">Status List</h2> -->
13
+          <!-- </div> -->
14
+          <div class="title-box-d">
15
+            <h1 class="title-d" style="text-align:left; font-size: 250%">Status List</h1>
10 16
           </div>
17
+          <br />
11 18
         </div>
12 19
       </div>
13
-    </section>
20
+    </div>
21
+    <!-- </section> -->
14 22
     <div class="container">
15 23
       <table class="table table-bordered">
16 24
         <thead>

+ 18
- 8
src/components/admin/status/tenderWeekAdminPage.vue View File

@@ -1,18 +1,28 @@
1 1
 <template>
2
-  <section class="intro-single">
3
-    <div class="container">
4
-      <div class="row">
5
-        <div class="col-md-12 col-lg-8">
6
-          <div class="title-single-box">
7
-            <h1 class="title-single" style="text-align:left;">Tender Week Admin</h1>
8
-          </div>
2
+  <!-- <section class="intro-single"> -->
3
+  <div class="container">
4
+    <br />
5
+    <br />
6
+    <br />
7
+    <br />
8
+    <div class="row">
9
+      <div class="col-md-12 col-lg-8">
10
+        <!-- <div class="title-single-box"> -->
11
+        <!-- <h1 class="title-single" style="text-align:left;">Tender Week Admin</h1> -->
12
+        <!-- </div> -->
13
+        <div class="title-box-d">
14
+          <h1 class="title-d" style="text-align:left; font-size: 250%">Tender Week Admin</h1>
9 15
         </div>
16
+        <br />
10 17
       </div>
11 18
     </div>
12 19
     <div id="table" class="col-xs-12 table-responsive">
13 20
       <datatable :columns="columns" :data="rows"></datatable>
14 21
     </div>
15
-  </section>
22
+    <br />
23
+  </div>
24
+
25
+  <!-- </section> -->
16 26
 </template>
17 27
 <script>
18 28
 import { mapState, mapActions } from 'vuex';

+ 16
- 8
src/components/admin/status/timeshareAdminPage.vue View File

@@ -1,18 +1,26 @@
1 1
 <template>
2
-  <section class="intro-single">
3
-    <div class="container">
4
-      <div class="row">
5
-        <div class="col-md-12 col-lg-8">
6
-          <div class="title-single-box">
7
-            <h1 class="title-single" style="text-align:left;">Timeshare Admin</h1>
8
-          </div>
2
+  <!-- <section class="intro-single"> -->
3
+  <div class="container">
4
+    <br />
5
+    <br />
6
+    <br />
7
+    <br />
8
+    <div class="row">
9
+      <div class="col-md-12 col-lg-8">
10
+        <!-- <div class="title-single-box"> -->
11
+        <!-- <h1 class="title-single" style="text-align:left;">Timeshare Admin</h1> -->
12
+        <!-- </div> -->
13
+        <div class="title-box-d">
14
+          <h1 class="title-d" style="text-align:left; font-size: 250%">Timeshare Admin</h1>
9 15
         </div>
16
+        <br />
10 17
       </div>
11 18
     </div>
12 19
     <div id="table" class="col-xs-12 table-responsive">
13 20
       <datatable :columns="columns" :data="rows"></datatable>
14 21
     </div>
15
-  </section>
22
+  </div>
23
+  <!-- </section> -->
16 24
 </template>
17 25
 <script>
18 26
 import { mapState, mapActions } from 'vuex';

+ 16
- 8
src/components/admin/status/userManagementPage.vue View File

@@ -1,18 +1,26 @@
1 1
 <template>
2
-  <section class="intro-single">
3
-    <div class="container">
4
-      <div class="row">
5
-        <div class="col-md-12 col-lg-8">
6
-          <div class="title-single-box">
7
-            <h1 class="title-single" style="text-align:left;">User Management</h1>
8
-          </div>
2
+  <!-- <section class="intro-single"> -->
3
+  <div class="container">
4
+    <br />
5
+    <br />
6
+    <br />
7
+    <br />
8
+    <div class="row">
9
+      <div class="col-md-12 col-lg-8">
10
+        <!-- <div class="title-single-box"> -->
11
+        <!-- <h1 class="title-single" style="text-align:left;">User Management</h1> -->
12
+        <!-- </div> -->
13
+        <div class="title-box-d">
14
+          <h1 class="title-d" style="text-align:left; font-size: 250%">User Management</h1>
9 15
         </div>
16
+        <br />
10 17
       </div>
11 18
     </div>
12 19
     <div id="table" class="col-xs-12 table-responsive">
13 20
       <datatable :columns="columns" :data="rows"></datatable>
14 21
     </div>
15
-  </section>
22
+  </div>
23
+  <!-- </section> -->
16 24
 </template>
17 25
 <script>
18 26
 import { mapState, mapActions } from 'vuex';

+ 16
- 8
src/components/admin/unitConfiguration/unitConfigurationPage.vue View File

@@ -1,16 +1,24 @@
1 1
 <template>
2 2
   <div>
3
-    <section class="intro-single">
4
-      <div class="container">
5
-        <div class="row">
6
-          <div class="col-md-12 col-lg-8">
7
-            <div class="title-single-box">
8
-              <h2 class="title-single">Unit Configuration List</h2>
9
-            </div>
3
+    <!-- <section class="intro-single"> -->
4
+    <div class="container">
5
+      <br />
6
+      <br />
7
+      <br />
8
+      <br />
9
+      <div class="row">
10
+        <div class="col-md-12 col-lg-8">
11
+          <!-- <div class="title-single-box"> -->
12
+          <!-- <h2 class="title-single">Unit Configuration List</h2> -->
13
+          <!-- </div> -->
14
+          <div class="title-box-d">
15
+            <h1 class="title-d" style="text-align:left; font-size: 250%">Unit Configuration List</h1>
10 16
           </div>
17
+          <br />
11 18
         </div>
12 19
       </div>
13
-    </section>
20
+    </div>
21
+    <!-- </section> -->
14 22
     <div class="container">
15 23
       <table class="table table-bordered">
16 24
         <thead>

+ 24
- 4
src/components/home/testimonialSection.vue View File

@@ -19,7 +19,12 @@
19 19
                 <div class="col-sm-12 col-md-6">
20 20
                   <div class="testimonial-img">
21 21
                     <router-link to="/resort/csp">
22
-                      <img src="img/testimonial-1.png" alt class="CrystalSprings" />
22
+                      <img
23
+                        src="img/testimonial-1.png"
24
+                        alt
25
+                        class="CrystalSprings"
26
+                        style="border-radius:10px"
27
+                      />
23 28
                     </router-link>
24 29
                   </div>
25 30
                 </div>
@@ -51,7 +56,12 @@
51 56
                 <div class="col-sm-12 col-md-6">
52 57
                   <div class="testimonial-img">
53 58
                     <router-link to="/resort/nl">
54
-                      <img src="img/testimonial-2.png" alt class="Ngwenya Lodge" />
59
+                      <img
60
+                        src="img/testimonial-2.png"
61
+                        alt
62
+                        class="Ngwenya Lodge"
63
+                        style="border-radius:10px"
64
+                      />
55 65
                     </router-link>
56 66
                   </div>
57 67
                 </div>
@@ -81,7 +91,12 @@
81 91
                 <div class="col-sm-12 col-md-6">
82 92
                   <div class="testimonial-img">
83 93
                     <router-link to="/resort/mnr">
84
-                      <img src="img/testimonial-3.2.jpg" alt class="Mabalingwe Nature Reserve" />
94
+                      <img
95
+                        src="img/testimonial-3.2.jpg"
96
+                        alt
97
+                        class="Mabalingwe Nature Reserve"
98
+                        style="border-radius:10px"
99
+                      />
85 100
                     </router-link>
86 101
                   </div>
87 102
                 </div>
@@ -111,7 +126,12 @@
111 126
                 <div class="col-sm-12 col-md-6">
112 127
                   <div class="testimonial-img">
113 128
                     <router-link to="/resort/le">
114
-                      <img src="img/testimonial-4.png" alt class="Little Eden" />
129
+                      <img
130
+                        src="img/testimonial-4.png"
131
+                        alt
132
+                        class="Little Eden"
133
+                        style="border-radius:10px"
134
+                      />
115 135
                     </router-link>
116 136
                   </div>
117 137
                 </div>

+ 3
- 6
src/components/misc/contactUs.vue View File

@@ -8,14 +8,11 @@
8 8
             src="img/contact-us.jpg"
9 9
             alt="Frequently Asked Questions"
10 10
             class="img-fluid"
11
-            style="width:800px;height:400px;"
11
+            style="width:800px;height:400px; border-radius:10px"
12 12
           />
13 13
         </div>
14
-        <div class="sinse-box">
15
-          <h3 class="sinse-title">
16
-            Contact Us
17
-            <span></span>
18
-          </h3>
14
+        <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
15
+          <h3 class="sinse-title">Contact Us</h3>
19 16
         </div>
20 17
       </div>
21 18
       <div class="container col-md-10">

+ 3
- 6
src/components/misc/privacyPolicyPage.vue View File

@@ -8,14 +8,11 @@
8 8
             src="img/privacy.jpg"
9 9
             alt="Privacy Policy"
10 10
             class="img-fluid"
11
-            style="width:800px;height:400px;"
11
+            style="width:800px;height:400px; border-radius:10px"
12 12
           />
13 13
         </div>
14
-        <div class="sinse-box">
15
-          <h3 class="sinse-title">
16
-            Privacy Policy
17
-            <span></span>
18
-          </h3>
14
+        <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
15
+          <h3 class="sinse-title">Privacy Policy</h3>
19 16
         </div>
20 17
       </div>
21 18
       <div class="col-md-12 text-left">

+ 22
- 9
src/components/property/propertyList.vue View File

@@ -2,18 +2,30 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4 4
     <div class="container">
5
-      <section class="intro-single">
6
-        <div class="container">
7
-          <div class="row">
8
-            <div class="col-md-12 col-lg-8">
9
-              <div class="title-single-box">
10
-                <h1 v-if="user !== 'All'" class="title-single">My {{ propertyType }} Properties</h1>
11
-                <h1 v-else class="title-single">All {{ propertyType }} Properties</h1>
12
-              </div>
5
+      <!-- <section class="intro-single"> -->
6
+      <div class="container">
7
+        <br />
8
+        <br />
9
+        <br />
10
+        <br />
11
+        <div class="row">
12
+          <div class="col-md-12 col-lg-8">
13
+            <div class="title-box-d">
14
+              <h1
15
+                v-if="user !== 'All'"
16
+                class="title-d"
17
+                style="text-align:left; font-size: 250%"
18
+              >My {{ propertyType }} Properties</h1>
19
+              <h1
20
+                v-else
21
+                class="title-d"
22
+                style="text-align:left; font-size: 250%"
23
+              >All {{ propertyType }} Properties</h1>
13 24
             </div>
14 25
           </div>
15 26
         </div>
16
-      </section>
27
+      </div>
28
+      <!-- </section> -->
17 29
     </div>
18 30
     <div class="container">
19 31
       <table class="table table-bordered">
@@ -54,6 +66,7 @@
54 66
         </tbody>
55 67
       </table>
56 68
     </div>
69
+    <br />
57 70
   </div>
58 71
 </template>
59 72
 

+ 12
- 13
src/components/property/propertySearchPage.vue View File

@@ -8,14 +8,11 @@
8 8
             src="img/Pretoria-South-Africa.jpg"
9 9
             alt="Property Listing"
10 10
             class="img-fluid"
11
-            style="width:800px;height:400px;"
11
+            style="width:800px;height:400px; border-radius:10px"
12 12
           />
13 13
         </div>
14
-        <div class="sinse-box">
15
-          <h3 class="sinse-title">
16
-            Property Listing
17
-            <span></span>
18
-          </h3>
14
+        <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
15
+          <h3 class="sinse-title">Property Listing</h3>
19 16
         </div>
20 17
       </div>
21 18
       <br />
@@ -73,14 +70,11 @@
73 70
             src="img/Johannesburg-south-africa-1.jpg"
74 71
             alt="Property Listing"
75 72
             class="img-fluid"
76
-            style="width:800px;height:400px;"
73
+            style="width:800px;height:400px; border-radius:10px"
77 74
           />
78 75
         </div>
79
-        <div class="sinse-box">
80
-          <h3 class="sinse-title">
81
-            Property Listing
82
-            <span></span>
83
-          </h3>
76
+        <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
77
+          <h3 class="sinse-title">Property Listing</h3>
84 78
         </div>
85 79
       </div>
86 80
       <br />
@@ -113,7 +107,12 @@
113 107
         </div>
114 108
         <div class="col-md-4">
115 109
           <p>
116
-            <img class="img-fluid" src="./../../../public/img/commercial.jpg" alt="About Resale" />
110
+            <img
111
+              class="img-fluid"
112
+              src="./../../../public/img/commercial.jpg"
113
+              alt="About Resale"
114
+              style="border-radius:10px"
115
+            />
117 116
           </p>
118 117
         </div>
119 118
       </div>

+ 3
- 6
src/components/property/propertyeditPage.vue View File

@@ -8,14 +8,11 @@
8 8
             src="img/Listings2.jpg"
9 9
             alt="Timeshare To Buy"
10 10
             class="img-fluid"
11
-            style="width:800px;height:400px;"
11
+            style="width:800px;height:400px; border-radius:10px"
12 12
           />
13 13
         </div>
14
-        <div class="sinse-box">
15
-          <h3 class="sinse-title">
16
-            List {{ propertyType }} {{ salesType }} Property
17
-            <span></span>
18
-          </h3>
14
+        <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
15
+          <h3 class="sinse-title">List {{ propertyType }} {{ salesType }} Property</h3>
19 16
         </div>
20 17
       </div>
21 18
       <br />

+ 30
- 2
src/components/shared/navBar.vue View File

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <nav class="navbar navbar-default navbar-trans navbar-expand-lg fixed-top">
4
-    <div class="container">
4
+    <div class="container-fluid">
5 5
       <button
6 6
         class="navbar-toggler collapsed"
7 7
         type="button"
@@ -16,6 +16,12 @@
16 16
         <span></span>
17 17
       </button>
18 18
       <a class="navbar-brand text-brand" @click="routerGoTo('/')">
19
+        <img
20
+          class="img-fluid"
21
+          src="/img/logos/UVProp.png"
22
+          alt="UVProp logo"
23
+          style="width:110px;height:60px;"
24
+        />
19 25
         Uni-Vate
20 26
         <span class="color-b">Properties</span>
21 27
       </a>
@@ -194,7 +200,7 @@
194 200
             >Login</a>
195 201
             <div class="dropdown-menu" aria-labelledby="navbarDropdown">
196 202
               <a class="dropdown-item cursor-pointer" @click="routerGoTo('/user/login')">Login</a>
197
-              <a class="dropdown-item cursor-pointer" @click="routerGoTo('/user/login')">Logout</a>
203
+              <a class="dropdown-item cursor-pointer" @click="routerGoTo('/user/logout')">Logout</a>
198 204
               <a class="dropdown-item cursor-pointer" @click="routerGoTo('/user/register')">Register</a>
199 205
               <a
200 206
                 class="dropdown-item cursor-pointer"
@@ -214,11 +220,33 @@
214 220
         <span class="fa fa-search" aria-hidden="true"></span>
215 221
       </button>
216 222
     </div>
223
+    <span v-if="showLogout">
224
+      <a @click="logout()">Logout</a>
225
+    </span>
226
+    <span v-else></span>
217 227
   </nav>
218 228
 </template>
229
+
219 230
 <script>
231
+import { mapGetters, mapActions } from 'vuex';
232
+
220 233
 export default {
234
+  data() {
235
+    return {};
236
+  },
237
+  computed: {
238
+    showLogout() {
239
+      return this.$store.state.authentication.status === 'success';
240
+    },
241
+    Logout() {
242
+      return this.$store.state.authentication.methods.logout;
243
+    },
244
+  },
245
+
221 246
   methods: {
247
+    ...mapGetters('authentication', ['isLoggedIn']),
248
+    ...mapActions('authentication', ['logout']),
249
+
222 250
     routerGoTo(goTo) {
223 251
       console.log(goTo);
224 252
       this.$emit('routerGoTo', goTo);

+ 4
- 7
src/components/timeshare/buy/buyPage.vue View File

@@ -9,14 +9,11 @@
9 9
               src="img/buy.jpg"
10 10
               alt="Timeshare To Buy"
11 11
               class="img-fluid"
12
-              style="width:800px;height:400px;"
12
+              style="width:800px;height:400px; border-radius:10px"
13 13
             />
14 14
           </div>
15
-          <div class="sinse-box">
16
-            <h3 class="sinse-title">
17
-              Timeshare To Buy
18
-              <span></span>
19
-            </h3>
15
+          <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
16
+            <h3 class="sinse-title">Timeshare To Buy</h3>
20 17
           </div>
21 18
         </div>
22 19
 
@@ -95,7 +92,7 @@
95 92
                     width="100%"
96 93
                     height="450"
97 94
                     frameborder="0"
98
-                    style="border:0"
95
+                    style="border-radius:10px"
99 96
                     allowfullscreen
100 97
                   ></iframe>
101 98
                   <br />

+ 3
- 6
src/components/timeshare/faqPage.vue View File

@@ -9,14 +9,11 @@
9 9
               src="img/questions.jpg"
10 10
               alt="Frequently Asked Questions"
11 11
               class="img-fluid"
12
-              style="width:800px;height:400px;"
12
+              style="width:800px;height:400px; border-radius:10px"
13 13
             />
14 14
           </div>
15
-          <div class="sinse-box">
16
-            <h3 class="sinse-title">
17
-              Frequently Asked Questions
18
-              <span></span>
19
-            </h3>
15
+          <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
16
+            <h3 class="sinse-title">Frequently Asked Questions</h3>
20 17
           </div>
21 18
         </div>
22 19
         <div class="container col-md-10">

+ 3
- 3
src/components/timeshare/resort/resortPage.vue View File

@@ -15,13 +15,13 @@
15 15
         </div>
16 16
         <div class="row mb-4">
17 17
           <div class="col-md-4">
18
-            <img class="img-fluid" :src="image1" alt="Resort Image" />
18
+            <img class="img-fluid" :src="image1" alt="Resort Image" style="border-radius:10px" />
19 19
           </div>
20 20
           <div class="col-md-4">
21
-            <img class="img-fluid" :src="image2" alt="Resort Image" />
21
+            <img class="img-fluid" :src="image2" alt="Resort Image" style="border-radius:10px" />
22 22
           </div>
23 23
           <div class="col-md-4">
24
-            <img class="img-fluid" :src="image3" alt="Resort Image" />
24
+            <img class="img-fluid" :src="image3" alt="Resort Image" style="border-radius:10px" />
25 25
           </div>
26 26
         </div>
27 27
       </div>

+ 3
- 3
src/components/timeshare/resort/unitPage.vue View File

@@ -14,13 +14,13 @@
14 14
       </div>
15 15
       <div class="row mb-4">
16 16
         <div class="col-md-4">
17
-          <img class="img-fluid" :src="image1" alt="Resort Image" />
17
+          <img class="img-fluid" :src="image1" alt="Resort Image" style="border-radius:10px" />
18 18
         </div>
19 19
         <div class="col-md-4">
20
-          <img class="img-fluid" :src="image2" alt="Resort Image" />
20
+          <img class="img-fluid" :src="image2" alt="Resort Image" style="border-radius:10px" />
21 21
         </div>
22 22
         <div class="col-md-4">
23
-          <img class="img-fluid" :src="image3" alt="Resort Image" />
23
+          <img class="img-fluid" :src="image3" alt="Resort Image" style="border-radius:10px" />
24 24
         </div>
25 25
       </div>
26 26
     </div>

+ 3
- 6
src/components/timeshare/sell/sellPage.vue View File

@@ -9,14 +9,11 @@
9 9
               src="img/sell2.jpg"
10 10
               alt="Timeshare To Sell"
11 11
               class="img-fluid"
12
-              style="width:800px;height:400px;"
12
+              style="width:800px;height:400px; border-radius:10px"
13 13
             />
14 14
           </div>
15
-          <div class="sinse-box">
16
-            <h3 class="sinse-title">
17
-              Timeshare To Sell
18
-              <span></span>
19
-            </h3>
15
+          <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
16
+            <h3 class="sinse-title">Timeshare To Sell</h3>
20 17
           </div>
21 18
         </div>
22 19
         <br />

+ 19
- 0
src/components/user/logOut.vue View File

@@ -0,0 +1,19 @@
1
+<script>
2
+import { mapActions } from 'vuex';
3
+
4
+export default {
5
+  computed: {
6
+    isLoggedIn() {
7
+      return this.$store.getters.isLoggedIn;
8
+    },
9
+  },
10
+  methods: {
11
+    ...mapActions('authentication', ['logout']),
12
+    Logout() {
13
+      this.logout('logout').then(() => {
14
+        this.$router.push('/users/login');
15
+      });
16
+    },
17
+  },
18
+};
19
+</script>

+ 14
- 10
src/components/user/loginPage.vue View File

@@ -6,6 +6,7 @@
6 6
         <div class="form">
7 7
           <div>
8 8
             <h4>Login</h4>
9
+            <br />
9 10
           </div>
10 11
           <div class="row">
11 12
             <div class="col-md-11" style="margin-bottom: 1em">
@@ -19,6 +20,7 @@
19 20
                     type="text"
20 21
                     name="username"
21 22
                     placeholder="Username"
23
+                    v-model="username"
22 24
                     value
23 25
                   />
24 26
                 </div>
@@ -57,7 +59,6 @@
57 59
           <p v-if="user !== null">{{ user }}</p>
58 60
         </div>
59 61
       </form>
60
-
61 62
       <form id="forgot">
62 63
         <div class="form">
63 64
           <h5>Trouble signing in?</h5>
@@ -82,7 +83,9 @@
82 83
 </template>
83 84
 
84 85
 <script>
85
-const axios = require('axios');
86
+import { mapActions, mapState } from 'vuex';
87
+// import axios from 'axios';
88
+// import User from '../../assets/Log';
86 89
 
87 90
 export default {
88 91
   name: 'Login',
@@ -98,18 +101,19 @@ export default {
98 101
       text: '',
99 102
       showPassword: false,
100 103
       password: '',
104
+      email: '',
101 105
     };
102 106
   },
107
+  computed: {
108
+    ...mapState('authentication', ['token', 'status']),
109
+  },
103 110
   methods: {
111
+    ...mapActions('authentication', ['login']),
104 112
     Login() {
105
-      axios
106
-        .post('/api/register/authenticate', {
107
-          username: this.username,
108
-          password: this.password,
109
-        })
110
-        .then(response => console.log(response.data))
111
-        .catch(error => console.log(error.push));
112
-      this.$router.push('/');
113
+      this.login({ username: this.username, password: this.password })
114
+        .then(() => this.router.push('/'))
115
+        .catch(err => console.log(err));
116
+      this.$router.push('/about/us');
113 117
     },
114 118
     togglePassword() {
115 119
       this.showPassword = true;

+ 5
- 0
src/components/user/secure.vue View File

@@ -0,0 +1,5 @@
1
+<template>
2
+  <div>
3
+    <h1>This page is protected by auth</h1>
4
+  </div>
5
+</template>

+ 19
- 0
src/main.js View File

@@ -1,5 +1,6 @@
1 1
 import Vue from 'vue';
2 2
 import EvaIcons from 'vue-eva-icons';
3
+import axios from 'axios';
3 4
 import App from './App.vue';
4 5
 import router from './router';
5 6
 import store from './store';
@@ -8,6 +9,24 @@ Vue.use(EvaIcons);
8 9
 
9 10
 Vue.config.productionTip = false;
10 11
 
12
+Vue.prototype.$http = axios;
13
+const token = localStorage.getItem('token');
14
+if (token) {
15
+  Vue.prototype.$http.defaults.headers.common.Authorization = token;
16
+}
17
+
18
+router.beforeEach((to, from, next) => {
19
+  if (to.matched.some(record => record.meta.requiresAuth)) {
20
+    if (store.getters.isLoggedIn) {
21
+      next();
22
+      return;
23
+    }
24
+    next('/users/login');
25
+  } else {
26
+    next();
27
+  }
28
+});
29
+
11 30
 Vue.filter('toCurrency', (value) => {
12 31
   if (typeof value !== 'number') {
13 32
     return value;

+ 2
- 0
src/router/index.js View File

@@ -1,3 +1,4 @@
1
+/* eslint-disable import/prefer-default-export */
1 2
 import Vue from 'vue';
2 3
 import Router from 'vue-router';
3 4
 
@@ -39,6 +40,7 @@ import PrivacyPolicy from '../components/misc/privacyPolicyPage.vue';
39 40
 
40 41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
41 42
 import Offer from '../components/processFlow/offers.vue';
43
+// import store from '../store';
42 44
 
43 45
 Vue.use(Router);
44 46
 

+ 2
- 0
src/store/index.js View File

@@ -16,6 +16,7 @@ import PropertyTypes from './modules/property/propertyTypes';
16 16
 import Register from './modules/user/register';
17 17
 import WeekList from './modules/timeshare/weekList';
18 18
 import Bid from './modules/processFlow/bid';
19
+import Authentication from './modules/user/authentication';
19 20
 
20 21
 Vue.use(Vuex);
21 22
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -37,5 +38,6 @@ export default new Vuex.Store({
37 38
     registerAgency: Register,
38 39
     weekList: WeekList,
39 40
     bid: Bid,
41
+    authentication: Authentication,
40 42
   },
41 43
 });

+ 67
- 0
src/store/modules/user/authentication.js View File

@@ -0,0 +1,67 @@
1
+import Vue from 'vue';
2
+import Vuex from 'vuex';
3
+import axios from 'axios';
4
+
5
+Vue.use(Vuex);
6
+export default {
7
+  namespaced: true,
8
+  state: {
9
+    status: '',
10
+    token: localStorage.getItem('token') || '',
11
+    user: {},
12
+  },
13
+  mutations: {
14
+    auth_request(state) {
15
+      state.status = 'loading';
16
+    },
17
+    auth_success(state, token, user) {
18
+      state.status = 'success';
19
+      state.token = token;
20
+      state.user = user;
21
+    },
22
+    auth_error(state) {
23
+      state.status = 'error';
24
+    },
25
+    logout(state) {
26
+      state.status = '';
27
+      state.token = '';
28
+    },
29
+  },
30
+  getters: {
31
+    isLoggedIn: state => !!state.token,
32
+    authStatus: state => state.status,
33
+  },
34
+  actions: {
35
+    login({
36
+      commit,
37
+    }, user) {
38
+      return new Promise((reject) => {
39
+        commit('auth_request');
40
+        axios({
41
+          url: '/api/register/authenticate',
42
+          data: user,
43
+          method: 'POST',
44
+        })
45
+          .then((resp) => {
46
+            console.log(resp.data);
47
+            localStorage.setItem('token', resp.data.token);
48
+            commit('auth_success', resp.data.token, resp.data);
49
+          })
50
+          .catch((err) => {
51
+            commit('auth_error');
52
+            localStorage.removeItem('token');
53
+            reject(err);
54
+          });
55
+      });
56
+    },
57
+    logout({
58
+      commit,
59
+    }) {
60
+      return new Promise(() => {
61
+        commit('logout');
62
+        localStorage.removeItem('token');
63
+        delete axios.defaults.headers.common.Authorization;
64
+      });
65
+    },
66
+  },
67
+};

Loading…
Cancel
Save