Bläddra i källkod

Fix Commercial and Timeshare to Buy links to pages

master
Brian Conway 2 år sedan
förälder
incheckning
e31ed9dbde

+ 91
- 48
src/components/property/commercial/singleView/contentSection.vue Visa fil

@@ -3,7 +3,7 @@
3 3
     <div class="container">
4 4
       <div class="row" id="resort-profile">
5 5
         <div class="col-md-4">
6
-          <div class="resPortfolioSection" style="margin-top:-5px">
6
+          <div class="resPortfolioSection" style="margin-top: -5px;">
7 7
             <iframe
8 8
               v-if="property.video !== null"
9 9
               width="100%"
@@ -11,36 +11,52 @@
11 11
               frameborder="0"
12 12
               allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
13 13
               allowfullscreen
14
-              style="margin-bottom:-6px"
14
+              style="margin-bottom: -6px;"
15 15
             ></iframe>
16 16
             <div v-if="propertyImages.length > 0">
17
-              <div v-for="(image, i) in propertyImages" @click="index = i" :key="i">
17
+              <div
18
+                v-for="(image, i) in propertyImages"
19
+                @click="index = i"
20
+                :key="i"
21
+              >
18 22
                 <div v-if="i < 3">
19 23
                   <img
20 24
                     v-if="i === 0"
21
-                    style="width:100%; height:201px;object-fit: cover"
25
+                    style="width: 100%; height: 201px; object-fit: cover;"
22 26
                     :src="image.image"
23 27
                   />
24 28
                   <div v-else-if="i !== 0">
25 29
                     <img
26 30
                       v-if="i % 2 === 0"
27
-                      style="width:50%; height:140px; float:right;"
31
+                      style="width: 50%; height: 140px; float: right;"
32
+                      :src="image.image"
33
+                    />
34
+                    <img
35
+                      v-else
36
+                      style="width: 50%; height: 140px; float: left;"
28 37
                       :src="image.image"
29 38
                     />
30
-                    <img v-else style="width:50%; height:140px; float:left" :src="image.image" />
31 39
                   </div>
32 40
                 </div>
33 41
               </div>
34
-              <gallery :images="Images" :index="index" @close="index = null"></gallery>
42
+              <gallery
43
+                :images="Images"
44
+                :index="index"
45
+                @close="index = null"
46
+              ></gallery>
35 47
             </div>
36 48
           </div>
37 49
 
38 50
           <div
39 51
             class="panel-left p-5"
40
-            :class="propertyImages.length > 0 ? 'galleryImages' : 'noGalleryImages'"
52
+            :class="
53
+              propertyImages.length > 0 ? 'galleryImages' : 'noGalleryImages'
54
+            "
41 55
           >
42 56
             <h2>Property Detail</h2>
43
-            <p v-if="property.showAddress">{{ property.streetNumber }} {{ property.streetName }}</p>
57
+            <p v-if="property.showAddress">
58
+              {{ property.streetNumber }} {{ property.streetName }}
59
+            </p>
44 60
             <p>{{ property.city }}, {{ property.suburb }}</p>
45 61
             <div v-if="property.displayData.length > 0">
46 62
               <div v-for="(data, i) in property.displayData" :key="i">
@@ -57,7 +73,9 @@
57 73
             </div>-->
58 74
             <p>{{ property.shortDescription }}</p>
59 75
 
60
-            <p v-if="property.statusString === 'For Sale'">{{ property.price | toCurrency }}</p>
76
+            <p v-if="property.statusString === 'For Sale'">
77
+              {{ property.price | toCurrency }}
78
+            </p>
61 79
             <p v-else>{{ property.price | toCurrency }} Per Month</p>
62 80
           </div>
63 81
           <div class="panel-left px-5 pb-5 text-center">
@@ -66,25 +84,37 @@
66 84
               href="http://www.facebook.com/sharer.php?u=https://www.univateproperties.co.za/"
67 85
               target="_blank"
68 86
             >
69
-              <img src="img/icon-facebook.svg" alt="Share on Facebook" class="col-3 p-1 mx-1" />
87
+              <img
88
+                src="img/icon-facebook.svg"
89
+                alt="Share on Facebook"
90
+                class="col-3 p-1 mx-1"
91
+              />
70 92
             </a>
