Explorar el Código

Property video update

master
30117125 hace 4 años
padre
commit
21972f8da7

+ 25
- 33
src/components/property/propertyeditPage.vue Ver fichero

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

+ 10
- 6
src/components/property/residential/singleView/contentSection.vue Ver fichero

@@ -191,12 +191,8 @@ export default {
191 191
     //this.getListsForPropertyEdit(this.property.id);
192 192
   },
193 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 196
     this.currentUrl = window.location.origin + this.$route.fullPath;
201 197
   },
202 198
   data() {
@@ -208,6 +204,14 @@ export default {
208 204
   },
209 205
   methods: {
210 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 216
   computed: {
213 217
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),

Loading…
Cancelar
Guardar