Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

propertyCardSearch.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <section id="portfolio">
  3. <div class="container-fluid">
  4. <div class="row">
  5. <div
  6. class="col-lg-3 col-md-6 col-sm-6 my-3"
  7. v-for="currentProperty in properties"
  8. :key="currentProperty.id"
  9. >
  10. <div v-if="currentProperty.propertyUsageType === 'Residential'">
  11. <router-link :to="`/property/residential/property/${currentProperty.id}`">
  12. <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
  13. <div class="feature-top pt-3 mb-2">
  14. <h3 style="color:white !important">{{ currentProperty.displayPrice }}</h3>
  15. <img
  16. style="height:165px; object-fit: cover;"
  17. :src="currentProperty.displayImage"
  18. alt
  19. />
  20. </div>
  21. <h1>{{ currentProperty.suburb }}</h1>
  22. <p>
  23. <strong>Property Reference</strong>
  24. {{ currentProperty.propertyReference }}
  25. </p>
  26. <p
  27. v-if="currentProperty.displayText != ''"
  28. :class="[currentProperty.displayColor === 'green' ? 'greenText' : currentProperty.displayColor === 'orange' ? 'pendingOffer' : currentProperty.displayColor === 'red' ? 'redText' : 'normalText']"
  29. >
  30. <strong>{{ currentProperty.displayText }}</strong>
  31. </p>
  32. </div>
  33. </router-link>
  34. </div>
  35. <div v-else-if="currentProperty.propertyUsageType === 'Commercial'">
  36. <router-link :to="`/property/commercial/property/${currentProperty.id}`">
  37. <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
  38. <div class="feature-top pt-3 mb-2">
  39. <h3>{{ currentProperty.displayPrice }}</h3>
  40. <img
  41. style="height:165px; object-fit: cover;"
  42. :src="currentProperty.displayImage"
  43. alt
  44. />
  45. </div>
  46. <h1>{{ currentProperty.suburb }}</h1>
  47. <p>
  48. <strong>Property Reference</strong>
  49. {{ currentProperty.propertyReference }}
  50. </p>
  51. </div>
  52. </router-link>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </section>
  58. <!-- #listings -->
  59. </template>
  60. <script>
  61. /* eslint-disable */
  62. export default {
  63. props: {
  64. properties: { type: Array, default: () => [] },
  65. showSort: { type: Boolean, default: true },
  66. salesType: { type: String, default: "Rent" },
  67. },
  68. methods: {
  69. sortHighPrice() {
  70. function compare(a, b) {
  71. if (a.price < b.price) return 1;
  72. if (a.price > b.price) return -1;
  73. return 0;
  74. }
  75. return this.properties.sort(compare);
  76. },
  77. sortLowPrice() {
  78. function compare(a, b) {
  79. if (a.price < b.price) return -1;
  80. if (a.price > b.price) return 1;
  81. return 0;
  82. }
  83. return this.properties.sort(compare);
  84. },
  85. sortNewest() {
  86. function compare(a, b) {
  87. if (a.dateCreated < b.dateCreated) return 1;
  88. if (a.dateCreated > b.dateCreated) return -1;
  89. return 0;
  90. }
  91. return this.properties.sort(compare);
  92. },
  93. sortDateAvailable() {
  94. function compare(a, b) {
  95. if (a.dateAvailable > b.dateAvailable) return 1;
  96. if (a.dateAvailable < b.dateAvailable) return -1;
  97. return 0;
  98. }
  99. return this.properties.sort(compare);
  100. },
  101. },
  102. };
  103. </script>
  104. <style lang="scss" scoped></style>