71 93
             <a
72 94
               href="mailto:?Subject=Simple Share Buttons&amp;Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://www.univateproperties.co.za/"
73 95
             >
74
-              <img src="/img/icon-email.svg" alt="Share on email" class="col-3 p-1 mx-1" />
96
+              <img
97
+                src="/img/icon-email.svg"
98
+                alt="Share on email"
99
+                class="col-3 p-1 mx-1"
100
+              />
75 101
             </a>
76 102
             <a
77 103
               href="whatsapp://send?text=Have a look at this property: https://www.univateproperties.co.za"
78 104
               data-action="share/whatsapp/share"
79 105
               target="_blank"
80 106
             >
81
-              <img src="img/icon-whatsapp.svg" alt="Share on whatsapp" class="col-3 p-1 mx-1" />
107
+              <img
108
+                src="img/icon-whatsapp.svg"
109
+                alt="Share on whatsapp"
110
+                class="col-3 p-1 mx-1"
111
+              />
82 112
             </a>
83 113
           </div>
84 114
         </div>
85 115
         <div class="col-md-8 p-5 resort-profile">
86 116
           <h2 v-if="property.showAddress">
87
-            <div style="display:inline" v-if="property.propertyName !== null">
117
+            <div style="display: inline;" v-if="property.propertyName !== null">
88 118
               {{ property.propertyName }} /
89 119
             </div>
90 120
             {{ property.streetNumber }} {{ property.streetName }}
@@ -93,10 +123,18 @@
93 123
           <p>{{ property.shortDescription }}</p>
94 124
           <h4>Property Features</h4>
95 125
           <div v-if="property.displayData.length > 0">
96
-            <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
126
+            <div
127
+              v-for="(data, i) in property.displayData"
128
+              :key="i"
129
+              class="row my-3"
130
+            >
97 131
               <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
98 132
                 <div
99
-                  :style="field.value.toUpperCase() === 'FALSE' ? 'display:none' : 'display:show'"
133
+                  :style="
134
+                    field.value.toUpperCase() === 'FALSE'
135
+                      ? 'display:none'
136
+                      : 'display:show'
137
+                  "
100 138
                   v-if="field.value.toUpperCase() != 'TRUE'"
101 139
                 >
102 140
                   <i class="fa fa-check-circle"></i>
@@ -112,7 +150,7 @@
112 150
 
113 151
           <div class="mt-5" v-html="property.description"></div>
114 152
           <button
115
-            style="float:right; white-space: nowrap;"
153
+            style="float: right; white-space: nowrap;"
116 154
             :class="checkStatus() ? 'btn-disabled mt-3' : 'btn-solid-blue mt-3'"
117 155
             :disabled="checkStatus()"
118 156
             @click="goToSingle()"
@@ -120,7 +158,9 @@
120 158
             ENQUIRE NOW
121 159
           </button>
122 160
 
123
-          <h4 v-if="property.virtualTour !== null" style="margin-top:150px">Virtual Tour</h4>
161
+          <h4 v-if="property.virtualTour !== null" style="margin-top: 150px;">
162
+            Virtual Tour
163
+          </h4>
124 164
           <iframe
125 165
             v-if="property.virtualTour !== null"
126 166
             width="100%"
@@ -129,7 +169,7 @@
129 169
             frameborder="0"
130 170
             allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
131 171
             allowfullscreen
132
-            style="margin-bottom:-6px"
172
+            style="margin-bottom: -6px;"
133 173
             class="mt-3"
134 174
           ></iframe>
135 175
           <h4 v-if="property.video !== null" class="mt-5">Video</h4>
@@ -141,7 +181,7 @@
141 181
             frameborder="0"
142 182
             allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
143 183
             allowfullscreen
144
-            style="margin-bottom:-6px"
184
+            style="margin-bottom: -6px;"
145 185
             class="mt-3"
146 186
           ></iframe>
147 187
         </div>
@@ -152,67 +192,70 @@
152 192
 
153 193
 <script>
154 194
 /* eslint-disable */
