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.

336 lines
12 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
  1. <template>
  2. <div class="exhibitionBannerArea">
  3. <div class="banner">
  4. <div
  5. class="bannerfilter md:tw-px-[30px] md:tw-py-[40px] xl:tw-px-[40px] xl:tw-py-[60px]"
  6. >
  7. <div
  8. 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]"
  9. >
  10. <div>
  11. <div v-if="exhibition.logo == null">
  12. <img
  13. src="~/assets/svg/noLogo.svg"
  14. class="tw-border-solid tw-border tw-rounded-[16px] tw-border-neutrals-200"
  15. alt=""
  16. />
  17. </div>
  18. <div v-else>
  19. <img
  20. :src="exhibition.logo"
  21. class="tw-border-solid tw-border tw-rounded-[16px] tw-border-neutrals-200"
  22. alt=""
  23. />
  24. </div>
  25. <div class="tw-hidden md:tw-block md:tw-ml-[10px]">
  26. <div
  27. class="tw-head-body tw-flex tw-flex-row tw-items-center tw-mt-[10px]"
  28. >
  29. <div
  30. class="tw-text-warning-default tw-mr-[11px] md:tw-text-[18px]"
  31. >
  32. {{ exhibition.rating }}
  33. </div>
  34. <div>
  35. <img
  36. src="~/assets/svg/star_border.svg"
  37. class="tw-mr-[6px]"
  38. alt=""
  39. />
  40. <img
  41. src="~/assets/svg/star_border.svg"
  42. class="tw-mr-[6px]"
  43. alt=""
  44. />
  45. <img
  46. src="~/assets/svg/star_border.svg"
  47. class="tw-mr-[6px]"
  48. alt=""
  49. />
  50. <img
  51. src="~/assets/svg/star_border.svg"
  52. class="tw-mr-[6px]"
  53. alt=""
  54. />
  55. <img src="~/assets/svg/star_border.svg" alt="" />
  56. </div>
  57. </div>
  58. <div class="tw-text-warning-default tw-mt-[8px]">
  59. ({{
  60. exhibition.reviewCount == null ? "0" : exhibition.reviewCount
  61. }}
  62. reviews)
  63. </div>
  64. </div>
  65. </div>
  66. <div class="tw-justify-start md:tw-max-w-[528px] xl:tw-max-w-[976px]">
  67. <div class="tw-flex tw-flex-row tw-mb-[8px] md:tw-mb-[12px]">
  68. <div
  69. v-if="exhibition.isRecommend != null"
  70. 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]"
  71. >
  72. <img src="~/assets/svg/recommend.svg" alt="" />
  73. <div class="tw-text-white tw-text-[12px] md:tw-text-[14px]">
  74. {{ $t("exhibition.Recommended") }}
  75. </div>
  76. </div>
  77. <div
  78. v-if="exhibition.status != null && exhibition.status != '' "
  79. >
  80. <div
  81. v-if="exhibition.status == 'Upcoming'"
  82. 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]"
  83. >
  84. {{ $t("exhibition.Upcoming") }}
  85. </div>
  86. <div
  87. v-else-if="exhibition.status == 'Ongoing'"
  88. 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]"
  89. >
  90. {{ exhibition.status }}
  91. </div>
  92. <div
  93. v-else-if="exhibition.status == 'Finished'"
  94. 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]"
  95. >
  96. {{ exhibition.status }}
  97. </div>
  98. <div
  99. v-else-if="exhibition.status == 'Cancelled'"
  100. 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]"
  101. >
  102. {{ exhibition.status }}
  103. </div>
  104. <div
  105. v-else
  106. 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]"
  107. >
  108. {{ exhibition.status }}
  109. </div>
  110. </div>
  111. </div>
  112. <div class="tw-hidden md:tw-block">
  113. <div
  114. v-if="exhibition.categories != null"
  115. class="md:tw-flex md:tw-flex-row md:tw-items-center"
  116. >
  117. <div
  118. v-for="(item, index) in exhibition.categories"
  119. :key="index"
  120. 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"
  121. >
  122. {{ item.CategoryName }}
  123. </div>
  124. </div>
  125. </div>
  126. <div class="md:tw-hidden">
  127. <div
  128. v-if="exhibition.categories != null"
  129. class="md:tw-flex md:tw-flex-row md:tw-items-center"
  130. >
  131. <template v-for="(item, index) in exhibition.categories">
  132. <div
  133. :key="index"
  134. v-if="
  135. show ? (index = exhibition.categories.length) : index <= 1
  136. "
  137. 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"
  138. >
  139. {{ item.name }}
  140. </div>
  141. </template>
  142. <div v-if="exhibition.categories.length > 2">
  143. <button
  144. v-if="showCategoryNum"
  145. class="tw-text-warning-default tw-text-[16px] tw-hidden md:tw-block md:tw-mr[12px]"
  146. @click="openCategoryList()"
  147. >
  148. {{
  149. show
  150. ? exhibition.categories.length - 2 + "+"
  151. : exhibition.categories.length - 2 + "-"
  152. }}
  153. </button>
  154. </div>
  155. <button
  156. v-if="exhibition.categories.length > 2"
  157. 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]"
  158. @click="openCategoryList()"
  159. >
  160. <div
  161. :class="[
  162. 'tw-text-primary-1 tw-text-[12px]',
  163. 'primary_arrow',
  164. show ? 'show' : '',
  165. ]"
  166. >
  167. {{ openCategoryText }}
  168. </div>
  169. </button>
  170. </div>
  171. </div>
  172. <div class="tw-hidden md:tw-block">
  173. <div
  174. 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"
  175. >
  176. {{ exhibition.name }}
  177. </div>
  178. <div
  179. 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]"
  180. >
  181. {{
  182. exhibition.region.name == null
  183. ? ""
  184. : exhibition.region.name + "."
  185. }}{{
  186. exhibition.country.name == null
  187. ? ""
  188. : exhibition.country.name + "."
  189. }}{{ exhibition.city.name == null ? "" : exhibition.city.name }}
  190. </div>
  191. <div
  192. 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]"
  193. >
  194. <!-- {{ exhibition.startdate }} - {{ exhibition.enddate }} -->
  195. {{ formatDate(exhibition.startdate) + " - " + formatDate(exhibition.enddate) }}
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <!-- phone -->
  201. <div
  202. class="tw-flex tw-flex-col tw-max-w-[354px] tw-gap-[12px] md:tw-hidden"
  203. >
  204. <div class="tw-body-3 tw-break-all">
  205. {{ exhibition.name }}
  206. </div>
  207. <div class="tw-head-body tw-text-neutrals-500 tw-w-full">
  208. {{
  209. exhibition.region.name == null
  210. ? ""
  211. : exhibition.region.name + "."
  212. }}{{
  213. exhibition.country.name == null
  214. ? ""
  215. : exhibition.country.name + "."
  216. }}{{ exhibition.city.name == null ? "" : exhibition.city.name }}
  217. </div>
  218. <div class="tw-head-body tw-text-primary-1 tw-w-full">
  219. <!-- {{ exhibition.startdate }} - {{ exhibition.enddate }} -->
  220. {{ formatDate(exhibition.startdate) + " - " + formatDate(exhibition.enddate) }}
  221. </div>
  222. <div class="tw-head-body tw-flex tw-flex-row tw-items-center">
  223. <div class="tw-text-primary-1 tw-mr-[6px]">
  224. {{ exhibition.rating }}
  225. </div>
  226. <img src="~/assets/svg/star.svg" class="tw-mr-[12px]" alt="" />
  227. <div class="tw-text-neutrals-500">
  228. ({{
  229. exhibition.reviewCount == null ? "0" : exhibition.reviewCount
  230. }}
  231. reviews)
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. </template>
  239. <script>
  240. import VClamp from "vue-clamp";
  241. import { formatDate, dateCountDown } from "~/utils/assist";
  242. export default {
  243. name: "ExhibitionBannerArea",
  244. data() {
  245. return {
  246. show: false,
  247. showCategoryNum: true,
  248. };
  249. },
  250. props: {
  251. exhibition: {
  252. type: Object,
  253. default: () => ({
  254. banner: "",
  255. logo: "",
  256. rating: "",
  257. reviewCount: 0,
  258. name: "",
  259. region: {},
  260. country: {},
  261. city: {},
  262. startdate: "",
  263. enddate: "",
  264. categories: [],
  265. }),
  266. },
  267. },
  268. computed: {
  269. openCategoryText() {
  270. if (this.show == false) {
  271. return "Expand";
  272. } else {
  273. return "Collapse";
  274. }
  275. },
  276. },
  277. methods: {
  278. formatDate,
  279. dateCountDown,
  280. openCategoryList() {
  281. this.show = !this.show;
  282. },
  283. },
  284. };
  285. </script>
  286. <style lang="scss" scoped>
  287. .banner {
  288. @media screen and (min-width: 768px) {
  289. background-image: url("~/assets/img/ExhibitionBanner.jpeg");
  290. background-repeat: no-repeat;
  291. background-position: center;
  292. background-size: cover;
  293. }
  294. }
  295. .bannerfilter {
  296. @media screen and (min-width: 768px) {
  297. background-color: rgba(0, 0, 0, 0.5);
  298. }
  299. }
  300. .primary_arrow {
  301. position: relative;
  302. &::after {
  303. content: "";
  304. display: inline-block;
  305. position: absolute;
  306. right: -21px;
  307. top: 6px;
  308. margin-top: auto;
  309. margin-bottom: auto;
  310. background-image: url("~/assets/svg/arrow-down-primary.svg");
  311. background-size: 100%;
  312. background-position: right center;
  313. background-repeat: no-repeat;
  314. width: 7px;
  315. height: 4px;
  316. }
  317. &.show {
  318. &::after {
  319. transform: rotate(180deg);
  320. }
  321. }
  322. }
  323. </style>