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.

269 lines
11 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="exhibitionBannerArea">
  3. <div class="banner">
  4. <div class="bannerfilter md:tw-px-[30px] md:tw-py-[40px] xl:tw-px-[40px] xl:tw-py-[60px]">
  5. <div
  6. class="tw-grid tw-grid-cols-[102px_auto] tw-gap-[8px] tw-mb-[12px] md:tw-grid-cols-[160px_528px] xl:tw-grid-cols-[160px_976px] md:tw-gap-[20px] xl:tw-gap-[30px]">
  7. <div>
  8. <div v-if="exhibition.logo == null">
  9. <img src="~/assets/svg/noLogo.svg"
  10. class="tw-border-solid tw-border tw-rounded-[16px] tw-border-neutrals-200" alt="" />
  11. </div>
  12. <div v-else>
  13. <img :src="exhibition.logo" class="tw-border-solid tw-border tw-rounded-[16px] tw-border-neutrals-200"
  14. alt="" />
  15. </div>
  16. <!-- <div class="tw-hidden md:tw-block md:tw-ml-[10px]">
  17. <div class="tw-head-body tw-flex tw-flex-row tw-items-center tw-mt-[10px]">
  18. <div class="tw-text-warning-default tw-mr-[11px] md:tw-text-[18px]">
  19. {{ exhibition.rating }}
  20. </div>
  21. <div>
  22. <img src="~/assets/svg/star_border.svg" class="tw-mr-[6px]" alt="" />
  23. <img src="~/assets/svg/star_border.svg" class="tw-mr-[6px]" alt="" />
  24. <img src="~/assets/svg/star_border.svg" class="tw-mr-[6px]" alt="" />
  25. <img src="~/assets/svg/star_border.svg" class="tw-mr-[6px]" alt="" />
  26. <img src="~/assets/svg/star_border.svg" alt="" />
  27. </div>
  28. </div>
  29. <div class="tw-text-warning-default tw-mt-[8px]">
  30. ({{
  31. exhibition.reviewCount == null ? "0" : exhibition.reviewCount
  32. }}
  33. reviews)
  34. </div>
  35. </div> -->
  36. </div>
  37. <div class="tw-justify-start md:tw-max-w-[528px] xl:tw-max-w-[976px]">
  38. <div class="tw-flex tw-flex-row tw-mb-[8px] md:tw-mb-[12px]">
  39. <div v-if="exhibition.isRecommend != null && exhibition.isRecommend == 'Y' "
  40. class="tw-grid tw-grid-cols-[12px_auto] tw-gap-[4px] tw-items-center tw-border-solid tw-border tw-border-primary-2 tw-bg-primary-1 tw-rounded-[8px] tw-px-[10px] tw-py-[4px] tw-mr-[8px]">
  41. <img src="~/assets/svg/recommend.svg" alt="" />
  42. <div class="tw-text-white tw-text-[12px] md:tw-text-[14px]">
  43. {{ $t("exhibition.Recommended") }}
  44. </div>
  45. </div>
  46. <div v-if="exhibition.status != null && exhibition.status != ''">
  47. <div v-if="exhibition.status == 'Upcoming'"
  48. class="tw-border-solid tw-border tw-border-primary-1 tw-text-primary-1 tw-bg-white tw-rounded-[8px] tw-px-[10px] tw-py-[4px] tw-text-[12px] md:tw-text-[14px]">
  49. {{ $t("exhibition.Upcoming") }}
  50. </div>
  51. <div v-else-if="exhibition.status == 'Ongoing'"
  52. class="tw-border-solid tw-border tw-border-complementary-1 tw-text-complementary-1 tw-bg-white tw-rounded-[8px] tw-px-[10px] tw-py-[4px] tw-text-[12px] md:tw-text-[14px]">
  53. {{ exhibition.status }}
  54. </div>
  55. <div v-else-if="exhibition.status == 'Finished'"
  56. class="tw-border-solid tw-border tw-border-neutrals-500 tw-text-neutrals-500 tw-bg-white tw-rounded-[8px] tw-px-[10px] tw-py-[4px] tw-text-[12px] md:tw-text-[14px]">
  57. {{ exhibition.status }}
  58. </div>
  59. <div v-else-if="exhibition.status == 'Cancelled'"
  60. class="tw-border-solid tw-border tw-border-error-default tw-text-error-default tw-bg-white tw-rounded-[8px] tw-px-[10px] tw-py-[4px] tw-text-[12px] md:tw-text-[14px]">
  61. {{ exhibition.status }}
  62. </div>
  63. <div v-else
  64. class="tw-border-solid tw-border tw-bg-error-default tw-text-white tw-rounded-[8px] tw-px-[10px] tw-py-[4px] tw-text-[12px] md:tw-text-[14px]">
  65. {{ exhibition.status }}
  66. </div>
  67. </div>
  68. </div>
  69. <div class="tw-hidden md:tw-block">
  70. <div v-if="exhibition.categories != null" class="md:tw-flex md:tw-flex-row md:tw-items-center">
  71. <div v-for="(item, index) in exhibition.categories" :key="index"
  72. class="tw-bg-[#f6f6f6] tw-w-fit tw-border-solid tw-border tw-border-neutrals-400 tw-text-neutrals-800 tw-rounded-[10px] tw-mb-[4px] tw-whitespace-nowrap tw-px-[10px] tw-py-[5px] tw-text-[12px] md:tw-text-[14px] md:tw-mr-[12px] md:tw-text-white md:tw-bg-neutrals-400 md:tw-bg-opacity-50">
  73. {{ item.CategoryName }}
  74. </div>
  75. </div>
  76. </div>
  77. <div class="md:tw-hidden">
  78. <div v-if="exhibition.categories != null" class="md:tw-flex md:tw-flex-row md:tw-items-center">
  79. <template v-for="(item, index) in exhibition.categories">
  80. <div :key="index" v-if="
  81. show ? (index = exhibition.categories.length) : index <= 1
  82. "
  83. class="tw-bg-[#f6f6f6] tw-w-full tw-flex tw-justify-center tw-px-[10px] tw-py-[5px] tw-text-neutrals-800 tw-rounded-[10px] tw-mb-[4px] tw-whitespace-nowrap tw-text-[12px] md:tw-text-[14px] md:tw-mr-[12px] md:tw-text-white md:tw-bg-neutrals-400 md:tw-bg-opacity-50">
  84. {{ item.CategoryName }}
  85. </div>
  86. </template>
  87. <div v-if="exhibition.categories.length > 2">
  88. <button v-if="showCategoryNum"
  89. class="tw-text-warning-default tw-text-[16px] tw-hidden md:tw-block md:tw-mr[12px]"
  90. @click="openCategoryList()">
  91. {{
  92. show
  93. ? exhibition.categories.length - 2 + "+"
  94. : exhibition.categories.length - 2 + "-"
  95. }}
  96. </button>
  97. </div>
  98. <button v-if="exhibition.categories.length > 2"
  99. class="tw-grid tw-w-full tw-grid-cols-[auto_16px] tw-gap-[8px] tw-bg-white tw-items-center tw-justify-center tw-py-[4px]"
  100. @click="openCategoryList()">
  101. <div :class="[
  102. 'tw-text-primary-1 tw-text-[12px]',
  103. 'primary_arrow',
  104. show ? 'show' : '',
  105. ]">
  106. {{ openCategoryText }}
  107. </div>
  108. </button>
  109. </div>
  110. </div>
  111. <div class="tw-hidden md:tw-block">
  112. <div v-if="`${this.$i18n.localeProperties['langQuery']}` != 'en-US'">
  113. <div
  114. class="tw-body-3 tw-break-all tw-text-base-primary tw-w-full md:t24 md:tw-text-white md:tw-mt-[12px] xl:tw-text-[28px] xl:tw-font-bold">
  115. {{ exhibition.name }}
  116. </div>
  117. </div>
  118. <div
  119. class="tw-body-3 tw-break-all tw-text-base-primary tw-w-full md:t24 md:tw-text-white md:tw-mt-[12px] xl:tw-text-[28px] xl:tw-font-bold">
  120. {{ exhibition.shortName }}, {{ exhibition.enname }}
  121. </div>
  122. <div
  123. class="tw-head-body tw-text-neutrals-500 tw-w-full md:tw-text-[20px] md:tw-font-medium md:tw-text-neutrals-0 md:tw-mt-[12px]">
  124. {{ exhibition.region.name == null ? "" : exhibition.region.name + "." }}
  125. {{ exhibition.country.name == null ? "" : exhibition.country.name + "." }}
  126. {{ exhibition.city.name == null ? "" : exhibition.city.name }}
  127. </div>
  128. <div
  129. class="tw-head-body tw-text-primary-1 tw-w-full md:tw-text-[20px] md:tw-font-medium md:tw-text-white md:tw-mt-[12px]">
  130. <!-- {{ exhibition.startdate }} - {{ exhibition.enddate }} -->
  131. {{ formatDate(exhibition.startdate) + " - " + formatDate(exhibition.enddate) }}
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <!-- phone -->
  137. <div class="tw-flex tw-flex-col tw-max-w-[354px] tw-gap-[12px] md:tw-hidden">
  138. <div class="tw-body-3 tw-break-all">
  139. {{ exhibition.name }}
  140. </div>
  141. <div class="tw-head-body tw-text-neutrals-500 tw-w-full">
  142. {{ exhibition.region.name == null ? "" : exhibition.region.name + "." }}
  143. {{ exhibition.country.name == null ? "" : exhibition.country.name + "." }}
  144. {{ exhibition.city.name == null ? "" : exhibition.city.name }}
  145. </div>
  146. <div class="tw-head-body tw-text-primary-1 tw-w-full">
  147. <!-- {{ exhibition.startdate }} - {{ exhibition.enddate }} -->
  148. {{ formatDate(exhibition.startdate) + " - " + formatDate(exhibition.enddate) }}
  149. </div>
  150. <!-- <div class="tw-head-body tw-flex tw-flex-row tw-items-center">
  151. <div class="tw-text-primary-1 tw-mr-[6px]">
  152. {{ exhibition.rating }}
  153. </div>
  154. <img src="~/assets/svg/star.svg" class="tw-mr-[12px]" alt="" />
  155. <div class="tw-text-neutrals-500">
  156. ({{
  157. exhibition.reviewCount == null ? "0" : exhibition.reviewCount
  158. }}
  159. reviews)
  160. </div>
  161. </div> -->
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <script>
  168. import VClamp from "vue-clamp";
  169. import { formatDate, dateCountDown } from "~/utils/assist";
  170. export default {
  171. name: "ExhibitionBannerArea",
  172. data() {
  173. return {
  174. show: false,
  175. showCategoryNum: true,
  176. };
  177. },
  178. props: {
  179. exhibition: {
  180. type: Object,
  181. default: () => ({
  182. banner: "",
  183. logo: "",
  184. rating: "",
  185. reviewCount: 0,
  186. name: "",
  187. region: {},
  188. country: {},
  189. city: {},
  190. startdate: "",
  191. enddate: "",
  192. categories: [],
  193. }),
  194. },
  195. },
  196. computed: {
  197. openCategoryText() {
  198. if (this.show == false) {
  199. return "Expand";
  200. } else {
  201. return "Collapse";
  202. }
  203. },
  204. },
  205. methods: {
  206. formatDate,
  207. dateCountDown,
  208. openCategoryList() {
  209. this.show = !this.show;
  210. },
  211. },
  212. };
  213. </script>
  214. <style lang="scss" scoped>
  215. .banner {
  216. @media screen and (min-width: 768px) {
  217. background-image: url("~/assets/img/ExhibitionBanner.jpeg");
  218. background-repeat: no-repeat;
  219. background-position: center;
  220. background-size: cover;
  221. }
  222. }
  223. .bannerfilter {
  224. @media screen and (min-width: 768px) {
  225. background-color: rgba(0, 0, 0, 0.5);
  226. }
  227. }
  228. .primary_arrow {
  229. position: relative;
  230. &::after {
  231. content: "";
  232. display: inline-block;
  233. position: absolute;
  234. right: -21px;
  235. top: 6px;
  236. margin-top: auto;
  237. margin-bottom: auto;
  238. background-image: url("~/assets/svg/arrow-down-primary.svg");
  239. background-size: 100%;
  240. background-position: right center;
  241. background-repeat: no-repeat;
  242. width: 7px;
  243. height: 4px;
  244. }
  245. &.show {
  246. &::after {
  247. transform: rotate(180deg);
  248. }
  249. }
  250. }
  251. </style>