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.

169 lines
5.9 KiB

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