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.

333 lines
12 KiB

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. Recommend
  75. </div>
  76. </div>
  77. <div
  78. v-if="
  79. exhibition.status != null && exhibition.status.name != null
  80. "
  81. >
  82. <div
  83. v-if="exhibition.status.name == 'Upcoming'"
  84. 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]"
  85. >
  86. {{ exhibition.status ? exhibition.status.name : "" }}
  87. </div>
  88. <div
  89. v-else-if="exhibition.status.name == 'Ongoing'"
  90. 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]"
  91. >
  92. {{ exhibition.status ? exhibition.status.name : "" }}
  93. </div>
  94. <div
  95. v-else-if="exhibition.status.name == 'Finished'"
  96. 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]"
  97. >
  98. {{ exhibition.status ? exhibition.status.name : "" }}
  99. </div>
  100. <div
  101. v-else-if="exhibition.status.name == 'Cancelled'"
  102. 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]"
  103. >
  104. {{ exhibition.status ? exhibition.status.name : "" }}
  105. </div>
  106. <div
  107. v-else
  108. 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]"
  109. >
  110. {{ exhibition.status ? exhibition.status.name : "" }}
  111. </div>
  112. </div>
  113. </div>
  114. <div class="tw-hidden md:tw-block">
  115. <div
  116. v-if="exhibition.categories != null"
  117. class="md:tw-flex md:tw-flex-row md:tw-items-center"
  118. >
  119. <div
  120. v-for="(item, index) in exhibition.categories"
  121. :key="index"
  122. 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"
  123. >
  124. {{ item.name }}
  125. </div>
  126. </div>
  127. </div>
  128. <div class="md:tw-hidden">
  129. <div
  130. v-if="exhibition.categories != null"
  131. class="md:tw-flex md:tw-flex-row md:tw-items-center"
  132. >
  133. <template v-for="(item, index) in exhibition.categories">
  134. <div
  135. :key="index"
  136. v-if="
  137. show ? (index = exhibition.categories.length) : index <= 1
  138. "
  139. 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"
  140. >
  141. {{ item.name }}
  142. </div>
  143. </template>
  144. <div v-if="exhibition.categories.length > 2">
  145. <button
  146. v-if="showCategoryNum"
  147. class="tw-text-warning-default tw-text-[16px] tw-hidden md:tw-block md:tw-mr[12px]"
  148. @click="openCategoryList()"
  149. >
  150. {{
  151. show
  152. ? exhibition.categories.length - 2 + "+"
  153. : exhibition.categories.length - 2 + "-"
  154. }}
  155. </button>
  156. </div>
  157. <button
  158. v-if="exhibition.categories.length > 2"
  159. 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]"
  160. @click="openCategoryList()"
  161. >
  162. <div
  163. :class="[
  164. 'tw-text-primary-1 tw-text-[12px]',
  165. 'primary_arrow',
  166. show ? 'show' : '',
  167. ]"
  168. >
  169. {{ openCategoryText }}
  170. </div>
  171. </button>
  172. </div>
  173. </div>
  174. <div class="tw-hidden md:tw-block">
  175. <div
  176. 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"
  177. >
  178. {{ exhibition.name }}
  179. </div>
  180. <div
  181. 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]"
  182. >
  183. {{
  184. exhibition.region.name == null
  185. ? ""
  186. : exhibition.region.name + "."
  187. }}{{
  188. exhibition.country.name == null
  189. ? ""
  190. : exhibition.country.name + "."
  191. }}{{ exhibition.city.name == null ? "" : exhibition.city.name }}
  192. </div>
  193. <div
  194. 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]"
  195. >
  196. {{ exhibition.startdate }} - {{ exhibition.enddate }}
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <!-- phone -->
  202. <div
  203. class="tw-flex tw-flex-col tw-max-w-[354px] tw-gap-[12px] md:tw-hidden"
  204. >
  205. <div class="tw-body-3 tw-break-all">
  206. {{ exhibition.name }}
  207. </div>
  208. <div class="tw-head-body tw-text-neutrals-500 tw-w-full">
  209. {{
  210. exhibition.region.name == null
  211. ? ""
  212. : exhibition.region.name + "."
  213. }}{{
  214. exhibition.country.name == null
  215. ? ""
  216. : exhibition.country.name + "."
  217. }}{{ exhibition.city.name == null ? "" : exhibition.city.name }}
  218. </div>
  219. <div class="tw-head-body tw-text-primary-1 tw-w-full">
  220. {{ exhibition.startdate }} - {{ 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. export default {
  242. name: "ExhibitionBannerArea",
  243. data() {
  244. return {
  245. show: false,
  246. showCategoryNum: true,
  247. };
  248. },
  249. props: {
  250. exhibition: {
  251. type: Object,
  252. default: () => ({
  253. banner: "",
  254. logo: "",
  255. rating: "",
  256. reviewCount: 0,
  257. name: "",
  258. region: {},
  259. country: {},
  260. city: {},
  261. startdate: "",
  262. enddate: "",
  263. categories: [],
  264. }),
  265. },
  266. },
  267. computed: {
  268. openCategoryText() {
  269. if (this.show == false) {
  270. return "Expand";
  271. } else {
  272. return "Collapse";
  273. }
  274. },
  275. },
  276. methods: {
  277. openCategoryList() {
  278. this.show = !this.show;
  279. },
  280. },
  281. };
  282. </script>
  283. <style lang="scss" scoped>
  284. .banner {
  285. @media screen and (min-width: 768px) {
  286. background-image: url("~/assets/img/ExhibitionBanner.jpeg");
  287. background-repeat: no-repeat;
  288. background-position: center;
  289. background-size: cover;
  290. }
  291. }
  292. .bannerfilter {
  293. @media screen and (min-width: 768px) {
  294. background-color: rgba(0, 0, 0, 0.5);
  295. }
  296. }
  297. .primary_arrow {
  298. position: relative;
  299. &::after {
  300. content: "";
  301. display: inline-block;
  302. position: absolute;
  303. right: -21px;
  304. top: 6px;
  305. margin-top: auto;
  306. margin-bottom: auto;
  307. background-image: url("~/assets/svg/arrow-down-primary.svg");
  308. background-size: 100%;
  309. background-position: right center;
  310. background-repeat: no-repeat;
  311. width: 7px;
  312. height: 4px;
  313. }
  314. &.show {
  315. &::after {
  316. transform: rotate(180deg);
  317. }
  318. }
  319. }
  320. </style>