Browse Source

Property video update

master
30117125 4 years ago
parent
commit
21972f8da7

+ 25
- 33
src/components/property/propertyeditPage.vue View File

298
               class="btn btn-b-n"
298
               class="btn btn-b-n"
299
               style="width: 85px; height:40px;"
299
               style="width: 85px; height:40px;"
300
               :disabled="!mayEdit"
300
               :disabled="!mayEdit"
301
-            >Save</button>
301
+            >
302
+              Save
303
+            </button>
302
             <button
304
             <button
303
               type="button"
305
               type="button"
304
               @click="Close()"
306
               @click="Close()"
307
               :disabled="
309
               :disabled="
308
                 showPropertyTypeError || showProvinceError || showCityError || showSuburbError
310
                 showPropertyTypeError || showProvinceError || showCityError || showSuburbError
309
               "
311
               "
310
-            >Close</button>
312
+            >
313
+              Close
314
+            </button>
311
             <div
315
             <div
312
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
316
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
313
             >
317
             >
314
-              <p
315
-                class="alert myError"
316
-              >Missing fields. Please fill in all required fields. Marked with *</p>
318
+              <p class="alert myError">
319
+                Missing fields. Please fill in all required fields. Marked with *
320
+              </p>
317
             </div>
321
             </div>
318
             <div v-if="wait" id="preloader"></div>
322
             <div v-if="wait" id="preloader"></div>
319
           </form>
323
           </form>
336
     ImageLoad,
340
     ImageLoad,
337
     VueEditor,
341
     VueEditor,
338
     propField,
342
     propField,
339
-    field,
343
+    field
340
   },
344
   },
341
   data() {
345
   data() {
342
     return {
346
     return {
349
       customToolbar: [
353
       customToolbar: [
350
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
354
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
351
         ["bold", "italic", "underline", "strike"],
355
         ["bold", "italic", "underline", "strike"],
352
-        [
353
-          { align: "" },
354
-          { align: "center" },
355
-          { align: "right" },
356
-          { align: "justify" },
357
-        ],
356
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
358
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
357
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
359
         [{ script: "sub" }, { script: "super" }],
358
         [{ script: "sub" }, { script: "super" }],
360
-        [{ indent: "-1" }, { indent: "+1" }],
359
+        [{ indent: "-1" }, { indent: "+1" }]
361
       ],
360
       ],
362
       salesTypeArr: [
361
       salesTypeArr: [
363
         { id: 1, description: "Sale" },
362
         { id: 1, description: "Sale" },
364
-        { id: 2, description: "Rental" },
363
+        { id: 2, description: "Rental" }
365
       ],
364
       ],
366
       pricePerArr: ["Month", "Day"],
365
       pricePerArr: ["Month", "Day"],
367
       yesno: ["Yes", "No"],
366
       yesno: ["Yes", "No"],
368
       showPropertyTypeError: false,
367
       showPropertyTypeError: false,
369
       showProvinceError: false,
368
       showProvinceError: false,
370
       showCityError: false,
369
       showCityError: false,
371
-      showSuburbError: false,
370
+      showSuburbError: false
372
     };
371
     };
373
   },
372
   },