155
-import gallery from "../../../shared/gallerySlideShow";
156
-import { mapState, mapActions } from "vuex";
195
+import gallery from '../../../shared/gallerySlideShow'
196
+import { mapState, mapActions } from 'vuex'
157 197
 export default {
158 198
   components: {
159
-    gallery
199
+    gallery,
160 200
   },
161 201
   props: {
162 202
     property: {},
163
-    propertyImages: {}
203
+    propertyImages: {},
164 204
   },
165 205
   data() {
166 206
     return {
167 207
       index: null,
168
-      date: new Date()
169
-    };
208
+      date: new Date(),
209
+    }
170 210
   },
171 211
   computed: {
172
-    ...mapState("status", ["singleStatus"]),
212
+    ...mapState('status', ['singleStatus']),
173 213
     Images() {
174
-      const list = [];
214
+      const list = []
175 215
       if (this.propertyImages) {
176 216
         for (let i = 0; i < this.propertyImages.length; i++) {
177
-          list.push(this.propertyImages[i].image);
217
+          list.push(this.propertyImages[i].image)
178 218
         }
179 219
       }
180
-      return list;
181
-    }
220
+      return list
221
+    },
182 222
   },
183 223
   methods: {
184
-    ...mapActions("status", ["getSingleStatus"]),
224
+    ...mapActions('status', ['getSingleStatus']),
185 225
     goToSingle() {
186
-      this.$router.push({ name: "EnquireNow", params: { id: this.$route.params.id } });
226
+      this.$router.push({
227
+        name: 'EnquireNow',
228
+        params: { id: this.$route.params.id },
229
+      })
187 230
     },
188 231
     checkStatus() {
189
-      this.getSingleStatus(this.property.statusId);
232
+      this.getSingleStatus(this.property.statusId)
190 233
       if (
191
-        this.singleStatus.code === "CIP" ||
192
-        this.singleStatus.code === "S" ||
193
-        this.singleStatus.code === "P"
234
+        this.singleStatus.code === 'CIP' ||
235
+        this.singleStatus.code === 'S' ||
236
+        this.singleStatus.code === 'P'
194 237
       ) {
195
-        return true;
238
+        return true
196 239
       } else {
197
-        return false;
240
+        return false
198 241
       }
199
-    }
242
+    },
200 243
   },
201 244
   mounted() {
202
-    if (this.property.video === "") {
203
-      this.property.video = null;
245
+    if (this.property.video === '') {
246
+      this.property.video = null
204 247
     }
205
-    if (this.property.virtualTour === "") {
206
-      this.property.virtualTour = null;
248
+    if (this.property.virtualTour === '') {
249
+      this.property.virtualTour = null
207 250
     }
208
-    this.$emit("Loaded", true);
209
-  }
210
-};
251
+    this.$emit('Loaded', true)
252
+  },
253
+}
211 254
 </script>
212 255
 
213 256
 <style lang="scss" scoped>
214 257
 .btn-disabled {
215
-  font-family: "Muli";
258
+  font-family: 'Muli';
216 259
   font-size: 15px;
217 260
   letter-spacing: 1px;
218 261
   display: inline-block;

+ 1
- 5
src/components/timeshare/buy/weekListComponent.vue Visa fil

@@ -168,11 +168,7 @@ export default {
168 168
     },
169 169
   },
170 170
   mounted() {
171
-    //if (this.resortCode) {
172
-    //  this.applyResortFilter(this.resortCode);
173
-    //}
174 171
     this.getByResortCode(this.$route.params.resortCode)
175
-    //this.getWeeks();
176 172
   },
