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.

166 lines
5.7 KiB

2 years ago
  1. <template>
  2. <!-- v-click-outside="closeDrawer" -->
  3. <div :class="[
  4. 'tw-overflow-auto tw-fixed tw-top-0 tw-bottom-0 tw-left-0 tw-right-0 tw-w-full tw-h-full tw-z-10',
  5. drawerAcitve ? '' : 'tw-pointer-events-none',
  6. ]">
  7. <div :class="[
  8. 'tw-bg-black tw-top-0 tw-bottom-0 tw-left-0 tw-w-full tw-h-full tw-fixed tw-overflow-auto tw-z-10 tw-transition-all tw-duration-600',
  9. drawerAcitve ? 'tw-opacity-80' : 'tw-pointer-events-none tw-opacity-0',
  10. ]" @click="closeDrawer"></div>
  11. <div ref="drawer" :class="[
  12. 'drawer tw-bg-white tw-absolute tw-z-20 tw-overflow-auto tw-px-[20px] tw-py-[30px] tw-w-4/5 tw-h-full tw-transition-all tw-duration-300 tw-delay-75 tw-ease-in-out tw-rounded-none md:tw-px-[40px] md:tw-py-[40px]',
  13. drawerAcitve ? 'tw-translate-x-0' : '-tw-translate-x-full',
  14. ]">
  15. <div class="tw-flex tw-flex-col tw-justify-between tw-h-full">
  16. <div class="tw-flex tw-flex-col">
  17. <div class="tw-mb-[25px] tw-pb-[25px] tw-border-0 tw-border-b tw-border-solid tw-border-neutrals-200">
  18. <a :href="localePath('/exhibition')"
  19. :class="['tw-block tw-body-3 tw-text-neutral-800 tw-mb-[30px] md:tw-body-2',$route.path.match('\/exhibition') ? 'tw-text-primary-default' : '']">
  20. {{ $t('Exhibition')}}</a>
  21. <exhibitionList v-for="(item, index) in exhibitionsCategory" :key="item.id" :exhibitionIndex="index"
  22. :exhibitionCategory="item" :exhibitionListIcon="exhibitionListIcon[index]" @activeIndex="getActiveIndex"
  23. :exhibitionsActiveIndex="
  24. exhibitionsActiveIndex == index ? true : false
  25. "></exhibitionList>
  26. </div>
  27. <div class="tw-mb-[25px] tw-pb-[25px] tw-border-0 tw-border-b tw-border-solid tw-border-neutrals-200">
  28. <a :href="localePath('/service')"
  29. :class="['tw-block tw-body-3 tw-text-neutral-800 tw-mb-[30px] md:tw-body-2',$route.path.match('\/service') ? 'tw-text-primary-default' : '']">
  30. {{ $t('Service')}}</a>
  31. <serviceList v-for="(item, index) in serviceCategory" :key="item.id" :serviceIndex="index"
  32. :servicecategory="item" :serviceListIcon="serviceListIcon[index]" @activeIndex="getServiceActiveIndex"
  33. :serviceActiveIndex="serviceActiveIndex == index ? true : false">
  34. </serviceList>
  35. </div>
  36. <div>
  37. <a href="https://medium.com/showeasy" target="_blank" class="tw-body-3 md:tw-body-2">{{ $t("Blog") }}</a>
  38. </div>
  39. </div>
  40. <div class="tw-flex-col tw-items-end tw-mt-[40px] tw-pb-[30px] md:tw-mt-[80px] md:tw-pb-[60px]">
  41. <client-only>
  42. <changeCurrency></changeCurrency>
  43. </client-only>
  44. <div
  45. class="changeLanguage tw-flex tw-items-center tw-border-solid tw-border-[1px] tw-border-neutrals-200 tw-bg-white tw-text-neutrals-800 tw-rounded-[16px] tw-mb-[16px]">
  46. <select v-model="lang"
  47. class="t14 tw-font-normal tw-w-full tw-my-[12px] tw-mx-[25px] md:t16 focus:tw-outline-none">
  48. <option class="tw-mb-[30px] md:tw-body-3" v-for="(item, index) in $i18n.locales" :key="index"
  49. :value="item.code">
  50. {{ item.text }}
  51. </option>
  52. </select>
  53. <img src="@/assets/svg/down-arrow.svg" class="tw-mr-[20px]" alt="" />
  54. </div>
  55. <a class="tw-block t14 tw-font-normal tw-border-solid tw-border-[1px] tw-border-neutrals-200 tw-bg-white tw-text-neutrals-800 tw-rounded-[16px] tw-py-[12px] tw-px-[25px] md:t16"
  56. href="/faq" @click="this.$store.dispatch('toggleDrawer', true)">
  57. {{ $t("Help") }}
  58. </a>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import changeCurrency from "@/components/dropdown/changeCurrency.vue";
  66. import exhibitionList from "@/components/dropdown/exhibitionList.vue";
  67. import serviceList from "@/components/dropdown/serviceList.vue";
  68. import { object } from "is_js";
  69. export default {
  70. props: {
  71. serviceCategory: {
  72. type: Array,
  73. },
  74. exhibitionsCategory: {
  75. type: Array,
  76. },
  77. exhibitionListIcon: {
  78. type: Array
  79. },
  80. serviceListIcon: {
  81. type: Array
  82. },
  83. },
  84. data() {
  85. return {
  86. lang: "en",
  87. // show: false,
  88. exhibitionsActiveIndex: "",
  89. serviceActiveIndex: "",
  90. };
  91. },
  92. components: {
  93. changeCurrency,
  94. exhibitionList,
  95. serviceList,
  96. },
  97. computed: {
  98. drawerAcitve() {
  99. return this.$store.getters.getDrawerStatus;
  100. },
  101. },
  102. created() {
  103. this.$i18n.locale === "en" ? (this.lang = "en") : (this.lang = "zh-tw");
  104. // this.contents = [
  105. // "Rental cars",
  106. // "Flower",
  107. // "Hotel",
  108. // "SIM Card",
  109. // ];
  110. },
  111. mounted() {
  112. // vm.$refs.drawer.scrollTo(0, 0);
  113. },
  114. methods: {
  115. closeDrawer() {
  116. if (this.$store.getters.getDrawerStatus === true) {
  117. this.$store.dispatch("toggleDrawer", false);
  118. }
  119. },
  120. getActiveIndex(data) {
  121. this.exhibitionsActiveIndex = data;
  122. },
  123. getServiceActiveIndex(data) {
  124. this.serviceActiveIndex = data;
  125. },
  126. },
  127. watch: {
  128. lang: {
  129. handler: function () {
  130. if (this.lang === "en") {
  131. this.$i18n.setLocale(this.lang);
  132. } else {
  133. this.$i18n.setLocale(this.lang);
  134. }
  135. this.$store.dispatch("toggleDrawer", false);
  136. this.$emit('changeLang', true);
  137. },
  138. },
  139. drawerAcitve: {
  140. handler: function () {
  141. if (this.drawerAcitve == true) {
  142. this.$refs.drawer.scrollTo(0, 0);
  143. }
  144. }
  145. }
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scoped>
  150. .drawer {
  151. &.show {
  152. left: 0;
  153. }
  154. }
  155. .drawer-title {
  156. font-weight: 500;
  157. font-size: 14px;
  158. line-height: 20px;
  159. letter-spacing: 0.02em;
  160. color: #ee9546;
  161. }
  162. </style>