374
   methods: {
373
   methods: {
375
     ...mapActions("property", ["getPropertyTypes"]),
374
     ...mapActions("property", ["getPropertyTypes"]),
376
-    ...mapActions("propertyEdit", [
377
-      "getSavedPropertyData",
378
-      "updateProperty",
379
-      "mayEditProperty",
380
-    ]),
375
+    ...mapActions("propertyEdit", ["getSavedPropertyData", "updateProperty", "mayEditProperty"]),
381
     salesTypeChanged(item) {
376
     salesTypeChanged(item) {
382
       console.log(item);
377
       console.log(item);
383
     },
378
     },
384
     UpdateValue(item) {
379
     UpdateValue(item) {
385
       if (item.isUDF) {
380
       if (item.isUDF) {
386
         if (item.isPropOverview) {
381
         if (item.isPropOverview) {
387
-          this.propertyOverviewFields[0].fields[item.arrayIndex].value =
388
-            item.value;
382
+          this.propertyOverviewFields[0].fields[item.arrayIndex].value = item.value;
389
         } else if (item.isPropOverview === false) {
383
         } else if (item.isPropOverview === false) {
390
-          this.propertyFields[item.arrayIndex].fields[
391
-            item.arrayItemIndex
392
-          ].value = item.value;
384
+          this.propertyFields[item.arrayIndex].fields[item.arrayItemIndex].value = item.value;
393
         }
385
         }
394
       } else if (!item.isUDF) {
386
       } else if (!item.isUDF) {
395
         if (item.fieldName) {
387
         if (item.fieldName) {
439
         }
431
         }
440
         this.newPropertyImages.images.push({
432
         this.newPropertyImages.images.push({
441
           image: this.images[i],
433
           image: this.images[i],
442
-          isDefault: setAsDefault,
434
+          isDefault: setAsDefault
443
         });
435
         });
444
       }
436
       }
445
       this.property.propertyImages = this.propertyImages;
437
       this.property.propertyImages = this.propertyImages;
451
       this.property.propertyFields = this.propertyFields;
443
       this.property.propertyFields = this.propertyFields;
452
       this.updateProperty({
444
       this.updateProperty({
453
         property: this.property,
445
         property: this.property,
454
-        images: this.newPropertyImages,
446
+        images: this.newPropertyImages
455
       }).then(() => {
447
       }).then(() => {
456
         this.$router.push("/properties");
448
         this.$router.push("/properties");
457
       });
449
       });
466
       this.defaultImage = item;
458
       this.defaultImage = item;
467
     },
459
     },
468
     DeleteImage(image) {
460
     DeleteImage(image) {
469
-      this.propertyImages.find((item) => item.id === image.id).isDeleted = true;
470
-    },
461
+      this.propertyImages.find(item => item.id === image.id).isDeleted = true;
462
+    }
471
   },
463
   },
472
   mounted() {
464
   mounted() {
473
     // Need to check this can remove unused code
465
     // Need to check this can remove unused code
508
       "property",
500
       "property",
509
       "propertyImages",
501
       "propertyImages",
510
       "mayEdit",
502
       "mayEdit",
511
-      "newPropertyImages",
503
+      "newPropertyImages"
512
     ]),
504
     ]),
513
     ...mapState("authentication", ["user"]),
505
     ...mapState("authentication", ["user"]),
514
     SalesTypeChanged() {
506
     SalesTypeChanged() {
522
       this.getPropertyTypes(this.propertyType);
514
       this.getPropertyTypes(this.propertyType);
523
 
515
 
524
       return this.propertyType;
516
       return this.propertyType;
525
-    },
517
+    }
526
   },
518
   },
527
   watch: {
519
   watch: {
528
     SalesTypeChanged() {
520
     SalesTypeChanged() {
529
       return null;
521
       return null;
530
-    },
531
-  },
522
+    }
523
+  }
532
 };
524
 };
533
 </script>
525
 </script>
534
 
526
 

+ 10
- 6
src/components/property/residential/singleView/contentSection.vue View File

191
     //this.getListsForPropertyEdit(this.property.id);
191
     //this.getListsForPropertyEdit(this.property.id);
192
   },
192
   },
193
   async mounted() {
193
   async mounted() {
194
-    if (this.property.video === "") {
195
-      this.property.video = null;
196
-    }
197
-    if (this.property.virtualTour === "") {
198
-      this.property.virtualTour = null;
199
-    }
194
+    console.log(this.property);
195
+    await this.checkForVideos;
200
     this.currentUrl = window.location.origin + this.$route.fullPath;
196
     this.currentUrl = window.location.origin + this.$route.fullPath;
201
   },
197
   },
202
   data() {
198
   data() {
208
   },
204
   },
209
   methods: {
205
   methods: {
210
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
206
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
207
+    checkForVideos() {
208
+      if (this.property.video === "") {
209
+        this.property.video = null;
210
+      }
211
+      if (this.property.virtualTour === "") {
212
+        this.property.virtualTour = null;
213
+      }
214
+    }
211
   },
215
   },
212
   computed: {
216
   computed: {
213
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
217
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),

Loading…
Cancel
Save