177 173
   methods: {
178 174
     ...mapActions('weekList', [
@@ -181,7 +177,7 @@ export default {
181 177
       'getByResortCode',
182 178
     ]),
183 179
     View(item) {
184
-      this.$router.push(`/resort/${item.resort.resortCode}/${item.unitNumber}`)
180
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`)
185 181
     },
186 182
     onChangeItemsPerPage() {
187 183
       if (this.currentPage !== 1) {

+ 44
- 45
src/components/timeshare/resort/resortPageNew.vue Visa fil

@@ -4,50 +4,52 @@
4 4
     <main id="main" style="margin-top: 20px;">
5 5
       <section>
6 6
         <div class="container">
7
-          <div class="row" id="resort-profile">
8
-            <div class="col-md-3">
9
-              <gallerySection :images="resort.images" />
10
-              <FilterComponent :hideTop="true" />
11
-            </div>
12
-            <div
13
-              class="col-md-9 resort-profile"
14
-              style="margin-top: 15px; margin-bottom: 15px;"
15
-            >
16
-              <h2>{{ resort.prName }}</h2>
17
-              <WeekList :resortCode="resortCode" />
18
-              <p v-if="description && description !== ''">
19
-                {{ description }}
20
-              </p>
21
-              <br v-if="description && description !== ''" />
22
-              <div class="d-flex mt-3">
23
-                <iframe
24
-                  width="100%"
25
-                  height="200"
26
-                  id="gmap_canvas"
27
-                  :src="
28
-                    'https://maps.google.com/maps?q=' +
29
-                    resort.prLatitude +
30
-                    ',' +
31
-                    resort.prLongitude +
32
-                    '&hl=en&z=14&amp;output=embed'
33
-                  "
34
-                  frameborder="0"
35
-                  scrolling="no"
36
-                  marginheight="0"
37
-                  marginwidth="0"
38
-                ></iframe>
7
+          <div class="form">
8
+            <div class="row" id="resort-profile">
9
+              <div class="col-md-3">
10
+                <gallerySection :images="resort.images" />
11
+                <FilterComponent :hideTop="true" />
39 12
               </div>
40
-            </div>
41
-          </div>
42
-          <div class="row">
43
-            <div class="col">
44
-              <router-link
45
-                style="float: right;"
46
-                class="btn-white-border mb-4"
47
-                to="/timeshare/buy"
13
+              <div
14
+                class="col-md-9 resort-profile"
15
+                style="margin-top: 15px; margin-bottom: 15px;"
48 16
               >
49
-                Back
50
-              </router-link>
17
+                <h2>{{ resort.prName }}</h2>
18
+                <WeekList :resortCode="resortCode" />
19
+                <p v-if="description && description !== ''">
20
+                  {{ description }}
21
+                </p>
22
+                <br v-if="description && description !== ''" />
23
+                <div class="d-flex mt-3">
24
+                  <iframe
25
+                    width="100%"
26
+                    height="200"
27
+                    id="gmap_canvas"
28
+                    :src="
29
+                      'https://maps.google.com/maps?q=' +
30
+                      resort.prLatitude +
31
+                      ',' +
32
+                      resort.prLongitude +
33
+                      '&hl=en&z=14&amp;output=embed'
34
+                    "
35
+                    frameborder="0"
36
+                    scrolling="no"
37
+                    marginheight="0"
38
+                    marginwidth="0"
39
+                  ></iframe>
40
+                </div>
41
+              </div>
42
+            </div>
43
+            <div class="row">
44
+              <div class="col">
45
+                <router-link
46
+                  style="float: right;"
47
+                  class="btn-white-border mb-4"
48
+                  to="/timeshare/buy"
49
+                >
50
+                  Back
51
+                </router-link>
52
+              </div>
51 53
             </div>
52 54
           </div>
53 55
         </div>
@@ -94,11 +96,8 @@ export default {
94 96
     ...mapState('resort', ['resort', 'images', 'description']),
95 97
   },
96 98
   created() {
97
-    console.log('Resort Description')
98
-    console.log(this.resortCode)
99 99
     this.getDescription(this.resortCode)
100 100
 
101
-    console.log(this.resort.description)
102 101
     this.getResortData(
103 102
       this.resortCode.includes('SILV') ? 'SILV1' : this.resortCode,
104 103
     ).then(() => (this.wait = false))

+ 7
- 14
src/components/timeshare/resort/unit/summarySection.vue Visa fil

@@ -3,7 +3,7 @@
3 3
     <div class="row">
4 4
       <div class="col">
5 5
         <div class="section-header">
6
-          <h2>{{ week ? week.resort.resortName : '' }}</h2>
6
+          <!--<h2>{{ week ? week.resort.resortName : '' }}</h2> -->
7 7
         </div>
8 8
       </div>
9 9
     </div>
@@ -105,25 +105,18 @@ export default {
105 105
     makeOffer,
106 106
     gallerySection,
107 107
   },
108
+  mounted() {
109
+    this.getWeek(this.weekId)
110
+  },
108 111
   computed: {
109 112
     ...mapState('resort', ['resort', 'description', 'images', 'layout']),
110
-
111
-    ...mapGetters({
112
-      weekById: 'weekList/weekById',
113
-    }),
114
-    week() {
115
-      return this.weekById(this.resortCode, this.unitNumber)
116
-    },
117
-    // ...mapState('week', ['currentWeek']),
113
+    ...mapState('weekList', ['week']),
118 114
   },
119 115
   props: {
120
-    resortCode: {},
121
-    unitNumber: {},
116
+    weekId: {},
122 117
   },
123 118
   methods: {
124
-    ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
125
-    ...mapActions('resort', ['initResort']),
126
-    // ...mapActions('week', ['initWeek']),
119
+    ...mapActions('weekList', ['getWeek']),
127 120
     formatPrice(value) {
128 121
       if (value) {
129 122
         const val = (value / 1).toFixed(2)

+ 39
- 47
src/components/timeshare/resort/unit/unitPageNew.vue Visa fil

@@ -1,12 +1,12 @@
1 1
 <template>
2
-  <main id="main" style="padding-bottom:50px">
2
+  <main id="main" style="padding-bottom: 50px;">
3 3
     <!-- <carouselSection v-if="!wait" :resortImages="resort.images" /> -->
4
-    <summarySection :resortCode="resortCode" :unitNumber="unitNumber" />
4
+    <summarySection :weekId="weekId" />
5 5
     <div class="container">
6 6
       <div class="row mt-5">
7 7
         <div class="col">
8 8
           <tabSection
9
-            style="margin-bottom:100px"
9
+            style="margin-bottom: 100px;"
10 10
             :resortCode="calculatedCode"
11 11
             :resortCoords="resort.prPostAdd1"
12 12
             :layoutImages="layouts"
@@ -21,28 +21,28 @@
21 21
 
22 22
 <script>
23 23
 /* eslint-disable */
24
-import { mapState, mapActions, mapGetters } from "vuex";
25
-import gallerySection from "../gallerySection";
26
-import tabSection from "./tabSection";
27
-import summarySection from "./summarySection";
28
-import carouselSection from "./carouselSection";
24
+import { mapState, mapActions, mapGetters } from 'vuex'
25
+import gallerySection from '../gallerySection'
26
+import tabSection from './tabSection'
27
+import summarySection from './summarySection'
28
+import carouselSection from './carouselSection'
29 29
 
30 30
 export default {
31
-  name: "unit",
31
+  name: 'unit',
32 32
   components: {
33 33
     gallerySection,
34 34
     tabSection,
35 35
     summarySection,
36
-    carouselSection
36
+    carouselSection,
37 37
   },
38 38
   props: {
39 39
     resortCode: {},
40
-    unitNumber: {}
40
+    weekId: {},
41 41
   },
42 42
   data() {
43 43
     return {
44
-      wait: false
45
-    };
44
+      wait: false,
45
+    }
46 46
   },
47 47
   mounted() {
48 48
     // await this.initResort(this.resortCode);
@@ -54,50 +54,42 @@ export default {
54 54
     // setTimeout(() => {
55 55
     //   this.boolLoaded = true;
56 56
     // }, 500);
57
-    this.wait = true;
58
-    this.getResortData(this.resortCode.includes("SILV") ? "SILV1" : this.resortCode).then(
59
-      fulfilled => {
60
-        this.applyResortFilter(this.resortCode.includes("SILV") ? "SILV1" : this.resortCode);
61
-        this.getWeeks();
62
-        this.wait = false;
63
-      }
64
-    );
57
+    this.wait = true
58
+    console.log(this.weekId)
59
+    this.getResortData(
60
+      this.resortCode.includes('SILV') ? 'SILV1' : this.resortCode,
61
+    ).then((fulfilled) => {
62
+      this.applyResortFilter(
63
+        this.resortCode.includes('SILV') ? 'SILV1' : this.resortCode,
64
+      )
65
+      this.getWeeks()
66
+      this.wait = false
67
+    })
65 68
   },
66 69
   computed: {
67
-    ...mapState("resort", ["resort"]),
68
-
69
-    ...mapGetters({
70
-      weekById: "weekList/weekById"
71
-    }),
72
-    week() {
73
-      return this.weekById(
74
-        this.resortCode.includes("SILV") ? "SILV1" : this.resortCode,
75
-        this.unitNumber
76
-      );
77
-    },
70
+    ...mapState('resort', ['resort']),
71
+    ...mapState('weekList', ['weeks', 'week']),
78 72
     layouts() {
79
-      var layouts = [];
80
-      layouts.push(this.resort.layout);
81
-      return layouts;
73
+      var layouts = []
74
+      layouts.push(this.resort.layout)
75
+      return layouts
82 76
     },
83 77
     calculatedCode() {
84
-      return this.resortCode.includes("SILV") ? "SILV1" : this.resortCode;
85
-    }
86
-    // ...mapState('week', ['currentWeek']),
78
+      return this.resortCode.includes('SILV') ? 'SILV1' : this.resortCode
79
+    },
87 80
   },
88 81
   methods: {
89
-    ...mapActions("weekList", ["getWeeks", "applyResortFilter"]),
90
-    ...mapActions("resort", ["getResortData"]),
91
-    // ...mapActions('week', ['initWeek']),
82
+    ...mapActions('weekList', ['getWeeks', 'getWeek', 'applyResortFilter']),
83
+    ...mapActions('resort', ['getResortData']),
92 84
     formatPrice(value) {
93 85
       if (value) {
94
-        const val = (value / 1).toFixed(2);
95
-        return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
86
+        const val = (value / 1).toFixed(2)
87
+        return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ')
96 88
       }
97
-      return "";
98
-    }
99
-  }
100
-};
89
+      return ''
90
+    },
91
+  },
92
+}
101 93
 </script>
102 94
 
103 95
 <style lang="scss" scoped>

+ 1
- 1
src/router/index.js Visa fil

@@ -399,7 +399,7 @@ export default new Router({
399 399
             props: true,
400 400
         },
401 401
         {
402
-            path: '/resort/:resortCode/:unitNumber',
402
+            path: '/resort/:resortCode/:weekId',
403 403
             name: 'UnitPage',
404 404
             component: UnitPage,
405 405
             props: true,

+ 8
- 8
src/store/modules/timeshare/status.js Visa fil

@@ -5,24 +5,24 @@ export default {
5 5
     namespaced: true,
6 6
     state: {
7 7
         statusList: [],
8
-        status: {},
8
+        singleStatus: {},
9 9
     },
10 10
     mutations: {
11 11
         setStatusList(state, list) {
12 12
             state.statusList = list
13 13
         },
14
-        addNewStatus(state, status) {
15
-            state.statusList.push(status)
14
+        addNewStatus(state, jsstatus) {
15
+            state.statusList.push(jsstatus)
16 16
         },
17
-        setSingleStatus(state, status) {
18
-            state.status = status
17
+        setSingleStatus(state, jsstatus) {
18
+            state.singleStatus = jsstatus
19 19
         },
20
-        deleteStatus(state, id) {
21
-            var index = state.statusList.findIndex((stat) => stat.id == id)
20
+        deleteStatus(state, jsid) {
21
+            var index = state.statusList.findIndex((stat) => stat.id == jsid)
22 22
             state.statusList.splice(index, 1)
23 23
         },
24 24
         clearStatus(state) {
25
-            state.status = {
25
+            state.singleStatus = {
26 26
                 code: '',
27 27
                 description: '',
28 28
             }

+ 24
- 32
src/store/modules/timeshare/weekList.js Visa fil

@@ -10,6 +10,7 @@ export default {
10 10
     namespaced: true,
11 11
     state: {
12 12
         weeks: [],
13
+        week: {},
13 14
         status: undefined,
14 15
         filter: {
15 16
             season: undefined,
@@ -38,18 +39,21 @@ export default {
38 39
         onError(state) {
39 40
             state.status = 'Error occurred getting data.'
40 41
         },
41
-        onClearFilter(state, filter) {
42
-            state.filter[filter] = undefined
42
+        onClearFilter(state, jsfilter) {
43
+            state.filter[jsfilter] = undefined
43 44
         },
44
-        setWeeks(state, weeks) {
45
-            state.weeks = weeks
45
+        setWeeks(state, jsweeks) {
46
+            state.weeks = jsweeks
46 47
             state.status = ''
47 48
         },
48
-        addWeek(state, week) {
49
-            state.weeks.push(week)
49
+        setWeek(state, jsweek) {
50
+            state.week = jsweek
50 51
         },
51
-        applyResort(state, resort) {
52
-            state.filter.resort = resort
52
+        addWeek(state, jsweek) {
53
+            state.weeks.push(jsweek)
54
+        },
55
+        applyResort(state, jsresort) {
56
+            state.filter.resort = jsresort
53 57
         },
54 58
     },
55 59
     getters: {
@@ -140,15 +144,8 @@ export default {
140 144
             return rootGetters['timeshare/getRegionCode']('KK')
141 145
         },
142 146
         weekById(state) {
143
-            return (resortCode, unitNumber) => {
144
-                const w = state.weeks.find(
145
-                    (week) =>
146
-                    week.resort !== undefined &&
147
-                    week.resort.resortCode === resortCode &&
148
-                    week.unitNumber === unitNumber,
149
-                )
150
-                console.log(resortCode, unitNumber)
151
-
147
+            return (week) => {
148
+                const w = state.weeks.find((week) => week.id === weekId)
152 149
                 if (w) {
153 150
                     return w
154 151
                 }
@@ -167,7 +164,6 @@ export default {
167 164
                 .get('/api/timeshareweek/getByResortCode/' + resortCode)
168 165
                 .then((result) => {
169 166
                     commit('setWeeks', result.data)
170
-                    console.log(result)
171 167
                 })
172 168
         },
173 169
         async getWeeks({ commit, rootGetters }) {
@@ -183,29 +179,25 @@ export default {
183 179
                         if (myItem !== undefined) {
184 180
                             const code = myItem.resort.resortCode
185 181
                             myItem.region = {
186
-                                regionName: rootGetters['timeshare/getRegionCode'](code),
182
+                                regionName: rootGetters['timeshare/getRegionCode'](this.code),
187 183
                             }
188 184
                             myItem.resort = {
189
-                                resortName: rootGetters['timeshare/getResortName'](code),
190
-                                resortCode: code,
185
+                                resortName: rootGetters['timeshare/getResortName'](this.code),
186
+                                resortCode: this.code,
191 187
                             }
192 188
                         }
193 189
                     }
194
-
195
-                    console.log(code)
196
-                        //console.log(arr3)
197 190
                     commit('setWeeks', arr2)
198 191
                 })
199 192
                 .catch(console.error)
200 193
         },
201
-        // getWeeks({ commit }) {
202
-        //   axios.get("api/timeshareweek").then(result =>
203
-        //     commit(
204
-        //       "setWeeks",
205
-        //       result.data.filter(x => x.region !== null)
206
-        //     )
207
-        //   );
208
-        // },
194
+        async getWeek({ commit }, jsweekId) {
195
+            commit('onLoading')
196
+            await axios.get('/api/timeshareweek/' + jsweekId).then((result) => {
197
+                commit('setWeek', result.data)
198
+            })
199
+        },
200
+
209 201
         clearFilter({ commit }, filter) {
210 202
             commit('onClearFilter', filter)
211 203
         },

+ 1
- 1
vue.config.js Visa fil

@@ -4,7 +4,7 @@ module.exports = {
4 4
             '/api': {
5 5
                 target: 'http://localhost:57260/',
6 6
                 //target: 'http://training.provision-sa.com:120/',
7
-                //target: "https://www.pvsl.co.za:86/",
7
+                //target: 'https://www.pvsl.co.za:86/',
8 8
                 changeOrigin: true,
9 9
             },
10 10
             '/nph-srep': {

Laddar…
Avbryt
Spara