選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

propertyCard.vue 4.0KB

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