You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.7 KiB

2 years ago
  1. <template>
  2. <div>
  3. <nuxt-link
  4. :to="localePath(`/exhibition/${item.id}`)"
  5. class="remove-underline"
  6. v-if="days > 0"
  7. >
  8. <v-card
  9. flat
  10. class="HiExCard py-3 px-3 d-flex flex-column"
  11. width="100%"
  12. height="236"
  13. v-if="!!item"
  14. >
  15. <v-img
  16. :aspect-ratio="16 / 9"
  17. width="100%"
  18. sizes="100%"
  19. contain
  20. :src="item.logo"
  21. class="border-radius-10 mb-1"
  22. ></v-img>
  23. <div>
  24. <v-spacer id="title" class="mb-1 d-flex justify-start">
  25. <v-clamp autoresize :max-lines="2">{{ item.name }}</v-clamp>
  26. </v-spacer>
  27. <div
  28. class="location"
  29. v-if="!!item.region || !!item.country || !!item.city"
  30. >
  31. {{ item.region.name ? item.region.name + " . " : "" }}
  32. {{ item.country.name ? item.country.name + " . " : "" }}
  33. {{ item.city.name ? item.city.name : "" }}
  34. </div>
  35. <div>
  36. <span class="time">
  37. {{ formatDate(item.startdate) }}
  38. ~
  39. {{ formatDate(item.enddate) }}
  40. </span>
  41. </div>
  42. </div>
  43. <v-spacer class="d-flex justify-end align-end">
  44. <div
  45. class="caption grey--text text--lighten-1 pb-0 ps-1 d-flex align-end justify-end"
  46. v-html="
  47. $t('in days', {
  48. days: `<span class=
  49. 'warning--text last-dates text-size-14 padding-6'>${dateCountDown(
  50. item.startdate
  51. )}</span>`,
  52. s: `<span v-if='${days} !== 1'>s</span>`,
  53. })
  54. "
  55. ></div>
  56. </v-spacer>
  57. </v-card>
  58. </nuxt-link>
  59. </div>
  60. </template>
  61. <script>
  62. import { formatDate, dateCountDown } from "~/utils/assist";
  63. import VClamp from "vue-clamp";
  64. export default {
  65. props: {
  66. item: {
  67. type: Object,
  68. },
  69. },
  70. components: {
  71. VClamp,
  72. },
  73. created() {
  74. this.days = this.dateCountDown(this.$props.item.startdate);
  75. },
  76. data() {
  77. return {
  78. days: 1,
  79. };
  80. },
  81. methods: {
  82. formatDate,
  83. dateCountDown,
  84. },
  85. };
  86. </script>
  87. <style lang="scss" scoped>
  88. .HiExCard {
  89. background-color: $Neutrals-100;
  90. // min-width: 167px;
  91. // height: 236px;
  92. border-radius: 10px !important;
  93. }
  94. #title {
  95. font-weight: 400;
  96. font-size: 10px;
  97. line-height: 13px;
  98. letter-spacing: 0.02em;
  99. color: #000000;
  100. }
  101. .location {
  102. color: #9c9c9c;
  103. font-size: 10px;
  104. line-height: 13px;
  105. letter-spacing: 0.02em;
  106. }
  107. .time {
  108. font-weight: 400;
  109. font-size: 10px;
  110. line-height: 13px;
  111. letter-spacing: 0.02em;
  112. color: #000000;
  113. }
  114. </style>