Преглед изворни кода

Fixes to properties - controls not loading

master
George Williams пре 4 година
родитељ
комит
4fc4986aff

+ 12
- 8
src/components/property/commercial/singleView/singleCommercialPage.vue Прегледај датотеку

@@ -25,25 +25,29 @@ export default {
25 25
   components: {
26 26
     makeOffer,
27 27
     carouselSection,
28
-    contentSection
28
+    contentSection,
29 29
   },
30 30
   data() {
31 31
     return {
32 32
       index: null,
33
-      date: new Date()
33
+      date: new Date(),
34 34
     };
35 35
   },
36 36
   async mounted() {
37 37
     await this.getProperty(this.$route.params.id);
38
-    await this.getPropertyImages(this.$route.params.id);
39
-    this.mayEditProperty(this.$route.params.id);
38
+    // await this.getPropertyImages(this.$route.params.id);
39
+    // this.mayEditProperty(this.$route.params.id);
40 40
   },
41 41
   computed: {
42 42
     ...mapState("property", ["property", "propertyImages"]),
43
-    ...mapState("propertyEdit", ["mayEdit"])
43
+    ...mapState("propertyEdit", ["mayEdit"]),
44 44
   },
45 45
   methods: {
46
-    ...mapActions("property", ["getProperty", "getPropertyImages", "clearPropertyImages"]),
46
+    ...mapActions("property", [
47
+      "getProperty",
48
+      "getPropertyImages",
49
+      "clearPropertyImages",
50
+    ]),
47 51
     ...mapActions("propertyEdit", ["mayEditProperty"]),
48 52
     formatPrice(value) {
49 53
       const val = (value / 1).toFixed(2);
@@ -54,11 +58,11 @@ export default {
54 58
         return `${value}<br/>`;
55 59
       }
56 60
       return "";
57
-    }
61
+    },
58 62
   },
59 63
   beforeDestroy() {
60 64
     this.clearPropertyImages();
61
-  }
65
+  },
62 66
 };
63 67
 </script>
64 68
 

+ 43
- 38
src/components/property/editProperty/editProperty.vue Прегледај датотеку

@@ -66,9 +66,11 @@
66 66
                     :disabled="!canEdit"
67 67
                   >
68 68
                     <option value="0">Please select type *</option>
69
-                    <option v-for="item in propertyTypes" :value="item.id" :key="item.id">{{
69
+                    <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
70
+                      {{
70 71
                       item.description
71
-                    }}</option>
72
+                      }}
73
+                    </option>
72 74
                   </select>
73 75
                 </div>
74 76
                 <div v-if="property.propertyUsageType === 'Commercial'" class="col-md-2">
@@ -108,8 +110,7 @@
108 110
                           for="price"
109 111
                           class="uniSelectLabel"
110 112
                           style="text-transform:uppercase; margin-left:17px; background-color:white"
111
-                          >{{ property.salesTypeString }} Price</label
112
-                        >
113
+                        >{{ property.salesTypeString }} Price</label>
113 114
                       </div>
114 115
                       <input
115 116
                         class="form-control uniInput"
@@ -255,9 +256,11 @@
255 256
                   </div>
256 257
                   <div class="row my-3">
257 258
                     <div class="col-md-12">
258
-                      <button type="button" @click="clearAddress()" class="btn-solid-blue">
259
-                        Clear Address
260
-                      </button>
259
+                      <button
260
+                        type="button"
261
+                        @click="clearAddress()"
262
+                        class="btn-solid-blue"
263
+                      >Clear Address</button>
261 264
                     </div>
262 265
                   </div>
263 266
                 </div>
@@ -265,16 +268,8 @@
265 268
               <div class="row">
266 269
                 <div class="col-md-12">
267 270
                   <label for="Property Description" style="font-family:'muli'">Description:</label>
268
-                  <vue-editor
269
-                    v-model="property.description"
270
-                    :editor-toolbar="customToolbar"
271
-                    :disabled="!canEdit"
272
-                  />
271
+                  <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
273 272
                   <br />
274
-                  <p>
275
-                    * A listing fee of R380 including VAT is payable to list your Property on the
276
-                    Uni-Vate website
277
-                  </p>
278 273
                 </div>
279 274
               </div>
280 275
               <div class="row">
@@ -303,7 +298,11 @@
303 298
                     </div>
304 299
                     <div v-else-if="field.type === 'yesno'">
305 300
                       {{ field.name }}
306
-                      <input type="checkbox" v-model="field.value" :disabled="!canEdit" />
301
+                      <input
302
+                        type="checkbox"
303
+                        v-model="field.value"
304
+                        :disabled="!canEdit"
305
+                      />
307 306
                     </div>
308 307
                     <div v-else class="display:none"></div>
309 308
                   </div>
@@ -362,17 +361,8 @@
362 361
                 @DeleteImage="DeleteImage"
363 362
                 :mayEdit="canEdit"
364 363
               />
365
-              <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
366
-                Save
367
-              </button>
368
-              <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">
369
-                Close
370
-              </button>
371
-              <div v-if="showPropertyTypeError">
372
-                <p class="alert myError">
373
-                  Missing fields. Please fill in all required fields. Marked with *
374
-                </p>
375
-              </div>
364
+              <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
365
+              <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">Close</button>
376 366
               <div v-if="!addressSet">
377 367
                 <p class="alert myError">Please enter an address.</p>
378 368
               </div>
@@ -387,6 +377,7 @@
387 377
 
388 378
 <script>
389 379
 /* eslint-disable */
