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.

1325 lines
44 KiB

2 years ago
  1. <template>
  2. <div
  3. class="NavBar tw-bg-white tw-sticky tw-top-0 tw-left-0 tw-w-full tw-border-0 tw-border-b tw-border-solid tw-border-neutral-200 tw-z-10"
  4. >
  5. <div
  6. class="tw-px-[20px] tw-py-[20px] md:tw-px-[30px] md:tw-py-[24px] xl:tw-px-[60px] xl:tw-pt-[22px] xl:tw-pb-[14px] xl:tw-max-w-[1366px] xl:tw-mx-auto"
  7. >
  8. <div class="tw-flex tw-justify-between tw-items-center xl:tw-h-[48px]">
  9. <div
  10. class="tw-flex tw-items-center tw-flex-grow xl:tw-grid xl:tw-grid-cols-[188px_auto] xl:tw-gap-[30px] xl:tw-basis-[70%]"
  11. >
  12. <img
  13. class="tw-mr-[20px] md:tw-mr-[40px] xl:tw-hidden"
  14. :src="require('@/assets/svg/menu.svg')"
  15. @click="clickMenu"
  16. />
  17. <nuxt-link
  18. :to="localePath('/')"
  19. class="tw-block tw-w-[146px] md:tw-w-[188px]"
  20. ><img
  21. :src="require('@/assets/svg/logo_v2.svg')"
  22. class="tw-w-full"
  23. alt=""
  24. />
  25. </nuxt-link>
  26. <!-- <v-card class="tw-hidden flex-row rounded-lg py-1 px-4 xl:tw-flex xl:tw-ml-[30px]" outlined
  27. v-if="showNavSearch" @click="bigSearch = true">
  28. <v-card flat color="transparent" :width="$vuetify.breakpoint.mdAndDown ? '70px' : '300px'"
  29. class="my-auto neutrals--text text--darken-3 text-size-14">
  30. {{
  31. this.$vuetify.breakpoint.mdAndDown
  32. ? $t("Looking ?")
  33. : $t("What are you looking for?")
  34. }}
  35. </v-card>
  36. <svg width="24" height="24" class="tw-my-auto" shape-rendering="geometricPrecision">
  37. <image xlink:href="@/assets/svg/icon-search-small.svg" src="@/assets/svg/icon-search-small.svg" width="24"
  38. height="24" />
  39. </svg>
  40. </v-card> -->
  41. <div v-if="showNavSearch" class="tw-w-full tw-hidden xl:tw-block">
  42. <Search
  43. v-if="showNavSearch"
  44. :exhibitionsCategories="exhibitionsCategories"
  45. :exhibitionsLocations="exhibitionsLocations"
  46. :exhibitionsSearchs="exhibitionsSearchs"
  47. :servicesLocations="servicesLocations"
  48. :servicesSearchs="servicesSearchs"
  49. @loaading="isPageLoading = true"
  50. />
  51. </div>
  52. </div>
  53. <div
  54. class="tw-basis-[46%] md:tw-basis-[66%] xl:tw-basis-[43%] xl:tw-ml-[56px]"
  55. v-click-outside="clickOutSide"
  56. >
  57. <div class="tw-flex tw-justify-end xl:tw-hidden">
  58. <div class="tw-flex tw-justify-center tw-items-center">
  59. <v-img
  60. max-width="24"
  61. class="mr-4 float-left"
  62. contain
  63. :src="require('@/assets/svg/search-black.svg')"
  64. @click="clickSearch"
  65. ></v-img>
  66. </div>
  67. <!--v-img
  68. max-width="24"
  69. class="mr-4 hidden-md-and-up"
  70. contain
  71. :src="require('@/assets/svg/shopping-bag.svg')"
  72. ></v-img-->
  73. <span max-width="28px" v-if="$auth.$state.loggedIn">
  74. <v-menu
  75. offset-y
  76. bottom
  77. left
  78. nudge-bottom="20"
  79. class="neutrals darken-1 mt-4 on-top"
  80. >
  81. <template v-slot:activator="{ on, attrs }">
  82. <v-btn
  83. v-bind="attrs"
  84. v-on="on"
  85. @click="UserInfoPopup = true"
  86. v-if="$auth.$storage.getUniversal('userPicture')"
  87. icon
  88. width="28px"
  89. height="28px"
  90. class="ms-2"
  91. >
  92. <v-img
  93. :src="userPicture"
  94. max-width="28px"
  95. max-height="28px"
  96. class="rounded-circle"
  97. :key="userPicture"
  98. ></v-img>
  99. </v-btn>
  100. <v-btn
  101. v-bind="attrs"
  102. v-on="on"
  103. @click="UserInfoPopup = true"
  104. v-else-if="
  105. $auth.$storage.getUniversal('userLastName') != undefined
  106. "
  107. fab
  108. class="user-no-picture-border mx-2 tw-shadow-none"
  109. color="primary"
  110. width="28"
  111. height="28"
  112. >
  113. <span class="tw-text-[16px]">
  114. {{ $auth.$storage.getUniversal("userLastName") }}
  115. </span>
  116. </v-btn>
  117. <nuxt-link
  118. v-else
  119. class="tw-bg-primary-default tw-rounded-[12px] tw-whitespace-nowrap tw-block tw-text-white tw-px-[16px] tw-py-[9px] tw-whitespace-nowrap tw-text-[10px] tw-font-medium tw-transition-all tw-duration-200 tw-ease-in-out hover:tw-bg-primary-light"
  120. :to="localePath('/user')"
  121. >
  122. {{ $t("Log in/Sign up") }}
  123. </nuxt-link>
  124. </template>
  125. <div class="neutrals darken-1 tw-hidden xl:tw-block">
  126. <v-btn
  127. :to="
  128. localePath(
  129. $auth.$storage.getUniversal('jwt')
  130. ? `/user/${
  131. $auth.$storage.getUniversal('jwt').user_id
  132. }`
  133. : ''
  134. )
  135. "
  136. class="neutrals darken-1 neutrals--text text--darken-5 no-text-transform elevation-0 text-size-14"
  137. >
  138. <unicon
  139. class="mr-3"
  140. name="user"
  141. height="20px"
  142. fill="neutrals-darken5"
  143. />{{ $t("Profile") }}
  144. </v-btn>
  145. <v-btn
  146. @click="logout"
  147. class="neutrals darken-1 warning--text no-text-transform elevation-0"
  148. >
  149. <unicon
  150. class="mr-3 text-size-14"
  151. name="signout"
  152. height="20px"
  153. fill="#EF5A5A"
  154. />{{ $t("Logout") }}
  155. </v-btn>
  156. </div>
  157. <!-- <v-list class="neutrals darken-1 tw-hidden xl:tw-block">
  158. <v-list-item>
  159. <v-btn :to="
  160. localePath(
  161. $auth.$storage.getUniversal('jwt')
  162. ? `/user/${
  163. $auth.$storage.getUniversal('jwt').user_id
  164. }`
  165. : ''
  166. )
  167. "
  168. class="neutrals darken-1 neutrals--text text--darken-5 no-text-transform elevation-0 text-size-14">
  169. <unicon class="mr-3" name="user" height="20px" fill="neutrals-darken5" />{{ $t("Profile") }}
  170. </v-btn>
  171. </v-list-item>
  172. <v-list-item>
  173. <v-btn @click="logout" class="neutrals darken-1 warning--text no-text-transform elevation-0">
  174. <unicon class="mr-3 text-size-14" name="signout" height="20px" fill="#EF5A5A" />{{ $t("Logout") }}
  175. </v-btn>
  176. </v-list-item>
  177. </v-list> -->
  178. </v-menu>
  179. </span>
  180. <span v-else>
  181. <nuxt-link :to="localePath('/user')">
  182. <img class="" :src="require('@/assets/svg/profile.svg')" />
  183. </nuxt-link>
  184. </span>
  185. </div>
  186. <div
  187. class="tw-hidden xl:tw-flex xl:tw-justify-end xl:tw-items-center"
  188. >
  189. <v-btn
  190. v-if="$i18n.locale == 'zh-tw'"
  191. depressed
  192. class="remove-upper tw-mx-0 tw-px-0 tw-bg-transparent tw-text-primary-default"
  193. href="https://medium.com/showeasy"
  194. target="_blank"
  195. >
  196. {{ $t("Blog") }}
  197. </v-btn>
  198. <v-btn
  199. v-else
  200. depressed
  201. class="remove-upper tw-mx-0 tw-px-0 tw-bg-transparent tw-text-primary-default"
  202. href="https://medium.com/showeasy-eng"
  203. target="_blank"
  204. >
  205. {{ $t("Blog") }}
  206. </v-btn>
  207. <v-menu offset-y class="on-top">
  208. <template v-slot:activator="{ on, attrs }">
  209. <v-btn
  210. v-bind="attrs"
  211. v-on="on"
  212. depressed
  213. class="white neutrals--text text--darken-5 no-text-transform tw-body-3 tw-font-normal"
  214. >
  215. {{ $i18n.localeProperties["title"] }}
  216. <img src="@/assets/svg/down-arrow.svg" alt="" class="ml-1" />
  217. </v-btn>
  218. </template>
  219. <v-list>
  220. <v-list-item
  221. v-for="(lang, idx) in this.$i18n.locales"
  222. :key="idx"
  223. class="tw-mx-auto"
  224. >
  225. <nuxt-link
  226. :to="switchLocalePath(lang.code)"
  227. class="tw-rounded-[10px] tw-text-base-primary text-decoration-none tw-body-3 tw-font-normal tw-w-full tw-px-[12px] tw-py-[8px] hover:tw-bg-primary-3 hover:tw-text-primary-1"
  228. >
  229. {{ lang.text }}
  230. </nuxt-link>
  231. </v-list-item>
  232. </v-list>
  233. </v-menu>
  234. <changeCurrency></changeCurrency>
  235. <nuxt-link
  236. class="tw-px-[10px] tw-mr-[10px] hover:tw-bg-primary-3 active:tw-bg-primary-3"
  237. :to="localePath('/FAQ')"
  238. ><img src="~/assets/svg/faq.svg" alt=""
  239. /></nuxt-link>
  240. <!-- <v-btn
  241. depressed
  242. class="white tw-mr-[16px]"
  243. :to="localePath('/FAQ')"
  244. >
  245. <svg width="20" height="20">
  246. <image
  247. xlink:href="@/assets/svg/help-circle.svg"
  248. src="@/assets/svg/help-circle.svg"
  249. width="20"
  250. height="20"
  251. />
  252. </svg>
  253. </v-btn> -->
  254. <!-- <v-btn depressed class="white" small>
  255. <img src="@/assets/svg/shopping-bag.svg" alt="" />
  256. </v-btn> -->
  257. <div v-if="$auth.$state.loggedIn" class="tw-relative">
  258. <div
  259. v-if="$auth.$storage.getUniversal('userPicture')"
  260. class="tw-mx-auto"
  261. >
  262. <img
  263. :src="userPicture"
  264. class="tw-max-w-[28px] tw-max-h-[28px] tw-rounded-[50px] tw-flex tw-items-center tw-cursor-pointer"
  265. @click="UserInfoPopup = true"
  266. alt=""
  267. />
  268. </div>
  269. <v-btn
  270. @click="UserInfoPopup = true"
  271. v-else-if="
  272. $auth.$storage.getUniversal('userLastName') != undefined
  273. "
  274. fab
  275. class="user-no-picture-border mx-2 tw-shadow-none"
  276. color="primary"
  277. width="28"
  278. height="28"
  279. >
  280. <span class="tw-text-[16px]">
  281. {{ $auth.$storage.getUniversal("userLastName") }}
  282. </span>
  283. </v-btn>
  284. <nuxt-link
  285. v-else
  286. class="tw-bg-primary-default tw-rounded-[12px] tw-whitespace-nowrap tw-block tw-text-white tw-px-[16px] tw-py-[9px] tw-whitespace-nowrap tw-text-[10px] tw-font-medium tw-transition-all tw-duration-200 tw-ease-in-out hover:tw-bg-primary-light"
  287. :to="localePath('/user')"
  288. >
  289. {{ $t("Log in/Sign up") }}
  290. </nuxt-link>
  291. <div
  292. :class="[
  293. 'tw-grid-cols-1 tw-gap-[14px] tw-px-[10px] tw-py-[8px] tw-bg-white tw-rounded-[10px] tw-w-max tw-absolute tw-right-0 tw-top-[40px] tw-z-50 tw-shadow-[0_1px_4px_0_rgba(0,0,0,0.3)]',
  294. UserInfoPopup && width >= 1366 ? 'tw-grid' : 'tw-hidden',
  295. ]"
  296. >
  297. <nuxt-link
  298. :to="
  299. localePath(
  300. $auth.$storage.getUniversal('jwt')
  301. ? `/user/${$auth.$storage.getUniversal('jwt').user_id}`
  302. : ''
  303. )
  304. "
  305. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  306. @click.native="UserInfoPopup = false"
  307. ><img src="~/assets/svg/profile.svg" alt="" />
  308. <div class="tw-head-body tw-text-base-primary">
  309. {{ $t("userProfile.profile") }}
  310. </div>
  311. </nuxt-link>
  312. <!-- <nuxt-link :to="localePath('/user/myBooking')"
  313. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"><img
  314. src="~/assets/svg/bookings.svg" alt="" />
  315. <div class="tw-head-body tw-text-base-primary">
  316. {{ $t('My Bookings')}}
  317. </div>
  318. </nuxt-link> -->
  319. <nuxt-link
  320. :to="localePath('/user/saveExhibition')"
  321. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  322. @click.native="UserInfoPopup = false"
  323. ><img src="~/assets/svg/saveExhibition.svg" alt="" />
  324. <div class="tw-head-body tw-text-base-primary">
  325. {{ $t("userProfile.savedExhibitions") }}
  326. </div>
  327. </nuxt-link>
  328. <!-- <nuxt-link :to="localePath('/user/saveService')"
  329. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  330. @click.native="UserInfoPopup = false"><img src="~/assets/svg/saveService.svg" alt="" />
  331. <div class="tw-head-body tw-text-base-primary">
  332. {{ $t("userProfile.savedServices") }}
  333. </div>
  334. </nuxt-link> -->
  335. <nuxt-link
  336. :to="localePath('/user/companyInfo')"
  337. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  338. @click.native="UserInfoPopup = false"
  339. ><img src="~/assets/svg/companyInfo.svg" alt="" />
  340. <div class="tw-head-body tw-text-base-primary">
  341. {{ $t("userProfile.companyInfo") }}
  342. </div>
  343. </nuxt-link>
  344. <nuxt-link
  345. :to="localePath('/user/contactInfo')"
  346. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  347. @click.native="UserInfoPopup = false"
  348. ><img src="~/assets/svg/contactInfo.svg" alt="" />
  349. <div class="tw-head-body tw-text-base-primary">
  350. {{ $t("Contact Info") }}
  351. </div>
  352. </nuxt-link>
  353. <nuxt-link
  354. :to="localePath('/user/setting')"
  355. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  356. @click.native="UserInfoPopup = false"
  357. ><img src="~/assets/svg/profile_setting.svg" alt="" />
  358. <div class="tw-head-body tw-text-base-primary">
  359. {{ $t("userProfile.setting") }}
  360. </div>
  361. </nuxt-link>
  362. <div
  363. class="tw-border tw-border-t tw-border-solid tw-border-neutral-200"
  364. ></div>
  365. <button
  366. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  367. @click="logout"
  368. >
  369. <img src="~/assets/svg/logout.svg" alt="" />
  370. <div
  371. class="tw-flex tw-head-body tw-text-error-default tw-justify-start"
  372. >
  373. {{ $t("userProfile.logout") }}
  374. </div>
  375. </button>
  376. </div>
  377. </div>
  378. <div v-else>
  379. <nuxt-link
  380. :to="localePath('/user')"
  381. class="tw-text-[14px] tw-min-w-[123px] tw-whitespace-nowrap tw-text-white tw-bg-primary-1 tw-px-[16px] tw-py-[9px] tw-rounded-[12px]"
  382. >
  383. {{ $t("Log in/Sign up") }}</nuxt-link
  384. >
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. <div
  390. ref="dropdown"
  391. :class="[
  392. 'navBar-row2 tw-relative tw-hidden xl:tw-grid xl:tw-mt-[35px] tw-transition-all tw-duration-200 tw-delay-75 tw-ease-linear',
  393. ]"
  394. >
  395. <div
  396. class="customMenuLink tw-relative tw-flex tw-justify-start tw-items-center tw-z-3"
  397. @mouseleave="exhibitionActiveIndex = 0"
  398. >
  399. <a
  400. :href="localePath('/exhibition')"
  401. @click="isPageLoading = true"
  402. :class="[
  403. 'tw-text-black tw-body-3 tw-font-normal hover:tw-text-primary-default',
  404. $route.path.match('\/exhibition')
  405. ? 'tw-text-primary-default'
  406. : '',
  407. ]"
  408. >
  409. {{ $t("Exhibition") }}</a
  410. >
  411. <div
  412. class="customDropMenu exhibition tw-bg-white tw-p-[20px] tw-rounded-[10px] tw-w-max tw-absolute tw-top-[36px] tw-left-0 tw-mt-[10px] tw-overflow-hidden tw-shadow-[0_1px_6px_0_rgba(0,0,0,0.4)]"
  413. >
  414. <div
  415. class="tw-relative tw-grid tw-grid-cols-2 tw-w-[700px] tw-h-[556px] tw-overflow-hidden"
  416. >
  417. <div
  418. class="tw-list-none tw-overflow-x-hidden tw-overflow-y-auto tw-h-auto tw-break-inside-avoid tw-grid tw-grid-cols-1 tw-gap-[20px]"
  419. >
  420. <div
  421. class="tw-list-none tw-mr-[20px]"
  422. v-for="(item, index) in exhibitionsCategoryList"
  423. :key="index"
  424. @mouseover="exhibitionActiveIndex = index"
  425. >
  426. <div
  427. :class="[
  428. 'exhibitionDropdownLink tw-grid tw-grid-cols-[30px_auto] tw-gap-[10px] tw-body-4 tw-font-normal hover:tw-text-primary-default',
  429. exhibitionActiveIndex == index
  430. ? 'tw-text-primary-default active'
  431. : 'tw-text-neutrals-900',
  432. ]"
  433. >
  434. <img
  435. v-if="exhibitionListIcon[index] !== undefined"
  436. :src="
  437. require(`@/assets/img/CategoryIcon/${exhibitionListIcon[index]}.png`)
  438. "
  439. /><span class="tw-flex tw-items-center tw-min-w-[322px]">{{
  440. $t(item.title)
  441. }}</span>
  442. </div>
  443. </div>
  444. </div>
  445. <div class="tw-w-full tw-overflow-x-hidden tw-overflow-y-auto">
  446. <ul
  447. class="tw-list-none tw-grid tw-grid-cols-1 tw-gap-[20px] tw-px-[20px]"
  448. >
  449. <li class="tw-list-none">
  450. <a
  451. :href="
  452. localePath(
  453. `/exhibition?category=${exhibitionsCategoryList[exhibitionActiveIndex].id}`
  454. )
  455. "
  456. class="tw-block tw-body-4 tw-font-normal tw-text-neutral-800 hover:tw-text-primary-default"
  457. >{{ $t("All") }}</a
  458. >
  459. </li>
  460. <li
  461. v-for="(sub, index) in exhibitionsCategoryList[
  462. exhibitionActiveIndex
  463. ].subcategory"
  464. :key="index"
  465. class="tw-list-none"
  466. >
  467. <a
  468. :href="localePath(`/exhibition?subcategory=${sub.id}`)"
  469. class="tw-block tw-min-h-[30px] tw-body-4 tw-font-normal tw-min-w-[230px] tw-text-neutral-800 hover:tw-text-primary-default"
  470. >{{ sub.title }}</a
  471. >
  472. </li>
  473. </ul>
  474. </div>
  475. </div>
  476. </div>
  477. </div>
  478. <span class="vertical-line"></span>
  479. <div
  480. class="customMenuLink tw-relative tw-flex tw-justify-start tw-items-center tw-z-3"
  481. >
  482. <a
  483. :href="localePath('/service')"
  484. :class="[
  485. 'tw-text-black tw-body-3 tw-font-normal hover:tw-text-primary-default',
  486. $route.path.match('\/service') ? 'tw-text-primary-default' : '',
  487. ]"
  488. >
  489. {{ $t("All Services") }}</a
  490. >
  491. <div
  492. class="customDropMenu services tw-bg-white tw-p-[20px] tw-rounded-[10px] tw-w-max tw-absolute tw-top-[36px] tw-left-0 tw-mt-[10px] -tw-mb-[60px] tw-shadow-[0_1px_6px_0_rgba(0,0,0,0.4)]"
  493. >
  494. <ul
  495. v-for="(item, index) in serviceCategoryList"
  496. :key="item.id"
  497. class="tw-list-none tw-mb-0 tw-mr-[40px] tw-h-auto tw-break-inside-avoid"
  498. >
  499. <li class="tw-list-none">
  500. <a
  501. :href="localePath(`/service?category=${item.id}`)"
  502. class="tw-block tw-mb-[16px] tw-grid tw-grid-cols-[16px_auto] tw-gap-[10px] tw-body-4 tw-font-normal tw-text-primary-default hover:tw-text-primary-default"
  503. >
  504. <svg
  505. width="16"
  506. height="16"
  507. class="tw-my-auto"
  508. shape-rendering="geometricPrecision"
  509. v-if="serviceListIcon[index] !== undefined"
  510. >
  511. <image
  512. :xlink:href="
  513. require(`@/assets/svg/${serviceListIcon[index]}.svg`)
  514. "
  515. :src="
  516. require(`@/assets/svg/${serviceListIcon[index]}.svg`)
  517. "
  518. width="16"
  519. height="16"
  520. />
  521. </svg>
  522. <div v-else></div>
  523. <span>{{ item.title }}</span>
  524. </a>
  525. <ul
  526. class="tw-list-none tw-grid tw-grid-cols-1 tw-gap-[16px] tw-p-0"
  527. >
  528. <li
  529. v-for="(sub, index) in item.subcategory"
  530. :key="index"
  531. class="tw-list-none"
  532. >
  533. <a
  534. :href="localePath(`/service?subcatg=${sub.id}`)"
  535. class="tw-block tw-body-4 tw-font-normal tw-text-neutral-800 hover:tw-text-primary-default"
  536. >{{ sub.title }}</a
  537. >
  538. </li>
  539. </ul>
  540. </li>
  541. <div class="tw-h-[60px]"></div>
  542. </ul>
  543. </div>
  544. </div>
  545. <div
  546. ref="headerSwiper"
  547. class="swiper-container headerService tw-w-full tw-overflow-hidden tw-relative tw-max-w-[1008px] tw-ml-[25px] tw-transition-all tw-duration-200 tw-delay-75 tw-ease-in"
  548. >
  549. <div class="swiper-wrapper">
  550. <div
  551. class="swiper-slide customMenuLink tw-relative tw-justify-start tw-items-center tw-w-auto"
  552. v-for="item in serviceCategoryList"
  553. :key="item.id"
  554. >
  555. <a
  556. :href="localePath(`/service?category=${item.id}`)"
  557. class="tw-text-black tw-body-3 tw-font-normal hover:tw-text-primary-default tw-whitespace-nowrap"
  558. >{{ item.title }}</a
  559. >
  560. <ul
  561. class="customDropMenu oneType tw-grid-cols-1 tw-gap-[16px] tw-bg-white tw-p-[20px] tw-rounded-[10px] tw-w-max tw-absolute tw-top-[36px] tw-left-0 tw-mt-[10px] tw-shadow-[0_1px_6px_0_rgba(0,0,0,0.4)]"
  562. >
  563. <li
  564. v-for="(sub, index) in item.subcategory"
  565. :key="index"
  566. class="tw-list-none"
  567. >
  568. <a
  569. :href="localePath(`/service?subcatg=${sub.id}`)"
  570. class="tw-block tw-body-4 tw-font-normal tw-text-black hover:tw-text-primary-default"
  571. >{{ sub.title }}</a
  572. >
  573. </li>
  574. </ul>
  575. </div>
  576. </div>
  577. <div
  578. :class="[
  579. 'swiper-button-prev headerService tw-text-black tw-hidden',
  580. headerServiceSwiper
  581. ? 'xl:tw-flex xl:tw-justify-center xl:tw-items-center'
  582. : '',
  583. ]"
  584. ></div>
  585. <div
  586. :class="[
  587. 'swiper-button-next headerService tw-text-black tw-hidden',
  588. headerServiceSwiper
  589. ? 'xl:tw-flex xl:tw-justify-center xl:tw-items-center'
  590. : '',
  591. ]"
  592. ></div>
  593. </div>
  594. </div>
  595. </div>
  596. <Drawer
  597. :serviceCategory.sync="serviceCategoryList"
  598. :exhibitionsCategory.sync="exhibitionsCategoryList"
  599. :serviceListIcon="serviceListIcon"
  600. :exhibitionListIcon="exhibitionListIcon"
  601. @changeLang="changeLang()"
  602. />
  603. <SearchDialog
  604. ref="searchDialog"
  605. :exhibitionsCategoryList="exhibitionsCategoryList"
  606. :exhibitionsLocations="exhibitionsLocations"
  607. :exhibitionListIcon="exhibitionListIcon"
  608. :exhibitionsCategories="exhibitionsCategories"
  609. :servicesLocations="servicesLocations"
  610. :servicesSearchs="servicesSearchs"
  611. :populars="populars"
  612. @loaading="isPageLoading = true"
  613. />
  614. <mobileUserInfoPopup
  615. v-show="width < 1366"
  616. :show="UserInfoPopup"
  617. :width="width"
  618. @popup="UserInfoPopup = $event"
  619. >
  620. </mobileUserInfoPopup>
  621. <loading :isLoading="isPageLoading"></loading>
  622. </div>
  623. </template>
  624. <script>
  625. import Search from "@/components/home/headerInlineSearch";
  626. import Drawer from "@/components/newDrawer";
  627. import SearchDialog from "@/components/SearchDialog";
  628. import mobileUserInfoPopup from "@/components/mobileUserInfoPopup.vue";
  629. import { SettingsIcon } from "vue-feather-icons";
  630. import jwt_decode from "jwt-decode";
  631. import loading from "@/components/newComponent/loading/loading.vue";
  632. import changeCurrency from "@/components/dropdown/changeCurrencyWeb.vue";
  633. import Swiper from "swiper/bundle";
  634. import { handler } from "@tailwindcss/line-clamp";
  635. export default {
  636. components: {
  637. Drawer,
  638. Search,
  639. SettingsIcon,
  640. SearchDialog,
  641. mobileUserInfoPopup,
  642. loading,
  643. changeCurrency,
  644. Swiper,
  645. },
  646. data() {
  647. return {
  648. show: false,
  649. bigSearch: false,
  650. userPicture: "",
  651. showNavSearch: true,
  652. servicesSearchs: [],
  653. servicesLocations: [],
  654. serviceCategoryList: [],
  655. serviceListIcon: [
  656. "Booth",
  657. "Exhibit",
  658. "event",
  659. "Marketing",
  660. "journey",
  661. "human",
  662. "service_others",
  663. ],
  664. exhibitionsCategoryList: [{ subcategory: [] }],
  665. exhibitionsSearchs: [],
  666. exhibitionsLocations: [],
  667. exhibitionsCategories: [],
  668. exhibitionListIcon: [
  669. "rawMaterial",
  670. "aeroSpace",
  671. "energy",
  672. "autoMobile",
  673. "electronics",
  674. "contrucstion",
  675. "security",
  676. "Machinary",
  677. "Medical",
  678. "education",
  679. "textile",
  680. "food",
  681. "entertainment",
  682. "consumer",
  683. "others",
  684. ],
  685. populars: {},
  686. exhibitionActiveIndex: 0,
  687. width: undefined,
  688. drawer: false,
  689. group: null,
  690. isPageLoading: false,
  691. UserInfoPopup: false,
  692. headerServiceSwiper: null,
  693. offsetLeft: 0,
  694. top: 0,
  695. TAIWAN_ID: 18,
  696. JAPAN_ID: 16,
  697. ITALY_ID: 31,
  698. };
  699. },
  700. async created() {
  701. if (process.client) {
  702. this.width = window.innerWidth;
  703. }
  704. if (!this.$route) return;
  705. if (!this.$route.name) return;
  706. const [path, lang] = this.$route.name.split("___");
  707. if (path == "index") {
  708. this.showNavSearch = false;
  709. } else {
  710. this.showNavSearch = true;
  711. }
  712. await this.fetchUser();
  713. await this.socialRegister();
  714. // await this.getServiceCategory();
  715. // await this.getExhibitionsCategory();
  716. // await this.getServiceHistory();
  717. // await this.getExhibitionsHistory();
  718. // await this.getServiceLocations();
  719. // await this.getExhibitionsLocations();
  720. // await this.getExhibitionsCategories();
  721. // await this.getExhibitionsCollections();
  722. // await this.getPopulars();
  723. },
  724. mounted() {
  725. let vm = this;
  726. vm.$nextTick(function () {
  727. window.addEventListener("resize", this.onResize);
  728. vm.initSwiper();
  729. });
  730. },
  731. beforeDestroy() {
  732. window.removeEventListener("resize", this.onResize);
  733. },
  734. computed: {
  735. windowWidth() {
  736. if (process.client) {
  737. this.width = window.innerWidth;
  738. }
  739. return this.width;
  740. },
  741. pictureStatus() {
  742. return this.$store.getters.getPictureStatus;
  743. },
  744. registerStatus() {
  745. return this.$store.getters.getRegisterStatus;
  746. },
  747. lang() {
  748. return this.$i18n.localeProperties["langQuery"];
  749. },
  750. },
  751. watch: {
  752. group: {
  753. handler: function () {
  754. this.drawer = false;
  755. },
  756. },
  757. $route: {
  758. handler: function (to, from) {
  759. if (!to) return;
  760. if (!to.name) return;
  761. const [path, lang] = to.name.split("___");
  762. if (path == "index") {
  763. this.showNavSearch = false;
  764. } else {
  765. this.showNavSearch = true;
  766. }
  767. if (path === "exhibition") {
  768. this.isPageLoading = false;
  769. }
  770. if (path === "service") {
  771. this.isPageLoading = false;
  772. }
  773. if (to != from) {
  774. this.bigSearch = false;
  775. }
  776. },
  777. },
  778. pictureStatus: {
  779. handler: function (newVal, oldVal) {
  780. this.fetchUser();
  781. this.$forceUpdate();
  782. },
  783. },
  784. registerStatus: {
  785. handler: function (newVal, oldVal) {
  786. this.socialRegister();
  787. },
  788. },
  789. lang: {
  790. handler: async function (newVal, oldVal) {
  791. if (newVal != oldVal) {
  792. this.$refs.dropdown.style.opacity = 0;
  793. // await this.getServiceCategory();
  794. // await this.getExhibitionsCategory();
  795. // await this.getServiceHistory();
  796. // await this.getExhibitionsHistory();
  797. // await this.getServiceLocations();
  798. // await this.getExhibitionsLocations();
  799. // await this.getExhibitionsCategories();
  800. // await this.getExhibitionsCollections();
  801. await this.initSwiper();
  802. }
  803. },
  804. },
  805. },
  806. methods: {
  807. clickOutSide() {
  808. this.show = false;
  809. this.UserInfoPopup = false;
  810. },
  811. onResize() {
  812. if (process.client) {
  813. this.width = window.innerWidth;
  814. }
  815. },
  816. clickMenu() {
  817. if (this.windowWidth < 1366) {
  818. this.$store.dispatch("toggleDrawer", true);
  819. }
  820. },
  821. clickSearch() {
  822. this.$store.dispatch("toggleSearchDialog", true);
  823. },
  824. initSwiper() {
  825. let vm = this;
  826. vm.$nextTick(function () {
  827. vm.headerServiceSwiper = new Swiper(".swiper-container.headerService", {
  828. direction: "horizontal",
  829. initialSlide: 0,
  830. observer: true,
  831. observeParents: true,
  832. rebuildOnUpdate: true,
  833. slidesPerView: "auto",
  834. spaceBetween: 25,
  835. watchSlidesVisibility: true,
  836. slideVisibleClass: "swiper-slide-visible",
  837. allowTouchMove: false,
  838. navigation: {
  839. nextEl: ".swiper-button-next.headerService",
  840. prevEl: ".swiper-button-prev.headerService",
  841. },
  842. });
  843. vm.headerServiceSwiper.init();
  844. vm.headerServiceSwiper.update();
  845. // this.$refs.headerSwiper.style.opacity = 1;
  846. vm.$refs.dropdown.style.opacity = 1;
  847. });
  848. },
  849. async fetchUser() {
  850. if (this.$auth.loggedIn) {
  851. const jwt = this.$auth.$storage.getUniversal("jwt");
  852. let jsonPayload = {};
  853. if (jwt) {
  854. const token = this.$auth.$storage.getUniversal("jwt").token;
  855. jsonPayload = jwt_decode(token) || {};
  856. }
  857. if (!this.$auth.$storage.getUniversal("userPicture")) {
  858. this.userPicture = jsonPayload.picture || "";
  859. this.$auth.$storage.setUniversal("userPicture", jsonPayload.picture);
  860. } else {
  861. this.userPicture = this.$auth.$storage.getUniversal("userPicture");
  862. }
  863. this.$auth.$storage.setUniversal(
  864. "userLastName",
  865. jsonPayload && jsonPayload.last_name
  866. ? jsonPayload.last_name.substring(0, 1)
  867. : ""
  868. );
  869. }
  870. },
  871. getServiceCategory() {
  872. let vm = this;
  873. vm.$nextTick(() => {
  874. vm.$axios
  875. .get(`/service/category?lang_code=${this.lang}`)
  876. .then((result) => {
  877. vm.serviceCategoryList = result.data.map((item) => {
  878. const subcategory = item.service_subcategory.map((sub) => {
  879. return {
  880. id: sub.id,
  881. title: sub.language_text[0].text,
  882. key: sub.language_text[0].text,
  883. type: "subcategory",
  884. order: sub.order_in_category,
  885. };
  886. });
  887. return {
  888. id: item.id,
  889. order: item.order,
  890. title: item.language_text[0].text,
  891. key: item.language_text[0].text,
  892. type: "category",
  893. subcategory: subcategory,
  894. };
  895. });
  896. return result.data;
  897. })
  898. .catch((err) => {
  899. console.log(err);
  900. });
  901. });
  902. },
  903. async getExhibitionsCategory() {
  904. await this.$axios
  905. .get(
  906. `/t/exhibitions/categories?lang=${this.$i18n.localeProperties["langQuery"]}&sort=true`
  907. )
  908. .then((result) => {
  909. this.exhibitionsCategoryList = result.data.sort_results;
  910. this.exhibitionsCategoryList = this.exhibitionsCategoryList.map(
  911. (item) => {
  912. item.subcategories_list = item.subcategories_list.map(
  913. (children) => {
  914. return {
  915. id: children.subcategory_id,
  916. title: children.subcategory_name,
  917. key: children.subcategory_name,
  918. type: "subcategory",
  919. };
  920. }
  921. );
  922. return {
  923. id: item.categories_id,
  924. title: item.category_name,
  925. key: item.category_name,
  926. type: "category",
  927. subcategory: item.subcategories_list,
  928. };
  929. }
  930. );
  931. })
  932. .catch((err) => {
  933. console.log(err);
  934. });
  935. },
  936. async getServiceHistory() {
  937. await this.$axios
  938. .get(
  939. `/trending/services/search/history?lang=${this.$i18n.localeProperties["langQuery"]}`
  940. )
  941. .then((response) => {
  942. this.servicesSearchs = response.data.searches;
  943. })
  944. .catch((error) => console.log(error));
  945. },
  946. async getExhibitionsHistory() {
  947. await this.$axios
  948. .get(
  949. `/trending/exhibitions/search/history?lang=${this.$i18n.localeProperties["langQuery"]}`
  950. )
  951. .then((response) => {
  952. this.exhibitionsSearchs = response.data.searches;
  953. })
  954. .catch((error) => console.log(error));
  955. },
  956. async getServiceLocations() {
  957. await this.$axios
  958. .get(
  959. `/trending/services/locations?lang=${this.$i18n.localeProperties["langQuery"]}`
  960. )
  961. .then((response) => {
  962. this.servicesLocations = response.data.locations;
  963. })
  964. .catch((error) => console.log(error));
  965. },
  966. async getExhibitionsLocations() {
  967. await this.$axios
  968. .get(
  969. `/trending/exhibitions/locations?lang=${this.$i18n.localeProperties["langQuery"]}`
  970. )
  971. .then((response) => {
  972. this.exhibitionsLocations = response.data.locations;
  973. })
  974. .catch((error) => console.log(error));
  975. },
  976. async getExhibitionsCategories() {
  977. await this.$axios
  978. .get(
  979. `/t/exhibitions/categories?lang=${this.$i18n.localeProperties["langQuery"]}&sort=true`
  980. )
  981. .then((result) => {
  982. this.exhibitionsCategories = result.data.sort_results;
  983. this.exhibitionsCategories = this.exhibitionsCategories.map(
  984. (item) => {
  985. item.subcategories_list = item.subcategories_list.map(
  986. (children) => {
  987. return {
  988. id: children.subcategory_id,
  989. title: children.subcategory_name,
  990. key: children.subcategory_name,
  991. type: "subcategory",
  992. };
  993. }
  994. );
  995. return {
  996. id: item.categories_id,
  997. title: item.category_name,
  998. key: item.category_name,
  999. type: "category",
  1000. subcategory: item.subcategories_list,
  1001. };
  1002. }
  1003. );
  1004. })
  1005. .catch((err) => {
  1006. console.log(err);
  1007. });
  1008. },
  1009. async getExhibitionsCollections() {
  1010. await this.$axios
  1011. .get(
  1012. `/trending/exhibitions/collections?lang=${this.$i18n.localeProperties["langQuery"]}`
  1013. )
  1014. .then((response) => {
  1015. this.collections = response.data.collections;
  1016. })
  1017. .catch((error) => console.log(error));
  1018. },
  1019. async changeLang() {
  1020. // await this.getServiceCategory();
  1021. // await this.getExhibitionsCategory();
  1022. // await this.getServiceHistory();
  1023. // await this.getExhibitionsHistory();
  1024. // await this.getServiceLocations();
  1025. // await this.getExhibitionsLocations();
  1026. // await this.getExhibitionsCategories();
  1027. // await this.getExhibitionsCollections();
  1028. },
  1029. async getPopulars() {
  1030. await this.$axios
  1031. .get(
  1032. `/trending/search/popular?lang=${this.$i18n.localeProperties["langQuery"]}`
  1033. )
  1034. .then((response) => {
  1035. this.populars = response.data;
  1036. })
  1037. .catch((error) => console.log(error));
  1038. },
  1039. logout() {
  1040. this.$auth.$storage.removeUniversal("jwt");
  1041. this.$auth.$storage.removeUniversal("userPicture");
  1042. this.$auth.$storage.removeUniversal("userLastName");
  1043. this.$auth.$storage.removeUniversal("userBeforePath");
  1044. if (this.width < 1024) {
  1045. this.$router.push(this.localePath("/"));
  1046. } else {
  1047. this.$router.push(this.localePath("/user"));
  1048. }
  1049. this.$auth.logout();
  1050. this.$nuxt.refresh();
  1051. this.UserInfoPopup = false;
  1052. },
  1053. async socialRegister() {
  1054. if (this.$auth.loggedIn) {
  1055. const jsonPayload =
  1056. this.$auth.$storage.getUniversal("jwt") &&
  1057. this.$auth.$storage.getUniversal("jwt").token != undefined
  1058. ? jwt_decode(this.$auth.$storage.getUniversal("jwt").token)
  1059. : { ueid: "" };
  1060. if (
  1061. this.$auth.$state.strategy === "google" ||
  1062. this.$auth.$state.strategy === "facebook"
  1063. ) {
  1064. const userData = {
  1065. social_id:
  1066. this.$auth.$state.strategy === "google"
  1067. ? this.$auth.$state.user.sub
  1068. : this.$auth.$state.user.id,
  1069. first_name:
  1070. this.$auth.$state.strategy === "google"
  1071. ? this.$auth.$state.user.given_name
  1072. : this.$auth.$state.user.first_name,
  1073. last_name:
  1074. this.$auth.$state.strategy === "google"
  1075. ? this.$auth.$state.user.family_name
  1076. : this.$auth.$state.user.last_name,
  1077. email: this.$auth.$state.user.email,
  1078. picture:
  1079. this.$auth.$state.strategy === "google"
  1080. ? this.$auth.$state.user.picture
  1081. : this.$auth.$state.user.picture.data.url,
  1082. social_schema: this.$auth.$state.strategy,
  1083. };
  1084. jsonPayload.ueid != ""
  1085. ? (userData.user_id = JSON.parse(jsonPayload.ueid))
  1086. : "";
  1087. await this.$axios
  1088. .post("/member/users/social", userData)
  1089. .then((result) => {
  1090. this.$auth.$storage.setUniversal("jwt", result.data, true);
  1091. this.$store.dispatch("updatePicture");
  1092. })
  1093. .catch((err) => {
  1094. console.log(err);
  1095. });
  1096. }
  1097. this.$store.dispatch("updatePicture");
  1098. }
  1099. },
  1100. toShowList(countryId) {
  1101. if (countryId > 0) {
  1102. this.$router.push(this.localePath(`/exhibition?country=${countryId}`));
  1103. } else {
  1104. this.$router.push(this.localePath(`/exhibition`));
  1105. }
  1106. this.isPageLoading = true;
  1107. },
  1108. },
  1109. };
  1110. </script>
  1111. <style lang="scss" scoped>
  1112. .v-menu__content {
  1113. box-shadow: none;
  1114. min-width: 186px;
  1115. border-radius: 10px;
  1116. }
  1117. .v-list-item {
  1118. padding-left: 12px;
  1119. padding-right: 12px;
  1120. color: #232323 !important;
  1121. }
  1122. .navBar-row2 {
  1123. opacity: 0;
  1124. grid-template-columns: fit-content(70px) 50px fit-content(90px) auto;
  1125. }
  1126. .navBar-row2 {
  1127. opacity: 0;
  1128. grid-template-columns: fit-content(70px) 50px fit-content(90px) auto;
  1129. }
  1130. .vertical-line {
  1131. display: inline-block;
  1132. border-left: 1.5px solid;
  1133. margin: 5px 20px 5px 20px;
  1134. height: 15px;
  1135. }
  1136. :deep(.v-toolbar__content) {
  1137. max-width: 1366px;
  1138. width: 1366px;
  1139. }
  1140. .user-picture-container {
  1141. width: 28px;
  1142. height: 28px;
  1143. }
  1144. .user-picture-border {
  1145. border: 1px solid #f5cda8;
  1146. }
  1147. .user-no-picture-border {
  1148. border: 2px solid #f5cda8;
  1149. }
  1150. .user-no-picture-font {
  1151. font-family: "DM Sans";
  1152. font-style: normal;
  1153. font-weight: 400;
  1154. font-size: 16px;
  1155. line-height: 21px;
  1156. }
  1157. .v-btn:before {
  1158. background-color: rgba(238, 149, 70, 0.6) !important;
  1159. font-color: #ee9546;
  1160. }
  1161. .on-top {
  1162. z-index: 500;
  1163. }
  1164. .customMenuLink {
  1165. &::after {
  1166. content: "";
  1167. display: block;
  1168. width: 150%;
  1169. height: 40px;
  1170. position: absolute;
  1171. top: 20px;
  1172. left: 0;
  1173. }
  1174. &:hover {
  1175. .customDropMenu {
  1176. display: block;
  1177. &.oneType {
  1178. display: grid;
  1179. }
  1180. }
  1181. }
  1182. }
  1183. .customDropMenu {
  1184. column-count: 4;
  1185. display: none;
  1186. &.exhibition {
  1187. column-count: initial;
  1188. column-gap: initial;
  1189. }
  1190. &.services {
  1191. column-count: 3;
  1192. column-gap: 30px;
  1193. }
  1194. &.oneType {
  1195. column-count: 1;
  1196. column-gap: 30px;
  1197. }
  1198. > ul {
  1199. &:last-of-type {
  1200. > div {
  1201. display: none !important;
  1202. }
  1203. }
  1204. }
  1205. }
  1206. .swiper-button {
  1207. &-prev {
  1208. left: 0;
  1209. &::before {
  1210. content: "";
  1211. display: block;
  1212. width: 60px;
  1213. height: 100%;
  1214. background-image: url("~/assets/svg/swiper_linear.svg");
  1215. // background-image: linear-gradient(to left, transparent, #fff);
  1216. position: absolute;
  1217. left: -6px;
  1218. top: 0;
  1219. z-index: -1;
  1220. transform: rotate(180deg);
  1221. }
  1222. &:after {
  1223. content: "";
  1224. display: block;
  1225. position: absolute;
  1226. right: 10px;
  1227. background-image: url("~/assets/svg/left-arrow-default.svg");
  1228. background-position: center;
  1229. background-repeat: no-repeat;
  1230. background-size: 7px 13px;
  1231. width: 24px;
  1232. height: 24px;
  1233. }
  1234. }
  1235. &-next {
  1236. right: 0;
  1237. &::before {
  1238. content: "";
  1239. display: block;
  1240. width: 60px;
  1241. height: 100%;
  1242. background-image: url("~/assets/svg/swiper_linear.svg");
  1243. // background-image: linear-gradient(to right, transparent, #fff);
  1244. position: absolute;
  1245. right: -6px;
  1246. top: 0;
  1247. z-index: -1;
  1248. }
  1249. &:after {
  1250. content: "";
  1251. display: block;
  1252. position: absolute;
  1253. left: 10px;
  1254. background-image: url("~/assets/svg/right-arrow-default.svg");
  1255. background-position: center;
  1256. background-repeat: no-repeat;
  1257. background-size: 7px 13px;
  1258. width: 24px;
  1259. height: 24px;
  1260. }
  1261. }
  1262. }
  1263. :deep(.swiper-container) {
  1264. .swiper-slide {
  1265. opacity: 0;
  1266. display: flex;
  1267. &.swiper-slide-visible {
  1268. opacity: 1;
  1269. }
  1270. }
  1271. [aria-disabled="true"] {
  1272. opacity: 0;
  1273. &::before {
  1274. display: none;
  1275. }
  1276. &::after {
  1277. display: none;
  1278. }
  1279. }
  1280. }
  1281. .exhibitionDropdownLink {
  1282. &.active {
  1283. background-image: url("@/assets/svg/icon-arrow.svg");
  1284. background-position: right center;
  1285. background-size: 16px;
  1286. background-repeat: no-repeat;
  1287. }
  1288. }
  1289. </style>