瀏覽代碼

Fixes to properties - controls not loading

master
George Williams 4 年之前
父節點
當前提交
4fc4986aff

+ 12
- 8
src/components/property/commercial/singleView/singleCommercialPage.vue 查看文件

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

+ 43
- 38
src/components/property/editProperty/editProperty.vue 查看文件

66
                     :disabled="!canEdit"
66
                     :disabled="!canEdit"
67
                   >
67
                   >
68
                     <option value="0">Please select type *</option>
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
                       item.description
71
                       item.description
71
-                    }}</option>
72
+                      }}
73
+                    </option>
72
                   </select>
74
                   </select>
73
                 </div>
75
                 </div>
74
                 <div v-if="property.propertyUsageType === 'Commercial'" class="col-md-2">
76
                 <div v-if="property.propertyUsageType === 'Commercial'" class="col-md-2">
108
                           for="price"
110
                           for="price"
109
                           class="uniSelectLabel"
111
                           class="uniSelectLabel"
110
                           style="text-transform:uppercase; margin-left:17px; background-color:white"
112
                           style="text-transform:uppercase; margin-left:17px; background-color:white"
111
-                          >{{ property.salesTypeString }} Price</label
112
-                        >
113
+                        >{{ property.salesTypeString }} Price</label>
113
                       </div>
114
                       </div>
114
                       <input
115
                       <input
115
                         class="form-control uniInput"
116
                         class="form-control uniInput"
255
                   </div>
256
                   </div>
256
                   <div class="row my-3">
257
                   <div class="row my-3">
257
                     <div class="col-md-12">
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
                     </div>
264
                     </div>
262
                   </div>
265
                   </div>
263
                 </div>
266
                 </div>
265
               <div class="row">
268
               <div class="row">
266
                 <div class="col-md-12">
269
                 <div class="col-md-12">
267
                   <label for="Property Description" style="font-family:'muli'">Description:</label>
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
                   <br />
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
                 </div>
273
                 </div>
279
               </div>
274
               </div>
280
               <div class="row">
275
               <div class="row">
303
                     </div>
298
                     </div>
304
                     <div v-else-if="field.type === 'yesno'">
299
                     <div v-else-if="field.type === 'yesno'">
305
                       {{ field.name }}
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
                     </div>
306
                     </div>
308
                     <div v-else class="display:none"></div>
307
                     <div v-else class="display:none"></div>
309
                   </div>
308
                   </div>
362
                 @DeleteImage="DeleteImage"
361
                 @DeleteImage="DeleteImage"
363
                 :mayEdit="canEdit"
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
               <div v-if="!addressSet">
366
               <div v-if="!addressSet">
377
                 <p class="alert myError">Please enter an address.</p>
367
                 <p class="alert myError">Please enter an address.</p>
378
               </div>
368
               </div>
387
 
377
 
388
 <script>
378
 <script>
389
 /* eslint-disable */
379
 /* eslint-disable */
380
+import { VueEditor } from "vue2-editor";
390
 import { mapState, mapActions } from "vuex";
381
 import { mapState, mapActions } from "vuex";
391
 import mapSection from "../mapSection";
382
 import mapSection from "../mapSection";
392
 import ImageLoad from "../propertyImage";
383
 import ImageLoad from "../propertyImage";
396
   name: "PropertyEditPage",
387
   name: "PropertyEditPage",
397
   components: {
388
   components: {
398
     mapSection,
389
     mapSection,
399
-    ImageLoad
390
+    ImageLoad,
391
+    VueEditor,
400
   },
392
   },
401
   data() {
393
   data() {
402
     return {
394
     return {
404
       defaultImage: 0,
396
       defaultImage: 0,
405
       images: [],
397
       images: [],
406
       wait: false,
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
   methods: {
415
   methods: {
412
       "getProperty",
417
       "getProperty",
413
       "getPropertyTypes",
418
       "getPropertyTypes",
414
       "getPropertyFields",
419
       "getPropertyFields",
415
-      "updateProperty"
420
+      "updateProperty",
416
     ]),
421
     ]),
417
     StatusChanged(item) {
422
     StatusChanged(item) {
418
       if (
423
       if (
475
         }
480
         }
476
         this.property.newImages.push({
481
         this.property.newImages.push({
477
           image: this.images[i],
482
           image: this.images[i],
478
-          isDefault: setAsDefault
483
+          isDefault: setAsDefault,
479
         });
484
         });
480
       }
485
       }
481
 
486
 
483
 
488
 
484
       //console.log(JSON.stringify(this.property));
489
       //console.log(JSON.stringify(this.property));
485
 
490
 
486
-      this.updateProperty(this.property).then(fulfilled => {
491
+      this.updateProperty(this.property).then((fulfilled) => {
487
         this.$router.push("/PropertyAdmin");
492
         this.$router.push("/PropertyAdmin");
488
       });
493
       });
489
     },
494
     },
504
     },
509
     },
505
     DeleteImage(item) {
510
     DeleteImage(item) {
506
       this.propertyImages[item].isDeleted = true;
511
       this.propertyImages[item].isDeleted = true;
507
-    }
512
+    },
508
   },
513
   },
509
   mounted() {
514
   mounted() {
510
-    this.getProperty(this.$route.params.id).then(fulfilled => {
515
+    this.getProperty(this.$route.params.id).then((fulfilled) => {
511
       this.wait = false;
516
       this.wait = false;
512
       if (
517
       if (
513
         this.property.statusString === "Offer Pending" ||
518
         this.property.statusString === "Offer Pending" ||
526
       "propertyTypes",
531
       "propertyTypes",
527
       "propertyImages",
532
       "propertyImages",
528
       "propertyFields",
533
       "propertyFields",
529
-      "statuses"
534
+      "statuses",
530
     ]),
535
     ]),
531
     savedImages() {
536
     savedImages() {
532
       const list = [];
537
       const list = [];
534
         list.push(this.proeprtyImages[i].image);
539
         list.push(this.proeprtyImages[i].image);
535
       }
540
       }
536
       return list;
541
       return list;
537
-    }
538
-  }
542
+    },
543
+  },
539
 };
544
 };
540
 </script>
545
 </script>
541
 
546
 

+ 17
- 14
src/components/property/residential/singleView/singleResidentialPage.vue 查看文件

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

Loading…
取消
儲存