380
+import { VueEditor } from "vue2-editor";
390 381
 import { mapState, mapActions } from "vuex";
391 382
 import mapSection from "../mapSection";
392 383
 import ImageLoad from "../propertyImage";
@@ -396,7 +387,8 @@ export default {
396 387
   name: "PropertyEditPage",
397 388
   components: {
398 389
     mapSection,
399
-    ImageLoad
390
+    ImageLoad,
391
+    VueEditor,
400 392
   },
401 393
   data() {
402 394
     return {
@@ -404,7 +396,20 @@ export default {
404 396
       defaultImage: 0,
405 397
       images: [],
406 398
       wait: false,
407
-      canEdit: true
399
+      canEdit: true,
400
+      customToolbar: [
401
+        [{ header: [false, 1, 2, 3, 4, 5, 6] }],
402
+        ["bold", "italic", "underline", "strike"],
403
+        [
404
+          { align: "" },
405
+          { align: "center" },
406
+          { align: "right" },
407
+          { align: "justify" },
408
+        ],
409
+        [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
410
+        [{ script: "sub" }, { script: "super" }],
411
+        [{ indent: "-1" }, { indent: "+1" }],
412
+      ],
408 413
     };
409 414
   },
410 415
   methods: {
@@ -412,7 +417,7 @@ export default {
412 417
       "getProperty",
413 418
       "getPropertyTypes",
414 419
       "getPropertyFields",
415
-      "updateProperty"
420
+      "updateProperty",
416 421
     ]),
417 422
     StatusChanged(item) {
418 423
       if (
@@ -475,7 +480,7 @@ export default {
475 480
         }
476 481
         this.property.newImages.push({
477 482
           image: this.images[i],
478
-          isDefault: setAsDefault
483
+          isDefault: setAsDefault,
479 484
         });
480 485
       }
481 486
 
@@ -483,7 +488,7 @@ export default {
483 488
 
484 489
       //console.log(JSON.stringify(this.property));
485 490
 
486
-      this.updateProperty(this.property).then(fulfilled => {
491
+      this.updateProperty(this.property).then((fulfilled) => {
487 492
         this.$router.push("/PropertyAdmin");
488 493
       });
489 494
     },
@@ -504,10 +509,10 @@ export default {
504 509
     },
505 510
     DeleteImage(item) {
506 511
       this.propertyImages[item].isDeleted = true;
507
-    }
512
+    },
508 513
   },
509 514
   mounted() {
510
-    this.getProperty(this.$route.params.id).then(fulfilled => {
515
+    this.getProperty(this.$route.params.id).then((fulfilled) => {
511 516
       this.wait = false;
512 517
       if (
513 518
         this.property.statusString === "Offer Pending" ||
@@ -526,7 +531,7 @@ export default {
526 531
       "propertyTypes",
527 532
       "propertyImages",
528 533
       "propertyFields",
529
-      "statuses"
534
+      "statuses",
530 535
     ]),
531 536
     savedImages() {
532 537
       const list = [];
@@ -534,8 +539,8 @@ export default {
534 539
         list.push(this.proeprtyImages[i].image);
535 540
       }
536 541
       return list;
537
-    }
538
-  }
542
+    },
543
+  },
539 544
 };
540 545
 </script>
541 546
 

+ 17
- 14
src/components/property/residential/singleView/singleResidentialPage.vue Прегледај датотеку

@@ -24,34 +24,37 @@ export default {
24 24
   components: {
25 25
     makeOffer,
26 26
     carouselSection,
27
-    contentSection
27
+    contentSection,
28 28
   },
29 29
   data() {
30 30
     return {
31 31
       index: null,
32 32
       date: new Date(),
33
-      boolLoaded: false
33
+      boolLoaded: false,
34 34
     };
35 35
   },
36 36
   async mounted() {
37
-    console.log(this.$route.params.id);
38
-
39 37
     await this.getProperty(this.$route.params.id);
40
-    await this.getPropertyImages(this.$route.params.id);
41
-    setTimeout(() => {
42
-      if (this.propertyImages.length > 0) {
43
-        this.boolLoaded = true;
44
-      }
45
-    }, 100);
38
+
39
+    // await this.getPropertyImages(this.$route.params.id);
40
+    // setTimeout(() => {
41
+    //   if (this.propertyImages.length > 0) {
42
+    //     this.boolLoaded = true;
43
+    //   }
44
+    // }, 100);
46 45
 
47 46
     //this.mayEditProperty(this.$route.params.id);
48 47
   },
49 48
   computed: {
50 49
     ...mapState("property", ["property", "propertyImages"]),
51
-    ...mapState("propertyEdit", ["mayEdit"])
50
+    ...mapState("propertyEdit", ["mayEdit"]),
52 51
   },
53 52
   methods: {
54
-    ...mapActions("property", ["getProperty", "getPropertyImages", "clearPropertyImages"]),
53
+    ...mapActions("property", [
54
+      "getProperty",
55
+      "getPropertyImages",
56
+      "clearPropertyImages",
57
+    ]),
55 58
     ...mapActions("propertyEdit", ["mayEditProperty"]),
56 59
 
57 60
     formatPrice(value) {
@@ -63,11 +66,11 @@ export default {
63 66
         return `${value}<br/>`;
64 67
       }
65 68
       return "";
66
-    }
69
+    },
67 70
   },
68 71
   beforeDestroy() {
69 72
     this.clearPropertyImages();
70
-  }
73
+  },
71 74
 };
72 75
 </script>
73 76
 

Loading…
Откажи
Сачувај