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.

1312 lines
44 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
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
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
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
  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('authtoken')
  130. ? `/user/${
  131. $auth.$storage.getUniversal('authtoken').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('authtoken')
  162. ? `/user/${
  163. $auth.$storage.getUniversal('authtoken').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('/user/mobileUserInfoPopup')"
  300. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  301. @click.native="UserInfoPopup = false"
  302. ><img src="~/assets/svg/profile.svg" alt="" />
  303. <div class="tw-head-body tw-text-base-primary">
  304. {{ $t("userProfile.profile") }}
  305. </div>
  306. </nuxt-link>
  307. <!-- <nuxt-link :to="localePath('/user/myBooking')"
  308. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"><img
  309. src="~/assets/svg/bookings.svg" alt="" />
  310. <div class="tw-head-body tw-text-base-primary">
  311. {{ $t('My Bookings')}}
  312. </div>
  313. </nuxt-link> -->
  314. <nuxt-link
  315. :to="localePath('/user/saveExhibition')"
  316. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  317. @click.native="UserInfoPopup = false"
  318. ><img src="~/assets/svg/saveExhibition.svg" alt="" />
  319. <div class="tw-head-body tw-text-base-primary">
  320. {{ $t("userProfile.savedExhibitions") }}
  321. </div>
  322. </nuxt-link>
  323. <!-- <nuxt-link :to="localePath('/user/saveService')"
  324. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  325. @click.native="UserInfoPopup = false"><img src="~/assets/svg/saveService.svg" alt="" />
  326. <div class="tw-head-body tw-text-base-primary">
  327. {{ $t("userProfile.savedServices") }}
  328. </div>
  329. </nuxt-link> -->
  330. <nuxt-link
  331. :to="localePath('/user/companyInfo')"
  332. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  333. @click.native="UserInfoPopup = false"
  334. ><img src="~/assets/svg/companyInfo.svg" alt="" />
  335. <div class="tw-head-body tw-text-base-primary">
  336. {{ $t("userProfile.companyInfo") }}
  337. </div>
  338. </nuxt-link>
  339. <nuxt-link
  340. :to="localePath('/user/contactInfo')"
  341. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  342. @click.native="UserInfoPopup = false"
  343. ><img src="~/assets/svg/contactInfo.svg" alt="" />
  344. <div class="tw-head-body tw-text-base-primary">
  345. {{ $t("Contact Info") }}
  346. </div>
  347. </nuxt-link>
  348. <nuxt-link
  349. :to="localePath('/user/setting')"
  350. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  351. @click.native="UserInfoPopup = false"
  352. ><img src="~/assets/svg/profile_setting.svg" alt="" />
  353. <div class="tw-head-body tw-text-base-primary">
  354. {{ $t("userProfile.setting") }}
  355. </div>
  356. </nuxt-link>
  357. <div
  358. class="tw-border tw-border-t tw-border-solid tw-border-neutral-200"
  359. ></div>
  360. <button
  361. class="tw-grid tw-grid-cols-[20px_auto] tw-gap-[10px] tw-px-[10px] tw-py-[8px]"
  362. @click="logout"
  363. >
  364. <img src="~/assets/svg/logout.svg" alt="" />
  365. <div
  366. class="tw-flex tw-head-body tw-text-error-default tw-justify-start"
  367. >
  368. {{ $t("userProfile.logout") }}
  369. </div>
  370. </button>
  371. </div>
  372. </div>
  373. <div v-else>
  374. <nuxt-link
  375. :to="localePath('/user')"
  376. 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]"
  377. >
  378. {{ $t("Log in/Sign up") }}</nuxt-link
  379. >
  380. </div>
  381. </div>
  382. </div>
  383. </div>
  384. <div
  385. ref="dropdown"
  386. :class="[
  387. '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',
  388. ]"
  389. >
  390. <div
  391. class="customMenuLink tw-relative tw-flex tw-justify-start tw-items-center tw-z-3"
  392. @mouseleave="exhibitionActiveIndex = 0"
  393. >
  394. <a
  395. :href="localePath('/exhibition')"
  396. @click="isPageLoading = true"
  397. :class="[
  398. 'tw-text-black tw-body-3 tw-font-normal hover:tw-text-primary-default',
  399. $route.path.match('\/exhibition')
  400. ? 'tw-text-primary-default'
  401. : '',
  402. ]"
  403. >
  404. {{ $t("Exhibition") }}</a
  405. >
  406. <div v-if="exhibitionsCategoryList.length>0"
  407. 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)]"
  408. >
  409. <div
  410. class="tw-relative tw-grid tw-grid-cols-2 tw-max-w-[700px] tw-max-h-[556px] tw-overflow-hidden"
  411. >
  412. <div
  413. 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]"
  414. >
  415. <div
  416. class="tw-list-none tw-mr-[20px]"
  417. v-for="(item, index) in exhibitionsCategoryList"
  418. :key="index"
  419. @mouseover="exhibitionActiveIndex = index"
  420. >
  421. <div
  422. :class="[
  423. 'exhibitionDropdownLink tw-grid tw-grid-cols-[30px_auto] tw-gap-[10px] tw-body-4 tw-font-normal hover:tw-text-primary-default',
  424. exhibitionActiveIndex == index
  425. ? 'tw-text-primary-default active'
  426. : 'tw-text-neutrals-900',
  427. ]"
  428. >
  429. <img
  430. v-if="exhibitionListIcon[index] !== undefined"
  431. :src="
  432. require(`@/assets/img/CategoryIcon/${exhibitionListIcon[index]}.png`)
  433. "
  434. /><span class="tw-flex tw-items-center tw-min-w-[322px]">{{
  435. $t(item.CategoryName)
  436. }}</span>
  437. </div>
  438. </div>
  439. </div>
  440. <div class="tw-w-full tw-overflow-x-hidden tw-overflow-y-auto" v-if="exhibitionsCategoryList.length>0">
  441. <ul
  442. class="tw-list-none tw-grid tw-grid-cols-1 tw-gap-[20px] tw-px-[20px]"
  443. >
  444. <li class="tw-list-none">
  445. <a
  446. :href="
  447. localePath(
  448. `/exhibition?category=${exhibitionsCategoryList[exhibitionActiveIndex].CategoryID}`
  449. )
  450. "
  451. class="tw-block tw-body-4 tw-font-normal tw-text-neutral-800 hover:tw-text-primary-default"
  452. >{{ $t("All") }}</a
  453. >
  454. </li>
  455. <template v-if="exhibitionsCategoryList[
  456. exhibitionActiveIndex
  457. ].SubCategoryList && exhibitionsCategoryList[
  458. exhibitionActiveIndex
  459. ].SubCategoryList.length>0">
  460. <li
  461. v-for="(sub, index) in exhibitionsCategoryList[
  462. exhibitionActiveIndex
  463. ].SubCategoryList"
  464. :key="index"
  465. class="tw-list-none"
  466. >
  467. <a
  468. :href="localePath(`/exhibition?subcategory=${sub.CategoryID}`)"
  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.CategoryName }}</a
  471. >
  472. </li></template>
  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="javascript:void(0);"
  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 v-if="serviceCategoryList.length>0"
  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/${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/${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/${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 v-if="item.subcategory && item.subcategory.length>0"
  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/${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 "authtoken-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 { getCurrentTime } from "~/utils/assist";
  635. // import { handler } from "@tailwindcss/line-clamp";
  636. export default {
  637. components: {
  638. Drawer,
  639. Search,
  640. SettingsIcon,
  641. SearchDialog,
  642. mobileUserInfoPopup,
  643. loading,
  644. changeCurrency,
  645. Swiper,
  646. },
  647. data() {
  648. return {
  649. show: false,
  650. bigSearch: false,
  651. userPicture: "",
  652. showNavSearch: true,
  653. servicesSearchs: [],
  654. servicesLocations: [],
  655. serviceCategoryList: [
  656. { id: 'Taiwan',title: 'Taiwan service',subcategory: [] }
  657. ],
  658. serviceListIcon: [
  659. "Booth",
  660. "Exhibit",
  661. "event",
  662. "Marketing",
  663. "journey",
  664. "human",
  665. "service_others",
  666. ],
  667. exhibitionsCategoryList: [],
  668. exhibitionsSearchs: [],
  669. exhibitionsLocations: [],
  670. exhibitionsCategories: [],
  671. exhibitionListIcon: [
  672. "rawMaterial",
  673. "aeroSpace",
  674. "energy",
  675. "autoMobile",
  676. "electronics",
  677. "contrucstion",
  678. "security",
  679. "Machinary",
  680. "Medical",
  681. "education",
  682. "textile",
  683. "food",
  684. "entertainment",
  685. "consumer",
  686. "others",
  687. ],
  688. populars: {},
  689. exhibitionActiveIndex: 0,
  690. width: undefined,
  691. drawer: false,
  692. group: null,
  693. isPageLoading: false,
  694. UserInfoPopup: false,
  695. headerServiceSwiper: null,
  696. offsetLeft: 0,
  697. top: 0,
  698. TAIWAN_ID: 18,
  699. JAPAN_ID: 16,
  700. ITALY_ID: 31,
  701. };
  702. },
  703. created() {
  704. if (process.client) {
  705. this.width = window.innerWidth;
  706. }
  707. if (!this.$route) return;
  708. if (!this.$route.name) return;
  709. const [path, lang] = this.$route.name.split("___");
  710. if (path == "index") {
  711. this.showNavSearch = false;
  712. } else {
  713. this.showNavSearch = true;
  714. }
  715. this.fetchUser();
  716. // this.socialRegister();
  717. // this.getServiceCategory();
  718. // this.getExhibitionsCategory();
  719. // this.getServiceHistory();
  720. // this.getExhibitionsHistory();
  721. // this.getServiceLocations();
  722. // this.getExhibitionsLocations();
  723. this.getExhibitionsCategories();
  724. // this.getExhibitionsCollections();
  725. // this.getPopulars();
  726. },
  727. mounted() {
  728. let vm = this;
  729. vm.$nextTick(function () {
  730. window.addEventListener("resize", this.onResize);
  731. vm.initSwiper();
  732. });
  733. },
  734. beforeDestroy() {
  735. window.removeEventListener("resize", this.onResize);
  736. },
  737. computed: {
  738. windowWidth() {
  739. if (process.client) {
  740. this.width = window.innerWidth;
  741. }
  742. return this.width;
  743. },
  744. pictureStatus() {
  745. return this.$store.getters.getPictureStatus;
  746. },
  747. registerStatus() {
  748. return this.$store.getters.getRegisterStatus;
  749. },
  750. lang() {
  751. return this.$i18n.localeProperties["langQuery"];
  752. },
  753. },
  754. watch: {
  755. group: {
  756. handler: function () {
  757. this.drawer = false;
  758. },
  759. },
  760. $route: {
  761. handler: function (to, from) {
  762. if (!to) return;
  763. if (!to.name) return;
  764. const [path, lang] = to.name.split("___");
  765. if (path == "index") {
  766. this.showNavSearch = false;
  767. } else {
  768. this.showNavSearch = true;
  769. }
  770. if (path === "exhibition") {
  771. this.isPageLoading = false;
  772. }
  773. // if (path === "service") {
  774. // this.isPageLoading = false;
  775. // }
  776. if (to != from) {
  777. this.bigSearch = false;
  778. }
  779. },
  780. },
  781. pictureStatus: {
  782. handler: function (newVal, oldVal) {
  783. this.fetchUser();
  784. this.$forceUpdate();
  785. },
  786. },
  787. registerStatus: {
  788. handler: function (newVal, oldVal) {
  789. // this.socialRegister();
  790. },
  791. },
  792. lang: {
  793. handler: function (newVal, oldVal) {
  794. if (newVal != oldVal) {
  795. this.$refs.dropdown.style.opacity = 0;
  796. // this.getServiceCategory();
  797. // this.getExhibitionsCategory();
  798. // this.getServiceHistory();
  799. // this.getExhibitionsHistory();
  800. // this.getServiceLocations();
  801. // this.getExhibitionsLocations();
  802. this.getExhibitionsCategories();
  803. // this.getExhibitionsCollections();
  804. this.initSwiper();
  805. }
  806. },
  807. },
  808. },
  809. methods: {
  810. clickOutSide() {
  811. this.show = false;
  812. this.UserInfoPopup = false;
  813. },
  814. onResize() {
  815. if (process.client) {
  816. this.width = window.innerWidth;
  817. }
  818. },
  819. clickMenu() {
  820. if (this.windowWidth < 1366) {
  821. this.$store.dispatch("toggleDrawer", true);
  822. }
  823. },
  824. clickSearch() {
  825. this.$store.dispatch("toggleSearchDialog", true);
  826. },
  827. initSwiper() {
  828. let vm = this;
  829. vm.$nextTick(function () {
  830. vm.headerServiceSwiper = new Swiper(".swiper-container.headerService", {
  831. direction: "horizontal",
  832. initialSlide: 0,
  833. observer: true,
  834. observeParents: true,
  835. rebuildOnUpdate: true,
  836. slidesPerView: "auto",
  837. spaceBetween: 25,
  838. watchSlidesVisibility: true,
  839. slideVisibleClass: "swiper-slide-visible",
  840. allowTouchMove: false,
  841. navigation: {
  842. nextEl: ".swiper-button-next.headerService",
  843. prevEl: ".swiper-button-prev.headerService",
  844. },
  845. });
  846. vm.headerServiceSwiper.init();
  847. vm.headerServiceSwiper.update();
  848. // this.$refs.headerSwiper.style.opacity = 1;
  849. vm.$refs.dropdown.style.opacity = 1;
  850. });
  851. },
  852. fetchUser() {
  853. if (this.$auth.loggedIn) {
  854. this.$axios
  855. .get(`/trending/api/members/info`)
  856. .then((response) => {
  857. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  858. let data = response.data.DATA.rel
  859. if(data){
  860. if(data.MemberPicture){
  861. this.userPicture = data.MemberPicture;
  862. this.$auth.$storage.setUniversal("userPicture", data.MemberPicture);
  863. }
  864. if(data.LastName){
  865. this.$auth.$storage.setUniversal("userLastName", data.LastName);
  866. }
  867. }
  868. }
  869. })
  870. .catch((error) =>
  871. console.log(error)
  872. );
  873. }
  874. },
  875. // getServiceCategory() {
  876. // let vm = this;
  877. // vm.$nextTick(() => {
  878. // vm.$axios
  879. // .get(`/service/category?lang_code=${this.lang}`)
  880. // .then((result) => {
  881. // vm.serviceCategoryList = result.data.map((item) => {
  882. // const subcategory = item.service_subcategory.map((sub) => {
  883. // return {
  884. // id: sub.id,
  885. // title: sub.language_text[0].text,
  886. // key: sub.language_text[0].text,
  887. // type: "subcategory",
  888. // order: sub.order_in_category,
  889. // };
  890. // });
  891. // return {
  892. // id: item.id,
  893. // order: item.order,
  894. // title: item.language_text[0].text,
  895. // key: item.language_text[0].text,
  896. // type: "category",
  897. // subcategory: subcategory,
  898. // };
  899. // });
  900. // return result.data;
  901. // })
  902. // .catch((err) => {
  903. // console.log(err);
  904. // });
  905. // });
  906. // },
  907. // getExhibitionsCategory() {
  908. // this.$axios
  909. // .get(
  910. // `/t/exhibitions/categories?lang=${this.$i18n.localeProperties["langQuery"]}&sort=true`
  911. // )
  912. // .then((result) => {
  913. // this.exhibitionsCategoryList = result.data.sort_results;
  914. // this.exhibitionsCategoryList = this.exhibitionsCategoryList.map(
  915. // (item) => {
  916. // item.subcategories_list = item.subcategories_list.map(
  917. // (children) => {
  918. // return {
  919. // id: children.subcategory_id,
  920. // title: children.subcategory_name,
  921. // key: children.subcategory_name,
  922. // type: "subcategory",
  923. // };
  924. // }
  925. // );
  926. // return {
  927. // id: item.categories_id,
  928. // title: item.category_name,
  929. // key: item.category_name,
  930. // type: "category",
  931. // subcategory: item.subcategories_list,
  932. // };
  933. // }
  934. // );
  935. // })
  936. // .catch((err) => {
  937. // console.log(err);
  938. // });
  939. // },
  940. // getServiceHistory() {
  941. // this.$axios
  942. // .get(
  943. // `/trending/services/search/history?lang=${this.$i18n.localeProperties["langQuery"]}`
  944. // )
  945. // .then((response) => {
  946. // this.servicesSearchs = response.data.searches;
  947. // })
  948. // .catch((error) => console.log(error));
  949. // },
  950. // getExhibitionsHistory() {
  951. // this.$axios
  952. // .get(
  953. // `/trending/exhibitions/search/history?lang=${this.$i18n.localeProperties["langQuery"]}`
  954. // )
  955. // .then((response) => {
  956. // this.exhibitionsSearchs = response.data.searches;
  957. // })
  958. // .catch((error) => console.log(error));
  959. // },
  960. // getServiceLocations() {
  961. // this.$axios
  962. // .get(
  963. // `/trending/services/locations?lang=${this.$i18n.localeProperties["langQuery"]}`
  964. // )
  965. // .then((response) => {
  966. // this.servicesLocations = response.data.locations;
  967. // })
  968. // .catch((error) => console.log(error));
  969. // },
  970. // getExhibitionsLocations() {
  971. // this.$axios
  972. // .get(
  973. // `/trending/exhibitions/locations?lang=${this.$i18n.localeProperties["langQuery"]}`
  974. // )
  975. // .then((response) => {
  976. // this.exhibitionsLocations = response.data.locations;
  977. // })
  978. // .catch((error) => console.log(error));
  979. // },
  980. getExhibitionsCategories() {
  981. this.$axios
  982. .get(`/trending/api/Exhibition/Categories?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  983. .then((response) => {
  984. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  985. let data = response.data.DATA.rel
  986. if(data.length>0){
  987. this.exhibitionsCategoryList = data;
  988. }
  989. }
  990. })
  991. .catch((error) =>
  992. console.log(error)
  993. );
  994. },
  995. // getExhibitionsCollections() {
  996. // this.$axios
  997. // .get(
  998. // `/trending/exhibitions/collections?lang=${this.$i18n.localeProperties["langQuery"]}`
  999. // )
  1000. // .then((response) => {
  1001. // this.collections = response.data.collections;
  1002. // })
  1003. // .catch((error) => console.log(error));
  1004. // },
  1005. changeLang() {
  1006. // this.getServiceCategory();
  1007. // this.getExhibitionsCategory();
  1008. // this.getServiceHistory();
  1009. // this.getExhibitionsHistory();
  1010. // this.getServiceLocations();
  1011. // this.getExhibitionsLocations();
  1012. this.getExhibitionsCategories();
  1013. // this.getExhibitionsCollections();
  1014. },
  1015. getPopulars() {
  1016. this.$axios
  1017. .get(
  1018. `/trending/search/popular?lang=${this.$i18n.localeProperties["langQuery"]}`
  1019. )
  1020. .then((response) => {
  1021. this.populars = response.data;
  1022. })
  1023. .catch((error) => console.log(error));
  1024. },
  1025. logout() {
  1026. this.$auth.$storage.removeUniversal("authtoken");
  1027. this.$auth.$storage.removeUniversal("userPicture");
  1028. this.$auth.$storage.removeUniversal("userLastName");
  1029. this.$auth.$storage.removeUniversal("userBeforePath");
  1030. if (this.width < 1024) {
  1031. this.$router.push(this.localePath("/"));
  1032. } else {
  1033. this.$router.push(this.localePath("/user"));
  1034. }
  1035. this.$auth.logout();
  1036. this.$nuxt.refresh();
  1037. this.UserInfoPopup = false;
  1038. },
  1039. // socialRegister() {
  1040. // if (this.$auth.loggedIn) {
  1041. // const jsonPayload =
  1042. // this.$auth.$storage.getUniversal("authtoken") &&
  1043. // this.$auth.$storage.getUniversal("authtoken").token != undefined
  1044. // ? jwt_decode(this.$auth.$storage.getUniversal("authtoken").token)
  1045. // : { ueid: "" };
  1046. // if (
  1047. // this.$auth.$state.strategy === "google" ||
  1048. // this.$auth.$state.strategy === "facebook"
  1049. // )
  1050. // {
  1051. // const userData = {
  1052. // social_id:
  1053. // this.$auth.$state.strategy === "google"
  1054. // ? this.$auth.$state.user.sub
  1055. // : this.$auth.$state.user.id,
  1056. // first_name:
  1057. // this.$auth.$state.strategy === "google"
  1058. // ? this.$auth.$state.user.given_name
  1059. // : this.$auth.$state.user.first_name,
  1060. // last_name:
  1061. // this.$auth.$state.strategy === "google"
  1062. // ? this.$auth.$state.user.family_name
  1063. // : this.$auth.$state.user.last_name,
  1064. // email: this.$auth.$state.user.email,
  1065. // picture:
  1066. // this.$auth.$state.strategy === "google"
  1067. // ? this.$auth.$state.user.picture
  1068. // : this.$auth.$state.user.picture.data.url,
  1069. // social_schema: this.$auth.$state.strategy,
  1070. // };
  1071. // jsonPayload.ueid != ""
  1072. // ? (userData.user_id = JSON.parse(jsonPayload.ueid))
  1073. // : "";
  1074. // this.$axios
  1075. // .post("/member/users/social", userData)
  1076. // .then((result) => {
  1077. // this.$auth.$storage.setUniversal("authtoken", result.data, true);
  1078. // this.$store.dispatch("updatePicture");
  1079. // })
  1080. // .catch((err) => {
  1081. // console.log(err);
  1082. // });
  1083. // }
  1084. // this.$store.dispatch("updatePicture");
  1085. // }
  1086. // },
  1087. // toShowList(countryId) {
  1088. // if (countryId > 0) {
  1089. // this.$router.push(this.localePath(`/exhibition?country=${countryId}`));
  1090. // } else {
  1091. // this.$router.push(this.localePath(`/exhibition`));
  1092. // }
  1093. // this.isPageLoading = true;
  1094. // },
  1095. },
  1096. };
  1097. </script>
  1098. <style lang="scss" scoped>
  1099. .v-menu__content {
  1100. box-shadow: none;
  1101. min-width: 186px;
  1102. border-radius: 10px;
  1103. }
  1104. .v-list-item {
  1105. padding-left: 12px;
  1106. padding-right: 12px;
  1107. color: #232323 !important;
  1108. }
  1109. .navBar-row2 {
  1110. opacity: 0;
  1111. grid-template-columns: fit-content(70px) 50px fit-content(90px) auto;
  1112. }
  1113. .navBar-row2 {
  1114. opacity: 0;
  1115. grid-template-columns: fit-content(70px) 50px fit-content(90px) auto;
  1116. }
  1117. .vertical-line {
  1118. display: inline-block;
  1119. border-left: 1.5px solid;
  1120. margin: 5px 20px 5px 20px;
  1121. height: 15px;
  1122. }
  1123. :deep(.v-toolbar__content) {
  1124. max-width: 1366px;
  1125. width: 1366px;
  1126. }
  1127. .user-picture-container {
  1128. width: 28px;
  1129. height: 28px;
  1130. }
  1131. .user-picture-border {
  1132. border: 1px solid #f5cda8;
  1133. }
  1134. .user-no-picture-border {
  1135. border: 2px solid #f5cda8;
  1136. }
  1137. .user-no-picture-font {
  1138. font-family: "DM Sans";
  1139. font-style: normal;
  1140. font-weight: 400;
  1141. font-size: 16px;
  1142. line-height: 21px;
  1143. }
  1144. .v-btn:before {
  1145. background-color: rgba(238, 149, 70, 0.6) !important;
  1146. font-color: #ee9546;
  1147. }
  1148. .on-top {
  1149. z-index: 500;
  1150. }
  1151. .customMenuLink {
  1152. &::after {
  1153. content: "";
  1154. display: block;
  1155. width: 150%;
  1156. height: 40px;
  1157. position: absolute;
  1158. top: 20px;
  1159. left: 0;
  1160. }
  1161. &:hover {
  1162. .customDropMenu {
  1163. display: block;
  1164. &.oneType {
  1165. display: grid;
  1166. }
  1167. }
  1168. }
  1169. }
  1170. .customDropMenu {
  1171. column-count: 4;
  1172. display: none;
  1173. &.exhibition {
  1174. column-count: initial;
  1175. column-gap: initial;
  1176. }
  1177. &.services {
  1178. column-count: 3;
  1179. column-gap: 30px;
  1180. }
  1181. &.oneType {
  1182. column-count: 1;
  1183. column-gap: 30px;
  1184. }
  1185. > ul {
  1186. &:last-of-type {
  1187. > div {
  1188. display: none !important;
  1189. }
  1190. }
  1191. }
  1192. }
  1193. .swiper-button {
  1194. &-prev {
  1195. left: 0;
  1196. &::before {
  1197. content: "";
  1198. display: block;
  1199. width: 60px;
  1200. height: 100%;
  1201. background-image: url("~/assets/svg/swiper_linear.svg");
  1202. // background-image: linear-gradient(to left, transparent, #fff);
  1203. position: absolute;
  1204. left: -6px;
  1205. top: 0;
  1206. z-index: -1;
  1207. transform: rotate(180deg);
  1208. }
  1209. &:after {
  1210. content: "";
  1211. display: block;
  1212. position: absolute;
  1213. right: 10px;
  1214. background-image: url("~/assets/svg/left-arrow-default.svg");
  1215. background-position: center;
  1216. background-repeat: no-repeat;
  1217. background-size: 7px 13px;
  1218. width: 24px;
  1219. height: 24px;
  1220. }
  1221. }
  1222. &-next {
  1223. right: 0;
  1224. &::before {
  1225. content: "";
  1226. display: block;
  1227. width: 60px;
  1228. height: 100%;
  1229. background-image: url("~/assets/svg/swiper_linear.svg");
  1230. // background-image: linear-gradient(to right, transparent, #fff);
  1231. position: absolute;
  1232. right: -6px;
  1233. top: 0;
  1234. z-index: -1;
  1235. }
  1236. &:after {
  1237. content: "";
  1238. display: block;
  1239. position: absolute;
  1240. left: 10px;
  1241. background-image: url("~/assets/svg/right-arrow-default.svg");
  1242. background-position: center;
  1243. background-repeat: no-repeat;
  1244. background-size: 7px 13px;
  1245. width: 24px;
  1246. height: 24px;
  1247. }
  1248. }
  1249. }
  1250. :deep(.swiper-container) {
  1251. .swiper-slide {
  1252. opacity: 0;
  1253. display: flex;
  1254. &.swiper-slide-visible {
  1255. opacity: 1;
  1256. }
  1257. }
  1258. [aria-disabled="true"] {
  1259. opacity: 0;
  1260. &::before {
  1261. display: none;
  1262. }
  1263. &::after {
  1264. display: none;
  1265. }
  1266. }
  1267. }
  1268. .exhibitionDropdownLink {
  1269. &.active {
  1270. background-image: url("@/assets/svg/icon-arrow.svg");
  1271. background-position: right center;
  1272. background-size: 16px;
  1273. background-repeat: no-repeat;
  1274. }
  1275. }
  1276. </style>